From c62903d054deecbe3d7aa10930562642d8adc4a5 Mon Sep 17 00:00:00 2001 From: Darren Starr Date: Tue, 3 Nov 2026 11:09:38 +0100 Subject: [PATCH 001/247] Print: add direct PDF transport for PCL-only printers (#5339) Adds an opt-in Windows print path that resolves the selected queue's Standard TCP/IP RAW port and streams the print-ready PDF, framed with PJL, to the printer's own PDF interpreter. This bypasses PCL drivers that rewrite a custom page (the HP Z5200ps V4 squares a 1067 x 480 mm sheet). Includes TCP/PJL tests, UI checkbox and docs. --- Cargo.lock | 1 + apps/vectorcraft/Cargo.toml | 3 + apps/vectorcraft/src/printing.rs | 5 + apps/vectorcraft/src/printing/direct_pdf.rs | 127 ++++++++++++++++++++ crates/ui-egui/src/dialogs/print.rs | 16 ++- crates/ui-egui/src/print.rs | 9 +- docs/gaps.md | 1 + docs/print-tiling.md | 9 ++ 8 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 apps/vectorcraft/src/printing/direct_pdf.rs diff --git a/Cargo.lock b/Cargo.lock index 0b55428494..03f5044eb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6109,6 +6109,7 @@ dependencies = [ "webbrowser", "windows", "winit", + "winreg", "winresource", "winsafe", "x11rb", diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml index 47d26eb7b6..cc8bb1e5e9 100644 --- a/apps/vectorcraft/Cargo.toml +++ b/apps/vectorcraft/Cargo.toml @@ -40,6 +40,9 @@ craft-print = { workspace = true } [target.'cfg(windows)'.dependencies] craft-update = { workspace = true } clipboard-win = { workspace = true } +# Reads a print queue's Standard TCP/IP RAW port for the direct-PDF transport (src/direct_pdf.rs). +# MIT, already in the build through the update client. +winreg = "0.55" # Which GPU drives which display (EnumDisplayDevices, src/gpu.rs), so the window is drawn on the # GPU that shows it: drawing on a GPU without a monitor reset the display driver. Safe wrappers over # Win32 (MIT); the `user` feature is User32.dll only. Only the wgpu renderer chooses an adapter. diff --git a/apps/vectorcraft/src/printing.rs b/apps/vectorcraft/src/printing.rs index 74e05e698f..f2ddb7fce8 100644 --- a/apps/vectorcraft/src/printing.rs +++ b/apps/vectorcraft/src/printing.rs @@ -3,6 +3,8 @@ use std::process::Command; use vectorcraft_ui_egui::print::{PrintJob, PrintService, Printer}; +mod direct_pdf; + pub struct SystemPrint; impl PrintService for SystemPrint { fn printers(&mut self) -> Vec { @@ -35,6 +37,9 @@ mod system { craft_print::printers().into_iter().map(|p| Printer { name: p.name, default: p.default }).collect() } pub fn print(job: &PrintJob) -> Result { + if job.direct_pdf { + return super::direct_pdf::print(job); + } // Copies, layout, marks and colour management are already in the PDF. Preserve its // physical sheet size and the queue's duplex default without printing copies twice. let settings = craft_print::Job { printer: job.printer.map(str::to_string), title: job.title.into(), ..Default::default() }; diff --git a/apps/vectorcraft/src/printing/direct_pdf.rs b/apps/vectorcraft/src/printing/direct_pdf.rs new file mode 100644 index 0000000000..93e657cce9 --- /dev/null +++ b/apps/vectorcraft/src/printing/direct_pdf.rs @@ -0,0 +1,127 @@ +//! Send the print-ready PDF to the printer's own PDF interpreter over its RAW TCP port. +//! +//! This is the opt-in escape hatch for large-format PCL drivers that rewrite a custom page +//! (the HP DesignJet Z5200ps V4 driver emits a square PCL page for a 1067 x 480 mm sheet). The +//! PDF already carries the paper size, so the printer's interpreter prints it as laid out. + +#[cfg(windows)] +mod imp { + use std::io::Write; + use std::net::{Shutdown, TcpStream, ToSocketAddrs}; + use std::time::Duration; + + use vectorcraft_ui_egui::print::PrintJob; + use winreg::RegKey; + use winreg::enums::{HKEY_LOCAL_MACHINE, KEY_READ}; + + /// Submit one composed PDF to the selected printer's Standard TCP/IP RAW port. + pub fn print(job: &PrintJob) -> Result { + let printer = job + .printer + .map(str::to_string) + .or_else(|| craft_print::printers().into_iter().find(|p| p.default).map(|p| p.name)) + .ok_or("direct PDF needs a selected printer")?; + let (host, port) = tcp_port(&printer)?; + send(&host, port, &pjl(job.title, job.pdf))?; + Ok(format!(" (direct PDF to {host}:{port})")) + } + + /// The `HostName` and port of a printer port registered as a Standard TCP/IP RAW port. + fn tcp_port(printer: &str) -> Result<(String, u16), String> { + let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); + let printer_key = hklm + .open_subkey_with_flags(format!(r"SYSTEM\CurrentControlSet\Control\Print\Printers\{printer}"), KEY_READ) + .map_err(|e| format!("direct PDF: cannot read the printer settings for {printer}: {e}"))?; + let port_name: String = printer_key.get_value("Port").map_err(|e| format!("direct PDF: {printer} has no port: {e}"))?; + let port_key = hklm + .open_subkey_with_flags(format!(r"SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\{port_name}"), KEY_READ) + .map_err(|e| format!("direct PDF: {printer} does not use a Standard TCP/IP port ({port_name}): {e}"))?; + let protocol: u32 = port_key.get_value("Protocol").unwrap_or(1); + if protocol != 1 { + return Err(format!("direct PDF: {printer}'s port ({port_name}) is not a RAW TCP/IP port")); + } + let host = port_key + .get_value::("HostName") + .ok() + .filter(|h| !h.trim().is_empty()) + .or_else(|| port_key.get_value::("IPAddress").ok().filter(|h| !h.trim().is_empty())) + .ok_or_else(|| format!("direct PDF: {printer}'s port ({port_name}) has no host address"))?; + let number = port_key.get_value::("PortNumber").unwrap_or(9100); + let port = u16::try_from(number).map_err(|_| format!("direct PDF: invalid port number {number}"))?; + Ok((host.trim().to_string(), port)) + } + + /// Frame the PDF for the printer's PJL interpreter. + fn pjl(title: &str, pdf: &[u8]) -> Vec { + let mut name: String = title.chars().map(|c| if (c.is_ascii_graphic() || c == ' ') && c != '"' { c } else { '_' }).take(80).collect(); + if name.is_empty() { + name.push_str("VectorCraft"); + } + let mut out = Vec::with_capacity(pdf.len() + 96); + out.extend_from_slice(b"\x1b%-12345X@PJL JOB NAME=\""); + out.extend_from_slice(name.as_bytes()); + out.extend_from_slice(b"\"\r\n@PJL ENTER LANGUAGE=PDF\r\n"); + out.extend_from_slice(pdf); + out.extend_from_slice(b"\r\n\x1b%-12345X@PJL EOJ\r\n"); + out + } + + /// Stream `data` to the first reachable address of `host:port`. + fn send(host: &str, port: u16, data: &[u8]) -> Result<(), String> { + let addrs = (host, port).to_socket_addrs().map_err(|e| format!("direct PDF: cannot resolve {host}: {e}"))?; + let mut last = None; + for addr in addrs { + match TcpStream::connect_timeout(&addr, Duration::from_secs(10)) { + Ok(mut stream) => { + stream.set_write_timeout(Some(Duration::from_secs(120))).map_err(|e| format!("direct PDF: {e}"))?; + stream.write_all(data).map_err(|e| format!("direct PDF: writing to {host}:{port} failed: {e}"))?; + stream.shutdown(Shutdown::Write).map_err(|e| format!("direct PDF: finishing {host}:{port} failed: {e}"))?; + return Ok(()); + } + Err(e) => last = Some(e), + } + } + Err(match last { + Some(e) => format!("direct PDF: cannot connect to {host}:{port}: {e}"), + None => format!("direct PDF: {host}:{port} has no addresses"), + }) + } + + #[cfg(test)] + mod tests { + use super::*; + use std::io::Read; + use std::net::TcpListener; + + #[test] + fn the_pjl_frames_the_pdf() { + let out = pjl("witch hat\"", b"%PDF-1.7"); + let text = String::from_utf8_lossy(&out); + assert!(text.starts_with("\u{1b}%-12345X@PJL JOB NAME=\"witch hat_\"\r\n@PJL ENTER LANGUAGE=PDF\r\n")); + assert!(text.contains("%PDF-1.7")); + assert!(text.ends_with("\r\n\u{1b}%-12345X@PJL EOJ\r\n")); + } + + #[test] + fn the_pdf_reaches_a_listening_port() { + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let port = listener.local_addr().unwrap().port(); + let t = std::thread::spawn(move || { + let (mut stream, _) = listener.accept().unwrap(); + let mut got = Vec::new(); + stream.read_to_end(&mut got).unwrap(); + got + }); + send("127.0.0.1", port, b"%PDF-1.7 test").unwrap(); + assert_eq!(t.join().unwrap(), b"%PDF-1.7 test"); + } + } +} + +#[cfg(windows)] +pub use imp::print; + +#[cfg(not(windows))] +pub fn print(_: &vectorcraft_ui_egui::print::PrintJob) -> Result { + Err("direct PDF printing is only available on Windows".into()) +} diff --git a/crates/ui-egui/src/dialogs/print.rs b/crates/ui-egui/src/dialogs/print.rs index 76650401c0..496cc7cb25 100644 --- a/crates/ui-egui/src/dialogs/print.rs +++ b/crates/ui-egui/src/dialogs/print.rs @@ -91,6 +91,7 @@ pub fn open(app: &mut VectorcraftApp) -> Result { fields.insert("printer".into(), json!(default)); fields.insert("toFile".into(), json!(!printers["service"].as_bool().unwrap_or(false))); fields.insert("__printers".into(), printers); + fields.insert("__directPdf".into(), json!(false)); fields.insert("__section".into(), json!(SECTIONS[0])); fields.insert("__sheet".into(), json!(0)); // The saved preset these settings are, if any (else [Default], shown as [Custom] if they differ). @@ -205,7 +206,15 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { app.ui.dialog = None; return Ok(json!({ "settings": settings })); } - let r = crate::print::run(app, &json!({ "settings": settings, "printer": d.str("printer"), "toFile": d.bool("toFile") }))?; + let r = crate::print::run( + app, + &json!({ + "settings": settings, + "printer": d.str("printer"), + "toFile": d.bool("toFile"), + "directPdf": d.bool("__directPdf"), + }), + )?; app.ui.dialog = None; Ok(r) } @@ -358,6 +367,11 @@ fn printer_row(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { app.status(e); } }); + if service && cfg!(windows) { + let to_file = d.bool("toFile"); + flag(ui, d, "__directPdf", "Send PDF directly (bypass driver)", !to_file); + note(ui, "Writes the print-ready PDF to the printer's TCP/IP RAW port, for PCL-only drivers that change the custom page size."); + } } /// `print.preview` of `settings` (an error when they can't print), cached until they or the diff --git a/crates/ui-egui/src/print.rs b/crates/ui-egui/src/print.rs index 499f6f2607..6c94e0cad8 100644 --- a/crates/ui-egui/src/print.rs +++ b/crates/ui-egui/src/print.rs @@ -26,6 +26,9 @@ pub struct PrintJob<'a> { /// The job's name in the print queue. pub title: &'a str, pub pdf: &'a [u8], + /// Send the PDF to the printer's own PDF interpreter over its RAW TCP port instead of + /// spooling it through the platform driver (Windows). + pub direct_pdf: bool, } /// Submission callable from the desktop background worker. @@ -105,6 +108,7 @@ pub fn run(app: &mut VectorcraftApp, p: &Value) -> Result { let pdf = data.as_ref().and_then(Value::as_str).and_then(vectorcraft_format::base64_decode).ok_or("the print job has no data")?; let title = app.session.active().map(|d| d.title()).unwrap_or_default(); let printer = s("printer").filter(|n| !n.is_empty()); + let direct_pdf = p.get("directPdf").and_then(Value::as_bool).unwrap_or(false); let service = app.services.print.as_mut().ok_or("no print service")?; if let Some(submit) = service.shared_print() { let pending_printer = printer.clone(); @@ -114,7 +118,8 @@ pub fn run(app: &mut VectorcraftApp, p: &Value) -> Result { format!("Printing {title}"), None, move |_| { - submit(&PrintJob { printer: printer.as_deref(), title: &title, pdf: &pdf }).map(|note| json!({ "note": note, "printer": printer })) + submit(&PrintJob { printer: printer.as_deref(), title: &title, pdf: &pdf, direct_pdf }) + .map(|note| json!({ "note": note, "printer": printer })) }, move |app, result| { let receipt = result?; @@ -135,7 +140,7 @@ pub fn run(app: &mut VectorcraftApp, p: &Value) -> Result { } return Ok(v); } - let done = service.print(&PrintJob { printer: printer.as_deref(), title: &title, pdf: &pdf })?; + let done = service.print(&PrintJob { printer: printer.as_deref(), title: &title, pdf: &pdf, direct_pdf })?; app.status(done); v["printer"] = json!(printer); v["printed"] = json!(true); diff --git a/docs/gaps.md b/docs/gaps.md index d7276abeab..dccc4a5193 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -19,6 +19,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-03 | minor | Windows: opt-in direct PDF transport writes the print-ready PDF to a printer's Standard TCP/IP RAW port, for PCL-only drivers that rewrite custom pages (#5339, #4004); TCP framing and ticket-independent submission covered by app tests. No ranked entry closed; scores and estimates unchanged. | | 2026-10-24 | minor | G12: General › Corner Radius is the Rounded Rectangle tool's radius, a change while the tool is active reaches it, and the radius ↑/↓ set while drawing (or a Tool Options value) becomes the preference, within 0–1296 pt (#394, `crates/engine/src/tests/constrain_tools.rs`); no entry closed, estimate unchanged. | | 2026-10-22 | minor | Reconcile upstream documentation after review F-3; preserve every dated revision and the original scaleArt runtime evidence without repeating completed jobs. | | 2026-10-22 | minor | Reconcile upstream documentation after review F-2; preserve every dated revision and the original scaleArt runtime evidence without repeating completed jobs. | diff --git a/docs/print-tiling.md b/docs/print-tiling.md index 28d92a376e..00bf82c33e 100644 --- a/docs/print-tiling.md +++ b/docs/print-tiling.md @@ -49,6 +49,15 @@ pages before sending it to a printer. When printing that PDF, keep its page size than applying another fit-to-page reduction. For a sewing pattern, measure a known length on a printed sheet before printing the full job. +## Direct PDF on PCL-only printers + +Some Windows PCL drivers rewrite a custom page to a different physical size; the HP DesignJet +Z5200ps V4, for example, turns a 1067 x 480 mm page into a square PCL page. In **Print**, under +**Printer**, turn on **Send PDF directly (bypass driver)**. VectorCraft then writes the print-ready +PDF to the selected printer's Standard TCP/IP RAW port, so the printer's own PDF interpreter prints +the PDF's page size. It needs a printer with PDF support and a RAW TCP/IP port; it bypasses the +Windows driver's paper, colour and finishing settings. Leave it off for ordinary driver printing. + ## Choose a tiling mode | Scaling | How it divides the drawing | When to use it | From 3c31104997594e5a21e3931bf509374c03187319 Mon Sep 17 00:00:00 2001 From: Darren Starr Date: Tue, 3 Nov 2026 14:41:14 +0100 Subject: [PATCH 002/247] Print: keep direct PDF user-confirmed (#5341) Store the direct-PDF choice in UI-only state instead of dialog fields, so ui.dialog.set and ui.dialog.confirm cannot enable a driver-bypassing print; only a person clicking the Print dialog checkbox can. Update the app tests. --- crates/ui-egui/src/dialogs/print.rs | 7 ++++--- crates/ui-egui/src/state.rs | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/print.rs b/crates/ui-egui/src/dialogs/print.rs index 496cc7cb25..ee644ecb6b 100644 --- a/crates/ui-egui/src/dialogs/print.rs +++ b/crates/ui-egui/src/dialogs/print.rs @@ -91,7 +91,7 @@ pub fn open(app: &mut VectorcraftApp) -> Result { fields.insert("printer".into(), json!(default)); fields.insert("toFile".into(), json!(!printers["service"].as_bool().unwrap_or(false))); fields.insert("__printers".into(), printers); - fields.insert("__directPdf".into(), json!(false)); + app.ui.print_direct_pdf = false; fields.insert("__section".into(), json!(SECTIONS[0])); fields.insert("__sheet".into(), json!(0)); // The saved preset these settings are, if any (else [Default], shown as [Custom] if they differ). @@ -206,13 +206,14 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { app.ui.dialog = None; return Ok(json!({ "settings": settings })); } + let direct_pdf = app.ui.print_direct_pdf; let r = crate::print::run( app, &json!({ "settings": settings, "printer": d.str("printer"), "toFile": d.bool("toFile"), - "directPdf": d.bool("__directPdf"), + "directPdf": direct_pdf, }), )?; app.ui.dialog = None; @@ -369,7 +370,7 @@ fn printer_row(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { }); if service && cfg!(windows) { let to_file = d.bool("toFile"); - flag(ui, d, "__directPdf", "Send PDF directly (bypass driver)", !to_file); + ui.add_enabled(!to_file, egui::Checkbox::new(&mut app.ui.print_direct_pdf, "Send PDF directly (bypass driver)")); note(ui, "Writes the print-ready PDF to the printer's TCP/IP RAW port, for PCL-only drivers that change the custom page size."); } } diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 4dd6d9012d..c1c01c51fd 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -334,6 +334,10 @@ pub struct UiState { #[serde(rename = "language", skip_serializing)] pub legacy_language: Option, pub brightness: Brightness, + /// The Print dialog's opt-in direct-PDF transport. UI-only and not serialized: the control + /// channel cannot enable a print that bypasses the printer driver. + #[serde(skip)] + pub print_direct_pdf: bool, pub dock_tab: DockTab, /// Tab order in the dock's tabbed group when it differs from [`DockTab::ALL`]. #[serde(default, skip_serializing_if = "Vec::is_empty")] @@ -909,6 +913,7 @@ impl Default for UiState { Self { legacy_language: None, brightness: Brightness::MediumDark, + print_direct_pdf: false, dock_tab: DockTab::Properties, dock_tab_order: Vec::new(), dock_collapsed: false, From 046d4e67ff9facec11717a0de46dc043edbac7f1 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Fri, 6 Nov 2026 20:50:28 -0500 Subject: [PATCH 003/247] EPS import: shadings not extended paint only between their ends shfill filled the whole clip with an axial or radial shading whatever its Extend. Without Extend (the default, PLRM 3rd ed. section 4.9.3) an axial shading now paints only between the lines through its ends across its axis, and a radial shading from a point only over its circles. --- crates/eps/src/import/graphics/ops.rs | 16 +++- crates/eps/src/import/graphics/paint.rs | 111 ++++++++++++++++++++++ crates/eps/src/import/tests_generators.rs | 28 ++++++ docs/file-format-parity.md | 5 +- 4 files changed, 155 insertions(+), 5 deletions(-) diff --git a/crates/eps/src/import/graphics/ops.rs b/crates/eps/src/import/graphics/ops.rs index 78a214b410..01731807d8 100644 --- a/crates/eps/src/import/graphics/ops.rs +++ b/crates/eps/src/import/graphics/ops.rs @@ -1,4 +1,4 @@ -use super::paint::is_mesh; +use super::paint::{is_mesh, polygon, shading_extent}; use super::state::{GState, Space}; use super::{ Affine, Color, FillRule, Interp, Key, LineCap, LineJoin, MAX_DASH_ENTRIES, MAX_DASHES, MAX_GSAVE, MAX_PATH, Obj, Op, Paint, Point, PsError, Rc, @@ -531,10 +531,20 @@ impl Interp<'_> { let m = self.xf(); if let Some(g) = self.gradient(&d, m)? { let area = self.clip_bounds()?; + // Not extended, it paints only between its ends. + let extent = shading_extent(&d, m, area); + let path = match &extent { + Some(pts) if pts.len() < 3 => return Ok(()), + Some(pts) => polygon(pts), + None => area.to_path(0.1), + }; let paint = Paint::Gradient(Box::new(g)); let clips = self.g.clips.clone(); - self.out.fill(area.to_path(0.1), FillRule::NonZero, paint, self.g.overprint, &clips); - if let Some((_, n)) = self.out.drawn.last() { + self.out.fill(path, FillRule::NonZero, paint, self.g.overprint, &clips); + // Only a fill of the whole clip can stand in for the clip's shape. + if extent.is_none() + && let Some((_, n)) = self.out.drawn.last() + { let id = n.id; self.out.shadings.insert(id); } diff --git a/crates/eps/src/import/graphics/paint.rs b/crates/eps/src/import/graphics/paint.rs index 8b0a729eef..d0f8cb6788 100644 --- a/crates/eps/src/import/graphics/paint.rs +++ b/crates/eps/src/import/graphics/paint.rs @@ -429,6 +429,117 @@ fn is_gradient(sh: &DictRef) -> bool { matches!(sh.borrow().get(&Key::name("ShadingType")).and_then(Obj::as_num), Some(2.0 | 3.0)) } +/// The part of `area` (in the document) that axial or radial shading `sh`, mapped into the +/// document by `m`, paints, as a convex polygon; `None` when it paints all of it. Without +/// `Extend` an axial shading paints only between the lines through its ends across its axis, and +/// a radial one only over its circles (PLRM 3rd ed. §4.9.3, shading types 2 and 3: `Extend` +/// defaults to `[false false]`). A radial shading extended at one end only, or starting from a +/// circle with a radius, is not bounded here (it paints all of `area`). +pub(super) fn shading_extent(sh: &DictRef, m: Affine, area: Rect) -> Option> { + let d = sh.borrow(); + let nums = |k: &str| -> Vec { + d.get(&Key::name(k)).and_then(Obj::items).map(|i| i.borrow().iter().filter_map(Obj::as_num).collect()).unwrap_or_default() + }; + let extend: Vec = d + .get(&Key::name("Extend")) + .and_then(Obj::items) + .map(|i| i.borrow().iter().map(|o| matches!(o, Obj::Bool(true))).collect()) + .unwrap_or_default(); + let (e0, e1) = (extend.first().copied().unwrap_or(false), extend.get(1).copied().unwrap_or(false)); + if (e0 && e1) || m.determinant().abs() < 1e-12 || !m.as_coeffs().iter().all(|v| v.is_finite()) { + return None; + } + let inv = m.inverse(); + // `area` in the shading's own space, where its axis and circles are. + let mut poly: Vec = + [(area.x0, area.y0), (area.x1, area.y0), (area.x1, area.y1), (area.x0, area.y1)].map(|(x, y)| inv * Point::new(x, y)).to_vec(); + let c = nums("Coords"); + let at = |i: usize| c.get(i).copied().filter(|v| v.is_finite()).unwrap_or(0.0); + match d.get(&Key::name("ShadingType")).and_then(Obj::as_num) { + Some(2.0) => { + let (p0, p1) = (Point::new(at(0), at(1)), Point::new(at(2), at(3))); + let axis = p1 - p0; + if axis.hypot2() < 1e-18 { + return None; + } + if !e0 { + poly = clip_half(&poly, |p| (p - p0).dot(axis)); + } + if !e1 { + poly = clip_half(&poly, |p| (p1 - p).dot(axis)); + } + } + Some(3.0) if !e0 && !e1 && at(2) <= 0.0 && at(5) > 0.0 => { + // The circles from a point to a circle cover the hull of that point and circle. + let (p0, c1, r1) = (Point::new(at(0), at(1)), Point::new(at(3), at(4)), at(5)); + let ring: Vec = (0..64).map(|i| c1 + Vec2::from_angle(i as f64 * std::f64::consts::TAU / 64.0) * r1).collect(); + for edge in hull(&[ring, vec![p0]].concat()).windows(2) { + if let [a, b] = edge { + let (a, b) = (*a, *b); + poly = clip_half(&poly, |p| (b - a).cross(p - a)); + } + } + } + _ => return None, + } + Some(poly.into_iter().map(|p| m * p).collect()) +} + +/// Convex polygon `poly` cut to where `f` (a linear function) is zero or more. +fn clip_half(poly: &[Point], f: impl Fn(Point) -> f64) -> Vec { + let mut out = Vec::with_capacity(poly.len() + 1); + for (i, &a) in poly.iter().enumerate() { + let Some(&b) = poly.get((i + 1) % poly.len()) else { continue }; + let (fa, fb) = (f(a), f(b)); + if fa >= 0.0 { + out.push(a); + } + if (fa >= 0.0) != (fb >= 0.0) { + out.push(a.lerp(b, fa / (fa - fb))); + } + } + out +} + +/// The convex hull of `pts`, counter-clockwise, its first point repeated at the end. +fn hull(pts: &[Point]) -> Vec { + let mut p = pts.to_vec(); + p.sort_by(|a, b| a.x.total_cmp(&b.x).then(a.y.total_cmp(&b.y))); + let mut h: Vec = Vec::with_capacity(p.len() * 2); + let turn = |h: &[Point], q: Point| match h { + [.., a, b] => (*b - *a).cross(q - *a) <= 0.0, + _ => false, + }; + for &q in &p { + while turn(&h, q) { + h.pop(); + } + h.push(q); + } + let lower = h.len() + 1; + for &q in p.iter().rev().skip(1) { + while h.len() >= lower && turn(&h, q) { + h.pop(); + } + h.push(q); + } + h +} + +/// A closed path through `pts`. +pub(super) fn polygon(pts: &[Point]) -> kurbo::BezPath { + let mut bp = kurbo::BezPath::new(); + for (i, p) in pts.iter().enumerate() { + if i == 0 { + bp.move_to(*p); + } else { + bp.line_to(*p); + } + } + bp.close_path(); + bp +} + /// Is shading `sh` one [`Interp::mesh_fill`] paints? pub(super) fn is_mesh(sh: &DictRef) -> bool { matches!(sh.borrow().get(&Key::name("ShadingType")).and_then(Obj::as_num), Some(1.0 | 4.0 | 5.0 | 6.0 | 7.0)) diff --git a/crates/eps/src/import/tests_generators.rs b/crates/eps/src/import/tests_generators.rs index 4337b9474c..75e4fd5d3d 100644 --- a/crates/eps/src/import/tests_generators.rs +++ b/crates/eps/src/import/tests_generators.rs @@ -1141,3 +1141,31 @@ fn filter_output_counts_against_the_memory_budget() { let Err(err) = many else { panic!("the budget ends the program") }; assert!(err.contains("too much memory"), "{err}"); } + +/// A shading painted with `shfill` and not extended paints only between its ends: an axial one +/// between the lines through them across its axis, a radial one from a point over its circles +/// (PLRM 3rd ed. §4.9.3: `Extend` is `[false false]` by default). Extended both ways it paints +/// the whole clip. +#[test] +fn shadings_not_extended_paint_only_between_their_ends() { + let shade = |kind: u8, coords: &str, extend: &str| { + let r = read(&format!( + "<< /ShadingType {kind} /ColorSpace /DeviceRGB /Coords [{coords}] {extend} \ + /Function << /FunctionType 2 /Domain [0 1] /C0 [1 0 0] /C1 [0 0 1] /N 1 >> >> shfill" + )); + let n = all(&r.document).into_iter().find(|n| matches!(fill(n), Some(Paint::Gradient(_)))).expect("a gradient fill"); + bounds(&n) + }; + // Axial, from x 10 to 90 (and its reflection in y: the document's y runs down). + let b = shade(2, "10 0 90 0", ""); + assert!(near(b, Rect::new(10.0, 0.0, 90.0, 100.0)), "{b:?}"); + let b = shade(2, "10 0 90 0", "/Extend [false true]"); + assert!(near(b, Rect::new(10.0, 0.0, 100.0, 100.0)), "{b:?}"); + let b = shade(2, "10 0 90 0", "/Extend [true true]"); + assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{b:?}"); + // Radial from the centre point to a circle of radius 30. + let b = shade(3, "50 50 0 50 50 30", ""); + assert!((b.width() - 60.0).abs() < 0.5 && (b.height() - 60.0).abs() < 0.5 && (b.center().x - 50.0).abs() < 0.5, "{b:?}"); + let b = shade(3, "50 50 0 50 50 30", "/Extend [true true]"); + assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{b:?}"); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index d3e2f03031..f3484484c4 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-07 · **Change:** minor (EPS import: shadings not extended paint only between their ends; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public @@ -153,7 +153,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri | Illustrator template `.ait` | open, save | yes | PDF-compatible only, from Save as Template (`.vctemplate` stays its default) | New from Template opens a saved `.ait` untitled with its layers and art (`tests_pdfedit.rs`) | | Illustrator `.ai` | open, save | yes (PDF-compatible + editing-data structure with template layers and ruler guides, File Info) | PDF-compatible, or legacy version 7 (layers and groups) | see above; no real-file corpus | | PDF | open, place, save | yes (layers, masks, editable text, security, overprint, File Info from the XMP packet and the document information dictionary; Crop To › Trim takes the bleed box as the document's bleed) | yes (presets, PDF/X-1a/3/4, layers, marks and bleed, ICC, fast web view, 1.3+; objects' URLs as link annotations, not in PDF/X) | fuzzed import; shared guarded writer and windowed reader ([pdf-backend.md](pdf-backend.md)), metadata, incomplete-content and dependency-source regressions; PDF text opens where the file draws it, glyph by glyph (#722: kerning or none, spacing per character, text rise as baseline shift, vertical writing, justified text boxes); alpha soft masks drawn as images import with the mask (#1551); a clip only counts as covering the page when its shape does (#1542); a PDF another app copied pastes as editable vector art (#1499); letter-spaced type on a path keeps its length and its glyph-by-glyph stroke comes in as one text object (#1586, #1585); a crafted name tree with shared nodes no longer takes exponential time on open (#1781); fonts named with hyphens (`Noto-Sans-Bold`) or with a composite font's CMap (`Name-Identity-H`) find the installed family; invisible text (rendering mode 3: a scanned page's recognized text) opens as type with no fill or stroke and saves back as invisible, searchable text (#2675); PDF/X-1a and X-3 flattening in a CMYK document keeps CMYK inks where it rasterizes (#2160) | -| EPS | open, place, save | yes (own PostScript L3 interpreter, Illustrator EPS editing data structure) | yes (L2/L3, TIFF previews) | CID-keyed CJK type not read; #505; images encoded with `CCITTFaxDecode` (ITU-T T.4 Group 3 and T.6 Group 4, with `K`, `Columns`, `Rows`, `EndOfBlock`, `EndOfLine`, `EncodedByteAlign` and `BlackIs1`) draw, and damaged data keeps the rows decoded before its first damaged row; Type 42 (TrueType) fonts set type at its size (#1553); a clip only counts as covering the page when its shape does (#1542); an EPS another app copied pastes as editable vector art (`clipboard.importEps`, #1499); a stitched shading keeps its hard colour changes on import (#1654); CMYK images, CMYK JPEGs included, keep their ink amounts on import, as from PDF, and the pixels a `MaskColor` or `ImageType 3` mask hides become a grayscale opacity mask; ruzstd 0.9.1 for compressed editing data (#1807, RUSTSEC-2026-0344) | +| EPS | open, place, save | yes (own PostScript L3 interpreter, Illustrator EPS editing data structure) | yes (L2/L3, TIFF previews) | CID-keyed CJK type not read; #505; images encoded with `CCITTFaxDecode` (ITU-T T.4 Group 3 and T.6 Group 4, with `K`, `Columns`, `Rows`, `EndOfBlock`, `EndOfLine`, `EncodedByteAlign` and `BlackIs1`) draw, and damaged data keeps the rows decoded before its first damaged row; Type 42 (TrueType) fonts set type at its size (#1553); a clip only counts as covering the page when its shape does (#1542); an EPS another app copied pastes as editable vector art (`clipboard.importEps`, #1499); a stitched shading keeps its hard colour changes on import (#1654); an axial shading painted with `shfill` without `Extend` paints only between its ends, and a radial one from a point only over its circles; CMYK images, CMYK JPEGs included, keep their ink amounts on import, as from PDF, and the pixels a `MaskColor` or `ImageType 3` mask hides become a grayscale opacity mask; ruzstd 0.9.1 for compressed editing data (#1807, RUSTSEC-2026-0344) | | PostScript `.ps` | open, place | yes (the EPS reader reads its first page; `.epsf` files open and place as EPS) | via Print to PostScript | `tests_epsimport.rs` | | SVG / SVGZ | open, place, save | yes | yes (SVG Options, Preserve Editing, symbols, filters, rich text) | strongest format; tests in `crates/svg/tests`; text on a path follows basic shapes as their SVG 2 equivalent paths (#1527); CSS transforms and the `font` shorthand (#1565), percentage lengths in symbols (#1596), Inkscape flowed text as area type (#1568) and Inkscape pages as artboards (#1601) import; an unsupported filter is named in its warning (#1598); an artboard exported on its own (Export As with Use Artboards, Export for Screens, Asset Export) has the artboard's name as ``, Save the document's (#3544); attributes in other applications' XML namespaces (`plotter:pen="2"`) kept on their objects from import to export, as `data-*` attributes are (`crates/svg/tests/it/foreign_attributes.rs`); simple shapes export as `<rect>`, `<circle>`, `<ellipse>`, `<line>`, `<polygon>` and `<polyline>` where they draw the same as the path (#4652, `crates/svg/tests/it/basic_shapes.rs`) | | DXF | open, export | yes | yes (R12–2018) | R13–2018 closed SPLINE flags and control-point closure on import verified (#1299); circular cubic paths export as native CIRCLE/ARC where stroke semantics permit; R12 weighted strokes remain POLYLINE while non-circular curves keep the existing fallback (`crates/cad/src/tests.rs`); [Autodesk group 70](https://help.autodesk.com/cloudhelp/2024/ENU/AutoCAD-DXF/files/GUID-E1F884F8-AA90-4864-A215-3182D47A9C74.htm). DXF 2000–2018 LAYOUT objects write the paper image origin as 148/149 (was a stray 158), the shade plot codes (2004+) and the model type flag, and the plot style placeholder carries no subclass marker (#3085; structure test `r2000_and_later_files_have_the_structure_cad_apps_require`, checked with ezdxf's audit; not yet confirmed in Autodesk Fusion). CNC preset and VCarve QA remain open | @@ -191,6 +191,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri | Date | Change | Summary | |---|---|---| +| 2026-11-07 | minor | EPS import: an axial or radial shading painted with `shfill` filled the whole clip whatever its `Extend`, so one without it (the default, `[false false]`: PLRM 3rd ed. §4.9.3) painted its end colours past its ends. An axial shading not extended at an end now paints only up to the line through that end across its axis, and a radial one from a point (no starting radius) not extended at either end only over its circles. Test `shadings_not_extended_paint_only_between_their_ends`; a hand-written axial shading from x 10 to 190 is 0.5% from Ghostscript's render (it was 4.5%). Radial shadings extended at one end only or starting from a circle, and shadings through a shading pattern, still paint the whole area; scores unchanged | | 2026-11-06 | minor | SVG import: filter and mask regions clip (SVG 1.1 §15.5, §14.4). An object whose imported blur, shadow or glow reaches past its filter's region comes in inside a clip group cut to the region (#5876), and a mask's art is cut to the mask's region, in user space or the object's bounding box (#5875). Objects that fit their regions, and our own exports, are unchanged; primitive subregions are still ignored. Tests `import_live::a_blur_is_cut_at_its_filter_region`, `import_live::a_mask_counts_only_inside_its_region` (crate `vectorcraft-svg`); scores unchanged | | 2026-11-06 | minor | SVG import: a Gaussian blur keeps the colour space its filter asks for with `color-interpolation-filters` (initially `linearRGB`, SVG 1.1 §15.7.6): a linear-light blur becomes Gaussian Blur with the new `linear` parameter, which blurs the colours in linear light (black beside white meets at about 188/255 instead of 128), and SVG export writes it back on the `feGaussianBlur` (#5877). Blurs that ask for sRGB, and the blurs our own export writes, are as before. CSS export still writes `blur()`. Tests `pixel::tests::linear_light_blur_mixes_light_not_values` (crate `vectorcraft-effects`), `import_live::a_gaussian_blur_keeps_its_colour_space` (crate `vectorcraft-svg`); scores unchanged | | 2026-11-06 | minor | PDF export and PDF-compatible `.ai` saves write each object's URL (Attributes panel) as a link annotation with a URI action (web and mail URLs only) over the bounds of the object that shows, trimmed by its clipping groups (ISO 32000-1, 12.5.6.5 and 12.6.4.7); hidden objects, layers that don't print and prints have none, and PDF/X files leave them out with a warning (#5785). Own-fixture tests in `tests::links`; PDF import doesn't read links back as URLs yet; scores unchanged | From 1d689ac4d7db2ae93b3ac194b140c3db58d8549a Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Fri, 6 Nov 2026 21:11:24 -0500 Subject: [PATCH 004/247] EPS import: shfill in its own method (graphics_op under the complexity limit) --- crates/eps/src/import/graphics/ops.rs | 66 ++++++++++++++------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/crates/eps/src/import/graphics/ops.rs b/crates/eps/src/import/graphics/ops.rs index 01731807d8..1afd09eae2 100644 --- a/crates/eps/src/import/graphics/ops.rs +++ b/crates/eps/src/import/graphics/ops.rs @@ -519,39 +519,43 @@ impl Interp<'_> { } self.stroke_path(bp)?; } - ShFill => { - let d = self.pop_dict()?; - if self.g.null { - return Ok(()); - } - if is_mesh(&d) { - let m = self.xf(); - return self.mesh_fill(&d, m); - } - let m = self.xf(); - if let Some(g) = self.gradient(&d, m)? { - let area = self.clip_bounds()?; - // Not extended, it paints only between its ends. - let extent = shading_extent(&d, m, area); - let path = match &extent { - Some(pts) if pts.len() < 3 => return Ok(()), - Some(pts) => polygon(pts), - None => area.to_path(0.1), - }; - let paint = Paint::Gradient(Box::new(g)); - let clips = self.g.clips.clone(); - self.out.fill(path, FillRule::NonZero, paint, self.g.overprint, &clips); - // Only a fill of the whole clip can stand in for the clip's shape. - if extent.is_none() - && let Some((_, n)) = self.out.drawn.last() - { - let id = n.id; - self.out.shadings.insert(id); - } - } - } + ShFill => self.shfill()?, _ => self.data_op(op)?, } Ok(()) } + + /// `shfill`: shading `sh` over the clip, as a gradient mesh or a gradient fill. + fn shfill(&mut self) -> Res { + let d = self.pop_dict()?; + if self.g.null { + return Ok(()); + } + if is_mesh(&d) { + let m = self.xf(); + return self.mesh_fill(&d, m); + } + let m = self.xf(); + if let Some(g) = self.gradient(&d, m)? { + let area = self.clip_bounds()?; + // Not extended, it paints only between its ends. + let extent = shading_extent(&d, m, area); + let path = match &extent { + Some(pts) if pts.len() < 3 => return Ok(()), + Some(pts) => polygon(pts), + None => area.to_path(0.1), + }; + let paint = Paint::Gradient(Box::new(g)); + let clips = self.g.clips.clone(); + self.out.fill(path, FillRule::NonZero, paint, self.g.overprint, &clips); + // Only a fill of the whole clip can stand in for the clip's shape. + if extent.is_none() + && let Some((_, n)) = self.out.drawn.last() + { + let id = n.id; + self.out.shadings.insert(id); + } + } + Ok(()) + } } From 714b82d28309881983fe38008cc1777709ad2b66 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Fri, 6 Nov 2026 21:43:14 -0500 Subject: [PATCH 005/247] EPS import: a shading that cuts nothing from its area, or a flat area, fills it as before --- crates/eps/src/import/graphics/paint.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/eps/src/import/graphics/paint.rs b/crates/eps/src/import/graphics/paint.rs index d0f8cb6788..ca3b1dee82 100644 --- a/crates/eps/src/import/graphics/paint.rs +++ b/crates/eps/src/import/graphics/paint.rs @@ -446,13 +446,14 @@ pub(super) fn shading_extent(sh: &DictRef, m: Affine, area: Rect) -> Option<Vec< .map(|i| i.borrow().iter().map(|o| matches!(o, Obj::Bool(true))).collect()) .unwrap_or_default(); let (e0, e1) = (extend.first().copied().unwrap_or(false), extend.get(1).copied().unwrap_or(false)); - if (e0 && e1) || m.determinant().abs() < 1e-12 || !m.as_coeffs().iter().all(|v| v.is_finite()) { + if (e0 && e1) || area.width() <= 0.0 || area.height() <= 0.0 || m.determinant().abs() < 1e-12 || !m.as_coeffs().iter().all(|v| v.is_finite()) { return None; } let inv = m.inverse(); // `area` in the shading's own space, where its axis and circles are. - let mut poly: Vec<Point> = + let corners: Vec<Point> = [(area.x0, area.y0), (area.x1, area.y0), (area.x1, area.y1), (area.x0, area.y1)].map(|(x, y)| inv * Point::new(x, y)).to_vec(); + let mut poly = corners.clone(); let c = nums("Coords"); let at = |i: usize| c.get(i).copied().filter(|v| v.is_finite()).unwrap_or(0.0); match d.get(&Key::name("ShadingType")).and_then(Obj::as_num) { @@ -482,6 +483,10 @@ pub(super) fn shading_extent(sh: &DictRef, m: Affine, area: Rect) -> Option<Vec< } _ => return None, } + // Nothing cut: it paints the whole area. + if poly.len() == 4 && poly.iter().zip(&corners).all(|(a, b)| (*a - *b).hypot2() < 1e-18) { + return None; + } Some(poly.into_iter().map(|p| m * p).collect()) } From 295644fc9671a1c2c71d5a8a953e9059d111324d Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Fri, 6 Nov 2026 21:30:40 -0500 Subject: [PATCH 006/247] EPS/.ai editing data: an empty variable library gives no note A file can keep an empty variable library: its variableSets, variableSet and sampleDataSets nodes named, with no values and no node types. The reader found no variable set in it and counted the library as skipped, so the import said the library couldn't be read. A library whose nodes hold no value or type has nothing to list: it now gives no note. A library with any value or type that can't be read keeps the note. --- crates/eps/src/import/ai/read/document.rs | 19 +++++++++++++++++ crates/eps/src/import/ai/tests.rs | 25 +++++++++++++++++++++++ docs/file-format-parity.md | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/ai/read/document.rs b/crates/eps/src/import/ai/read/document.rs index 65d949f0f4..6dc621cc6b 100644 --- a/crates/eps/src/import/ai/read/document.rs +++ b/crates/eps/src/import/ai/read/document.rs @@ -1627,6 +1627,20 @@ impl LibraryWalk { } /// The library of the `variableSets` element `sets` (see [`variable_library`]). +/// Whether an XML node in `o` or the dictionaries it holds has a value or a type +/// (`xmlnode-nodevalue`, `xmlnode-nodetype`). `seen` counts the dictionaries looked at; past +/// [`MAX_LIBRARY_NODES`] of them, or deeper than [`MAX_DEPTH`], the library is taken to hold some. +fn holds_values(o: &Obj, seen: &mut usize, depth: usize) -> bool { + *seen = seen.saturating_add(1); + if *seen > MAX_LIBRARY_NODES || depth > MAX_DEPTH { + return true; + } + if o.ty == "XMLNode" && (o.get("xmlnode-nodevalue").is_some() || o.get("xmlnode-nodetype").is_some()) { + return true; + } + o.items().any(|c| holds_values(c, seen, depth + 1)) +} + fn read_variable_sets(sets: &Obj) -> VariableRead { let mut walk = LibraryWalk::default(); let mut vars = Variables::default(); @@ -1645,5 +1659,10 @@ fn read_variable_sets(sets: &Obj) -> VariableRead { if walk.nodes > MAX_LIBRARY_NODES { return VariableRead { variables: Variables::default(), bindings: vec![], bindings_skipped: 0, skipped: 1, present: true }; } + if vars == Variables::default() && walk.bindings.is_empty() && !holds_values(sets, &mut 0, 0) { + // The empty library a file can keep: nodes with names and nothing else (no value, no + // type). There is nothing in it to list, so nothing was left out. + walk.skipped = 0; + } VariableRead { variables: vars, bindings: walk.bindings, bindings_skipped: walk.bindings_skipped, skipped: walk.skipped, present: true } } diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 36a93a690d..8786a2d5eb 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -2353,6 +2353,31 @@ fn ai_variable_library_edge_cases() { assert_eq!(notes, ["the file's variable library couldn't be read: the Variables panel doesn't list it"]); } +/// The empty library a file can keep, its nodes named and nothing else (no value, no type, empty +/// attributes), has nothing to list: it comes in without a note. A node that has a value or a type +/// isn't empty, so the same skeleton with a value still gets the note. +#[test] +fn an_empty_variable_library_gives_no_note() { + // A node with a name and nothing else: its children, then its attributes, as `%_` lines. + fn bare(name: &str, attributes: &[&str], children: &[String]) -> String { + let close = |n: &str, key: &str| format!("{}%_; {key},\n", n.strip_suffix("%_;\n").unwrap_or(n)); + let attributes: String = attributes.iter().map(|a| close(&bare(a, &[], &[]), &format!("({a}) "))).collect(); + let children: String = children.iter().map(|c| close(c, "")).collect(); + format!( + "%_/XMLNode :\n%_/Dictionary :\n{attributes}%_; (xmlnode-attributes) ,\n%_/Array :\n{children}%_; (xmlnode-children) ,\n%_({name}) /String (xmlnode-nodename) ,\n%_;\n" + ) + } + let data_sets = bare("v:sampleDataSets", &["xmlns:v", "xmlns"], &[]); + let skeleton = bare("variableSets", &[], &[bare("variableSet", &["varSetName"], std::slice::from_ref(&data_sets))]); + let (vars, notes) = read_library(&skeleton); + assert_eq!(vars, vectorcraft_doc::Variables::default()); + assert!(notes.is_empty(), "{notes:?}"); + // A node with a value isn't empty. + let valued = data_sets.replace("(xmlnode-nodename) ,\n", "(xmlnode-nodename) ,\n%_(x) /String (xmlnode-nodevalue) ,\n"); + let (_, notes) = read_library(&bare("variableSets", &[], &[bare("variableSet", &[], &[valued])])); + assert_eq!(notes, ["the file's variable library couldn't be read: the Variables panel doesn't list it"]); +} + /// When the layers can't be read, or reading stops before the library, [`variables`] still reads /// it, for the file read from its PDF part. #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index f60d46f622..66449897f4 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: an empty variable library gives no note; EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public @@ -212,6 +212,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri | Date | Change | Summary | |---|---|---| +| 2026-11-06 | minor | EPS and `.ai` editing data: an empty variable library (its XML nodes named and nothing else: no values, no types) no longer gives the note that the library couldn't be read. With nothing in it to list, nothing was left out; two users' Illustrator EPS files (used locally, not committed) open without the note. A library with any value or type that can't be read keeps the note. Test `import::ai::tests::an_empty_variable_library_gives_no_note` (crate `vectorcraft-eps`); scores unchanged | | 2026-11-06 | minor | EPS and `.ai` editing data: `Q` restores the painting state but not the transparency (`Xy`), which the writer only sets when the next object's differs from the last one written. A Screen glow followed by a clipping group set back to Normal no longer leaves the type after the group in Screen: two users' Illustrator 26.5 and 30 EPS posters (used locally, not committed) now show their gold heading and crescent, and both open from their layers (2.5% and 2.7% from the page before, under the limit after). Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: a blend whose spine was never edited, written with its keys and no spine part, comes in as a live blend along the straight lines between its keys' centres (in its record's order) instead of as its drawn steps. Checked on six users' Illustrator EPS files (used locally, not committed): every blend in four of them now comes in live, their renders unchanged; two still have blends the reader can't match to their drawn steps. Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: the art styles are found before the art is read, so objects in symbols defined ahead of `%AI9_BeginArtStyles` (as Illustrator 24 writes it) come in as themselves with their style instead of their drawn look. Checked on two users' EPS files (used locally, not committed): one's Symbols panel gains live Feather and Round Corners, its drawn-look count drops from 5 to 2, and both render unchanged; own-fixture test in `import::ai::tests`; scores and hours unchanged | From 9436a883ed81b3be43c48037c58aee0c3b578425 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 00:45:49 -0500 Subject: [PATCH 007/247] EPS/.ai editing data: blends in opacity masks read their records A blend in hidden art has its record's hex digits on %_% lines, which the scanner skipped as a comment: the record read as empty and the blend kept its drawn steps whatever its spacing. Those lines are now hidden comments. --- crates/eps/src/import/ai/blend.rs | 3 ++- crates/eps/src/import/ai/lex.rs | 13 ++++++++++++- crates/eps/src/import/ai/tests.rs | 16 ++++++++++++++++ docs/file-format-parity.md | 3 ++- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/crates/eps/src/import/ai/blend.rs b/crates/eps/src/import/ai/blend.rs index 6124c9eeea..1aa95b710a 100644 --- a/crates/eps/src/import/ai/blend.rs +++ b/crates/eps/src/import/ai/blend.rs @@ -10,7 +10,8 @@ //! locally, never committed): the blend's own art on `%_` lines, a group holding the key objects //! and the spine, each object's `/ArtDictionary` naming its part (`ShapeBlendPathType`: `K` a key, //! `S` the spine) and a key's id (`ShapeBlendPathID`); then the steps drawn, a group on plain -//! lines; then `(Adobe Path Blends) 1 0 n XP` and `n` bytes as hex on `%` lines. Those bytes +//! lines; then `(Adobe Path Blends) 1 0 n XP` and `n` bytes as hex on `%` lines (`%_%` lines +//! for a blend in hidden art, as an opacity mask's is: all of it is on `%_` lines). Those bytes //! start `DCBA`. A blend whose spine was never edited has no spine part: only its keys. //! //! The reader reads the words after `DCBA` (little endian) this way. Word 1 is the spacing: 0 is diff --git a/crates/eps/src/import/ai/lex.rs b/crates/eps/src/import/ai/lex.rs index 810a01c3f2..a43166ccc9 100644 --- a/crates/eps/src/import/ai/lex.rs +++ b/crates/eps/src/import/ai/lex.rs @@ -5,7 +5,8 @@ //! - Any other line starting with `%` is a [`Tok::Comment`] (the section markers). //! - `%_` later in a line starts tokens too, hidden (a pseudo-comment operator after its //! operands, as a gradient stop's `… 50 100 %_Bs`: AI7 spec §1.4.3); any other `%` later in a -//! line starts a comment that is skipped. +//! line starts a comment that is skipped, but for a line of hex digits after `%_` (a hidden +//! blend's record), a hidden [`Tok::Comment`]. //! - The binary image data after `%%BeginData:` is one [`Tok::Data`]; the binary preview of a placed //! file is one [`Tok::Preview`]. //! - A document included whole (`%%BeginDocument:` … `%%EndDocument` lines, DSC 3.0 p. 68, nested @@ -222,6 +223,12 @@ impl<'a> Lexer<'a> { if prefixed && PLACE.iter().chain(&NOTES).chain(&RELATIVE).any(|m| line.starts_with(m)) { return Some(Token { tok: Tok::Comment(line.get(1..).unwrap_or_default()), hidden: true }); } + // And a line of hex digits, as a hidden blend's record is written (`%_%4443…` + // after its `XP`), like the plain one on `%` lines. + let digits = line.get(1..).unwrap_or_default(); + if prefixed && !digits.trim_ascii_end().is_empty() && digits.trim_ascii_end().iter().all(u8::is_ascii_hexdigit) { + return Some(Token { tok: Tok::Comment(digits), hidden: true }); + } // A comment later in a line. continue; } @@ -470,6 +477,10 @@ mod tests { let toks = all(b"1 % a note (\n2 %_Bs\n3 %_ 4\n"); let words: Vec<_> = toks.iter().map(|t| (t.tok.clone(), t.hidden)).collect(); assert_eq!(words, [(Tok::Num(1.0), false), (Tok::Num(2.0), false), (Tok::Word(b"Bs"), true), (Tok::Num(3.0), false)]); + // A hidden line of hex digits (a hidden blend's record) is a comment; other text after + // `%_%` stays skipped. + let toks = all(b"%_%44434241\n%_% not hex\n%_%\n1\n"); + assert_eq!(toks, [t(Tok::Comment(b"44434241"), true), t(Tok::Num(1.0), false)]); } #[test] diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 36a93a690d..36581bb691 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -7041,6 +7041,22 @@ fn a_blend_comes_in_as_a_live_blend() { assert!(!s.warnings.iter().any(|w| w == super::blend::DRAWN), "{:?}", s.warnings); } +/// A blend in an opacity mask's art is written on `%_` lines, its record's hex digits on `%_%` +/// lines: it comes in live there too. +#[test] +fn a_blend_in_an_opacity_mask_comes_in_live() { + let body = blend_file("%_10 50 m\n%_110 50 L\n", [Some("A"), Some("B")], &blend_record(&['A', 'B'])); + let mask_art: String = body.lines().map(|l| if l.starts_with("%_") { format!("{l}\n") } else { format!("%_{l}\n") }).collect(); + assert!(mask_art.contains("\n%_%44434241"), "{mask_art}"); + let mask = format!("%_/ArtDictionary :\n%_/Mask :\n%_X=\n%_u\n{mask_art}%_U\n%_X+\n%_(Art) ,\n%_; (AI9_Mask) ,\n%_;\n"); + let s = read_ok(&layer(&format!("{RED}0 0 m\n0 80 L\n80 80 L\n80 0 L\nf\n{mask}"))); + let m = art(&s.doc)[0].extras().mask.clone().expect("a mask"); + let blend = m.art.children().and_then(|c| c.first()).cloned().unwrap_or(m.art.clone()); + let NodeKind::Blend { children, spec } = &blend.kind else { panic!("a live blend: {:?} {:?}", blend.kind, s.warnings) }; + assert_eq!((children.len(), spec.spacing), (2, vectorcraft_doc::live::BlendSpacing::Steps(3))); + assert!(!s.warnings.iter().any(|w| w == super::blend::DRAWN), "{:?}", s.warnings); +} + /// A blend whose spine was never edited has no spine written, only its keys: its spine is the /// straight line between the keys' centres, in the record's order (here the left key, named `B`, /// first), and the blend comes in live. diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index f60d46f622..b3f8dc4c07 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: blends in opacity masks read their records; EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public @@ -212,6 +212,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri | Date | Change | Summary | |---|---|---| +| 2026-11-07 | minor | EPS and `.ai` editing data: a blend in hidden art (an opacity mask's) has all of it on `%_` lines, its record's hex digits on `%_%` lines, which the scanner skipped as comments: the blend's record read as empty and the blend kept its drawn steps whatever its spacing. Those lines are now read, so such a blend comes in live where its spacing lays out its drawn steps. In a user's Illustrator EPS (used locally, not committed) three Smooth Color blends in opacity masks now read their records; they keep their drawn steps all the same, as the file's step counts (253 and 1 between their keys) aren't the ones Smooth Color works out here | | 2026-11-06 | minor | EPS and `.ai` editing data: `Q` restores the painting state but not the transparency (`Xy`), which the writer only sets when the next object's differs from the last one written. A Screen glow followed by a clipping group set back to Normal no longer leaves the type after the group in Screen: two users' Illustrator 26.5 and 30 EPS posters (used locally, not committed) now show their gold heading and crescent, and both open from their layers (2.5% and 2.7% from the page before, under the limit after). Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: a blend whose spine was never edited, written with its keys and no spine part, comes in as a live blend along the straight lines between its keys' centres (in its record's order) instead of as its drawn steps. Checked on six users' Illustrator EPS files (used locally, not committed): every blend in four of them now comes in live, their renders unchanged; two still have blends the reader can't match to their drawn steps. Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: the art styles are found before the art is read, so objects in symbols defined ahead of `%AI9_BeginArtStyles` (as Illustrator 24 writes it) come in as themselves with their style instead of their drawn look. Checked on two users' EPS files (used locally, not committed): one's Symbols panel gains live Feather and Round Corners, its drawn-look count drops from 5 to 2, and both render unchanged; own-fixture test in `import::ai::tests`; scores and hours unchanged | From 57946bfbd72e7ae05d6e74cecea5586bf9e39e28 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 01:56:25 -0500 Subject: [PATCH 008/247] EPS/.ai editing data: Zig Zag on paths stays live where it draws the drawn look's outline Zig Zag in a path's or compound path's art style is kept live when the outline VectorCraft's Zig Zag draws lies within 0.25 pt of every outline of the object's drawn look, both ways. Otherwise the drawn look stays, as before; type keeps taking Zig Zag as it did. --- crates/eps/src/import/ai/read/ops.rs | 89 ++++++++++++++++++++++++- crates/eps/src/import/ai/style.rs | 8 ++- crates/eps/src/import/ai/style/tests.rs | 3 +- crates/eps/src/import/ai/tests.rs | 47 +++++++++++++ docs/file-format-parity.md | 3 +- 5 files changed, 144 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 9535aa062f..99ad5d23ff 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1094,7 +1094,94 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p } else { object.appearance.contents_index }; - Some(Appearance { items, effects: st.effects.clone(), contents_index }) + let appearance = Appearance { items, effects: st.effects.clone(), contents_index }; + // Zig Zag's ridges are placed by VectorCraft's own rule: on objects other than type it is kept + // only where they draw the outline the drawn look has. + if !slot && st.effects.iter().any(|e| e.id == "distort.zigZag") && !draws_look_outline(object, &appearance, look) { + return None; + } + Some(appearance) +} + +/// How far, in points, an outline drawn with a reshaping effect may lie from its drawn look's +/// ([`draws_look_outline`]): the look's coordinates are written to a few decimals. +const OUTLINE_TOLERANCE: f64 = 0.25; + +/// Most points compared, one outline's flattened points times the other's segments. +const MAX_OUTLINE_PAIRS: usize = 4_000_000; + +/// Does path or compound path `object` with `appearance`'s effects draw every outline of its drawn look +/// `look`, as `look` draws its own (each within [`OUTLINE_TOLERANCE`] of the other)? `false` for +/// anything else: a look holding other than paths, outlines too detailed to compare. +fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bool { + fn leaves(n: &Node, out: &mut Vec<vectorcraft_geom::PathData>, depth: usize) -> bool { + match &n.kind { + NodeKind::Path { path, .. } => { + out.push(path.clone()); + true + } + NodeKind::Compound { children, .. } => { + out.push(vectorcraft_geom::PathData::new( + children.iter().filter_map(|c| c.path_data()).flat_map(|p| p.subpaths.iter().cloned()).collect(), + )); + true + } + NodeKind::Group { clip: false, .. } if depth < MAX_DEPTH => n.children().into_iter().flatten().all(|c| leaves(c, out, depth + 1)), + _ => false, + } + } + /// The segments of `paths` flattened, at most `max` of them. + fn segments(paths: &[vectorcraft_geom::PathData], max: usize) -> Option<Vec<kurbo::Line>> { + let mut out = vec![]; + let (mut start, mut last) = (None, None); + let mut over = false; + for p in paths { + vectorcraft_geom::flatten(p.to_bezpath(), OUTLINE_TOLERANCE / 10.0, |el| { + let mut add = |a: kurbo::Point, b: kurbo::Point| { + if out.len() < max { + out.push(kurbo::Line::new(a, b)); + } else { + over = true; + } + }; + match el { + kurbo::PathEl::MoveTo(q) => (start, last) = (Some(q), Some(q)), + kurbo::PathEl::LineTo(q) => { + if let Some(l) = last { + add(l, q); + } + last = Some(q); + } + kurbo::PathEl::ClosePath => { + if let (Some(l), Some(s)) = (last, start) { + add(l, s); + } + last = start; + } + _ => {} + } + }); + } + (!over && !out.is_empty()).then_some(out) + } + /// Does every end of segments `a` lie within the tolerance of segments `b`? + fn near(a: &[kurbo::Line], b: &[kurbo::Line]) -> bool { + use kurbo::ParamCurveNearest; + a.iter().all(|s| b.iter().any(|t| t.nearest(s.p0, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE)) + } + let (mut ours, mut theirs) = (vec![], vec![]); + if !matches!(object.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) || !leaves(object, &mut ours, 0) || !leaves(look, &mut theirs, 0) { + return false; + } + // The object's outline reshaped as it is drawn: its effects from its own bounds. + for path in &mut ours { + let bounds = kurbo::Shape::bounding_box(&path.to_bezpath()); + *path = vectorcraft_effects::apply_geometry(&appearance.effects, path, bounds); + } + let max = MAX_OUTLINE_PAIRS.isqrt(); + let Some(ours) = segments(&ours, max) else { return false }; + // Each of the look's outlines (a fill and a stroke draw the same one) is the object's. + theirs.iter().all(|t| segments(std::slice::from_ref(t), max).is_some_and(|t| near(&t, &ours) && near(&ours, &t))) } /// A graphic style's appearance from art style `st`, on no object: `None` when the style isn't one diff --git a/crates/eps/src/import/ai/style.rs b/crates/eps/src/import/ai/style.rs index 9699e3ac6a..fa43984a04 100644 --- a/crates/eps/src/import/ai/style.rs +++ b/crates/eps/src/import/ai/style.rs @@ -1361,8 +1361,9 @@ impl Builder<'_> { /// Is `e`, on the whole object, an effect any object is read with? Of the Distort & Transform /// effects: Transform without copies (Random is never read), Twist, a Tweak that moves nothing, -/// Pucker & Bloat at 0, and Free Distort when its corners make a parallelogram (an affine map). -/// Zig Zag is left to type. Which objects Transform, Twist and Free Distort are read on is +/// Pucker & Bloat at 0, Free Distort when its corners make a parallelogram (an affine map), and Zig +/// Zag (on objects other than type only where it draws its drawn look's outline: `read::ops`' +/// `styled`). Which objects Transform, Twist and Free Distort are read on is /// `read::ops`' `moves_with`. fn any_object_takes(e: &Effect) -> bool { match e.id.as_str() { @@ -1379,7 +1380,8 @@ fn any_object_takes(e: &Effect) -> bool { | "path.outlineObject" | "path.outlineStroke" | "distort.twist" - | "distort.tweak" => true, + | "distort.tweak" + | "distort.zigZag" => true, // Copies are drawn as one path, its fills under all its strokes, where the file paints each // copy's fill and stroke in turn. "distort.transform" => e.params["copies"].as_i64() == Some(0), diff --git a/crates/eps/src/import/ai/style/tests.rs b/crates/eps/src/import/ai/style/tests.rs index bdb9a3d6e3..fa6eca9f4c 100644 --- a/crates/eps/src/import/ai/style/tests.rs +++ b/crates/eps/src/import/ai/style/tests.rs @@ -955,7 +955,8 @@ fn any_object_takes_the_distort_effects_that_draw_as_its_drawn_look() { assert!(simple("Adobe Free Distort", &corners(src, [[0.2, 0.0], [1.2, 0.0], [0.0, -1.0], [1.0, -1.0]]))); assert!(!simple("Adobe Free Distort", &corners(src, [[0.2, 0.0], [1.2, 0.1], [0.0, -1.0], [1.0, -1.0]]))); assert!(!simple("Adobe Punk and Bloat", "-35 /Real (d_factor) ,\n")); - assert!(!simple("Adobe Zigzag", "")); + // Zig Zag: objects other than type check it against their drawn look (`read::ops`). + assert!(simple("Adobe Zigzag", "")); assert!(!simple("Adobe Transform", &format!("1 /Int (numCopies) ,\n{SWITCHES}"))); // With another effect, only type takes it. let chain = [basic("Adobe Twirl", "45 /Real (angle) ,\n"), basic("Adobe Offset Path", "4 /Real (ofst) ,\n0 /Int (jntp) ,\n4 /Real (mlim) ,\n")]; diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 36a93a690d..6ed474caa2 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -5793,6 +5793,53 @@ fn an_object_with_a_distort_effect_drawn_another_way_keeps_its_drawn_look() { } } +#[test] +fn a_path_with_zig_zag_comes_in_as_itself_where_its_look_has_that_outline() { + // GUARDS: Zig Zag on a path came in as its drawn look even where the live effect draws the same outline. + let keys = "3 /Real (amount) ,\n1 /Real (absoluteness) ,\n2 /Real (ridges) ,\n0 /Real (roundness) ,\n"; + let zig = vectorcraft_doc::Effect { + id: "distort.zigZag".into(), + params: serde_json::json!({"size": 3.0, "relative": false, "ridges": 2, "points": "corner"}), + visible: true, + }; + // The square as the document has it (y up in the file, down in the document). + let plain = read_ok(&layer(&format!("{RED}{}f\n", rect_path(20.0, 20.0, 60.0, 50.0)))); + let square = art(&plain.doc)[0].path_data().unwrap().clone(); + let to_file = |p: Point| { + let start = square.subpaths[0].anchors[0].p; + Point::new(p.x - start.x + 20.0, start.y - p.y + 20.0) + }; + let outline = vectorcraft_effects::apply_geometry(&[zig], &square, square.bounds().unwrap()); + // The look: the outline the effect draws, as straight segments. + let ops = |shift: f64| -> String { + let mut out = String::new(); + for sp in &outline.subpaths { + for (i, a) in sp.anchors.iter().enumerate() { + let p = to_file(a.p); + out.push_str(&format!("{:.4} {:.4} {}\n", p.x + shift, p.y, if i == 0 { "m" } else { "L" })); + } + } + out + }; + let hidden_rect = rect_path(20.0, 20.0, 60.0, 50.0).replace('\n', "\n%_"); + let object = |look: &str| format!("0 Ae\nu\n0 0 0 0 0 0 1 Xa\n{look}f\nU\n%_{hidden_rect}f\n1 (Bent) XW\n"); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(0.0))))); + assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + let a = art(&r.doc); + assert_eq!(a.len(), 1, "{a:#?}"); + assert!(matches!(a[0].kind, NodeKind::Path { .. }), "the object, not its look: {a:#?}"); + let e = &a[0].appearance.effects; + assert_eq!(e.len(), 1, "{e:?}"); + assert_eq!( + (e[0].id.as_str(), &e[0].params), + ("distort.zigZag", &serde_json::json!({"size": 3.0, "relative": false, "ridges": 2, "points": "corner"})) + ); + // A look whose ridges lie elsewhere (here 1 pt to the right) keeps the drawn look. + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(1.0))))); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + assert!(matches!(art(&r.doc)[0].kind, NodeKind::Group { .. })); +} + /// The gradient `G`, white to black, defined for a document. const GRADIENT_G: &str = "%AI5_BeginGradient: (G)\n(G) 0 2 Bd\n[\n%_1 0 50 0 Bs\n%_0 0 50 100 Bs\nBD\n%AI5_EndGradient\n"; diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index f60d46f622..2ccd69d56e 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-07 · **Change:** minor (EPS and `.ai` editing data: Zig Zag on paths stays live where it draws its drawn look's outline) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public @@ -212,6 +212,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri | Date | Change | Summary | |---|---|---| +| 2026-11-07 | minor | EPS and `.ai` editing data: Zig Zag in a path's art style (Size, Relative or Absolute, Ridges per segment, Smooth or Corner points) stays live where VectorCraft's Zig Zag draws the outline the drawn look has, each within 0.25 pt of the other; where it doesn't, the drawn look stays, as before. Type keeps taking Zig Zag as it did. Checked on a user's Illustrator EPS (used locally, not committed): its 3 Zig Zag circles (Smooth and Corner, 10 and 13 ridges) come in live, within 0.03 pt of their drawn looks, and the render is unchanged. Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: `Q` restores the painting state but not the transparency (`Xy`), which the writer only sets when the next object's differs from the last one written. A Screen glow followed by a clipping group set back to Normal no longer leaves the type after the group in Screen: two users' Illustrator 26.5 and 30 EPS posters (used locally, not committed) now show their gold heading and crescent, and both open from their layers (2.5% and 2.7% from the page before, under the limit after). Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: a blend whose spine was never edited, written with its keys and no spine part, comes in as a live blend along the straight lines between its keys' centres (in its record's order) instead of as its drawn steps. Checked on six users' Illustrator EPS files (used locally, not committed): every blend in four of them now comes in live, their renders unchanged; two still have blends the reader can't match to their drawn steps. Scores and estimates unchanged. | | 2026-11-06 | minor | EPS and `.ai` editing data: the art styles are found before the art is read, so objects in symbols defined ahead of `%AI9_BeginArtStyles` (as Illustrator 24 writes it) come in as themselves with their style instead of their drawn look. Checked on two users' EPS files (used locally, not committed): one's Symbols panel gains live Feather and Round Corners, its drawn-look count drops from 5 to 2, and both render unchanged; own-fixture test in `import::ai::tests`; scores and hours unchanged | From a24fa8658b5e089c1eeaa6e5e8768426016196e5 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:14:58 -0500 Subject: [PATCH 009/247] Docs: file-format parity status date matches its newest revision --- docs/file-format-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index b3f8dc4c07..899d8c5c0b 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (EPS and `.ai` editing data: blends in opacity masks read their records; EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-07 · **Change:** minor (EPS and `.ai` editing data: blends in opacity masks read their records; EPS and `.ai` editing data: a transparency set inside a clipping group stays after its `Q`; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`, `OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/formats.rs`). Illustrator's list comes from its public From 60953b507726041787b8cfd1421a2f83ef61a0c6 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 11:01:52 -0500 Subject: [PATCH 010/247] EPS import: a radial shading's circle is cut to enough sides for large radii The end circle of a radial shading not extended was cut to 64 sides, so its chords lay up to 0.12% of the radius inside it and left a visible unpainted band on large circles. The side count now comes from a 0.01 pt tolerance in the document (64 to 1024 sides). --- crates/eps/src/import/graphics/paint.rs | 12 +++++++++++- crates/eps/src/import/tests_generators.rs | 13 +++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/graphics/paint.rs b/crates/eps/src/import/graphics/paint.rs index ca3b1dee82..8311976434 100644 --- a/crates/eps/src/import/graphics/paint.rs +++ b/crates/eps/src/import/graphics/paint.rs @@ -429,6 +429,11 @@ fn is_gradient(sh: &DictRef) -> bool { matches!(sh.borrow().get(&Key::name("ShadingType")).and_then(Obj::as_num), Some(2.0 | 3.0)) } +/// How far (points) the sides of the polygon a radial shading's circle is cut to may lie inside it. +const RING_TOLERANCE: f64 = 0.01; +/// Most sides of that polygon. +const MAX_RING: usize = 1024; + /// The part of `area` (in the document) that axial or radial shading `sh`, mapped into the /// document by `m`, paints, as a convex polygon; `None` when it paints all of it. Without /// `Extend` an axial shading paints only between the lines through its ends across its axis, and @@ -473,7 +478,12 @@ pub(super) fn shading_extent(sh: &DictRef, m: Affine, area: Rect) -> Option<Vec< Some(3.0) if !e0 && !e1 && at(2) <= 0.0 && at(5) > 0.0 => { // The circles from a point to a circle cover the hull of that point and circle. let (p0, c1, r1) = (Point::new(at(0), at(1)), Point::new(at(3), at(4)), at(5)); - let ring: Vec<Point> = (0..64).map(|i| c1 + Vec2::from_angle(i as f64 * std::f64::consts::TAU / 64.0) * r1).collect(); + // Enough sides that each lies within `RING_TOLERANCE` of the circle in the document + // (the radius scaled by how `m` scales areas), from 64 to `MAX_RING`. + let r = r1 * m.determinant().abs().sqrt(); + let sides = (std::f64::consts::PI / (1.0 - RING_TOLERANCE / r).clamp(-1.0, 1.0).acos()).ceil(); + let sides = if sides.is_finite() { (sides as usize).clamp(64, MAX_RING) } else { MAX_RING }; + let ring: Vec<Point> = (0..sides).map(|i| c1 + Vec2::from_angle(i as f64 * std::f64::consts::TAU / sides as f64) * r1).collect(); for edge in hull(&[ring, vec![p0]].concat()).windows(2) { if let [a, b] = edge { let (a, b) = (*a, *b); diff --git a/crates/eps/src/import/tests_generators.rs b/crates/eps/src/import/tests_generators.rs index 75e4fd5d3d..a2836985d3 100644 --- a/crates/eps/src/import/tests_generators.rs +++ b/crates/eps/src/import/tests_generators.rs @@ -1166,6 +1166,19 @@ fn shadings_not_extended_paint_only_between_their_ends() { // Radial from the centre point to a circle of radius 30. let b = shade(3, "50 50 0 50 50 30", ""); assert!((b.width() - 60.0).abs() < 0.5 && (b.height() - 60.0).abs() < 0.5 && (b.center().x - 50.0).abs() < 0.5, "{b:?}"); + // Its circle is cut to a polygon whose sides lie within 0.01 pt of it, also for a large one. + let r = read( + "<< /ShadingType 3 /ColorSpace /DeviceRGB /Coords [50 50 0 50 50 45] \ + /Function << /FunctionType 2 /Domain [0 1] /C0 [1 0 0] /C1 [0 0 1] /N 1 >> >> shfill", + ); + let n = all(&r.document).into_iter().find(|n| matches!(fill(n), Some(Paint::Gradient(_)))).expect("a gradient fill"); + let NodeKind::Path { path, .. } = &n.kind else { panic!("{n:?}") }; + let ring: Vec<Point> = path.subpaths.iter().flat_map(|s| s.anchors.iter().map(|a| a.p)).collect(); + let centre = Point::new(50.0, 50.0); + for (a, b) in ring.iter().zip(ring.iter().cycle().skip(1)) { + assert!((a.distance(centre) - 45.0).abs() < 1e-6, "{a:?}"); + assert!(a.midpoint(*b).distance(centre) > 45.0 - 0.01, "{a:?} {b:?}"); + } let b = shade(3, "50 50 0 50 50 30", "/Extend [true true]"); assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{b:?}"); } From bafa1868daa4f60959308420db575a568e41891d Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 13:21:55 -0500 Subject: [PATCH 011/247] EPS/.ai editing data: a live outline's check compares both ends of each segment The check that a reshaping effect draws its look's outline compared only the start of each segment, so the last point of an open outline was never compared and a look ending elsewhere still kept the effect live. Both ends are now compared. --- crates/eps/src/import/ai/read/ops.rs | 6 ++++-- crates/eps/src/import/ai/tests.rs | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 99ad5d23ff..b4e9142547 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1164,10 +1164,12 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo } (!over && !out.is_empty()).then_some(out) } - /// Does every end of segments `a` lie within the tolerance of segments `b`? + /// Does every end of segments `a` lie within the tolerance of segments `b`? Both ends: the last + /// point of an open outline starts no segment. fn near(a: &[kurbo::Line], b: &[kurbo::Line]) -> bool { use kurbo::ParamCurveNearest; - a.iter().all(|s| b.iter().any(|t| t.nearest(s.p0, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE)) + let close = |p: kurbo::Point| b.iter().any(|t| t.nearest(p, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE); + a.iter().all(|s| close(s.p0) && close(s.p1)) } let (mut ours, mut theirs) = (vec![], vec![]); if !matches!(object.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) || !leaves(object, &mut ours, 0) || !leaves(look, &mut theirs, 0) { diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 6ed474caa2..55949bfbea 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -5809,7 +5809,7 @@ fn a_path_with_zig_zag_comes_in_as_itself_where_its_look_has_that_outline() { let start = square.subpaths[0].anchors[0].p; Point::new(p.x - start.x + 20.0, start.y - p.y + 20.0) }; - let outline = vectorcraft_effects::apply_geometry(&[zig], &square, square.bounds().unwrap()); + let outline = vectorcraft_effects::apply_geometry(std::slice::from_ref(&zig), &square, square.bounds().unwrap()); // The look: the outline the effect draws, as straight segments. let ops = |shift: f64| -> String { let mut out = String::new(); @@ -5838,6 +5838,31 @@ fn a_path_with_zig_zag_comes_in_as_itself_where_its_look_has_that_outline() { let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(1.0))))); assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); assert!(matches!(art(&r.doc)[0].kind, NodeKind::Group { .. })); + // An open path (filled without closing it, `F`): its look's outline matches, and a look whose + // last point lies 3 pt away from where the effect ends it keeps the drawn look. + let open_path = "20 20 m\n60 20 L\n60 50 L\n"; + let plain = read_ok(&layer(&format!("{RED}{open_path}F\n"))); + let open = art(&plain.doc)[0].path_data().unwrap().clone(); + assert!(!open.subpaths[0].closed); + let start = open.subpaths[0].anchors[0].p; + let outline = vectorcraft_effects::apply_geometry(std::slice::from_ref(&zig), &open, open.bounds().unwrap()); + let ops = |last_shift: f64| -> String { + let mut out = String::new(); + for sp in &outline.subpaths { + for (i, a) in sp.anchors.iter().enumerate() { + let shift = if i + 1 == sp.anchors.len() { last_shift } else { 0.0 }; + let p = Point::new(a.p.x - start.x + 20.0 + shift, start.y - a.p.y + 20.0); + out.push_str(&format!("{:.4} {:.4} {}\n", p.x, p.y, if i == 0 { "m" } else { "L" })); + } + } + out + }; + let hidden_open = open_path.replace('\n', "\n%_"); + let object = |look: &str| format!("0 Ae\nu\n0 0 0 0 0 0 1 Xa\n{look}F\nU\n%_{hidden_open}F\n1 (Bent) XW\n"); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(0.0))))); + assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(3.0))))); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); } /// The gradient `G`, white to black, defined for a document. From 1cdea654828d3bbf7a0c74e74eeaff0dd72f52e0 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 15:02:03 -0500 Subject: [PATCH 012/247] EPS import: a radial shading's ring is sized for its greatest stretch The side count used the radius scaled by the square root of the transform's determinant, which a non-uniform scale (4 by 0.25, say) leaves at 1 while some sides stretch 4 times. It now uses the greatest stretch of the transform. --- crates/eps/src/import/graphics/paint.rs | 7 +++++-- crates/eps/src/import/tests_generators.rs | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/crates/eps/src/import/graphics/paint.rs b/crates/eps/src/import/graphics/paint.rs index 8311976434..dfa1b399cc 100644 --- a/crates/eps/src/import/graphics/paint.rs +++ b/crates/eps/src/import/graphics/paint.rs @@ -479,8 +479,11 @@ pub(super) fn shading_extent(sh: &DictRef, m: Affine, area: Rect) -> Option<Vec< // The circles from a point to a circle cover the hull of that point and circle. let (p0, c1, r1) = (Point::new(at(0), at(1)), Point::new(at(3), at(4)), at(5)); // Enough sides that each lies within `RING_TOLERANCE` of the circle in the document - // (the radius scaled by how `m` scales areas), from 64 to `MAX_RING`. - let r = r1 * m.determinant().abs().sqrt(); + // (the radius scaled by the most `m` stretches any direction), from 64 to `MAX_RING`. + let [a, b, c, d, ..] = m.as_coeffs(); + let (sum, det) = (a * a + b * b + c * c + d * d, a * d - b * c); + let stretch = ((sum + (sum * sum - 4.0 * det * det).max(0.0).sqrt()) / 2.0).sqrt(); + let r = r1 * stretch; let sides = (std::f64::consts::PI / (1.0 - RING_TOLERANCE / r).clamp(-1.0, 1.0).acos()).ceil(); let sides = if sides.is_finite() { (sides as usize).clamp(64, MAX_RING) } else { MAX_RING }; let ring: Vec<Point> = (0..sides).map(|i| c1 + Vec2::from_angle(i as f64 * std::f64::consts::TAU / sides as f64) * r1).collect(); diff --git a/crates/eps/src/import/tests_generators.rs b/crates/eps/src/import/tests_generators.rs index a2836985d3..2346b0d4b6 100644 --- a/crates/eps/src/import/tests_generators.rs +++ b/crates/eps/src/import/tests_generators.rs @@ -1179,6 +1179,18 @@ fn shadings_not_extended_paint_only_between_their_ends() { assert!((a.distance(centre) - 45.0).abs() < 1e-6, "{a:?}"); assert!(a.midpoint(*b).distance(centre) > 45.0 - 0.01, "{a:?} {b:?}"); } + // Stretched 4 times across and squashed to a quarter down (areas unchanged), the sides still + // lie within 0.01 pt of the ellipse it becomes. + let r = read( + "50 50 translate 4 0.25 scale << /ShadingType 3 /ColorSpace /DeviceRGB /Coords [0 0 0 0 0 10] \ + /Function << /FunctionType 2 /Domain [0 1] /C0 [1 0 0] /C1 [0 0 1] /N 1 >> >> shfill", + ); + let n = all(&r.document).into_iter().find(|n| matches!(fill(n), Some(Paint::Gradient(_)))).expect("a gradient fill"); + let NodeKind::Path { path, .. } = &n.kind else { panic!("{n:?}") }; + let sides = path.subpaths.iter().map(|s| s.anchors.len()).sum::<usize>(); + // A side of a regular polygon in the circle lies 1 - cos(pi / sides) of the radius inside it; + // stretched to 40 pt across, that is at most 0.01 pt. + assert!(40.0 * (1.0 - (std::f64::consts::PI / sides as f64).cos()) <= 0.01 + 1e-9, "{sides} sides"); let b = shade(3, "50 50 0 50 50 30", "/Extend [true true]"); assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{b:?}"); } From 5520a254b984c6e5c98a00d5052b0efd935e2211 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sat, 7 Nov 2026 15:02:04 -0500 Subject: [PATCH 013/247] EPS/.ai editing data: a live outline's check samples inside each segment Two outlines can share their vertices and join them differently: ends alone matched a bowtie to the square of its look. Each segment is now checked at points at most the tolerance apart, within the same budget of points compared. --- crates/eps/src/import/ai/read/ops.rs | 20 ++++++++++++++++---- crates/eps/src/import/ai/tests.rs | 7 +++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index b4e9142547..5a73729b88 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1164,12 +1164,24 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo } (!over && !out.is_empty()).then_some(out) } - /// Does every end of segments `a` lie within the tolerance of segments `b`? Both ends: the last - /// point of an open outline starts no segment. + /// Does every point of segments `a` lie within the tolerance of segments `b`? Each segment is + /// checked at both ends (the last point of an open outline starts no segment) and at points + /// at most the tolerance apart between them (two outlines can share their vertices and join + /// them differently). `false` past [`MAX_OUTLINE_PAIRS`] points compared. fn near(a: &[kurbo::Line], b: &[kurbo::Line]) -> bool { - use kurbo::ParamCurveNearest; + use kurbo::{ParamCurve, ParamCurveArclen, ParamCurveNearest}; let close = |p: kurbo::Point| b.iter().any(|t| t.nearest(p, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE); - a.iter().all(|s| close(s.p0) && close(s.p1)) + let mut budget = MAX_OUTLINE_PAIRS; + for s in a { + let steps = (s.arclen(1e-6) / OUTLINE_TOLERANCE).ceil(); + let steps = if steps.is_finite() && steps >= 1.0 { steps as usize } else { 1 }; + let Some(left) = budget.checked_sub(steps.saturating_add(1).saturating_mul(b.len())) else { return false }; + budget = left; + if !(0..=steps).all(|k| close(s.eval(k as f64 / steps as f64))) { + return false; + } + } + true } let (mut ours, mut theirs) = (vec![], vec![]); if !matches!(object.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) || !leaves(object, &mut ours, 0) || !leaves(look, &mut theirs, 0) { diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 55949bfbea..316d35c12d 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -5863,6 +5863,13 @@ fn a_path_with_zig_zag_comes_in_as_itself_where_its_look_has_that_outline() { assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", keys, BLUE_FILL), layer(&object(&ops(3.0))))); assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + // A Zig Zag of no size on an open path through the corners of its look's square, joined + // across it: the vertices match, the segments between them don't, so the drawn look stays. + let flat = "0 /Real (amount) ,\n1 /Real (absoluteness) ,\n0 /Real (ridges) ,\n0 /Real (roundness) ,\n"; + let bowtie = "%_20 20 m\n%_60 50 L\n%_60 20 L\n%_20 50 L\n%_F\n"; + let crossed = format!("0 Ae\nu\n0 0 0 0 0 0 1 Xa\n{}f\nU\n{bowtie}1 (Bent) XW\n", rect_path(20.0, 20.0, 60.0, 50.0)); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", flat, BLUE_FILL), layer(&crossed))); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); } /// The gradient `G`, white to black, defined for a document. From 91c0e030c7e0b7e8ff2624b594300b1f02cb0103 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sun, 8 Nov 2026 03:47:10 -0500 Subject: [PATCH 014/247] EPS/.ai editing data: test an empty variable library's value and type cases and its caps The valued case now differs from the empty skeleton only by its value, a type alone keeps the note too, and an empty library past the node or depth cap is taken to hold values. The library's doc comment is back above read_variable_sets. --- crates/eps/src/import/ai/read/document.rs | 26 ++++++++++++++++++++++- crates/eps/src/import/ai/tests.rs | 16 +++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/import/ai/read/document.rs b/crates/eps/src/import/ai/read/document.rs index 6dc621cc6b..d2a7c995a8 100644 --- a/crates/eps/src/import/ai/read/document.rs +++ b/crates/eps/src/import/ai/read/document.rs @@ -1626,7 +1626,6 @@ impl LibraryWalk { } } -/// The library of the `variableSets` element `sets` (see [`variable_library`]). /// Whether an XML node in `o` or the dictionaries it holds has a value or a type /// (`xmlnode-nodevalue`, `xmlnode-nodetype`). `seen` counts the dictionaries looked at; past /// [`MAX_LIBRARY_NODES`] of them, or deeper than [`MAX_DEPTH`], the library is taken to hold some. @@ -1641,6 +1640,7 @@ fn holds_values(o: &Obj, seen: &mut usize, depth: usize) -> bool { o.items().any(|c| holds_values(c, seen, depth + 1)) } +/// The library of the `variableSets` element `sets` (see [`variable_library`]). fn read_variable_sets(sets: &Obj) -> VariableRead { let mut walk = LibraryWalk::default(); let mut vars = Variables::default(); @@ -1666,3 +1666,27 @@ fn read_variable_sets(sets: &Obj) -> VariableRead { } VariableRead { variables: vars, bindings: walk.bindings, bindings_skipped: walk.bindings_skipped, skipped: walk.skipped, present: true } } + +#[cfg(test)] +mod tests { + use super::*; + use std::rc::Rc; + + /// An XML node holding `child` (when given) and nothing else: no value, no type. + fn node(child: Option<Obj>) -> Obj { + let children = Obj { ty: "Array".into(), content: child.map(|c| V::Obj(Rc::new(c))).into_iter().collect(), ..Obj::default() }; + Obj { ty: "XMLNode".into(), entries: vec![(Some("xmlnode-children".into()), vec![V::Obj(Rc::new(children))])], ..Obj::default() } + } + + /// An empty library is taken to hold values past the caps on what is looked at: nested deeper + /// than [`MAX_DEPTH`], or once [`MAX_LIBRARY_NODES`] dictionaries have been looked at. + #[test] + fn an_empty_library_past_the_caps_is_taken_to_hold_values() { + let shallow = node(Some(node(None))); + assert!(!holds_values(&shallow, &mut 0, 0)); + let deep = (0..MAX_DEPTH).fold(node(None), |inner, _| node(Some(inner))); + assert!(holds_values(&deep, &mut 0, 0)); + let mut seen = MAX_LIBRARY_NODES; + assert!(holds_values(&shallow, &mut seen, 0)); + } +} diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 8786a2d5eb..b021924818 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -2355,7 +2355,7 @@ fn ai_variable_library_edge_cases() { /// The empty library a file can keep, its nodes named and nothing else (no value, no type, empty /// attributes), has nothing to list: it comes in without a note. A node that has a value or a type -/// isn't empty, so the same skeleton with a value still gets the note. +/// isn't empty, so the same skeleton with a value, or with a type, still gets the note. #[test] fn an_empty_variable_library_gives_no_note() { // A node with a name and nothing else: its children, then its attributes, as `%_` lines. @@ -2372,10 +2372,16 @@ fn an_empty_variable_library_gives_no_note() { let (vars, notes) = read_library(&skeleton); assert_eq!(vars, vectorcraft_doc::Variables::default()); assert!(notes.is_empty(), "{notes:?}"); - // A node with a value isn't empty. - let valued = data_sets.replace("(xmlnode-nodename) ,\n", "(xmlnode-nodename) ,\n%_(x) /String (xmlnode-nodevalue) ,\n"); - let (_, notes) = read_library(&bare("variableSets", &[], &[bare("variableSet", &[], &[valued])])); - assert_eq!(notes, ["the file's variable library couldn't be read: the Variables panel doesn't list it"]); + let unread = ["the file's variable library couldn't be read: the Variables panel doesn't list it"]; + // The same skeleton but for one entry of the data sets node: a value, then a type. + let with = |entry: &str| { + let data_sets = data_sets.replace("(xmlnode-nodename) ,\n", &format!("(xmlnode-nodename) ,\n{entry}")); + bare("variableSets", &[], &[bare("variableSet", &["varSetName"], &[data_sets])]) + }; + for entry in ["%_(x) /String (xmlnode-nodevalue) ,\n", "%_1 /Int (xmlnode-nodetype) ,\n"] { + let (_, notes) = read_library(&with(entry)); + assert_eq!(notes, unread, "{entry}"); + } } /// When the layers can't be read, or reading stops before the library, [`variables`] still reads From aa76a8e89dc8404dc80a73b65829c696fbc4f377 Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sun, 8 Nov 2026 04:57:00 -0500 Subject: [PATCH 015/247] EPS import: test shading extents along y, on a diagonal, turned by the CTM, and from an off-centre point Also check that radial shadings extended at one end, or starting from a circle, still paint the whole area. --- crates/eps/src/import/tests_generators.rs | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/crates/eps/src/import/tests_generators.rs b/crates/eps/src/import/tests_generators.rs index 2346b0d4b6..f1e5559729 100644 --- a/crates/eps/src/import/tests_generators.rs +++ b/crates/eps/src/import/tests_generators.rs @@ -1193,4 +1193,41 @@ fn shadings_not_extended_paint_only_between_their_ends() { assert!(40.0 * (1.0 - (std::f64::consts::PI / sides as f64).cos()) <= 0.01 + 1e-9, "{sides} sides"); let b = shade(3, "50 50 0 50 50 30", "/Extend [true true]"); assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{b:?}"); + + // Axial along y, and extended at its start only. + let b = shade(2, "0 20 0 70", ""); + assert!(near(b, Rect::new(0.0, 30.0, 100.0, 80.0)), "{b:?}"); + let b = shade(2, "10 0 90 0", "/Extend [true false]"); + assert!(near(b, Rect::new(0.0, 0.0, 90.0, 100.0)), "{b:?}"); + // Diagonal: from (60, 60) to (90, 90) it paints where x + y lies from 120 to 180, a strip + // across the square's top-right corner whose own corners are cut off. + let r = read( + "<< /ShadingType 2 /ColorSpace /DeviceRGB /Coords [60 60 90 90] \ + /Function << /FunctionType 2 /Domain [0 1] /C0 [1 0 0] /C1 [0 0 1] /N 1 >> >> shfill", + ); + let n = all(&r.document).into_iter().find(|n| matches!(fill(n), Some(Paint::Gradient(_)))).expect("a gradient fill"); + assert!(near(bounds(&n), Rect::new(20.0, 0.0, 100.0, 80.0)), "{:?}", bounds(&n)); + let NodeKind::Path { path, .. } = &n.kind else { panic!("{n:?}") }; + for a in path.subpaths.iter().flat_map(|s| s.anchors.iter()) { + // Back in PostScript's y-up space. + let s = a.p.x + (100.0 - a.p.y); + assert!((120.0 - 1e-6..=180.0 + 1e-6).contains(&s), "{a:?}"); + } + // The current transformation turns the axis: rotated a quarter turn about the centre, an axis + // from -40 to 40 along x runs up the page from y 10 to 90. + let r = read( + "50 50 translate 90 rotate << /ShadingType 2 /ColorSpace /DeviceRGB /Coords [-40 0 40 0] \ + /Function << /FunctionType 2 /Domain [0 1] /C0 [1 0 0] /C1 [0 0 1] /N 1 >> >> shfill", + ); + let n = all(&r.document).into_iter().find(|n| matches!(fill(n), Some(Paint::Gradient(_)))).expect("a gradient fill"); + assert!(near(bounds(&n), Rect::new(0.0, 10.0, 100.0, 90.0)), "{:?}", bounds(&n)); + // Radial from a point off the circle's centre covers the hull of that point and the circle. + let b = shade(3, "20 50 0 60 50 30", ""); + assert!((b.x0 - 20.0).abs() < 0.5 && (b.x1 - 90.0).abs() < 0.5 && (b.y0 - 20.0).abs() < 0.5 && (b.y1 - 80.0).abs() < 0.5, "{b:?}"); + // Radial shadings this doesn't bound (extended at one end, or starting from a circle) still + // paint the whole area. + for (coords, extend) in [("50 50 0 50 50 30", "/Extend [true false]"), ("50 50 0 50 50 30", "/Extend [false true]"), ("50 50 10 50 50 30", "")] { + let b = shade(3, coords, extend); + assert!(near(b, Rect::new(0.0, 0.0, 100.0, 100.0)), "{coords} {extend}: {b:?}"); + } } From 79dba05dc6b4313ba4ad9f4336aa5ced8c096f1a Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sun, 8 Nov 2026 05:16:01 -0500 Subject: [PATCH 016/247] EPS/.ai editing data: Zig Zag's outline check works from one budget per object The point-to-segment distances for all of a look's outlines now come from one budget for the object, so a look with many outlines can't multiply the work, and boxes further apart than the tolerance are turned down before any points are compared. Tests: a look drawn thousands of times gives up, and a look worked out by hand (not by the effect) matches while its mirror doesn't. --- crates/eps/src/import/ai/read/ops.rs | 51 ++++++++++++++++++++++++---- crates/eps/src/import/ai/tests.rs | 11 ++++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 5a73729b88..f052b16114 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1107,7 +1107,7 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p /// ([`draws_look_outline`]): the look's coordinates are written to a few decimals. const OUTLINE_TOLERANCE: f64 = 0.25; -/// Most points compared, one outline's flattened points times the other's segments. +/// Most point-to-segment distances worked out for one object, over all its look's outlines. const MAX_OUTLINE_PAIRS: usize = 4_000_000; /// Does path or compound path `object` with `appearance`'s effects draw every outline of its drawn look @@ -1167,22 +1167,27 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo /// Does every point of segments `a` lie within the tolerance of segments `b`? Each segment is /// checked at both ends (the last point of an open outline starts no segment) and at points /// at most the tolerance apart between them (two outlines can share their vertices and join - /// them differently). `false` past [`MAX_OUTLINE_PAIRS`] points compared. - fn near(a: &[kurbo::Line], b: &[kurbo::Line]) -> bool { + /// them differently). Each point's distance to each segment of `b` (a projection onto it) is + /// taken from `budget`: `false` once that runs out. + fn near(a: &[kurbo::Line], b: &[kurbo::Line], budget: &mut usize) -> bool { use kurbo::{ParamCurve, ParamCurveArclen, ParamCurveNearest}; let close = |p: kurbo::Point| b.iter().any(|t| t.nearest(p, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE); - let mut budget = MAX_OUTLINE_PAIRS; for s in a { let steps = (s.arclen(1e-6) / OUTLINE_TOLERANCE).ceil(); let steps = if steps.is_finite() && steps >= 1.0 { steps as usize } else { 1 }; let Some(left) = budget.checked_sub(steps.saturating_add(1).saturating_mul(b.len())) else { return false }; - budget = left; + *budget = left; if !(0..=steps).all(|k| close(s.eval(k as f64 / steps as f64))) { return false; } } true } + /// The box round segments `lines` (`None` without any). + fn bounds(lines: &[kurbo::Line]) -> Option<kurbo::Rect> { + let first = lines.first()?.p0; + Some(lines.iter().fold(kurbo::Rect::from_points(first, first), |r, l| r.union_pt(l.p0).union_pt(l.p1))) + } let (mut ours, mut theirs) = (vec![], vec![]); if !matches!(object.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) || !leaves(object, &mut ours, 0) || !leaves(look, &mut theirs, 0) { return false; @@ -1194,8 +1199,18 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo } let max = MAX_OUTLINE_PAIRS.isqrt(); let Some(ours) = segments(&ours, max) else { return false }; + let Some(ours_box) = bounds(&ours) else { return false }; + // Two outlines each within the tolerance of the other have boxes as close: the boxes are + // compared first, then the points, from one budget for the object. + let boxed = |t: &[kurbo::Line]| { + let Some(r) = bounds(t) else { return false }; + [r.x0 - ours_box.x0, r.y0 - ours_box.y0, r.x1 - ours_box.x1, r.y1 - ours_box.y1].iter().all(|d| d.abs() <= OUTLINE_TOLERANCE) + }; + let mut budget = MAX_OUTLINE_PAIRS; // Each of the look's outlines (a fill and a stroke draw the same one) is the object's. - theirs.iter().all(|t| segments(std::slice::from_ref(t), max).is_some_and(|t| near(&t, &ours) && near(&ours, &t))) + theirs + .iter() + .all(|t| segments(std::slice::from_ref(t), max).is_some_and(|t| boxed(&t) && near(&t, &ours, &mut budget) && near(&ours, &t, &mut budget))) } /// A graphic style's appearance from art style `st`, on no object: `None` when the style isn't one @@ -1364,6 +1379,30 @@ mod tests { Arc::new(Node::path(NodeId(id), shapes::rectangle(Rect::new(0.0, 0.0, 10.0, 10.0)), Appearance::basic(fill, Paint::None, 0.0))) } + /// The outline check works from one budget for the object: a look of the outline drawn twice + /// (a fill and a stroke) matches, one drawn thousands of times gives up and keeps the drawn + /// look instead of comparing every copy. + #[test] + fn the_outline_check_has_one_budget_for_the_object() { + let zig = vectorcraft_doc::Effect { + id: "distort.zigZag".into(), + params: serde_json::json!({"size": 3.0, "relative": false, "ridges": 4, "points": "corner"}), + visible: true, + }; + let path = shapes::rectangle(Rect::new(0.0, 0.0, 100.0, 60.0)); + let appearance = Appearance { effects: vec![zig.clone()], ..Appearance::basic(Paint::None, Paint::None, 0.0) }; + let object = Node::path(NodeId(1), path.clone(), appearance.clone()); + let outline = vectorcraft_effects::apply_geometry(std::slice::from_ref(&zig), &path, Rect::new(0.0, 0.0, 100.0, 60.0)); + let look = |copies: u64| { + let drawn = (0..copies).map(|i| Arc::new(Node::path(NodeId(10 + i), outline.clone(), Appearance::default()))).collect(); + Node::group(NodeId(2), drawn) + }; + assert!(draws_look_outline(&object, &appearance, &look(2))); + let started = std::time::Instant::now(); + assert!(!draws_look_outline(&object, &appearance, &look(5_000))); + assert!(started.elapsed() < std::time::Duration::from_secs(5), "{:?}", started.elapsed()); + } + /// An image draws no stroke, so an image with a brush in its art style keeps its drawn look. #[test] fn an_image_with_a_brush_keeps_its_drawn_look() { diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 316d35c12d..c4c2bd785e 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -5870,6 +5870,17 @@ fn a_path_with_zig_zag_comes_in_as_itself_where_its_look_has_that_outline() { let crossed = format!("0 Ae\nu\n0 0 0 0 0 0 1 Xa\n{}f\nU\n{bowtie}1 (Bent) XW\n", rect_path(20.0, 20.0, 60.0, 50.0)); let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", flat, BLUE_FILL), layer(&crossed))); assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + // A look worked out by hand rather than by the effect: Zig Zag of 3 pt with one ridge per + // segment and corner points, on a line from (20, 20) to (60, 20), puts the line's ends 3 pt up + // the page and its middle 3 pt down. The same look mirrored keeps the drawn look. + let one = "3 /Real (amount) ,\n1 /Real (absoluteness) ,\n1 /Real (ridges) ,\n0 /Real (roundness) ,\n"; + let line = "20 20 m\n60 20 L\n".replace('\n', "\n%_"); + let object = |look: &str| format!("0 Ae\nu\n0 0 0 0 0 0 1 Xa\n{look}F\nU\n%_{line}F\n1 (Bent) XW\n"); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", one, BLUE_FILL), layer(&object("20 23 m\n40 17 L\n60 23 L\n")))); + assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + assert!(matches!(art(&r.doc)[0].kind, NodeKind::Path { .. }), "{:#?}", art(&r.doc)); + let r = read_ok(&format!("{}{}", distort_styles("Adobe Zigzag", one, BLUE_FILL), layer(&object("20 17 m\n40 23 L\n60 17 L\n")))); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); } /// The gradient `G`, white to black, defined for a document. From a90779740c315abd4819113f80a2eb9cc132c18f Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Sun, 8 Nov 2026 07:21:13 -0500 Subject: [PATCH 017/247] EPS/.ai editing data: Zig Zag's outline check holds between the points it checks --- crates/eps/src/import/ai/read/ops.rs | 47 +++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index f052b16114..19136ab010 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1107,6 +1107,17 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p /// ([`draws_look_outline`]): the look's coordinates are written to a few decimals. const OUTLINE_TOLERANCE: f64 = 0.25; +/// How far, in points, a flattened outline in [`draws_look_outline`] may lie from its curves. +const OUTLINE_FLATNESS: f64 = OUTLINE_TOLERANCE / 10.0; + +/// How far apart, in points, [`draws_look_outline`] checks points along each flattened segment. +const OUTLINE_SPACING: f64 = OUTLINE_TOLERANCE / 2.0; + +/// How close, in points, each checked point must lie to the other flattened outline: every point +/// between two checked ones is within half the spacing of one, and both outlines are within the +/// flatness of their curves, so the curves are then within [`OUTLINE_TOLERANCE`] of each other. +const OUTLINE_POINT_LIMIT: f64 = OUTLINE_TOLERANCE - 2.0 * OUTLINE_FLATNESS - OUTLINE_SPACING / 2.0; + /// Most point-to-segment distances worked out for one object, over all its look's outlines. const MAX_OUTLINE_PAIRS: usize = 4_000_000; @@ -1136,7 +1147,7 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo let (mut start, mut last) = (None, None); let mut over = false; for p in paths { - vectorcraft_geom::flatten(p.to_bezpath(), OUTLINE_TOLERANCE / 10.0, |el| { + vectorcraft_geom::flatten(p.to_bezpath(), OUTLINE_FLATNESS, |el| { let mut add = |a: kurbo::Point, b: kurbo::Point| { if out.len() < max { out.push(kurbo::Line::new(a, b)); @@ -1164,16 +1175,16 @@ fn draws_look_outline(object: &Node, appearance: &Appearance, look: &Node) -> bo } (!over && !out.is_empty()).then_some(out) } - /// Does every point of segments `a` lie within the tolerance of segments `b`? Each segment is - /// checked at both ends (the last point of an open outline starts no segment) and at points - /// at most the tolerance apart between them (two outlines can share their vertices and join - /// them differently). Each point's distance to each segment of `b` (a projection onto it) is - /// taken from `budget`: `false` once that runs out. + /// Does every point of segments `a` lie close enough to segments `b` ([`OUTLINE_POINT_LIMIT`])? + /// Each segment is checked at both ends (the last point of an open outline starts no segment) + /// and at points at most [`OUTLINE_SPACING`] apart between them (two outlines can share their + /// vertices and join them differently). Each point's distance to each segment of `b` (a + /// projection onto it) is taken from `budget`: `false` once that runs out. fn near(a: &[kurbo::Line], b: &[kurbo::Line], budget: &mut usize) -> bool { use kurbo::{ParamCurve, ParamCurveArclen, ParamCurveNearest}; - let close = |p: kurbo::Point| b.iter().any(|t| t.nearest(p, 1e-6).distance_sq <= OUTLINE_TOLERANCE * OUTLINE_TOLERANCE); + let close = |p: kurbo::Point| b.iter().any(|t| t.nearest(p, 1e-6).distance_sq <= OUTLINE_POINT_LIMIT * OUTLINE_POINT_LIMIT); for s in a { - let steps = (s.arclen(1e-6) / OUTLINE_TOLERANCE).ceil(); + let steps = (s.arclen(1e-6) / OUTLINE_SPACING).ceil(); let steps = if steps.is_finite() && steps >= 1.0 { steps as usize } else { 1 }; let Some(left) = budget.checked_sub(steps.saturating_add(1).saturating_mul(b.len())) else { return false }; *budget = left; @@ -1403,6 +1414,26 @@ mod tests { assert!(started.elapsed() < std::time::Duration::from_secs(5), "{:?}", started.elapsed()); } + /// The outline check holds for every point of the outlines, not only the points it checks: a + /// 0.25 pt line whose look has only short pieces over its ends, 0.24 pt away, leaves the + /// line's middle about 0.27 pt from the look, so the drawn look stays. The line drawn 0.1 pt + /// away matches. + #[test] + fn the_outline_check_holds_between_the_points_it_checks() { + use kurbo::Point; + use vectorcraft_geom::{PathData, SubPath}; + let appearance = Appearance::basic(Paint::None, Paint::None, 0.0); + let line = PathData::new(vec![SubPath::polyline(&[Point::new(0.0, 0.0), Point::new(0.25, 0.0)], false)]); + let object = Node::path(NodeId(1), line, appearance.clone()); + let look = |pieces: &[[Point; 2]]| { + let drawn = PathData::new(pieces.iter().map(|p| SubPath::polyline(p, false)).collect()); + Node::group(NodeId(2), vec![Arc::new(Node::path(NodeId(3), drawn, Appearance::default()))]) + }; + let ends = [[Point::new(0.0, 0.24), Point::new(0.01, 0.24)], [Point::new(0.24, 0.24), Point::new(0.25, 0.24)]]; + assert!(!draws_look_outline(&object, &appearance, &look(&ends))); + assert!(draws_look_outline(&object, &appearance, &look(&[[Point::new(0.0, 0.1), Point::new(0.25, 0.1)]]))); + } + /// An image draws no stroke, so an image with a brush in its art style keeps its drawn look. #[test] fn an_image_with_a_brush_keeps_its_drawn_look() { From 5401288918d7088d50ae36a99e687ff072da4bb9 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Fri, 13 Nov 2026 14:09:35 -0800 Subject: [PATCH 018/247] Artboard tool: edge buttons show a tooltip Resting the pointer on an Artboard tool edge button now shows a tooltip after egui's usual delay: "Click to add an artboard on this side; Alt-click to duplicate this artboard with its art", or on a locked artboard, where an Alt-click does nothing, "Click to add an artboard on this side". The wording is VectorCraft's own. Tools can attach hover text to an overlay region with the new Overlay::HoverText (a disc in document units, drawn as nothing). The canvas puts a hover-only widget over each region, so the canvas keeps every click and drag, and shows the translated text while the pointer is inside the disc, no canvas drag is under way and no pointer button is down. A button hidden for lack of room, during a drag or with several artboards selected has no region, so no tooltip. Both strings have rows in every complete catalog, checked by a new i18n test, since the tl! scan does not read the tools crate. --- crates/tools/src/lib.rs | 4 ++ crates/tools/src/xform.rs | 2 +- crates/tools/src/xform/artboard.rs | 11 +++- crates/tools/src/xform/artboard/tests.rs | 38 +++++++++++ crates/ui-egui/src/canvas.rs | 5 +- crates/ui-egui/src/canvas/overlays.rs | 23 +++++++ crates/ui-egui/src/canvas/tests.rs | 84 ++++++++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tests.rs | 12 ++++ crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + docs/target-app-parity.md | 1 + 36 files changed, 230 insertions(+), 4 deletions(-) diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index d46a7fd972..bb8335a5b1 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -92,6 +92,10 @@ pub enum Overlay { Swatch { p: Point, color: [u8; 4], selected: bool }, /// A hairline in a translucent colour (perspective gridlines), RGBA. GridLine { a: Point, b: Point, color: [u8; 4] }, + /// Hover text for the disc of `radius` (document units) around `center`: while the pointer + /// rests there and nothing is being dragged, the UI shows `text`, an English UI string it + /// translates, as a tooltip. Nothing is drawn for it. + HoverText { center: Point, radius: f64, text: &'static str }, } /// What an IME's "delete the text around the cursor" counts: UTF-8 bytes (winit's raw diff --git a/crates/tools/src/xform.rs b/crates/tools/src/xform.rs index 915eb35e8a..21aab996de 100644 --- a/crates/tools/src/xform.rs +++ b/crates/tools/src/xform.rs @@ -18,7 +18,7 @@ use vectorcraft_geom::{BezPath, Point, Rect, Shape}; use crate::{Overlay, Tool}; -pub use artboard::ArtboardTool; +pub use artboard::{ArtboardTool, EDGE_BUTTON_TIP, EDGE_BUTTON_TIP_LOCKED}; pub use eyedropper::EyedropperTool; pub use free::{DistortMode, FreeTransformTool}; pub use gradient::GradientTool; diff --git a/crates/tools/src/xform/artboard.rs b/crates/tools/src/xform/artboard.rs index 5af642c44b..cc4b0f52f3 100644 --- a/crates/tools/src/xform/artboard.rs +++ b/crates/tools/src/xform/artboard.rs @@ -28,7 +28,8 @@ //! no other artboard). Clicking one adds an empty artboard there (`artboard.new {beside, side}`); //! Alt-clicking duplicates the artboard with its art there (`artboard.duplicate {index, side}`), //! except on a locked artboard, where an Alt-click does nothing. Each is one undo step, and the new -//! artboard becomes the active one. +//! artboard becomes the active one. Resting the pointer on a button shows a tooltip that says what a +//! click does there and, on an unlocked artboard, what an Alt-click does. use serde_json::{Value, json}; use vectorcraft_doc::ArtboardSide; @@ -298,6 +299,10 @@ fn bleed_offset(cx: &ToolContext, rect: Rect, handle: Handle) -> Vec2 { const EDGE_BUTTON_OFFSET: f64 = 18.0; /// The add button's radius in screen pixels: a press this near its center takes it. const EDGE_BUTTON_RADIUS: f64 = 7.0; +/// The add button's tooltip ([`Overlay::HoverText`]), an English UI string the UI translates. +pub const EDGE_BUTTON_TIP: &str = "Click to add an artboard on this side; Alt-click to duplicate this artboard with its art"; +/// The add button's tooltip on a locked artboard, where an Alt-click does nothing. +pub const EDGE_BUTTON_TIP_LOCKED: &str = "Click to add an artboard on this side"; impl ArtboardTool { /// The add buttons on the active artboard's edges, each with its side and center: shown while @@ -657,9 +662,11 @@ impl Tool for ArtboardTool { if self.drag.is_some() { o.extend(self.guides.iter().cloned()); } - // The add buttons: a ring with a plus in it. + // The add buttons: a ring with a plus in it, and a tooltip over the area a press takes. let (radius, arm) = (cx.tol(EDGE_BUTTON_RADIUS), cx.tol(3.5)); + let tip = if ab.locked { EDGE_BUTTON_TIP_LOCKED } else { EDGE_BUTTON_TIP }; for (_, at) in self.edge_buttons(cx) { + o.push(Overlay::HoverText { center: at, radius, text: tip }); let ring: Vec<Point> = (0..24).map(|k| at + Vec2::from_angle(f64::from(k) * std::f64::consts::TAU / 24.0) * radius).collect(); let mut path = polygon(&ring, true); for arm in [Vec2::new(arm, 0.0), Vec2::new(0.0, arm)] { diff --git a/crates/tools/src/xform/artboard/tests.rs b/crates/tools/src/xform/artboard/tests.rs index 98410703f6..20c3128176 100644 --- a/crates/tools/src/xform/artboard/tests.rs +++ b/crates/tools/src/xform/artboard/tests.rs @@ -611,6 +611,44 @@ fn add_buttons_hide_with_several_artboards_selected_or_during_a_drag() { assert!(button_sides(&t, &c).is_empty(), "none while an artboard is dragged"); } +/// The tooltips the add buttons carry: each one's center, radius and text. +fn button_tips(t: &ArtboardTool, c: &ToolContext) -> Vec<(Point, f64, &'static str)> { + t.overlays(c) + .into_iter() + .filter_map(|o| if let Overlay::HoverText { center, radius, text } = o { Some((center, radius, text)) } else { None }) + .collect() +} + +#[test] +fn each_add_button_has_a_tooltip_over_the_area_a_press_takes() { + let mut d = two_boards(); + let (s, p) = (Selection::default(), paint()); + let c = cx(&d, &s, &p); + let t = ArtboardTool::default(); + let radius = c.tol(EDGE_BUTTON_RADIUS); + let want: Vec<_> = t.edge_buttons(&c).into_iter().map(|(_, at)| (at, radius, EDGE_BUTTON_TIP)).collect(); + assert_eq!(want.len(), 3, "no button and no tooltip on the side without room"); + assert_eq!(button_tips(&t, &c), want); + // The tooltip's disc is the one a press takes. + for (at, r, _) in &want { + assert!(t.edge_button_at(&c, *at + Vec2::new(r * 0.99, 0.0)).is_some()); + assert!(t.edge_button_at(&c, *at + Vec2::new(r * 1.01, 0.0)).is_none()); + } + // None with several artboards selected or during a drag. + let several = ArtboardTool { active: 1, others: vec![0], ..Default::default() }; + assert!(button_tips(&several, &c).is_empty()); + let mut dragging = ArtboardTool::default(); + dragging.pointer(&c, &ev(PointerKind::Down, 700.0, 100.0)); + dragging.pointer(&c, &ev(PointerKind::Drag, 720.0, 100.0)); + assert!(button_tips(&dragging, &c).is_empty(), "none while an artboard is dragged"); + // A locked artboard's buttons tell only what a click does: an Alt-click does nothing there. + d.artboards[0].locked = true; + let c = cx(&d, &s, &p); + let tips = button_tips(&t, &c); + assert_eq!(tips.len(), 3); + assert!(tips.iter().all(|(_, _, text)| *text == EDGE_BUTTON_TIP_LOCKED), "{tips:?}"); +} + #[test] fn an_add_button_adds_an_empty_artboard_and_alt_duplicates_on_that_side() { let d = two_boards(); diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index a947dde852..e67b0e9e18 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -61,7 +61,9 @@ use outline::KEY_OUTLINE; use outline::{OVERLAY_MAX_ANCHORS, c32, node_outline, walk_drawn}; #[cfg(test)] use overlays::selected_anchor; -use overlays::{HandleLook, blend_widgets_overlay, draw_inside_overlay, draw_overlays, hover_highlight, ime_geometry, selection_overlay}; +use overlays::{ + HandleLook, blend_widgets_overlay, draw_inside_overlay, draw_overlays, hover_highlight, ime_geometry, overlay_hover_text, selection_overlay, +}; pub use panes::Panes; pub(crate) use panes::{consolidate, pane, tile, tiled_area}; use raster::{changed_pixels, pixel_region, upload}; @@ -410,6 +412,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let overlays = selection_visuals(app, &painter, &xf, (hidden_chars, selection_marks, hover_still), revolve_edit, view_info); draw_overlays(&painter, &xf, &overlays, &t, HandleLook::of(&app.session.prefs)); + overlay_hover_text(ui, &xf, &overlays, ui.data(|d| d.get_temp::<Drag>(drag_id())).is_some()); if !revolve_edit { shaper_widget_overlay(app, &painter, &xf); crate::panels::three_d::paint_graphic_handles(app, &painter, &xf); diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index aefd9253e9..d2a9a54530 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -437,6 +437,29 @@ pub(super) fn draw_overlays(p: &egui::Painter, xf: &Xf, overlays: &[Overlay], t: p.circle_stroke(c, 8.0, Stroke::new(2.0, t.accent)); } } + // Shown as a tooltip by `overlay_hover_text`; nothing is drawn. + Overlay::HoverText { .. } => {} + } + } +} + +/// The tooltips of the tool's [`Overlay::HoverText`] regions. Each region is a hover-only widget +/// over the canvas, which keeps the clicks and drags; while the pointer rests inside a region's +/// disc, egui shows its text, translated, after its usual tooltip delay. No tooltip shows during a +/// canvas drag (`dragging`) or while a pointer button is down. +pub(super) fn overlay_hover_text(ui: &egui::Ui, xf: &Xf, overlays: &[Overlay], dragging: bool) { + let pressed = ui.input(|i| i.pointer.any_down()); + for (i, o) in overlays.iter().enumerate() { + let Overlay::HoverText { center, radius, text } = o else { continue }; + let c = xf.to_screen(*center); + let r = (*radius * xf.zoom) as f32; + if !(r.is_finite() && r > 0.0 && c.is_finite()) { + continue; + } + let id = egui::Id::unique("canvas-hover-text").with(i); + let resp = ui.interact(egui::Rect::from_center_size(c, vec2(2.0 * r, 2.0 * r)), id, egui::Sense::hover()); + if !dragging && !pressed && resp.hover_pos().is_some_and(|p| p.distance(c) <= r) { + resp.on_hover_text(crate::i18n::t(text)); } } } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 666a1c8a62..4c30cad0f9 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -884,6 +884,90 @@ fn the_artboard_tool_names_its_active_artboard_once() { assert!((active[0].1 - other[0].1).abs() < 2.0, "on the artboard's top edge like the other name: {active:?} vs {other:?}"); } +/// The texts one headless 800 × 600 canvas frame at `time` seconds draws, tooltips included. +fn texts_at(app: &mut VectorcraftApp, ctx: &egui::Context, time: f64, events: Vec<egui::Event>) -> Vec<String> { + fn collect(shape: &Shape, texts: &mut Vec<String>) { + match shape { + Shape::Text(t) => texts.push(t.galley.text().to_string()), + Shape::Vec(shapes) => shapes.iter().for_each(|s| collect(s, texts)), + _ => {} + } + } + let screen_rect = Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))); + let mut out = ctx.run_ui(egui::RawInput { screen_rect, time: Some(time), events, ..Default::default() }, |ui| show(app, ui)); + out.textures_delta.clear(); + let mut texts = vec![]; + out.shapes.iter().for_each(|s| collect(&s.shape, &mut texts)); + texts +} + +/// The Artboard tool's add buttons: resting the pointer on one shows its tooltip after egui's +/// tooltip delay, over the disc a press takes and not beside it. No tooltip shows while a drag +/// is under way, or once the button is gone. +#[test] +fn an_artboard_add_button_shows_its_tooltip_while_the_pointer_rests_on_it() { + use egui::Event; + let tip = vectorcraft_tools::xform::EDGE_BUTTON_TIP; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + app.select_tool("artboard"); + let ctx = egui::Context::default(); + texts_at(&mut app, &ctx, 0.0, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + // The bottom button: the one below the artboard. + let regions: Vec<(Pos2, f32)> = app + .session + .overlays(app.view_info()) + .into_iter() + .filter_map(|o| match o { + Overlay::HoverText { center, radius, text } if text == tip => Some((xf.to_screen(center), (radius * xf.zoom) as f32)), + _ => None, + }) + .collect(); + assert_eq!(regions.len(), 4, "one tooltip for each add button"); + let (at, r) = regions.iter().copied().max_by(|a, b| a.0.y.total_cmp(&b.0.y)).unwrap(); + assert!((r - 7.0).abs() < 1e-3, "the disc a press takes: {r}"); + let shown = |texts: &[String]| texts.iter().any(|s| s == tip); + // Resting inside the disc: nothing at first, the tooltip after the delay. + assert!(!shown(&texts_at(&mut app, &ctx, 1.0, vec![Event::PointerMoved(at + vec2(r - 1.0, 0.0))]))); + assert!(!shown(&texts_at(&mut app, &ctx, 1.05, vec![])), "egui's tooltip delay first"); + let mut seen = false; + for k in 1..=20 { + seen |= shown(&texts_at(&mut app, &ctx, 1.05 + 0.1 * f64::from(k), vec![])); + } + assert!(seen, "the tooltip shows while the pointer rests on the button"); + // Just outside the disc, inside the square around it: no tooltip. + let mut t = 4.0; + texts_at(&mut app, &ctx, t, vec![Event::PointerMoved(at + vec2(r - 1.0, r - 1.0))]); + for _ in 0..20 { + t += 0.1; + assert!(!shown(&texts_at(&mut app, &ctx, t, vec![])), "beside the button"); + } + // A middle-button drag that starts on the button pans the view with the pointer, so the pointer + // stays on the button: no tooltip while it lasts. + let middle = |pos, pressed| Event::PointerButton { pos, button: egui::PointerButton::Middle, pressed, modifiers: Default::default() }; + texts_at(&mut app, &ctx, t, vec![Event::PointerMoved(at)]); + t += 0.1; + texts_at(&mut app, &ctx, t, vec![middle(at, true)]); + let to = at + vec2(30.0, 0.0); + for _ in 0..20 { + t += 0.1; + assert!(!shown(&texts_at(&mut app, &ctx, t, vec![Event::PointerMoved(to)])), "during a drag"); + } + texts_at(&mut app, &ctx, t, vec![middle(to, false)]); + // With an artboard below, there is no room for the bottom button, and its tooltip goes with it. + let r0 = app.session.active().unwrap().doc.artboards[0].rect; + app.session.execute("artboard.new", &json!({"beside": 0, "side": "bottom"})).unwrap(); + assert_eq!(app.session.active().unwrap().doc.artboards[0].rect, r0); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let below = xf.to_screen(vectorcraft_geom::Point::new(r0.center().x, r0.y1)) + vec2(0.0, 18.0); + texts_at(&mut app, &ctx, t, vec![Event::PointerMoved(below)]); + for _ in 0..20 { + t += 0.1; + assert!(!shown(&texts_at(&mut app, &ctx, t, vec![])), "no tooltip where no button shows"); + } +} + #[test] fn shift_clicking_canvas_artboard_label_toggles_multi_selection() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 85bf31792e..5fe2fc7846 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -922,6 +922,8 @@ font-technology Variable Променливи Duplicate Дублиране Duplicate and Offset 10 pt Дублиране и отместване с 10 pt Duplicate Artboard Дублиране на работна област + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Щракнете, за да добавите работна област от тази страна, Alt-щракване дублира тази работна област заедно с графиката ѝ + Click to add an artboard on this side Щракнете, за да добавите работна област от тази страна Copy Artboard Копиране на работна област Cut Artboard Изрязване на работна област Rename Artboards Преименуване на работни области diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 4d757344a9..cda72b848b 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4102,6 +4102,8 @@ axis Both Obje Show Prikaži Copy Width Point Kopiraj tačku širine Duplicate Artboard Dupliciraj radnu ploču + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kliknite da dodate radnu ploču na ovu stranu, Alt-klik duplicira ovu radnu ploču s njenim crtežom + Click to add an artboard on this side Kliknite da dodate radnu ploču na ovu stranu Area / Path Type Tekst u području / na putanji Decrease Font Size Smanji veličinu fonta Decrease Font Size by Five Steps Smanji veličinu fonta za pet koraka diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 4ab4a2bfdc..0e4c753f98 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1363,6 +1363,8 @@ antiAlias Sharp Nítid Duplicate Duplica Duplicate and Offset 10 pt Duplica i desplaça 10 pt Duplicate Artboard Duplica el tauler + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Fes clic per afegir un tauler en aquest costat i Alt+clic per duplicar aquest tauler amb la il·lustració + Click to add an artboard on this side Fes clic per afegir un tauler en aquest costat Duplicate Artboards Duplica els taulers Duplicate Brush Duplica el pinzell Duplicate Character Style Duplica l’estil de caràcter diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 6edd8ba3be..cafef15cae 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4158,6 +4158,8 @@ axis Both Obě Show Zobrazit Copy Width Point Kopírovat bod šířky Duplicate Artboard Duplikovat pracovní plochu + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kliknutím přidáte pracovní plochu na tuto stranu, Alt+kliknutím duplikujete tuto pracovní plochu i s kresbou + Click to add an artboard on this side Kliknutím přidáte pracovní plochu na tuto stranu Area / Path Type Text v oblasti / na cestě Decrease Font Size Zmenšit velikost písma Decrease Font Size by Five Steps Zmenšit velikost písma o pět kroků diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 48a863cbfd..0fa669fb5b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3875,6 +3875,8 @@ axis Both Begge Show Vis Copy Width Point Kopiér breddepunkt Duplicate Artboard Duplikér tegneflade + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Klik for at tilføje en kunstplade på denne side, Alt-klik for at duplikere kunstpladen med dens grafik + Click to add an artboard on this side Klik for at tilføje en kunstplade på denne side Area / Path Type Arealtekst / kurvetekst Decrease Font Size Formindsk skriftstørrelse Increase Font Size Forøg skriftstørrelse diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 8fe1734165..0032065a23 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -924,6 +924,8 @@ font-technology Variable Variabel Duplicate Duplizieren Duplicate and Offset 10 pt Duplizieren und um 10 pt versetzen Duplicate Artboard Zeichenfläche duplizieren + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Klicken fügt auf dieser Seite eine Zeichenfläche hinzu, Alt-Klick dupliziert diese Zeichenfläche mit ihrem Bildmaterial + Click to add an artboard on this side Klicken fügt auf dieser Seite eine Zeichenfläche hinzu Copy Artboard Zeichenfläche kopieren Cut Artboard Zeichenfläche ausschneiden Rename Artboards Zeichenflächen umbenennen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 921eecb266..bc8996b468 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -894,6 +894,8 @@ font-technology Variable Μεταβλητές Duplicate Δημιουργία αντιγράφου Duplicate and Offset 10 pt Δημιουργία αντιγράφου με μετατόπιση 10 pt Duplicate Artboard Δημιουργία αντιγράφου πίνακα σχεδίασης + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Κλικ για προσθήκη πίνακα σχεδίασης σε αυτή την πλευρά, Alt-κλικ για αντίγραφο αυτού του πίνακα σχεδίασης μαζί με τα γραφικά του + Click to add an artboard on this side Κλικ για προσθήκη πίνακα σχεδίασης σε αυτή την πλευρά Copy Artboard Αντιγραφή πίνακα σχεδίασης Cut Artboard Αποκοπή πίνακα σχεδίασης Rename Artboards Μετονομασία πινάκων σχεδίασης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f3d98e0518..e42ba30994 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -937,6 +937,8 @@ font-technology Variable Variables Duplicate Duplicar Duplicate and Offset 10 pt Duplicar y desplazar 10 pt Duplicate Artboard Duplicar mesa de trabajo + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Clic para añadir una mesa de trabajo en este lado, Alt+clic para duplicar esta mesa de trabajo con su ilustración + Click to add an artboard on this side Clic para añadir una mesa de trabajo en este lado Copy Artboard Copiar mesa de trabajo Cut Artboard Cortar mesa de trabajo Rename Artboards Cambiar nombre de mesas de trabajo diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 8631ff3e0e..053ccb773b 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4082,6 +4082,8 @@ axis Both Molemmat Show Näytä Copy Width Point Kopioi leveyspiste Duplicate Artboard Monista piirtoalusta + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Lisää piirtoalusta tälle puolelle napsauttamalla, monista piirtoalusta kuvituksineen Alt-napsautuksella + Click to add an artboard on this side Lisää piirtoalusta tälle puolelle napsauttamalla Area / Path Type Alue- / polkuteksti Decrease Font Size Pienennä fonttikokoa Decrease Font Size by Five Steps Pienennä fonttikokoa viisi askelta diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 61854baa63..4223ce954c 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -940,6 +940,8 @@ font-technology Variable Variables Duplicate Dupliquer Duplicate and Offset 10 pt Dupliquer et décaler de 10 pt Duplicate Artboard Dupliquer le plan de travail + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Cliquez pour ajouter un plan de travail de ce côté, Alt+clic pour dupliquer ce plan de travail avec son illustration + Click to add an artboard on this side Cliquez pour ajouter un plan de travail de ce côté Copy Artboard Copier le plan de travail Cut Artboard Couper le plan de travail Rename Artboards Renommer les plans de travail diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index c99e152ce9..9a3ede918e 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1523,6 +1523,8 @@ antiAlias Sharp शार्प Duplicate Anchors एंकर की प्रति बनाएँ Duplicate and Offset 10 pt डुप्लिकेट और ऑफ़सेट 10 pt Duplicate Artboard आर्टबोर्ड की प्रति बनाएँ + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art इस ओर आर्टबोर्ड जोड़ने के लिए क्लिक करें; इस आर्टबोर्ड की उसके आर्टवर्क सहित प्रति बनाने के लिए Alt-क्लिक करें + Click to add an artboard on this side इस ओर आर्टबोर्ड जोड़ने के लिए क्लिक करें Duplicate Artboards आर्टबोर्ड्स की प्रति बनाएँ Duplicate Brush डुप्लिकेट ब्रश Duplicate Character Style कैरेक्टर स्टाइल की प्रति बनाएँ diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 8dd19c2cd7..a0dfd6df4a 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1218,6 +1218,8 @@ font-technology Variable Változó Duplicate Kettőzés Duplicate and Offset 10 pt Kettőzés és eltolás 10 pt-tal Duplicate Artboard Rajztábla kettőzése + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kattintás: rajztábla hozzáadása ezen az oldalon, Alt+kattintás: a rajztábla kettőzése a grafikájával együtt + Click to add an artboard on this side Kattintás: rajztábla hozzáadása ezen az oldalon Duplicate Artboards Rajztáblák kettőzése Duplicate Brush Ecset kettőzése Duplicate Character Style Karakterstílus kettőzése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 80b567db6c..d69032f83d 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3875,6 +3875,8 @@ axis Both Keduanya Show Tampilkan Copy Width Point Salin titik lebar Duplicate Artboard Duplikatkan artboard + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Klik untuk menambahkan artboard di sisi ini, Alt+klik untuk menduplikatkan artboard ini beserta karya seninya + Click to add an artboard on this side Klik untuk menambahkan artboard di sisi ini Area / Path Type Teks area / teks jalur Decrease Font Size Perkecil ukuran font Increase Font Size Perbesar ukuran font diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index fee7dbd594..2e896134bc 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -945,6 +945,8 @@ font-technology Variable Variabili Duplicate Duplica Duplicate and Offset 10 pt Duplica e sposta di 10 pt Duplicate Artboard Duplica tavola da disegno + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Fai clic per aggiungere una tavola da disegno su questo lato, Alt+clic per duplicare questa tavola da disegno con la sua grafica + Click to add an artboard on this side Fai clic per aggiungere una tavola da disegno su questo lato Copy Artboard Copia tavola da disegno Cut Artboard Taglia tavola da disegno Rename Artboards Rinomina tavole da disegno diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 16d873ee32..4fc97ceda1 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1580,6 +1580,8 @@ antiAlias Sharp シャープ Drawing Mode 描画モード Duplicate 複製 Duplicate Artboard アートボードを複製 + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art クリックでこの辺にアートボードを追加、Alt+クリックでこのアートボードをアートワークごと複製 + Click to add an artboard on this side クリックでこの辺にアートボードを追加 Copy Artboard アートボードをコピー Cut Artboard アートボードをカット Rename Artboards アートボード名を変更 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 667f6ca4c4..281810197b 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3696,6 +3696,8 @@ axis Both ორივე Show ჩვენება Copy Width Point სიგანის წერტილის კოპირება Duplicate Artboard სამუშაო დაფის დუბლირება + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art დაწკაპეთ ამ მხარეს სამუშაო დაფის დასამატებლად; Alt-დაწკაპეთ ამ სამუშაო დაფის ნახატთან ერთად დასადუბლირებლად + Click to add an artboard on this side დაწკაპეთ ამ მხარეს სამუშაო დაფის დასამატებლად Area / Path Type არის / ტრაექტორიის ტექსტი Decrease Font Size შრიფტის შემცირება Increase Font Size შრიფტის გაზრდა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 926bfb6f3f..52510d7e3d 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1570,6 +1570,8 @@ antiAlias Sharp 날카롭게 Drawing Mode 그리기 모드 Duplicate 복제 Duplicate Artboard 아트보드 복제 + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art 클릭하여 이쪽에 아트보드 추가, Alt-클릭하여 이 아트보드를 아트워크와 함께 복제 + Click to add an artboard on this side 클릭하여 이쪽에 아트보드 추가 Copy Artboard 아트보드 복사 Cut Artboard 아트보드 잘라내기 Rename Artboards 아트보드 이름 바꾸기 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 9152ecb3ec..2bc397359d 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4391,6 +4391,8 @@ axis Both Beide Show Tonen Copy Width Point Breedtepunt kopiëren Duplicate Artboard Tekengebied dupliceren + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Klik om aan deze kant een tekenbord toe te voegen, Alt-klik om dit tekenbord met zijn illustratie te dupliceren + Click to add an artboard on this side Klik om aan deze kant een tekenbord toe te voegen Area / Path Type Gebieds- / padtekst Decrease Font Size Tekengrootte verkleinen Increase Font Size Tekengrootte vergroten diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index ae2f4908c6..25266cf49b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4000,6 +4000,8 @@ axis Both Obie Show Pokaż Copy Width Point Kopiuj punkt szerokości Duplicate Artboard Powiel obszar kompozycji + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kliknij, aby dodać obszar kompozycji po tej stronie, kliknij z Alt, aby powielić ten obszar kompozycji wraz z grafiką + Click to add an artboard on this side Kliknij, aby dodać obszar kompozycji po tej stronie Area / Path Type Tekst akapitowy / na ścieżce Decrease Font Size Zmniejsz rozmiar czcionki Decrease Font Size by Five Steps Zmniejsz rozmiar czcionki o pięć kroków diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 3a0a6879e9..098ab09256 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -840,6 +840,8 @@ antiAlias Sharp Nítido Duotone Gradients Gradientes Duotônicos Duplicate Duplicar Duplicate Artboard Duplicar Mesa de Trabalho + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Clique para adicionar uma prancheta deste lado, Alt-clique para duplicar esta prancheta com sua arte + Click to add an artboard on this side Clique para adicionar uma prancheta deste lado Copy Artboard Copiar Mesa de Trabalho Cut Artboard Recortar Mesa de Trabalho Rename Artboards Renomear Mesas de Trabalho diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 44c8b914b9..b1ef9e9032 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -935,6 +935,8 @@ font-technology Variable Вариативные Duplicate Дублировать Duplicate and Offset 10 pt Дублировать и сместить на 10 пт Duplicate Artboard Дублировать монтажную область + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Щёлкните, чтобы добавить монтажную область с этой стороны; щёлкните с Alt, чтобы дублировать эту монтажную область вместе с графикой + Click to add an artboard on this side Щёлкните, чтобы добавить монтажную область с этой стороны Copy Artboard Копировать монтажную область Cut Artboard Вырезать монтажную область Rename Artboards Переименовать монтажные области diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 27117a1a61..12a2a48886 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -924,6 +924,8 @@ font-technology Variable Variabla Duplicate Duplicera Duplicate and Offset 10 pt Duplicera och förskjut 10 pt Duplicate Artboard Duplicera rityta + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Klicka för att lägga till en rityta på den här sidan, Alt-klicka för att duplicera ritytan med dess grafik + Click to add an artboard on this side Klicka för att lägga till en rityta på den här sidan Copy Artboard Kopiera rityta Cut Artboard Klipp ut rityta Rename Artboards Byt namn på ritytor diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 43bfd50f1a..e08cd2efa5 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -332,6 +332,18 @@ fn marquee_selection_labels_are_in_complete_catalogs() { } } +/// The Artboard tool's add buttons take their tooltips from the tools crate, which the `tl!` scan +/// does not read, so each complete catalog is checked for them here. +#[test] +fn artboard_add_button_tooltips_are_in_complete_catalogs() { + use vectorcraft_tools::xform::{EDGE_BUTTON_TIP, EDGE_BUTTON_TIP_LOCKED}; + for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus || COMPLETE_MESSAGES.contains(&lang.code)) { + for label in [EDGE_BUTTON_TIP, EDGE_BUTTON_TIP_LOCKED] { + assert!(lang.catalog().plain(label).is_some_and(|t| !t.is_empty() && t != label), "{} is missing {label}", lang.code); + } + } +} + /// Preferences › Performance › Use Monitor Profile for Canvas and the note under it. #[test] fn monitor_profile_labels_are_in_complete_catalogs() { diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 7d98ecaa48..91654916fa 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -916,6 +916,8 @@ font-technology Variable Değişken Duplicate Çoğalt Duplicate and Offset 10 pt Çoğalt ve Ofset 10 pt Duplicate Artboard Çalışma Yüzeyini Çoğalt + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Bu tarafa çalışma yüzeyi eklemek için tıklayın, bu çalışma yüzeyini çizimiyle birlikte çoğaltmak için Alt tuşunu basılı tutarak tıklayın + Click to add an artboard on this side Bu tarafa çalışma yüzeyi eklemek için tıklayın Copy Artboard Çalışma Yüzeyini Kopyala Cut Artboard Çalışma Yüzeyini Kes Rename Artboards Çalışma Yüzeylerini Yeniden Adlandır diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 0ceca21bbf..29c293e811 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -939,6 +939,8 @@ font-technology Variable Варіативні Duplicate Дублювати Duplicate and Offset 10 pt Дублювати та змістити на 10 пунктів Duplicate Artboard Дублювати монтажну область + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Клацніть, щоб додати монтажну область із цього боку; клацніть з Alt, щоб дублювати цю монтажну область разом із графікою + Click to add an artboard on this side Клацніть, щоб додати монтажну область із цього боку Copy Artboard Копіювати монтажну область Cut Artboard Вирізати монтажну область Rename Artboards Перейменувати монтажні області diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 39312c9214..9073421051 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1109,6 +1109,8 @@ font-technology Variable Biến thiên Duplicate Nhân bản Duplicate and Offset 10 pt Nhân bản và dịch 10 pt Duplicate Artboard Nhân bản bảng vẽ + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Bấm để thêm bảng vẽ ở phía này, Alt-bấm để nhân bản bảng vẽ này cùng tác phẩm của nó + Click to add an artboard on this side Bấm để thêm bảng vẽ ở phía này Duplicate Artboards Nhân bản các bảng vẽ Duplicate Brush Nhân bản cọ Duplicate Character Style Nhân bản kiểu ký tự diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index f6924adb06..9bfb2ca934 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -879,6 +879,8 @@ antiAlias Sharp 锐利 Duplicate 复制 Duplicate and Offset 10 pt 复制并偏移 10 pt Duplicate Artboard 复制画板 + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art 单击在此侧添加画板,Alt+单击复制此画板及其图稿 + Click to add an artboard on this side 单击在此侧添加画板 Copy Artboard 拷贝画板 Cut Artboard 剪切画板 Rename Artboards 重命名画板 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 06b73d2a4b..dc5411bb3c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -907,6 +907,8 @@ font-technology Variable 可變 Duplicate 製作複本 Duplicate and Offset 10 pt 製作複本並位移 10 pt Duplicate Artboard 製作工作區域複本 + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art 按一下以在這一側新增工作區域,Alt 加按一下以製作此工作區域及其圖稿的複本 + Click to add an artboard on this side 按一下以在這一側新增工作區域 Copy Artboard 複製工作區域 Cut Artboard 剪下工作區域 Rename Artboards 重新命名工作區域 diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e7c1b28726..8451304b9f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -732,6 +732,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Escape in the distort tools:** Escape during a Puppet Warp pin drag or turn, a Perspective Grid tool handle or plane widget drag, a Perspective Selection move, resize or plane widget drag, or a Liquify stroke cancels it: the art goes back to how the press found it, no undo step is added, and the tool stays chosen. Puppet Warp also selects again the pins selected before the press, and Escape during a Liquify Alt-drag puts the brush size back. Regression tests: `escape_cancels_*` in `crates/tools/src/distort/puppet.rs`, `perspective.rs` and `liquify.rs`, and `escape_cancels_a_puppet_warp_perspective_or_liquify_drag` in `tests/distortkeys.rs`. - **Shift with the Artboard tool:** a Shift-click adds an artboard to the selection or takes it out when the button comes up. A Shift-drag inside an artboard draws a new artboard there, and a Shift-drag on the pasteboard is a marquee that toggles the artboards it touches, as the [default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) (a Shift-drag draws an artboard within an existing one) and [Using multiple artboards](https://web.archive.org/web/20210925094818/https://helpx.adobe.com/illustrator/using/using-multiple-artboards.html) (archived copy) describe. Shift no longer keeps an artboard move at 45° steps or a drawn artboard square. Escape during a marquee or while a new artboard is being drawn cancels it and keeps the Artboard tool. Pointer and key tests in `crates/tools/src/xform/artboard.rs` cover the four gestures and Escape. - **Artboard edge buttons:** with the Artboard tool and one artboard selected, a button with a plus shows just outside the middle of each edge where an artboard of the same size fits on that side; clicking it adds an empty artboard of that size there (`artboard.new {beside, side}`), and Alt-clicking duplicates the artboard with its art there (`artboard.duplicate {index, side}`), each in one undo step, with the new artboard active. An Alt-click on a locked artboard's button does nothing, as the tool doesn't copy a locked artboard. The 20 pt gap and the room rule (within the canvas, overlapping no other artboard) are VectorCraft's own. Pointer tests in `crates/tools/src/xform/artboard/tests.rs` and an engine test in `tests/panelcmds.rs` cover it. Public references: [Add artboards instantly](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/add-new-artboards.html) and [Duplicate artboards instantly](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/duplicate-artboards.html). +- **Artboard edge button tooltips:** resting the pointer on an edge button shows a tooltip, after the interface's usual tooltip delay, that says a click adds an artboard on that side and, on an unlocked artboard, that an Alt-click duplicates the artboard with its art. The tooltip covers the same disc a press takes. No tooltip shows during a drag or where a button is hidden for lack of room. The wording is VectorCraft's own. Tools can attach such hover text to any overlay region (`Overlay::HoverText`). Tests in `crates/tools/src/xform/artboard/tests.rs`, `crates/ui-egui/src/canvas/tests.rs` and `crates/ui-egui/src/i18n/tests.rs` cover it. - **Artboard deletion keys:** Delete/Backspace delete selected boards in one Undo step, retaining the original first board in the current order when all are selected, as in the public [Delete artboards guide](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/delete-artboards.html). The last board and active drags stay protected; neither key clears selected artwork. Headless shortcut regressions in `tests/distortkeys.rs` cover reordered boards, artwork, saved state and Undo/Redo. - **Locked artboards:** a click in the Artboards panel's lock column locks or unlocks an artboard in one undo step (`artboard.setProps {index, locked}`), and the native format saves the lock. The Artboard tool doesn't move, copy, resize or delete a locked artboard, Rearrange and Fit to Artwork Bounds leave it as it is, and its name isn't edited on the canvas. The art on it (each object whose bounds overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, `select.set`, `select.all` and the tools pass over it, and commands that act on the selection leave it; art drawn or pasted onto it stays selected and editable until the selection leaves it out. Tests in `crates/doc/src/lib.rs`, `tests/panelcmds.rs`, `xform/artboard.rs`, `panels/artboards.rs` and `canvas.rs` cover them. Public references: [Lock artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/lock-artboards.html) and [Managing Artboards in Illustrator](https://creativepro.com/managing-artboards-in-illustrator/). - **Linux RPM packaging:** 64-bit runtime capabilities replace Fedora-specific required package names (#1275); glibc 2.35, libm and libgcc_s are declared alongside dynamically loaded xkbcommon and Vulkan/EGL. Generated x86_64/aarch64 metadata and isolated synthetic-provider resolution checked; real-distro install/start-up QA remains pending. From 9fe0b9ecc956f99787a30f3d521404efa843e0e9 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Fri, 13 Nov 2026 14:28:58 -0800 Subject: [PATCH 019/247] i18n: Spanish translates 1,840 of the status and error messages the untranslated report lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Spanish catalog lacked a row for 1,842 of the status and error messages that the untranslated report finds in the sources, so the status bar showed those messages in English. - es.tsv gains 1,840 `@msg` rows: the errors of commands and their parameter checks, scripts, file import and export, effects and plug-ins. The translations are VectorCraft's own, written from the English meaning in the catalog's neutral Spanish and its existing feature names. Placeholders, backticked names, quoted values, bare true, false and null, and command ids stay as the English writes them. - Two messages have no row and are still shown in English: "unknown parameter `{within}{key}`; {why}" and "{name} must be {lo}–{hi}{unit} (got {v})". Each has two placeholders in a row, and the catalog does not load a row for such a message. The untranslated report still lists both for Spanish. - Menu strings, `tl!` literals, undo labels and swatch names are unchanged. - A test checks that Spanish shows rendered messages from the script engine, the parameter checks, the importers, the 3D effects and the trim add-on in Spanish with their values kept. - The Spanish row of docs/localization-parity.md gives the catalog's current message counts. Docs: docs/target-app-parity.md, docs/localization-parity.md. --- crates/ui-egui/src/i18n/es.tsv | 1840 ++++++++++++++++++++++++++++++ crates/ui-egui/src/i18n/tests.rs | 25 + docs/localization-parity.md | 2 +- docs/target-app-parity.md | 1 + 4 files changed, 1867 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f3d98e0518..d26258c501 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7395,3 +7395,1843 @@ breakText Glyphs Glifos Margin Margen Box Caja Swatch Muestra +@msg 'caller', 'callee' and 'arguments' cannot be used on strict mode functions 'caller', 'callee' y 'arguments' no se pueden usar en funciones en modo estricto +@msg Boolean.prototype.{name} was called on a value that is not a Boolean Se llamó a Boolean.prototype.{name} con un valor que no es un Boolean +@msg CMYK images whose samples couldn't be read in CMYK were imported in RGB Las imágenes CMYK cuyas muestras no se pudieron leer en CMYK se importaron en RGB +@msg Cannot write to the location of “{name}”; choose where to save it No se puede escribir en la ubicación de “{name}”; elige dónde guardarlo +@msg DCS files can only be placed linked: use File › Place with Link on Los archivos DCS solo se pueden colocar vinculados: usa Archivo › Colocar con Vincular activado +@msg Date.prototype method called on a value that is not a Date object Se llamó a un método de Date.prototype con un valor que no es un objeto Date +@msg Error.prototype.toString was called on a value that is not an object Se llamó a Error.prototype.toString con un valor que no es un objeto +@msg Function.prototype.toString was called on a value that is not a function Se llamó a Function.prototype.toString con un valor que no es una función +@msg Import SVG Filter reads SVG files, not SVGZ Importar filtro SVG lee archivos SVG, no SVGZ +@msg JSON.parse: {why} (at offset {at}) JSON.parse: {why} (en el desplazamiento {at}) +@msg JSON.stringify cannot write a structure that contains itself JSON.stringify no puede escribir una estructura que se contiene a sí misma +@msg Namespace.prototype.toString needs a Namespace Namespace.prototype.toString necesita un Namespace +@msg New Document profiles need the preferences folder, which this run doesn't have Los perfiles de Nuevo documento necesitan la carpeta de preferencias, que esta ejecución no tiene +@msg Number.prototype.{name} was called on a value that is not a number Se llamó a Number.prototype.{name} con un valor que no es un número +@msg Object.create's prototype must be an object or null El prototipo de Object.create debe ser un objeto o null +@msg Object.{function} was given a value that is not an object Object.{function} recibió un valor que no es un objeto +@msg QName.prototype.toString needs a QName QName.prototype.toString necesita un QName +@msg RegExp.prototype.{name} was called on a value that is not a RegExp object Se llamó a RegExp.prototype.{name} con un valor que no es un objeto RegExp +@msg Stencil Bridges: the selected art is too large or too detailed to bridge Puentes de plantilla: la ilustración seleccionada es demasiado grande o detallada para unirla con puentes +@msg String.prototype.toString was called on a value that is not a string Se llamó a String.prototype.toString con un valor que no es una cadena +@msg The {name} profile could not be read, so the new document has the default settings: {reason} No se pudo leer el perfil {name}, así que el nuevo documento tiene los ajustes predeterminados: {reason} +@msg Trap: more than {_1} pairs of objects lie close enough to trap, or too many objects share a horizontal range; trap fewer objects at a time Reventar: más de {_1} pares de objetos están lo bastante cerca para reventarse, o demasiados objetos comparten un intervalo horizontal; reventa menos objetos a la vez +@msg Weed Box and Lines: no weeding line fits outside the art, and the weed box is off Caja y líneas de pelado: ninguna línea de pelado cabe fuera de la ilustración y la caja de pelado está desactivada +@msg \\ at end of pattern \\ al final del patrón +@msg `alignOn` cannot be empty `alignOn` no puede estar vacío +@msg `alignOn` must be a string `alignOn` debe ser una cadena +@msg `align` must be a string `align` debe ser una cadena +@msg `answer` for this {kind} dialog must be one of: {_1} `answer` para este cuadro de diálogo {kind} debe ser uno de: {_1} +@msg `answers` has more than {MAX_ANSWERS} answers `answers` tiene más de {MAX_ANSWERS} respuestas +@msg `answers` is larger than 1 MiB `answers` ocupa más de 1 MiB +@msg `answers` must be a list of answers `answers` debe ser una lista de respuestas +@msg `artboard` must be the index of an artboard of the document `artboard` debe ser el índice de una mesa de trabajo del documento +@msg `artboardsAt` must be [x, y] `artboardsAt` debe ser [x, y] +@msg `artboards` names an artboard the document does not have `artboards` nombra una mesa de trabajo que el documento no tiene +@msg `artboards` names an artboard twice `artboards` nombra dos veces la misma mesa de trabajo +@msg `at` must be [x, y] (got {at}) `at` debe ser [x, y] (se recibió {at}) +@msg `beside` needs `side` `beside` necesita `side` +@msg `code` must be a whole number `code` debe ser un número entero +@msg `colorMode` must be one of rgb, cmyk `colorMode` debe ser uno de rgb, cmyk +@msg `colors` does not apply to the {name} reduction `colors` no se aplica a la reducción {name} +@msg `colors` must be a whole number from 2 to 256 `colors` debe ser un número entero entre 2 y 256 +@msg `colors` must be at least 9 for the uniform reduction `colors` debe ser al menos 9 para la reducción uniforme +@msg `colors` must be between 1 and {MAX_THEME_COLORS} (got {n}) `colors` debe estar entre 1 y {MAX_THEME_COLORS} (se recibió {n}) +@msg `count` must be a whole number from 0 to {MAX_COUNT} `count` debe ser un número entero entre 0 y {MAX_COUNT} +@msg `ditherAmount` must be a number from 0 to 100 `ditherAmount` debe ser un número entre 0 y 100 +@msg `fidelity` must be from {lo} to {hi} pt `fidelity` debe estar entre {lo} y {hi} pt +@msg `focal` and `radius` cannot be used together `focal` y `radius` no se pueden usar juntos +@msg `focal` must be an array of [subpath, anchor] pairs `focal` debe ser una lista de pares [subpath, anchor] +@msg `focal` names [{si}, {ai}], which is not an anchor of the path `focal` nombra [{si}, {ai}], que no es un punto de ancla del trazado +@msg `glyphAlternate` takes only null, which takes a glyph choice away (text.setGlyphAlternate makes one) `glyphAlternate` solo acepta null, que quita una elección de glifo (text.setGlyphAlternate crea una) +@msg `group` must be one of {_1} `group` debe ser uno de {_1} +@msg `group` must be the Objects on Path group of `member` and `target` `group` debe ser el grupo de Objetos en trazado de `member` y `target` +@msg `id` is an object id, not {v} `id` es un id de objeto, no {v} +@msg `item` needs `index` `item` necesita `index` +@msg `kerningBefore` belongs to a line's first character, not to a character style (text.setRangeStyle sets it) `kerningBefore` corresponde al primer carácter de una línea, no a un estilo de carácter (lo establece text.setRangeStyle) +@msg `kinsokuType` must be "pushInFirst", "pushOutFirst" or "pushOutOnly" `kinsokuType` debe ser "pushInFirst", "pushOutFirst" o "pushOutOnly" +@msg `leader` must be a string `leader` debe ser una cadena +@msg `max` must be 1 to {MAX_SUGGESTIONS} `max` debe estar entre 1 y {MAX_SUGGESTIONS} +@msg `name` must be a name that is not empty `name` debe ser un nombre que no esté vacío +@msg `name` must not be empty `name` no debe estar vacío +@msg `origin` must be [x, y] in points `origin` debe ser [x, y] en puntos +@msg `picks` must be an array (got {v}) `picks` debe ser una lista (se recibió {v}) +@msg `picks` must hold 1 to {MAX_PICKS} picks (got {_1}) `picks` debe contener entre 1 y {MAX_PICKS} elecciones (se recibió {_1}) +@msg `radius` must be 0 or more `radius` debe ser 0 o más +@msg `rect` must be [x0, y0, x1, y1] (got {r}) `rect` debe ser [x0, y0, x1, y1] (se recibió {r}) +@msg `replace` must be a string `replace` debe ser una cadena +@msg `rows` must be lists of numbers or nulls, not {r} `rows` deben ser listas de números o valores null, no {r} +@msg `scale` must be a number from 0.001 to 1000 `scale` debe ser un número entre 0.001 y 1000 +@msg `scope.{key}` must be a non-empty array `scope.{key}` debe ser una lista que no esté vacía +@msg `scope` must be "document", {artboards} or {layers} `scope` debe ser "document", {artboards} o {layers} +@msg `side` must be "left", "right", "top" or "bottom" `side` debe ser "left", "right", "top" o "bottom" +@msg `side` places the artboard: leave out x, y, width and height `side` coloca la mesa de trabajo: omite x, y, width y height +@msg `source` is the only path in series group `target` `source` es el único trazado del grupo de serie `target` +@msg `spacing` makes more than {MAX_COUNT} lines across the box `spacing` genera más de {MAX_COUNT} líneas a lo ancho de la caja +@msg `spacing` must be more than 0 and at most {MAX_DISTANCE} pt `spacing` debe ser mayor que 0 y como máximo {MAX_DISTANCE} pt +@msg `target` must be an object of the same Objects on Path group as `member` `target` debe ser un objeto del mismo grupo de Objetos en trazado que `member` +@msg `version` must be 0 or {_1} `version` debe ser 0 o {_1} +@msg `version` must be 0 or {newest} `version` debe ser 0 o {newest} +@msg `weight` must be from 0.01 to 1000 pt `weight` debe estar entre 0.01 y 1000 pt +@msg `weights` must be a list of {_1} numbers, one per row (got {v}) `weights` debe ser una lista de {_1} números, uno por fila (se recibió {v}) +@msg `xml` must be a string `xml` debe ser una cadena +@msg `{KEY}` entry {n} gives the paragraph at byte {start} of {_1} other indents than an entry before it la entrada {n} de `{KEY}` da al párrafo del byte {start} de {_1} otras sangrías que una entrada anterior +@msg `{KEY}` entry {n} must be an object la entrada {n} de `{KEY}` debe ser un objeto +@msg `{KEY}` entry {n} sets neither `leftIndent` nor `firstLineIndent` la entrada {n} de `{KEY}` no establece ni `leftIndent` ni `firstLineIndent` +@msg `{KEY}` entry {n}: `id` must be an object id entrada {n} de `{KEY}`: `id` debe ser un id de objeto +@msg `{KEY}` entry {n}: `start` must be a byte offset entrada {n} de `{KEY}`: `start` debe ser un desplazamiento en bytes +@msg `{KEY}` entry {n}: `{k}` must be a number from -{MAX_PARA} to {MAX_PARA} pt entrada {n} de `{KEY}`: `{k}` debe ser un número entre -{MAX_PARA} y {MAX_PARA} pt +@msg `{KEY}` entry {n}: no paragraph of {_1} starts at byte {start} entrada {n} de `{KEY}`: ningún párrafo de {_1} empieza en el byte {start} +@msg `{KEY}` entry {n}: unknown key `{k}` entrada {n} de `{KEY}`: clave desconocida `{k}` +@msg `{KEY}` entry {n}: {_1} is not a type object entrada {n} de `{KEY}`: {_1} no es un objeto de texto +@msg `{KEY}` is empty `{KEY}` está vacío +@msg `{KEY}` must be a list `{KEY}` debe ser una lista +@msg `{KEY}` takes at most {MAX_PARAGRAPH_INDENTS} entries (got {_1}) `{KEY}` acepta como máximo {MAX_PARAGRAPH_INDENTS} entradas (se recibió {_1}) +@msg `{KEY}` takes no `{other}` beside it `{KEY}` no acepta `{other}` junto a él +@msg `{_1}` can't name a composite font `{_1}` no puede nombrar una fuente compuesta +@msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada +@msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} está compuesto en `{font}`, una fuente compuesta +@msg `{base}` is larger than {_1} MB `{base}` ocupa más de {_1} MB +@msg `{base}` is not in the DCS file's folder `{base}` no está en la carpeta del archivo DCS +@msg `{key}` holds more than {MAX_EDIT_WORDS} words `{key}` contiene más de {MAX_EDIT_WORDS} palabras +@msg `{key}` must be 0 or more `{key}` debe ser 0 o más +@msg `{key}` must be [x, y] numbers `{key}` debe ser [x, y] con números +@msg `{key}` must be a list of words `{key}` debe ser una lista de palabras +@msg `{key}` must be a list, not {v} `{key}` debe ser una lista, no {v} +@msg `{key}` must be a number or null, not {v} `{key}` debe ser un número o null, no {v} +@msg `{key}` must be a whole number of 0 or more `{key}` debe ser un número entero de 0 o más +@msg `{key}` must be from 0 to {MAX_DISTANCE} pt `{key}` debe estar entre 0 y {MAX_DISTANCE} pt +@msg `{key}` must be from {lo} to {hi}, not {v} `{key}` debe estar entre {lo} y {hi}, no {v} +@msg `{key}` must be one of auto, always, never `{key}` debe ser uno de auto, always, never +@msg `{key}` must be one of miter, round, bevel `{key}` debe ser uno de miter, round, bevel +@msg `{key}` must be one word of at most {_1} characters `{key}` debe ser una sola palabra de como máximo {_1} caracteres +@msg `{key}` must hold single words of at most {_1} characters `{key}` debe contener palabras sueltas de como máximo {_1} caracteres +@msg `{key}` must name an object attached to the path of an Objects on Path group `{key}` debe nombrar un objeto unido al trazado de un grupo de Objetos en trazado +@msg `{key}` names an object that is hidden or locked `{key}` nombra un objeto que está oculto o bloqueado +@msg `{name}` is a file of its own, which can only be found next to the DCS file's path `{name}` es un archivo independiente, que solo se puede encontrar junto a la ruta del archivo DCS +@msg `{name}`: give the kanji part `{name}`: indica la parte kanji +@msg `{name}`: parts must be an object `{name}`: las partes deben ser un objeto +@msg `{name}`: unknown class `{k}`; the classes are kanji, kana, punctuation, symbols, roman and numerals `{name}`: clase desconocida `{k}`; las clases son kanji, kana, punctuation, symbols, roman y numerals +@msg `{name}`: unknown key `{k}` in {_1} `{name}`: clave desconocida `{k}` en {_1} +@msg `{name}`: {_1} must be an object `{name}`: {_1} debe ser un objeto +@msg `{name}`: {_1}: {e} `{name}`: {_1}: {e} +@msg `{raw}` can't name a composite font (1 to {COMPOSITE_NAME_MAX} characters, no control characters) `{raw}` no puede nombrar una fuente compuesta (de 1 a {COMPOSITE_NAME_MAX} caracteres, sin caracteres de control) +@msg `{u}` is no Unicode character `{u}` no es un carácter Unicode +@msg `{word}` isn't in the custom dictionary `{word}` no está en el diccionario personalizado +@msg a CMap has too many mappings un CMap tiene demasiadas asignaciones +@msg a \\u escape needs four hexadecimal digits un escape \\u necesita cuatro dígitos hexadecimales +@msg a comma in an XPath expression must separate function arguments una coma en una expresión XPath debe separar argumentos de función +@msg a document holds at most {_1} SVG filters un documento contiene como máximo {_1} filtros SVG +@msg a document keeps at most {COMPOSITE_FONTS_MAX} composite fonts un documento guarda como máximo {COMPOSITE_FONTS_MAX} fuentes compuestas +@msg a document with unsaved changes has no recovery copy un documento con cambios sin guardar no tiene copia de recuperación +@msg a font's data is too large los datos de una fuente son demasiado grandes +@msg a font's subroutines are too large las subrutinas de una fuente son demasiado grandes +@msg a function declaration without a name una declaración de función sin nombre +@msg a host value has too many entries un valor del host tiene demasiadas entradas +@msg a host value is nested too deep un valor del host está anidado a demasiada profundidad +@msg a namespace declaration uses a reserved prefix or URI una declaración de espacio de nombres usa un prefijo o URI reservado +@msg a namespace qualifier is undefined un calificador de espacio de nombres no está definido +@msg a namespace with an empty URI cannot have a prefix un espacio de nombres con un URI vacío no puede tener prefijo +@msg a number has no digits un número no tiene dígitos +@msg a number's exponent has no digits el exponente de un número no tiene dígitos +@msg a number's fraction has no digits la parte fraccionaria de un número no tiene dígitos +@msg a property descriptor cannot have both a value or writable and a get or set un descriptor de propiedad no puede tener a la vez value o writable y get o set +@msg a property descriptor must be an object un descriptor de propiedad debe ser un objeto +@msg a property's {name} must be a function or undefined el {name} de una propiedad debe ser una función o undefined +@msg a stream in it would decode to more than 256 MB, or its decode parameters can't be applied un flujo que contiene se descodificaría en más de 256 MB, o no se pueden aplicar sus parámetros de descodificación +@msg a string holds a control character una cadena contiene un carácter de control +@msg a string holds an escape sequence JSON does not have una cadena contiene una secuencia de escape que JSON no tiene +@msg a string is not closed una cadena no está cerrada +@msg an SVG filter is named by its id: give `xml` with `name` un filtro SVG se nombra por su id: indica `xml` con `name` +@msg an XML element has two attributes with the same name un elemento XML tiene dos atributos con el mismo nombre +@msg an XML value cannot be inserted into itself or its descendants un valor XML no se puede insertar en sí mismo ni en sus descendientes +@msg an XML value's children cannot be assigned by position los hijos de un valor XML no se pueden asignar por posición +@msg an XML value's children cannot be deleted by position los hijos de un valor XML no se pueden eliminar por posición +@msg an XMLList converts to XML only when it has one item un XMLList solo se convierte en XML cuando tiene un elemento +@msg an XPath node test is missing falta una prueba de nodo XPath +@msg an XPath operand is missing falta un operando XPath +@msg an XPath operator is missing falta un operador XPath +@msg an XPath predicate or step cannot follow here aquí no puede seguir un predicado ni un paso XPath +@msg an XPath predicate or step follows a value that is not a node-set un predicado o paso XPath sigue a un valor que no es un conjunto de nodos +@msg an XPath step is missing falta un paso XPath +@msg an image couldn't be decoded and is missing from the picture no se pudo descodificar una imagen y falta en la imagen resultante +@msg an image of {w} × {h} pixels is too large to convert (at most {_1} pixels) una imagen de {w} × {h} píxeles es demasiado grande para convertirla (como máximo {_1} píxeles) +@msg apply was called on a value that is not a function se llamó a apply con un valor que no es una función +@msg area type in a thread cannot use Dynamic Text: {frames} el texto de área en un enlace no puede usar Texto dinámico: {frames} +@msg array literal too long literal de matriz demasiado largo +@msg assignment to a constant binding asignación a un enlace constante +@msg at least one row that isn't excluded needs a weight above 0 al menos una fila que no esté excluida necesita un peso mayor que 0 +@msg blend must be a mode name blend debe ser el nombre de un modo +@msg both sides of an XPath | must select nodes ambos lados de un | de XPath deben seleccionar nodos +@msg canceled cancelado +@msg cannot convert the object to a primitive value no se puede convertir el objeto en un valor primitivo +@msg cannot convert undefined or null to an object no se puede convertir undefined o null en un objeto +@msg character dimensions cannot be represented with the source text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de origen +@msg character dimensions cannot be represented with the target text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de destino +@msg continuation must be an array of path chunks continuation debe ser una lista de fragmentos de trazado +@msg continuation requires points continuation requiere points +@msg dataBase64 is not base64 dataBase64 no está en base64 +@msg each font must be {name, parts} cada fuente debe ser {name, parts} +@msg each font needs a name cada fuente necesita un nombre +@msg each path chunk must contain 1 to 4096 points cada fragmento de trazado debe contener entre 1 y 4096 puntos +@msg each pick is {{at: [x, y]}} or {{rect: [x0, y0, x1, y1]}} (got {v}) cada elección es {{at: [x, y]}} o {{rect: [x0, y0, x1, y1]}} (se recibió {v}) +@msg each weight must be a number of 0 or more (got {v}) cada peso debe ser un número de 0 o más (se recibió {v}) +@msg finally table {t} out of range tabla finally {t} fuera de rango +@msg flags cannot be given with a RegExp object no se pueden indicar indicadores con un objeto RegExp +@msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas +@msg function declaration index out of range índice de declaración de función fuera de rango +@msg give `char`, `text`, `code` or `unicode` indica `char`, `text`, `code` o `unicode` +@msg give `count` or `spacing`, not both indica `count` o `spacing`, no ambos +@msg give `name`, an SVG filter's name indica `name`, el nombre de un filtro SVG +@msg give `path`, an SVG file, or `svg`, SVG text indica `path`, un archivo SVG, o `svg`, texto SVG +@msg give `xml`, one SVG <filter> element indica `xml`, un elemento SVG <filter> +@msg give exactly one of `path`, `data` and `dataBase64` indica exactamente uno de `path`, `data` y `dataBase64` +@msg give fonts: [{name, parts}…] indica fonts: [{name, parts}…] +@msg give index or indexes, not both indica index o indexes, no ambos +@msg give one <filter> element indica un elemento <filter> +@msg give one of path, data or dataBase64 indica uno de path, data o dataBase64 +@msg give opacity or blend indica opacity o blend +@msg handler at {_1} expects {_2} values but its range starts with {d} el controlador en {_1} espera {_2} valores, pero su rango empieza con {d} +@msg handler depth too large profundidad de controlador demasiado grande +@msg handler range {_1}..{_2} out of range rango de controlador {_1}..{_2} fuera de rango +@msg hiddenLayers must be true or false hiddenLayers debe ser true o false +@msg hvcC hvcC +@msg images in a spot ink whose samples couldn't be read were imported in RGB las imágenes en una tinta plana cuyas muestras no se pudieron leer se importaron en RGB +@msg images past the most pixels one file may hold were left out se omitieron las imágenes que superaban el máximo de píxeles que puede contener un archivo +@msg images too large to read were left out se omitieron las imágenes demasiado grandes para leerlas +@msg indexes may hold at most {MAX_GUIDE_INDEXES} entries indexes puede contener como máximo {MAX_GUIDE_INDEXES} entradas +@msg indexes must be an array of guide indexes indexes debe ser una lista de índices de guías +@msg instruction out of range instrucción fuera de rango +@msg instruction {pc} ({op}) pops below the stack la instrucción {pc} ({op}) extrae por debajo de la pila +@msg instruction {pc} reached with stack depths {seen} and {d} se llegó a la instrucción {pc} con profundidades de pila {seen} y {d} +@msg invalid array length longitud de matriz no válida +@msg invalid group grupo no válido +@msg invalid object id {v}: expected a non-negative integer id de objeto no válido {v}: se esperaba un entero no negativo +@msg invalid regular expression flag '{_1}' indicador de expresión regular no válido '{_1}' +@msg invalid regular expression: {m} expresión regular no válida: {m} +@msg invalid time value valor de tiempo no válido +@msg is a confirm's answer, whose `value` must be true or false es la respuesta de un confirm, cuyo `value` debe ser true o false +@msg is a prompt's answer, whose `value` must be a string or null es la respuesta de un prompt, cuyo `value` debe ser una cadena o null +@msg is an alert's answer, whose `value` must be "ok" es la respuesta de un alert, cuyo `value` debe ser "ok" +@msg is longer than 16 KiB ocupa más de 16 KiB +@msg it draws its image through a clipping path dibuja su imagen a través de un trazado de recorte +@msg it draws no image no dibuja ninguna imagen +@msg it is larger than {MAX_DICTIONARY_FILE_BYTES} bytes ocupa más de {MAX_DICTIONARY_FILE_BYTES} bytes +@msg it isn't a file no es un archivo +@msg it names {_1} plates, and at most {MAX_PLATES} are read nombra {_1} planchas, y se leen como máximo {MAX_PLATES} +@msg its art is too long or too detailed for a head su ilustración es demasiado larga o detallada para una cabeza +@msg its art paints nothing su ilustración no pinta nada +@msg its image is too large to read su imagen es demasiado grande para leerla +@msg its plates are too large: more than {MAX_SAMPLES} pixels together sus planchas son demasiado grandes: más de {MAX_SAMPLES} píxeles en total +@msg its plates are too large: {_1} plates of {w} × {h} pixels sus planchas son demasiado grandes: {_1} planchas de {w} × {h} píxeles +@msg its plates can't be kept together sus planchas no se pueden mantener juntas +@msg its shapes could not be combined into one sus formas no se pudieron combinar en una +@msg jump to {pc}, past the end salto a {pc}, más allá del final +@msg legacyNameEncoding must be one of {_1} legacyNameEncoding debe ser uno de {_1} +@msg localize: the first argument must be a localization object or a string localize: el primer argumento debe ser un objeto de localización o una cadena +@msg missing `picks` falta `picks` +@msg missing `word` falta `word` +@msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` +@msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt +@msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` +@msg names must be a list of names names debe ser una lista de nombres +@msg names must be strings names deben ser cadenas +@msg needs a closing quote after the name necesita unas comillas de cierre después del nombre +@msg needs a name necesita un nombre +@msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes +@msg needs a name of letters, digits and _, or a quoted name necesita un nombre de letras, dígitos y _, o un nombre entre comillas +@msg needs a name without control characters necesita un nombre sin caracteres de control +@msg nesting too deep anidamiento demasiado profundo +@msg no HP-GL format no tiene formato HP-GL +@msg no New Document profile called `{shown}` ({_1}) no hay ningún perfil de Nuevo documento llamado `{shown}` ({_1}) +@msg no SVG filter at index {k} no hay ningún filtro SVG en el índice {k} +@msg no arrowheads file here aquí no hay ningún archivo de puntas de flecha +@msg no character has code {code} ningún carácter tiene el código {code} +@msg no composite font no hay ninguna fuente compuesta +@msg no composite font named `{n}` no hay ninguna fuente compuesta llamada `{n}` +@msg no composite fonts to export no hay fuentes compuestas que exportar +@msg no custom arrowhead {name} (see stroke.arrowheads.list) no existe la punta de flecha personalizada {name} (consulta stroke.arrowheads.list) +@msg no file to open no hay ningún archivo que abrir +@msg no instructions sin instrucciones +@msg no layer to rename no hay ninguna capa que cambiar de nombre +@msg no random numbers ({e}) no hay números aleatorios ({e}) +@msg no selected or given object has a visible 3D effect ningún objeto seleccionado o indicado tiene un efecto 3D visible +@msg no such artboard {v} no existe la mesa de trabajo {v} +@msg no symbol named `{_1}` no hay ningún símbolo llamado `{_1}` +@msg node {_1} already has the text variable `{_2}` el nodo {_1} ya tiene la variable de texto `{_2}` +@msg not a DCS file no es un archivo DCS +@msg not a RegExp object no es un objeto RegExp +@msg not a composite fonts file: no compositeFonts list no es un archivo de fuentes compuestas: no hay lista compositeFonts +@msg not a composite fonts file: {e} no es un archivo de fuentes compuestas: {e} +@msg not a regular expression no es una expresión regular +@msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número +@msg nothing to repeat nada que repetir +@msg numbers out of order in {_1} quantifier números desordenados en el cuantificador {_1} +@msg object {_1} needs a 3D effect el objeto {_1} necesita un efecto 3D +@msg object {_1}: a hollow Extrude & Bevel has no caps: turn on Cap to map a graphic objeto {_1}: una Extrusión y biselado hueca no tiene extremos: activa Extremo para asignar un gráfico +@msg object {_1}: with a depth of 0 the object has one face: map its graphics onto the front objeto {_1}: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal +@msg object {_1}: {_2} objeto {_1}: {_2} +@msg object {_1}: {e} objeto {_1}: {e} +@msg object {_1}: {name} at index {index} has no lighting presets; set its lights with effect.setParams objeto {_1}: {name} en el índice {index} no tiene preajustes de iluminación; define sus luces con effect.setParams +@msg opacity must be a number opacity debe ser un número +@msg operand too large operando demasiado grande +@msg order is a whole number from 0 to {others}, not `{v}` order es un número entero entre 0 y {others}, no `{v}` +@msg path chunks must share their boundary point los fragmentos de trazado deben compartir su punto límite +@msg path is empty el trazado está vacío +@msg pdfCompatible: false needs the artboards to keep the editable artwork when useArtboards is false pdfCompatible: false necesita que las mesas de trabajo conserven la ilustración editable cuando useArtboards es false +@msg point x must be a number el punto x debe ser un número +@msg point y must be a number el punto y debe ser un número +@msg points must be [x,y] pairs points deben ser pares [x,y] +@msg points must be finite canvas points points deben ser puntos finitos del lienzo +@msg range out of order in character class rango desordenado en la clase de caracteres +@msg reduce of an empty array with no initial value reduce de una matriz vacía sin valor inicial +@msg regular expression flag '{_1}' given twice indicador de expresión regular '{_1}' indicado dos veces +@msg sampled text would exceed the canvas (coordinates out of range) el texto muestreado superaría el lienzo (coordenadas fuera de rango) +@msg select an SVG filter selecciona un filtro SVG +@msg select an object with a 3D effect selecciona un objeto con un efecto 3D +@msg select an object with a 3D effect, or give its id in ids selecciona un objeto con un efecto 3D o indica su id en ids +@msg select one layer, group or object to rename selecciona una capa, un grupo o un objeto para cambiarle el nombre +@msg select the art to weed selecciona la ilustración que quieres pelar +@msg select type on a path or area type selecciona texto en trazado o texto de área +@msg side is left or right, not `{v}` side es left o right, no `{v}` +@msg source text transform is collapsed or unrepresentable la transformación del texto de origen está colapsada o no se puede representar +@msg table must be true or false table debe ser true o false +@msg takes one name acepta un nombre +@msg target text transform is collapsed or unrepresentable la transformación del texto de destino está colapsada o no se puede representar +@msg that makes too many pieces (at most 100000) or dash steps: simplify the dash pattern or make the dashes longer eso genera demasiadas piezas (como máximo 100000) o pasos de guion: simplifica el patrón de guiones o alarga los guiones +@msg the Layers panel is not shown el panel Capas no se muestra +@msg the Layers panel's search, filter or Show Layers Only hides its row la búsqueda, el filtro o Mostrar solo capas del panel Capas ocultan su fila +@msg the Objects on Path group is hidden or locked el grupo de Objetos en trazado está oculto o bloqueado +@msg the SVG file is larger than {MAX_IMPORT_BYTES} bytes el archivo SVG ocupa más de {MAX_IMPORT_BYTES} bytes +@msg the XML operation needs an XML or XMLList value la operación XML necesita un valor XML o XMLList +@msg the XPath expression does not evaluate to a node-set la expresión XPath no se evalúa como un conjunto de nodos +@msg the XPath expression ends early la expresión XPath termina antes de tiempo +@msg the XPath expression has an unmatched ) la expresión XPath tiene un ) sin pareja +@msg the XPath expression has an unmatched ] la expresión XPath tiene un ] sin pareja +@msg the XPath expression has an unmatched closing bracket la expresión XPath tiene un corchete de cierre sin pareja +@msg the XPath expression selects a namespace node, which is not an XML value la expresión XPath selecciona un nodo de espacio de nombres, que no es un valor XML +@msg the XPath expression selects the root node, which is not an XML value la expresión XPath selecciona el nodo raíz, que no es un valor XML +@msg the XPath function {name} needs a node-set la función XPath {name} necesita un conjunto de nodos +@msg the XPath function {name} takes the wrong number of arguments la función XPath {name} recibe un número incorrecto de argumentos +@msg the XPath name functions need a node-set las funciones de nombre de XPath necesitan un conjunto de nodos +@msg the XPath prefix {shown} is not bound to a namespace el prefijo XPath {shown} no está vinculado a un espacio de nombres +@msg the XPath variable ${shown} is not bound la variable XPath ${shown} no está vinculada +@msg the argument list is not an object la lista de argumentos no es un objeto +@msg the artwork is too large for EPS: what follows 256 MB of PostScript was left out la ilustración es demasiado grande para EPS: se omitió lo que sigue a 256 MB de PostScript +@msg the bitmaps hold more pixels than one file may los mapas de bits contienen más píxeles de los que puede tener un archivo +@msg the code runs past its last instruction el código continúa más allá de su última instrucción +@msg the curve tolerance must be from 0.01 to 10 points la tolerancia de curva debe estar entre 0.01 y 10 puntos +@msg the custom dictionary couldn't be saved to {_1}: {e} no se pudo guardar el diccionario personalizado en {_1}: {e} +@msg the custom dictionary {_1} can't be read ({why}), so it is left as it is no se puede leer el diccionario personalizado {_1} ({why}), así que se deja como está +@msg the document already has an SVG filter named {name} el documento ya tiene un filtro SVG llamado {name} +@msg the document has another SVG filter named {name}: use svgFilter.apply, or svgFilter.define with `replace` to edit it el documento tiene otro filtro SVG llamado {name}: usa svgFilter.apply, o svgFilter.define con `replace` para editarlo +@msg the document has no SVG filter named {name} el documento no tiene ningún filtro SVG llamado {name} +@msg the document has no SVG filter named {r} el documento no tiene ningún filtro SVG llamado {r} +@msg the document has no color swatches el documento no tiene muestras de color +@msg the document's swatches hold {_1} colors; the document reduction takes at most 255 las muestras del documento contienen {_1} colores; la reducción del documento acepta como máximo 255 +@msg the file holds more than {COMPOSITE_FONTS_MAX} composite fonts el archivo contiene más de {COMPOSITE_FONTS_MAX} fuentes compuestas +@msg the file holds no composite fonts el archivo no contiene fuentes compuestas +@msg the file holds two composite fonts named `{_1}` el archivo contiene dos fuentes compuestas llamadas `{_1}` +@msg the file is larger than 4 MB el archivo ocupa más de 4 MB +@msg the file isn't valid SVG: {e} el archivo no es un SVG válido: {e} +@msg the file names no plate el archivo no nombra ninguna plancha +@msg the function's prototype is not an object el prototipo de la función no es un objeto +@msg the guide is hidden or locked la guía está oculta o bloqueada +@msg the library's file is outside the read roots el archivo de la biblioteca está fuera de las raíces de lectura +@msg the method needs an XML value el método necesita un valor XML +@msg the paint is not a freeform gradient (apply one with paint.editGradient {kind}) la pintura no es un degradado de forma libre (aplica uno con paint.editGradient {kind}) +@msg the parameters or body do not form one function los parámetros o el cuerpo no forman una sola función +@msg the pasted SVG filter {name} draws differently from the document's filter of that name, and no free name fits it el filtro SVG pegado {name} dibuja de forma distinta al filtro del documento con ese nombre, y no hay ningún nombre libre para él +@msg the pen table holds more than 255 pens la tabla de plumillas contiene más de 255 plumillas +@msg the plates can't be kept no se pueden conservar las planchas +@msg the position table does not match the instructions la tabla de posiciones no coincide con las instrucciones +@msg the prompt's text is longer than {MAX_PROMPT_BYTES} bytes el texto del prompt ocupa más de {MAX_PROMPT_BYTES} bytes +@msg the radix must be between 2 and 36 la base debe estar entre 2 y 36 +@msg the right side of 'in' is not an object el lado derecho de 'in' no es un objeto +@msg the right side of 'instanceof' is not a function el lado derecho de 'instanceof' no es una función +@msg the selected art is nested more than {MAX_DEPTH} levels deep la ilustración seleccionada está anidada a más de {MAX_DEPTH} niveles de profundidad +@msg the selected art is too large to measure la ilustración seleccionada es demasiado grande para medirla +@msg the selection has no outlines to weed around la selección no tiene contornos alrededor de los que pelar +@msg the value bind was called on is not a function el valor con el que se llamó a bind no es una función +@msg the value is not a constructor el valor no es un constructor +@msg the value is not a function el valor no es una función +@msg the value is not a valid XML name el valor no es un nombre XML válido +@msg the value is not an XML attribute name el valor no es un nombre de atributo XML +@msg the value is not an XML name el valor no es un nombre XML +@msg the weeding lines cross the art's outlines too many times to measure; use fewer lines las líneas de pelado cruzan los contornos de la ilustración demasiadas veces para medirlas; usa menos líneas +@msg the weeding lines pass too close to too many outline segments to measure; use fewer lines or a smaller gap las líneas de pelado pasan demasiado cerca de demasiados segmentos de contorno para medirlas; usa menos líneas o un hueco más pequeño +@msg the weeding lines would be more than {max_pieces} pieces las líneas de pelado tendrían más de {max_pieces} piezas +@msg the {_1} plate lies outside the file la plancha {_1} está fuera del archivo +@msg this is a binary DXF file, which can't be read: save it from the CAD app as an ASCII DXF and open that este es un archivo DXF binario, que no se puede leer: guárdalo desde la aplicación CAD como DXF ASCII y abre ese +@msg this warp's points can't be edited: use Reset with Mesh first los puntos de esta deformación no se pueden editar: usa antes Restablecer con malla +@msg toExponential() digits must be between 0 and 20 los dígitos de toExponential() deben estar entre 0 y 20 +@msg toFixed() digits must be between 0 and 20 los dígitos de toFixed() deben estar entre 0 y 20 +@msg toISOString is not a function toISOString no es una función +@msg toPrecision() argument must be between 1 and 21 el argumento de toPrecision() debe estar entre 1 y 21 +@msg toSource: a getter cannot be written as source toSource: un getter no se puede escribir como código fuente +@msg toSource: an array with properties besides its elements, a property that is not enumerable or another prototype cannot be written as source toSource: una matriz con propiedades además de sus elementos, una propiedad que no es enumerable u otro prototipo no se puede escribir como código fuente +@msg toSource: an object with a property that is not enumerable, or whose prototype is not Object.prototype, cannot be written as source toSource: un objeto con una propiedad que no es enumerable, o cuyo prototipo no es Object.prototype, no se puede escribir como código fuente +@msg toSource: the source is too long toSource: el código fuente es demasiado largo +@msg toSource: the value contains itself toSource: el valor se contiene a sí mismo +@msg toSource: the value has too many entries toSource: el valor tiene demasiadas entradas +@msg toSource: the value is nested too deep toSource: el valor está anidado a demasiada profundidad +@msg toString is not a function toString no es una función +@msg too many arguments demasiados argumentos +@msg too many quantifiers demasiados cuantificadores +@msg two composite fonts are named `{_1}` dos fuentes compuestas se llaman `{_1}` +@msg unknown OpenType feature `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; prefix - to turn off; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom and aalt take an alternate's number as `tag=N` with N from 0 to {_1}, as `salt=2`) función OpenType desconocida `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; antepón - para desactivarla; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom y aalt aceptan el número de una alternativa como `tag=N` con N entre 0 y {_1}, como `salt=2`) +@msg unknown dither `{d}` (diffusion, pattern, noise or none) tramado desconocido `{d}` (diffusion, pattern, noise o none) +@msg unknown key `{k}`; a font takes name and parts clave desconocida `{k}`; una fuente acepta name y parts +@msg unknown panel `{panel}` panel desconocido `{panel}` +@msg unknown parameter `{key}` parámetro desconocido `{key}` +@msg unknown parameter `{within}settings.{format}`; {why} parámetro desconocido `{within}settings.{format}`; {why} +@msg unknown reduction `{reduction}` (selective, perceptual, adaptive, web, gray, blackWhite, uniform or document) reducción desconocida `{reduction}` (selective, perceptual, adaptive, web, gray, blackWhite, uniform o document) +@msg unmatched ')' ')' sin pareja +@msg unterminated character class clase de caracteres sin terminar +@msg unterminated group grupo sin terminar +@msg wordGap and lineGap need area type in the selection wordGap y lineGap necesitan texto de área en la selección +@msg xpath needs its variables as an object xpath necesita sus variables como un objeto +@msg xpath needs the expression as a string xpath necesita la expresión como una cadena +@msg {GRANT_NOT_REMOVED}, and its settings and cache can't be moved back from {_1} to {_2}: {e} {GRANT_NOT_REMOVED}, y sus ajustes y su caché no se pueden devolver de {_1} a {_2}: {e} +@msg {_1} is not a folder: {e} {_1} no es una carpeta: {e} +@msg {_1}: {_2} and {_3} are in the way {_1}: {_2} y {_3} estorban +@msg {code}: {0} {code}: {0} +@msg {dir}: {e} {dir}: {e} +@msg {file} names more than one linked JavaScript file {file} nombra más de un archivo JavaScript vinculado +@msg {k}: a custom arrowhead's path needs an area to fill and at most {most} anchors and {most} subpaths, each anchor within {far} head units of its tip {k}: el trazado de una punta de flecha personalizada necesita un área que rellenar y como máximo {most} puntos de ancla y {most} subtrazados, cada punto de ancla a no más de {far} unidades de cabeza de su punta +@msg {k}: bad custom arrowhead path: {e} {k}: trazado de punta de flecha personalizada incorrecto: {e} +@msg {k}: bad custom arrowhead: {e} {k}: punta de flecha personalizada incorrecta: {e} +@msg {k}: baseline must be {_1} to {_2}% {k}: baseline debe estar entre {_1} y {_2}% +@msg {k}: custom must be a name {k}: custom debe ser un nombre +@msg {k}: give a font {k}: indica una fuente +@msg {k}: only kana can be scaled at the center {k}: solo el kana se puede escalar desde el centro +@msg {k}: only kana, roman and numerals can be scaled {k}: solo se pueden escalar kana, roman y numerals +@msg {k}: scale must be {_1} to {_2}% {k}: scale debe estar entre {_1} y {_2}% +@msg {k}: size must be {_1} to {_2}% {k}: size debe estar entre {_1} y {_2}% +@msg {path}: copy takes a DCS file only when its plates are inside it; relink to it where its plate files are {path}: copy solo acepta un archivo DCS cuando sus planchas están dentro de él; vuelve a vincularlo donde estén sus archivos de planchas +@msg {path}: larger than {_1} MB {path}: ocupa más de {_1} MB +@msg {shown} is not an XPath 1.0 function {shown} no es una función de XPath 1.0 +@msg {v} names no layer or sublayer {v} no nombra ninguna capa ni subcapa +@msg {what} is not a function {what} no es una función +@msg {what} would print more than {MAX_COPIES_PER_SHEET} copies on a sheet: scale it up {what} imprimiría más de {MAX_COPIES_PER_SHEET} copias en una hoja: amplíalo +@msg {what} {i} out of range {what} {i} fuera de rango +@msg A profile supports one Revolve effect. Edit the existing effect's options instead. Un perfil admite un solo efecto Revolución. Edita en su lugar las opciones del efecto existente. +@msg Add Points at Crossings: a path went missing Agregar puntos en los cruces: falta un trazado +@msg CSS options: {e} Opciones de CSS: {e} +@msg CSV has a header but no data rows El CSV tiene encabezado pero ninguna fila de datos +@msg CSV holds NUL bytes: save it as UTF-8, or as UTF-16 with a byte-order mark El CSV contiene bytes NUL: guárdalo como UTF-8, o como UTF-16 con marca de orden de bytes +@msg CSV is empty El CSV está vacío +@msg CSV is larger than {MAX_CSV_BYTES} bytes El CSV ocupa más de {MAX_CSV_BYTES} bytes +@msg CSV is not UTF-16 El CSV no está en UTF-16 +@msg CSV is not UTF-8 El CSV no está en UTF-8 +@msg CSV would be larger than {MAX_CSV_BYTES} bytes El CSV ocuparía más de {MAX_CSV_BYTES} bytes +@msg Choose original artwork, not a dimension's generated paths Elige la ilustración original, no los trazados generados de una cota +@msg Contour: select paths or shapes Contorno: selecciona trazados o formas +@msg Contour: the Offset Path effect is not available Contorno: el efecto Desplazar trazado no está disponible +@msg Create needs fills, strokes or both Crear necesita rellenos, trazos o ambos +@msg DXF options: {e} Opciones de DXF: {e} +@msg DXF scale must be a positive number up to {_1}, not {scale} La escala de DXF debe ser un número positivo de hasta {_1}, no {scale} +@msg DXF {field} `{s}`: {allowed} DXF {field} `{s}`: {allowed} +@msg Dimension is locked or hidden La cota está bloqueada u oculta +@msg Dimension mode does not match its source El modo de la cota no coincide con su origen +@msg Draw Inside needs exactly one selected path, compound path or text Dibujar dentro necesita exactamente un trazado, trazado compuesto o texto seleccionado +@msg EPS Save writes all artwork: use document.export for selected-only EPS Guardar EPS escribe toda la ilustración: usa document.export para un EPS solo con lo seleccionado +@msg EPS flattener: {e} Acoplador de EPS: {e} +@msg EPS options: {e} Opciones de EPS: {e} +@msg EPS {field} `{s}`: {allowed} EPS {field} `{s}`: {allowed} +@msg Export for Screens writes png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai or vectorcraft Exportar para pantallas escribe png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai o vectorcraft +@msg Flare click coordinates must be finite numbers Las coordenadas del clic de destello deben ser números finitos +@msg HTML Text applies to object slices of type only Texto HTML solo se aplica a sectores de objeto de texto +@msg Identify Objects By is XML ID: the name must be a valid XML ID (start with a letter, underscore or colon; no spaces) Identificar objetos por está en ID de XML: el nombre debe ser un ID de XML válido (empieza con una letra, un guion bajo o dos puntos; sin espacios) +@msg Image Trace failed: internal error: its thread stopped (please report this bug) Error de Calco de imagen: error interno: su hilo se detuvo (informa de este error) +@msg Image Trace failed: {e} Error de Calco de imagen: {e} +@msg Image Trace finished, but its document was closed Calco de imagen terminó, pero su documento se cerró +@msg Image Trace finished, but the image or its settings changed meanwhile: trace it again Calco de imagen terminó, pero la imagen o sus ajustes cambiaron mientras tanto: cálcala de nuevo +@msg Invalid dimension offset Desplazamiento de cota no válido +@msg Invalid point Punto no válido +@msg Join: a subpath went missing Unir: falta un subtrazado +@msg Lock Workspace is not available in VectorCraft Bloquear espacio de trabajo no está disponible en VectorCraft +@msg Move Panel to New Window is not available: floating panels stay in the main window Mover panel a una ventana nueva no está disponible: los paneles flotantes permanecen en la ventana principal +@msg Offset Path: the path is too complex to offset Desplazar trazado: el trazado es demasiado complejo para desplazarlo +@msg Offset Path: {e} Desplazar trazado: {e} +@msg PDF content is incomplete or exceeds the reader's limits; no document was imported El contenido del PDF está incompleto o supera los límites del lector; no se importó ningún documento +@msg PDF flattener: {e} Acoplador de PDF: {e} +@msg PDF options: {e} Opciones de PDF: {e} +@msg Recolor Artwork is no longer open Volver a colorear ilustración ya no está abierto +@msg SVG is not UTF-8, UTF-16 or ISO 8859-1 El SVG no está en UTF-8, UTF-16 ni ISO 8859-1 +@msg Save writes one artboard: name one, or export several with document.export Guardar escribe una sola mesa de trabajo: nombra una o exporta varias con document.export +@msg Select a dimension first Selecciona primero una cota +@msg Select dimensions to update Selecciona las cotas que quieres actualizar +@msg Select only dimensions Selecciona solo cotas +@msg Select two or more objects, or a group Selecciona dos o más objetos, o un grupo +@msg Shaper needs 1–64 source paths Shaper necesita de 1 a 64 trazados de origen +@msg Switch x/y is for scatter graphs Cambiar x/y es para gráficos de dispersión +@msg Text options: {e} Opciones de texto: {e} +@msg `align` is start, center or end `align` es start, center o end +@msg `anchors` must be an array of [subpath, anchor] pairs `anchors` debe ser una lista de pares [subpath, anchor] +@msg `anchors` must list anchor indices (0, 1, 2…), not {k} `anchors` debe enumerar índices de puntos de ancla (0, 1, 2…), no {k} +@msg `anchors` must list anchor indices (0, 1, 2…), not {v} `anchors` debe enumerar índices de puntos de ancla (0, 1, 2…), no {v} +@msg `artboards` must be a list of artboard indices `artboards` debe ser una lista de índices de mesas de trabajo +@msg `asset` is the asset id (see assets.list) `asset` es el id del recurso (consulta assets.list) +@msg `at` must be a byte offset `at` debe ser un desplazamiento en bytes +@msg `autoLeading` must be a number `autoLeading` debe ser un número +@msg `background` must be "", "matte" or #rrggbb `background` debe ser "", "matte" o #rrggbb +@msg `burasagari` must be "none", "standard" or "forced" `burasagari` debe ser "none", "standard" o "forced" +@msg `center` must be [x, y] `center` debe ser [x, y] +@msg `charAlign` must be "romanBaseline", "emBoxTop", "emBoxCenter", "emBoxBottom", "icfTop" or "icfBottom" `charAlign` debe ser "romanBaseline", "emBoxTop", "emBoxCenter", "emBoxBottom", "icfTop" o "icfBottom" +@msg `charDirection` must be "default", "leftToRight" or "rightToLeft" `charDirection` debe ser "default", "leftToRight" o "rightToLeft" +@msg `clearStroke` requires `stroke: false`, `ids: []` and no `stop` `clearStroke` requiere `stroke: false`, `ids: []` y ningún `stop` +@msg `clear` must be a list of type object ids, not {v} `clear` debe ser una lista de ids de objetos de texto, no {v} +@msg `clear` must list type objects; {_1} is not one `clear` debe enumerar objetos de texto; {_1} no lo es +@msg `clear` must not list `id` `clear` no debe enumerar `id` +@msg `color` needs a `rule` to make the theme from `color` necesita una `rule` a partir de la que crear el tema +@msg `colors` is empty `colors` está vacío +@msg `columnType` is vertical, uniform, repeating or sliding `columnType` es vertical, uniform, repeating o sliding +@msg `columns` must be a whole number 1..50 `columns` debe ser un número entero 1..50 +@msg `commands` must not be empty `commands` no debe estar vacío +@msg `contents` goes with `to` `contents` va con `to` +@msg `corners` must be sharp, round or square, not `{other}` `corners` debe ser sharp, round o square, no `{other}` +@msg `corners` must list anchor indices (0, 1, 2…), not {v} `corners` debe enumerar índices de puntos de ancla (0, 1, 2…), no {v} +@msg `count` must be a whole number from 1 to 100 `count` debe ser un número entero entre 1 y 100 +@msg `dataBase64` is larger than the module limit `dataBase64` supera el límite de módulos +@msg `dataBase64` is not valid base64 `dataBase64` no es base64 válido +@msg `defaultsOnly` cannot be combined with `ids`, `reverse` or `append` `defaultsOnly` no se puede combinar con `ids`, `reverse` ni `append` +@msg `depth` and `childLimit` slice the summary: pass `summary: true` `depth` y `childLimit` recortan el resumen: pasa `summary: true` +@msg `design` is a design name, or null for plain columns `design` es el nombre de un diseño, o null para columnas simples +@msg `design` is a design name, or null for the default marker `design` es el nombre de un diseño, o null para el marcador predeterminado +@msg `destinationFolder` is required when destination is `folder` `destinationFolder` es obligatorio cuando el destino es `folder` +@msg `destination` must be `none`, `saveAndClose` or `folder` `destination` debe ser `none`, `saveAndClose` o `folder` +@msg `diameter` must be from 0.1 to 2500 pt `diameter` debe estar entre 0.1 y 2500 pt +@msg `digits` must be one of {_1} `digits` debe ser uno de {_1} +@msg `dimImages` is a percentage or false `dimImages` es un porcentaje o false +@msg `direction` must be "auto", "leftToRight" or "rightToLeft" `direction` debe ser "auto", "leftToRight" o "rightToLeft" +@msg `each` is the value one design stands for, more than 0 `each` es el valor que representa un diseño, mayor que 0 +@msg `end` must be "start" or "end" `end` debe ser "start" o "end" +@msg `ends` applies to joining exactly two paths `ends` se aplica al unir exactamente dos trazados +@msg `event` must be one of {_1} `event` debe ser uno de {_1} +@msg `every` must be "all", "odd" or "even", not {v} `every` debe ser "all", "odd" o "even", no {v} +@msg `expand` must be true or false `expand` debe ser true o false +@msg `files` must be 1 to 1000 paths of font files the last text.findFontFiles search found `files` debe ser de 1 a 1000 rutas de archivos de fuentes que encontró la última búsqueda de text.findFontFiles +@msg `folder` must be an absolute folder path `folder` debe ser una ruta de carpeta absoluta +@msg `fontAxes` must be an object of axis tags and values, such as {"wght"} `fontAxes` debe ser un objeto de etiquetas de eje y valores, como {"wght"} +@msg `format` must be a string `format` debe ser una cadena +@msg `format` must be one of {_1} `format` debe ser uno de {_1} +@msg `fractions` is chop or scale `fractions` es chop o scale +@msg `from` and `to` must differ `from` y `to` deben ser distintos +@msg `from` has an empty frame `from` tiene un marco vacío +@msg `from` must be a non-negative integer `from` debe ser un entero no negativo +@msg `from` must be area type or type on a path `from` debe ser texto de área o texto en trazado +@msg `gid` must be a glyph id, not {v} `gid` debe ser un id de glifo, no {v} +@msg `glyphAlternate` belongs to one character, not to a character style (text.setGlyphAlternate sets it) `glyphAlternate` corresponde a un solo carácter, no a un estilo de carácter (lo establece text.setGlyphAlternate) +@msg `guide` must be a guide index (guide.list) `guide` debe ser un índice de guía (guide.list) +@msg `hAlign` must be default, left, center or right `hAlign` debe ser default, left, center o right +@msg `id` must be a node id `id` debe ser un id de nodo +@msg `id` must be an object id, not {v} `id` debe ser un id de objeto, no {v} +@msg `ids` must name Objects on Path groups or objects in them `ids` debe nombrar grupos de Objetos en trazado u objetos que contengan +@msg `ids` takes at most {MAX_INSPECT_IDS} ids `ids` acepta como máximo {MAX_INSPECT_IDS} ids +@msg `imageMap` must be none, rectangle or polygon `imageMap` debe ser none, rectangle o polygon +@msg `includeArtboardFill` must be true or false `includeArtboardFill` debe ser true o false +@msg `includeSubdirs` must be true or false `includeSubdirs` debe ser true o false +@msg `index` must be a point index `index` debe ser un índice de punto +@msg `index` must be a whole number or null `index` debe ser un número entero o null +@msg `indices` must be a non-empty array of item indices `indices` debe ser una lista no vacía de índices de elementos +@msg `items` is a list of {kind, item} `items` es una lista de {kind, item} +@msg `items` is empty `items` está vacío +@msg `items` must be a list of {id, points} `items` debe ser una lista de {id, points} +@msg `items` must be a list of {{id, anchors?}}, not {v} `items` debe ser una lista de {{id, anchors?}}, no {v} +@msg `items` must be an array of {id, anchors} `items` debe ser una lista de {id, anchors} +@msg `items` must be an array of {{id, corners?}}, not {v} `items` debe ser una lista de {{id, corners?}}, no {v} +@msg `kashida` must be "none", "short", "medium", "long" or "stylistic" `kashida` debe ser "none", "short", "medium", "long" o "stylistic" +@msg `kind` is one of {_1} `kind` es uno de {_1} +@msg `kind` must be "round", "invertedRound" or "chamfer", not {v} `kind` debe ser "round", "invertedRound" o "chamfer", no {v} +@msg `kind` must be `text`, `visibility`, `image` or `graph` `kind` debe ser `text`, `visibility`, `image` o `graph` +@msg `kind` must be a string `kind` debe ser una cadena +@msg `kind` must be image, noImage or htmlText `kind` debe ser image, noImage o htmlText +@msg `kinsoku` must be "none", "hard" or "soft" `kinsoku` debe ser "none", "hard" o "soft" +@msg `label` must be a non-empty name of at most 200 characters `label` debe ser un nombre no vacío de como máximo 200 caracteres +@msg `language` must be a language name or tag, such as "Turkish" or "tr" `language` debe ser un nombre o una etiqueta de idioma, como "Turkish" o "tr" +@msg `leadingModel` must be "romanBaseline" or "emBoxTop" `leadingModel` debe ser "romanBaseline" o "emBoxTop" +@msg `leading` must be from 0.1 to 5000, or null for Auto `leading` debe estar entre 0.1 y 5000, o null para Automático +@msg `length` must be a number of at most 1000000 pt either way `length` debe ser un número de como máximo 1000000 pt en cualquier sentido +@msg `line` must be true or false `line` debe ser true o false +@msg `minAngle` ({min_angle}°) can't be more than `maxAngle` ({max_angle}°) `minAngle` ({min_angle}°) no puede ser mayor que `maxAngle` ({max_angle}°) +@msg `mode` must be "handles", "straight" or "smooth" `mode` debe ser "handles", "straight" o "smooth" +@msg `mode` must be "straight", "bezier" or "arc" `mode` debe ser "straight", "bezier" o "arc" +@msg `mode` must be one of {_1} `mode` debe ser uno de {_1} +@msg `mojikumi` must be "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" or "lineEndHalf" `mojikumi` debe ser "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" o "lineEndHalf" +@msg `names` is a list of preset names `names` es una lista de nombres de preajustes +@msg `names` lists preset names `names` enumera nombres de preajustes +@msg `names` must be a list of names `names` debe ser una lista de nombres +@msg `names` must be a list of swatch names `names` debe ser una lista de nombres de muestras +@msg `names` must be an array of style names `names` debe ser una lista de nombres de estilos +@msg `new` is a design name, or true `new` es el nombre de un diseño, o true +@msg `path` must be a folder `path` debe ser una carpeta +@msg `path` must be a path object `path` debe ser un objeto de trazado +@msg `pivot` must be a whole number from 0 to 8 `pivot` debe ser un número entero entre 0 y 8 +@msg `points` must be a list of [x, y] points `points` debe ser una lista de puntos [x, y] +@msg `points` must be a list of point indexes `points` debe ser una lista de índices de puntos +@msg `points` must be an array of point indices `points` debe ser una lista de índices de puntos +@msg `points` must be point indexes `points` deben ser índices de puntos +@msg `port` must be "in" or "out" `port` debe ser "in" u "out" +@msg `position` is above or below `position` es above o below +@msg `preset` must be a string `preset` debe ser una cadena +@msg `ratio` must be from 0.1 to 0.5 `ratio` debe estar entre 0.1 y 0.5 +@msg `rect` must be [x, y, width, height] with a positive size `rect` debe ser [x, y, width, height] con un tamaño positivo +@msg `relation` must be overlap, inside or outside `relation` debe ser overlap, inside u outside +@msg `reversed` must be true or false `reversed` debe ser true o false +@msg `rotate` must be a finite number `rotate` debe ser un número finito +@msg `rule` must be nonZero or evenOdd `rule` debe ser nonZero o evenOdd +@msg `scale` must be a number in (0, 100] `scale` debe ser un número en (0, 100] +@msg `scope` must be "selection" or "document", not {other} `scope` debe ser "selection" o "document", no {other} +@msg `script` must be a string `script` debe ser una cadena +@msg `seriesIndexes` is a non-empty list of series indexes `seriesIndexes` es una lista no vacía de índices de series +@msg `seriesIndexes` needs a `type` or a `valueAxis` `seriesIndexes` necesita un `type` o un `valueAxis` +@msg `shift` must be a number of points `shift` debe ser un número de puntos +@msg `showCenter` must be true or false `showCenter` debe ser true o false +@msg `singleWordJustification` must be "fullJustify", "alignLeft", "alignCenter" or "alignRight" `singleWordJustification` debe ser "fullJustify", "alignLeft", "alignCenter" o "alignRight" +@msg `size` is a percentage of the base text's size, 1 to 100 `size` es un porcentaje del tamaño del texto base, de 1 a 100 +@msg `source` and `target` are the same object `source` y `target` son el mismo objeto +@msg `source` must be `folder` or `datasets` `source` debe ser `folder` o `datasets` +@msg `spacing` must be a number `spacing` debe ser un número +@msg `spacing` must be a number of points, 0 or more, or "auto" `spacing` debe ser un número de puntos, 0 o más, o "auto" +@msg `start` must be a finite number `start` debe ser un número finito +@msg `starts` must be an array of anchor indices (or nulls) `starts` debe ser una lista de índices de puntos de ancla (o valores null) +@msg `status` must be linked, embedded, missing or modified, or a list of them `status` debe ser linked, embedded, missing o modified, o una lista de ellos +@msg `stop` must be a stop index `stop` debe ser un índice de parada +@msg `story` styles the whole story: give no `start` or `end` `story` aplica estilo a todo el artículo: no indiques `start` ni `end` +@msg `story` takes the whole story: give no `start` or `end` `story` abarca todo el artículo: no indiques `start` ni `end` +@msg `strokeMode` applies to strokes (stroke: true) `strokeMode` se aplica a los trazos (stroke: true) +@msg `style` must be roman or japanese `style` debe ser roman o japanese +@msg `subpaths` must be two integer indices `subpaths` deben ser dos índices enteros +@msg `symbol` must be a symbol name `symbol` debe ser el nombre de un símbolo +@msg `target` must be "object" or "contents", not {v} `target` debe ser "object" o "contents", no {v} +@msg `tint` applies to global and spot colours `tint` se aplica a colores globales y tintas planas +@msg `tint` goes with a global or spot `swatch` `tint` va con un `swatch` global o de tinta plana +@msg `tint` must be a number (%) `tint` debe ser un número (%) +@msg `tint` needs a global or spot colour `tint` necesita un color global o una tinta plana +@msg `to` is already threaded `to` ya está enlazado +@msg `to` is the design's new name `to` es el nuevo nombre del diseño +@msg `to` must be [x, y] `to` debe ser [x, y] +@msg `to` must be a closed path, area type or type on a path other than `from` `to` debe ser un trazado cerrado, texto de área o texto en trazado distinto de `from` +@msg `to` must be a whole number `to` debe ser un número entero +@msg `to` takes the rows of one object's stack, not aligned rows `to` acepta las filas de la pila de un objeto, no filas alineadas +@msg `useLab` must be true or false `useLab` debe ser true o false +@msg `vAlign` must be default, top, middle, baseline or bottom `vAlign` debe ser default, top, middle, baseline o bottom +@msg `values` must be a list `values` debe ser una lista +@msg `values` must be an object `values` debe ser un objeto +@msg `values` must name hex, rgb, cmyk, lab or gray `values` debe nombrar hex, rgb, cmyk, lab o gray +@msg `values` names a kind twice `values` nombra dos veces el mismo tipo +@msg `{_1}` can't be edited or removed `{_1}` no se puede editar ni eliminar +@msg `{_1}` is built in and always listed `{_1}` está integrado y siempre aparece en la lista +@msg `{_1}` is not a font file the last text.findFontFiles search found `{_1}` no es un archivo de fuente que haya encontrado la última búsqueda de text.findFontFiles +@msg `{_1}` would be overwritten by the package: choose a different folder or name el paquete sobrescribiría `{_1}`: elige otra carpeta u otro nombre +@msg `{file}` has no art to place `{file}` no tiene ilustración que colocar +@msg `{file}` is over {_1} MB `{file}` ocupa más de {_1} MB +@msg `{f}` belongs to a VectorCraft that is running `{f}` pertenece a un VectorCraft que se está ejecutando +@msg `{f}` is the copy of a document open now `{f}` es la copia de un documento abierto ahora +@msg `{id}` is no writable format (see document.formats) `{id}` no es un formato con escritura (consulta document.formats) +@msg `{id}` isn't a loaded library `{id}` no es una biblioteca cargada +@msg `{key}` has no colours `{key}` no tiene colores +@msg `{key}` is a design name `{key}` es el nombre de un diseño +@msg `{key}` is a design name or a list of them `{key}` es el nombre de un diseño o una lista de ellos +@msg `{key}` is longer than {MAX_NAME} characters `{key}` tiene más de {MAX_NAME} caracteres +@msg `{key}` is out of range `{key}` está fuera de rango +@msg `{key}` must be [min, desired, max] or {{min?, desired?, max?}}, in percent `{key}` debe ser [min, desired, max] o {{min?, desired?, max?}}, en porcentaje +@msg `{key}` must be a non-negative integer `{key}` debe ser un entero no negativo +@msg `{key}` must be a number {_1}..{_2} `{key}` debe ser un número {_1}..{_2} +@msg `{key}` must be a whole number of at least 0, not {n} `{key}` debe ser un número entero de al menos 0, no {n} +@msg `{key}` must be an appearance item index (paint order) or null `{key}` debe ser un índice de elemento de apariencia (orden de pintura) o null +@msg `{key}` must be an array of asset ids (see assets.list) `{key}` debe ser una lista de ids de recursos (consulta assets.list) +@msg `{key}` must be from 0 to 180 degrees, not {a} `{key}` debe estar entre 0 y 180 grados, no {a} +@msg `{key}` must be from {_1} to {shift_max} `{key}` debe estar entre {_1} y {shift_max} +@msg `{key}`: not a colour: {v} `{key}`: no es un color: {v} +@msg `{k}.family` is required `{k}.family` es obligatorio +@msg `{k}` is a number 0..1 `{k}` es un número 0..1 +@msg `{k}` is true or false `{k}` es true o false +@msg `{k}` isn't an export setting: {_1} `{k}` no es un ajuste de exportación: {_1} +@msg `{k}` must be a byte offset `{k}` debe ser un desplazamiento en bytes +@msg `{k}` must be a number `{k}` debe ser un número +@msg `{k}` must be a number of points `{k}` debe ser un número de puntos +@msg `{k}` must be a string `{k}` debe ser una cadena +@msg `{k}` must be a whole number `{k}` debe ser un número entero +@msg `{k}` must be from {lo} to {hi} for {key} `{k}` debe estar entre {lo} y {hi} para {key} +@msg `{k}` must be {what}, not {v} `{k}` debe ser {what}, no {v} +@msg `{l}` isn't a global or spot colour `{l}` no es un color global ni una tinta plana +@msg `{m}` isn't a bitmap: use clipboard.importSvg, importPdf or importText `{m}` no es un mapa de bits: usa clipboard.importSvg, importPdf o importText +@msg `{name}` can't be deleted `{name}` no se puede eliminar +@msg `{name}` can't be duplicated `{name}` no se puede duplicar +@msg `{name}` can't be edited `{name}` no se puede editar +@msg `{name}` can't be edited this way `{name}` no se puede editar de esta forma +@msg `{name}` can't be renamed `{name}` no se puede cambiar de nombre +@msg `{name}` can't name a folder `{name}` no puede nombrar una carpeta +@msg `{name}` has no art to place `{name}` no tiene ilustración que colocar +@msg `{name}` has no text to place `{name}` no tiene texto que colocar +@msg `{name}` in the Word document is not UTF-8 or UTF-16 text `{name}` en el documento de Word no es texto UTF-8 ni UTF-16 +@msg `{name}` in the Word document is not well-formed XML: {e} `{name}` en el documento de Word no es XML bien formado: {e} +@msg `{name}` in the Word document nests elements more than {MAX_NESTING} deep `{name}` en el documento de Word anida elementos a más de {MAX_NESTING} niveles +@msg `{name}` is a built-in preset and is read-only: save it under another name `{name}` es un preajuste integrado y es de solo lectura: guárdalo con otro nombre +@msg `{name}` is a built-in preset: save under another name `{name}` es un preajuste integrado: guarda con otro nombre +@msg `{name}` is a built-in profile and stays `{name}` es un perfil integrado y se conserva +@msg `{name}` is a tint of `{base}`: edit `{base}` (a tint swatch only takes a new name) `{name}` es un matiz de `{base}`: edita `{base}` (una muestra de matiz solo acepta un nombre nuevo) +@msg `{name}` is a working space: choose another with edit.colorSettings first `{name}` es un espacio de trabajo de color: elige antes otro con edit.colorSettings +@msg `{name}` is built in and stays `{name}` está integrado y se conserva +@msg `{name}` takes a paint of its own kind (colour, gradient or pattern) `{name}` acepta una pintura de su mismo tipo (color, degradado o motivo) +@msg `{name}`: Minimum must not exceed Desired, nor Desired Maximum `{name}`: Mínimo no debe superar a Deseado, ni Deseado a Máximo +@msg `{n}` can't be deleted `{n}` no se puede eliminar +@msg `{n}` can't be merged `{n}` no se puede combinar +@msg `{n}` can't be moved `{n}` no se puede mover +@msg `{n}` is not a colour swatch `{n}` no es una muestra de color +@msg `{n}` isn't a solid colour `{n}` no es un color sólido +@msg `{n}`: colour groups hold solid colours only `{n}`: los grupos de colores solo contienen colores sólidos +@msg `{other}` doesn't trace an image `{other}` no calca una imagen +@msg `{s}`: the step's references copy in more than {_1} MB of values `{s}`: las referencias del paso copian más de {_1} MB de valores +@msg `{tag}` is not an axis tag: a tag is four characters, such as "wght" `{tag}` no es una etiqueta de eje: una etiqueta tiene cuatro caracteres, como "wght" +@msg `{to}` is empty or already used `{to}` está vacío o ya se usa +@msg `{what}` is longer than {MAX_TEXT} bytes `{what}` ocupa más de {MAX_TEXT} bytes +@msg `{what}` must be text `{what}` debe ser texto +@msg a DXF drawing has one origin: pass useArtboards: true for one drawing per artboard un dibujo DXF tiene un solo origen: pasa useArtboards: true para un dibujo por mesa de trabajo +@msg a PDF presets file with over {_1} presets un archivo de preajustes de PDF con más de {_1} preajustes +@msg a batch preview cannot switch documents una vista previa por lotes no puede cambiar de documento +@msg a brush named `{nn}` exists ya existe un pincel llamado `{nn}` +@msg a container of the listed objects is gone ya no existe un contenedor de los objetos enumerados +@msg a content stream can't be read no se puede leer un flujo de contenido +@msg a content stream isn't a stream un flujo de contenido no es un flujo +@msg a design holds at most {_1} objects un diseño contiene como máximo {_1} objetos +@msg a design needs a name un diseño necesita un nombre +@msg a dictionary grew too large un diccionario creció demasiado +@msg a document keeps at most {_1} graph designs un documento guarda como máximo {_1} diseños de gráfico +@msg a document keeps at most {_1} saved selections un documento guarda como máximo {_1} selecciones guardadas +@msg a document keeps at most {_1} views un documento guarda como máximo {_1} vistas +@msg a document links at most {MAX_SVG_SCRIPTS} JavaScript files un documento vincula como máximo {MAX_SVG_SCRIPTS} archivos JavaScript +@msg a feConvolveMatrix filter's order is {x}×{y}, which overflows the kernel-size multiply usvg makes el orden de un filtro feConvolveMatrix es {x}×{y}, lo que desborda la multiplicación del tamaño del núcleo que hace usvg +@msg a gradient preset is already called {n} ya hay un preajuste de degradado llamado {n} +@msg a graph has at most {_1} series, so it transposes with at most that many categories un gráfico tiene como máximo {_1} series, así que se transpone con como máximo esa cantidad de categorías +@msg a layer can't be merged into its own sublayer una capa no se puede combinar en su propia subcapa +@msg a layer's form box isn't an array el cuadro del formulario de una capa no es una matriz +@msg a layer's form can't be read no se puede leer el formulario de una capa +@msg a layer's form has no box el formulario de una capa no tiene cuadro +@msg a layer's form has no dictionary el formulario de una capa no tiene diccionario +@msg a legend draws at most {MAX_CHIPS} swatches una leyenda dibuja como máximo {MAX_CHIPS} muestras +@msg a name names one asset: give multiple: false, or one object un nombre nombra un solo recurso: indica multiple: false, o un solo objeto +@msg a page can't be read no se puede leer una página +@msg a page object is used by something else otro elemento usa un objeto de página +@msg a page thumbnail must be RGB pixels, 1 to {THUMBNAIL_SIZE} a side (got {w} × {h}) una miniatura de página debe ser de píxeles RGB, de 1 a {THUMBNAIL_SIZE} por lado (se recibió {w} × {h}) +@msg a pattern layer doesn't end what it starts una capa de motivo no termina lo que empieza +@msg a pattern layer's colors hold something else los colores de una capa de motivo contienen otra cosa +@msg a pattern named `{n}` exists ya existe un motivo llamado `{n}` +@msg a plug-in with id {_1} is already installed ya hay instalado un plugin con el id {_1} +@msg a preset named `{n}` exists ya existe un preajuste llamado `{n}` +@msg a print presets file with over {_1} presets un archivo de preajustes de impresión con más de {_1} preajustes +@msg a profile is already called {n} ya hay un perfil llamado {n} +@msg a row can't go into itself una fila no puede entrar en sí misma +@msg a series goes on the left or the right value axis una serie va en el eje de valores izquierdo o derecho +@msg a start must be an anchor index ≥ 0 or null un inicio debe ser un índice de punto de ancla ≥ 0 o null +@msg a style named `{name}` already exists ya existe un estilo llamado `{name}` +@msg a style named `{to}` already exists ya existe un estilo llamado `{to}` +@msg a swatch needs a colour, gradient or pattern una muestra necesita un color, un degradado o un motivo +@msg a symbol named `{n}` already exists ya existe un símbolo llamado `{n}` +@msg a theme has 1 to {THEME_SIZE} colours un tema tiene de 1 a {THEME_SIZE} colores +@msg a theme is already called {name} (replace: "{name}" overwrites it) ya hay un tema llamado {name} (replace: "{name}" lo sobrescribe) +@msg a toolbar name has at most {MAX_NAME} characters el nombre de una barra de herramientas tiene como máximo {MAX_NAME} caracteres +@msg a view named `{_1}` exists ya existe una vista llamada `{_1}` +@msg a view named `{name}` exists ya existe una vista llamada `{name}` +@msg a workspace keeps at most {MAX} toolbars un espacio de trabajo guarda como máximo {MAX} barras de herramientas +@msg a {_1} series can't go in a {_2} graph una serie {_1} no puede ir en un gráfico {_2} +@msg aiVersion {v}: "pdf" (PDF-compatible, the default) or "7" (legacy .ai, version 7) aiVersion {v}: "pdf" (compatible con PDF, el predeterminado) o "7" (.ai heredado, versión 7) +@msg already editing an opacity mask ya se está editando una máscara de opacidad +@msg already editing another object's opacity mask ya se está editando la máscara de opacidad de otro objeto +@msg already in pattern editing mode ya está en el modo de edición de motivos +@msg an artboard is listed twice una mesa de trabajo aparece dos veces en la lista +@msg an empty artboard has no width or height to scale to una mesa de trabajo vacía no tiene anchura ni altura a la que escalar +@msg an image is too large for DXF and was left out una imagen es demasiado grande para DXF y se omitió +@msg an image of {_1} MB, at most {_2} MB una imagen de {_1} MB, como máximo {_2} MB +@msg an image of {declared_w} × {declared_h} pixels is too large to draw una imagen de {declared_w} × {declared_h} píxeles es demasiado grande para dibujarla +@msg an image of {width} × {height} pixels is too large to draw una imagen de {width} × {height} píxeles es demasiado grande para dibujarla +@msg an index must be a whole number un índice debe ser un número entero +@msg an inline graphic has no glyphs un gráfico en línea no tiene glifos +@msg an invisible text form can't be read no se puede leer un formulario de texto invisible +@msg an object is missing falta un objeto +@msg an object's header is missing falta el encabezado de un objeto +@msg an overprinting form can't be read no se puede leer un formulario con sobreimpresión +@msg an unread object has no readable bounds un objeto no leído no tiene límites legibles +@msg an unread object holds a frame of threaded type un objeto no leído contiene un marco de texto enlazado +@msg an unread object is missing from its layer falta un objeto no leído en su capa +@msg anchor `smooth` must be true or false `smooth` del punto de ancla debe ser true o false +@msg anchor `{key}` must be [x, y] `{key}` del punto de ancla debe ser [x, y] +@msg anchor `{key}` must be a number `{key}` del punto de ancla debe ser un número +@msg angle and roundness must be finite angle y roundness deben ser finitos +@msg angles must be a list as long as pins (degrees or null) angles debe ser una lista tan larga como pins (grados o null) +@msg appearance must be flat|center|edge appearance debe ser flat|center|edge +@msg apply is "fill" or "stroke", not `{other}` apply es "fill" o "stroke", no `{other}` +@msg area must be a closed polygon of 3 to 100000 [x, y] points area debe ser un polígono cerrado de 3 a 100000 puntos [x, y] +@msg area type needs a path that encloses an area el texto de área necesita un trazado que encierre un área +@msg area type {_1} is named twice el texto de área {_1} se nombra dos veces +@msg arrowAlign must be extend|tip, got {o} arrowAlign debe ser extend|tip, se recibió {o} +@msg arrowScale must be [start, end] arrowScale debe ser [start, end] +@msg artboard is a 0-based index artboard es un índice que empieza en 0 +@msg artboard must be a 0-based index artboard debe ser un índice que empieza en 0 +@msg artboard {i} doesn't print la mesa de trabajo {i} no se imprime +@msg artboardLayout must be {layout?, columns?, spacing?, rightToLeft?} artboardLayout debe ser {layout?, columns?, spacing?, rightToLeft?} +@msg artboardLayout.columns must be 1 or more artboardLayout.columns debe ser 1 o más +@msg artboardLayout.layout must be gridByRow, gridByColumn, row or column artboardLayout.layout debe ser gridByRow, gridByColumn, row o column +@msg artboardLayout.rightToLeft must be true or false artboardLayout.rightToLeft debe ser true o false +@msg artboardLayout.spacing must be 0–{MAX_SPACING} pt artboardLayout.spacing debe ser 0–{MAX_SPACING} pt +@msg artboards must be a non-empty list artboards debe ser una lista no vacía +@msg artboards must be a number artboards debe ser un número +@msg asset `{_1}` has no art to export el recurso `{_1}` no tiene ilustración que exportar +@msg at most {MAX_KEYWORDS} keywords como máximo {MAX_KEYWORDS} palabras clave +@msg at most {MAX_MATCHES} matches are kept se conservan como máximo {MAX_MATCHES} coincidencias +@msg at most {MAX_POINTS} points como máximo {MAX_POINTS} puntos +@msg at most {MAX_QUEUE} files como máximo {MAX_QUEUE} archivos +@msg at must be [x, y] at debe ser [x, y] +@msg at/rect lie outside the canvas at/rect quedan fuera del lienzo +@msg attribute must be size|leading|tracking|kerning|baselineShift attribute debe ser size|leading|tracking|kerning|baselineShift +@msg attrs must be an object attrs debe ser un objeto +@msg automation path rejected: the folder's name isn't valid text ruta de automatización rechazada: el nombre de la carpeta no es texto válido +@msg automation path rejected: {_1} isn't valid text ruta de automatización rechazada: {_1} no es texto válido +@msg automation path rejected: {why}: {path} ruta de automatización rechazada: {why}: {path} +@msg axis must be "vertical", "horizontal" or an angle in degrees, not `{given}` axis debe ser "vertical", "horizontal" o un ángulo en grados, no `{given}` +@msg backgroundContents must be transparent or white backgroundContents debe ser transparent o white +@msg bad AES key clave AES incorrecta +@msg bad `runs`: {e} `runs` incorrecto: {e} +@msg bad arrowScale arrowScale incorrecto +@msg bad base64 base64 incorrecto +@msg bad color {c} color incorrecto {c} +@msg bad colour color incorrecto +@msg bad colour in `colors` color incorrecto en `colors` +@msg bad colour {v} color incorrecto {v} +@msg bad colour {v} in groupColors color incorrecto {v} en groupColors +@msg bad cross-reference entry entrada de referencia cruzada incorrecta +@msg bad cross-reference table tabla de referencias cruzadas incorrecta +@msg bad current colour {v} color actual incorrecto {v} +@msg bad dataBase64 dataBase64 incorrecto +@msg bad edit edición incorrecta +@msg bad fill {v} relleno incorrecto {v} +@msg bad fit: {e} ajuste incorrecto: {e} +@msg bad model {other} (keep, new or document) modelo incorrecto {other} (keep, new o document) +@msg bad new colour {v} color nuevo incorrecto {v} +@msg bad object objeto incorrecto +@msg bad object number número de objeto incorrecto +@msg bad offset desplazamiento incorrecto +@msg bad path data: {e} datos de trazado incorrectos: {e} +@msg bad point {v}: expected [x, y] or [x, y, pressure] punto incorrecto {v}: se esperaba [x, y] o [x, y, pressure] +@msg bad reference referencia incorrecta +@msg bad trailer size tamaño de trailer incorrecto +@msg bad {k} colour color {k} incorrecto +@msg batches cannot nest los lotes no se pueden anidar +@msg bind something to a variable first vincula antes algo a una variable +@msg bleed must be 0–{MAX_BLEED} pt: a number, [top, bottom, left, right] or {{top, bottom, left, right}} bleed debe ser 0–{MAX_BLEED} pt: un número, [top, bottom, left, right] o {{top, bottom, left, right}} +@msg brush must be a name or null brush debe ser un nombre o null +@msg by must be a number by debe ser un número +@msg can't add page thumbnails: {why} no se pueden agregar miniaturas de página: {why} +@msg can't add the editing data for other apps: {why} no se pueden agregar los datos de edición para otras aplicaciones: {why} +@msg can't edit the written PDF: {why} no se puede editar el PDF escrito: {why} +@msg can't encrypt the PDF: {why} no se puede cifrar el PDF: {why} +@msg can't linearise the PDF: {why} no se puede linealizar el PDF: {why} +@msg can't open `{_1}`: {_2} no se puede abrir `{_1}`: {_2} +@msg can't open `{_1}`: {e} no se puede abrir `{_1}`: {e} +@msg can't open `{name}`: not a format VectorCraft reads (see document.formats) no se puede abrir `{name}`: no es un formato que VectorCraft lea (consulta document.formats) +@msg can't place `{name}`: not a format VectorCraft reads (see document.formats) no se puede colocar `{name}`: no es un formato que VectorCraft lea (consulta document.formats) +@msg can't read back the written PDF: {e} no se puede volver a leer el PDF escrito: {e} +@msg can't read this Word document: {why} no se puede leer este documento de Word: {why} +@msg can't write .{e} images: use .png, .jpg, .gif, .webp, .tif or .bmp no se pueden escribir imágenes .{e}: usa .png, .jpg, .gif, .webp, .tif o .bmp +@msg can't write PDF layers, overprint or invisible text: {why} no se pueden escribir capas PDF, sobreimpresión ni texto invisible: {why} +@msg can't write the file's copyright: {why} no se puede escribir el copyright del archivo: {why} +@msg can't write the file's modification date: {why} no se puede escribir la fecha de modificación del archivo: {why} +@msg can't write the pages' user units: {why} no se pueden escribir las unidades de usuario de las páginas: {why} +@msg cannot distort a zero-size or non-finite bounding box no se puede distorsionar un cuadro delimitador de tamaño cero o no finito +@msg cannot move an object into itself no se puede mover un objeto dentro de sí mismo +@msg case must be upper|lower|title|sentence case debe ser upper|lower|title|sentence +@msg category `{c}`: one of {_1} categoría `{c}`: una de {_1} +@msg center must be [x, y] center debe ser [x, y] +@msg choose at least one artboard elige al menos una mesa de trabajo +@msg choose at least one status elige al menos un estado +@msg clip must be true or false clip debe ser true o false +@msg clippingMask must be true or false clippingMask debe ser true o false +@msg closed must be a boolean closed debe ser un booleano +@msg collapsed must be true or false collapsed debe ser true o false +@msg color.profile: no RGB or CMYK profile is called “{profile}” color.profile: ningún perfil RGB ni CMYK se llama “{profile}” +@msg colorMode must be rgb or cmyk, not `{m}` colorMode debe ser rgb o cmyk, no `{m}` +@msg colorModel must be {own} (the document's mode), grayscale or bitmap colorModel debe ser {own} (el modo del documento), grayscale o bitmap +@msg colour groups can't go into colour groups los grupos de colores no pueden ir dentro de grupos de colores +@msg colour, mode and spot apply to solid-colour swatches only colour, mode y spot solo se aplican a muestras de color sólido +@msg column {column}: `{cell}` is a `%` column of graph data files, which are not read columna {column}: `{cell}` es una columna `%` de los archivos de datos de gráficos, que no se leen +@msg column {column}: `{cell}` names `{name}`, which is a {_1} variable columna {column}: `{cell}` nombra `{name}`, que es una variable {_1} +@msg column {column}: `{cell}` names no variable columna {column}: `{cell}` no nombra ninguna variable +@msg column {column}: the variable name is longer than {MAX_NAME} characters columna {column}: el nombre de la variable tiene más de {MAX_NAME} caracteres +@msg column: true floats the whole column and takes no onto, above or below column: true hace flotar toda la columna y no acepta onto, above ni below +@msg command must be a shape.* command command debe ser un comando shape.* +@msg commands[{i}]: missing `command` commands[{i}]: falta `command` +@msg composer must be "singleLine" or "everyLine" composer debe ser "singleLine" o "everyLine" +@msg compound shapes take paths, compound paths, groups, compound shapes, type, blends and envelopes las formas compuestas aceptan trazados, trazados compuestos, grupos, formas compuestas, texto, fusiones y envolventes +@msg compound {_1} must contain exactly one open path to join el compuesto {_1} debe contener exactamente un trazado abierto para unir +@msg connect end must be "start" or "end" el extremo de connect debe ser "start" o "end" +@msg connect needs a path other than the one extended connect necesita un trazado distinto del que se extiende +@msg connect needs id connect necesita id +@msg connect path has no open end el trazado de connect no tiene ningún extremo abierto +@msg copy needs path: the file to copy into the document's folder copy necesita path: el archivo que se copia en la carpeta del documento +@msg copy takes images only: relink placed documents where their files are copy solo acepta imágenes: vuelve a vincular los documentos colocados donde estén sus archivos +@msg copying a file isn't available on the web copiar un archivo no está disponible en la web +@msg copyrightStatus must be unknown, copyrighted or publicDomain copyrightStatus debe ser unknown, copyrighted o publicDomain +@msg copyrightUrl must be a URL (no spaces, at most 2048 characters) copyrightUrl debe ser una URL (sin espacios, como máximo 2048 caracteres) +@msg corners must be 4 [x, y] points (TL, TR, BR, BL) corners debe ser 4 puntos [x, y] (TL, TR, BR, BL) +@msg counterPer `{c}`: item or file counterPer `{c}`: item o file +@msg crop `{_1}`: only PDF pages have art, trim, bleed and media boxes; use "crop" or "bounding" crop `{_1}`: solo las páginas PDF tienen cuadros de ilustración, recorte, sangrado y medios; usa "crop" o "bounding" +@msg crop rectangle doesn't overlap the image el rectángulo de recorte no se superpone a la imagen +@msg cross-reference and object streams aren't supported no se admiten los flujos de referencias cruzadas ni de objetos +@msg damaged compressed data: {e} datos comprimidos dañados: {e} +@msg dash lengths must be numbers, got {v} las longitudes de guion deben ser números, se recibió {v} +@msg dash must be a list of lengths or null, got {v} dash debe ser una lista de longitudes o null, se recibió {v} +@msg data key `{k}`: letters, digits, -, _ and . (not name or vc-…) clave de datos `{k}`: letras, dígitos, -, _ y . (no name ni vc-…) +@msg data must be an object of key: value, not {v} data debe ser un objeto de key: value, no {v} +@msg data set `{name}` holds a value for `{var}`, which the library doesn't declare el conjunto de datos `{name}` contiene un valor para `{var}`, que la biblioteca no declara +@msg data set `{name}` holds two values for `{var}` el conjunto de datos `{name}` contiene dos valores para `{var}` +@msg data set `{name}` is declared twice el conjunto de datos `{name}` se declara dos veces +@msg data takes at most {MAX_DATA} keys at once data acepta como máximo {MAX_DATA} claves a la vez +@msg dataset `{name}` already exists ya existe el conjunto de datos `{name}` +@msg dataset `{to}` already exists ya existe el conjunto de datos `{to}` +@msg date `{d}`: YYYY-MM-DD fecha `{d}`: YYYY-MM-DD +@msg decoded data is too large los datos descodificados son demasiado grandes +@msg define a variable first define antes una variable +@msg detect must be true or false detect debe ser true o false +@msg direct-select anchor points of a path selecciona con Selección directa los puntos de ancla de un trazado +@msg distance must be > 0 distance debe ser > 0 +@msg dx and dy give the arrow's direction dx y dy indican la dirección de la flecha +@msg dx and dy must be numbers dx y dy deben ser números +@msg dxf fitTo must be [width, height], positive fitTo de dxf debe ser [width, height], positivo +@msg dxf must be an object of DXF import options dxf debe ser un objeto de opciones de importación de DXF +@msg dxf scale must be a positive number up to {_1}, not {s} scale de dxf debe ser un número positivo de hasta {_1}, no {s} +@msg dxf unit `{u}`: a unit such as mm, cm, in or pt unidad de dxf `{u}`: una unidad como mm, cm, in o pt +@msg dxf: {e} dxf: {e} +@msg each format is an object {format, scale?, suffix?} cada formato es un objeto {format, scale?, suffix?} +@msg each item needs an id cada elemento necesita un id +@msg each match needs `kind` cada coincidencia necesita `kind` +@msg each match needs a `name` cada coincidencia necesita un `name` +@msg each of `fonts` is {family, style?}; 1 to 1000 of them cada elemento de `fonts` es {family, style?}; de 1 a 1000 +@msg each of `items` is {kind, item} cada elemento de `items` es {kind, item} +@msg each of `items` is {{id, corners?}} with an object id, not {it} cada elemento de `items` es {{id, corners?}} con un id de objeto, no {it} +@msg each row needs `from` cada fila necesita `from` +@msg each stop needs a position cada parada necesita una posición +@msg each subpath needs an anchors array cada subtrazado necesita una matriz anchors +@msg easingType must be easeIn, easeOut, easeInOut or easeOutIn easingType debe ser easeIn, easeOut, easeInOut o easeOutIn +@msg editingData must be true or false editingData debe ser true o false +@msg editingData must be true, false or "always" editingData debe ser true, false o "always" +@msg edits overlap las ediciones se superponen +@msg effects of objects whose appearances differ can't be moved together los efectos de objetos cuyas apariencias difieren no se pueden mover juntos +@msg empty header in column {_1} encabezado vacío en la columna {_1} +@msg encoding `{_1}`: utf8 or utf16 codificación `{_1}`: utf8 o utf16 +@msg ends must be two of "first" and "last" ends debe ser dos de "first" y "last" +@msg every numbered name for the result is taken todos los nombres numerados para el resultado están ocupados +@msg expanded SVG styles exceed the import size limit los estilos SVG expandidos superan el límite de tamaño de importación +@msg export presets file is larger than {MAX_PRESET_FILE_BYTES} bytes el archivo de preajustes de exportación ocupa más de {MAX_PRESET_FILE_BYTES} bytes +@msg exportText must be editable or appearance exportText debe ser editable o appearance +@msg exportType must be movieClip or graphic, not `{s}` exportType debe ser movieClip o graphic, no `{s}` +@msg extend needs id extend necesita id +@msg featureChanges lists at most {MAX_FEATURE_CHANGES} tags featureChanges enumera como máximo {MAX_FEATURE_CHANGES} etiquetas +@msg featureChanges must be a list of tags featureChanges debe ser una lista de etiquetas +@msg features must be a list of tags features debe ser una lista de etiquetas +@msg fidelity must be 0..100 fidelity debe ser 0..100 +@msg files must be {name, dataBase64} files debe ser {name, dataBase64} +@msg fit must be none|autoHeight|shrinkText|block, got {id} fit debe ser none|autoHeight|shrinkText|block, se recibió {id} +@msg flattener: {e} acoplador: {e} +@msg flattenerPreset `{name}`: high, medium, low or a saved one (see flattener.presets.list) flattenerPreset `{name}`: high, medium, low o uno guardado (consulta flattener.presets.list) +@msg flipProfile must be along|across, got {o} flipProfile debe ser along|across, se recibió {o} +@msg folders `{f}`: none, rows, format, item or itemFormat folders `{f}`: none, rows, format, item o itemFormat +@msg folders deeper than {MAX_BATCH_DEPTH} levels carpetas con más de {MAX_BATCH_DEPTH} niveles de profundidad +@msg folders deeper than {MAX_DEPTH} levels carpetas con más de {MAX_DEPTH} niveles de profundidad +@msg font family `{family}` is not available la familia de fuentes `{family}` no está disponible +@msg font family `{tf}` is not available la familia de fuentes `{tf}` no está disponible +@msg format `{f}`: pdf or postscript formato `{f}`: pdf o postscript +@msg format `{f}`: text or json formato `{f}`: text o json +@msg format is `{format}` el formato es `{format}` +@msg formats must be an array of rows, not {v} formats debe ser una lista de filas, no {v} +@msg frequency must be between 1 and 300 lines per inch frequency debe estar entre 1 y 300 líneas por pulgada +@msg from and to must be finite from y to deben ser finitos +@msg from must be [x0, y0, x1, y1] from debe ser [x0, y0, x1, y1] +@msg give `before` or `after`, not both indica `before` o `after`, no ambos +@msg give `colors`, or `color` and `rule` indica `colors`, o `color` y `rule` +@msg give `event`, such as onclick indica `event`, como onclick +@msg give `file`, the JavaScript file's path or URL indica `file`, la ruta o URL del archivo JavaScript +@msg give `fill` and/or `stroke` indica `fill` y/o `stroke` +@msg give `fill`, `stroke` or both indica `fill`, `stroke` o ambos +@msg give `folder` indica `folder` +@msg give `fonts`, or open a document indica `fonts` o abre un documento +@msg give `from` or `indices`, not both indica `from` o `indices`, no ambos +@msg give `id` (no text is being edited) indica `id` (no se está editando ningún texto) +@msg give `id` and `anchors`, or `items`, not both indica `id` y `anchors`, o `items`, no ambos +@msg give `id` or `guide`, not both indica `id` o `guide`, no ambos +@msg give `length` or `to` indica `length` o `to` +@msg give `matches`: [{kind, name, target}] indica `matches`: [{kind, name, target}] +@msg give `name` (or edit a pattern) indica `name` (o edita un motivo) +@msg give `name` or `names` indica `name` o `names` +@msg give `path` (a .wasm file) or `dataBase64` (the module) indica `path` (un archivo .wasm) o `dataBase64` (el módulo) +@msg give `path`, `data` or `dataBase64` indica `path`, `data` o `dataBase64` +@msg give `path`, `data`, `dataBase64` or `csv` indica `path`, `data`, `dataBase64` o `csv` +@msg give `path`, `xml` or `dataBase64` indica `path`, `xml` o `dataBase64` +@msg give `script`, the JavaScript the event runs ("" removes the event) indica `script`, el JavaScript que ejecuta el evento ("" elimina el evento) +@msg give `text` (the reading) or `remove` indica `text` (la lectura) o `remove` +@msg give `x` and `y` (and a `tolerance` of 0 or more) indica `x` e `y` (y una `tolerance` de 0 o más) +@msg give a mode or r/g/b, c/m/y/k, gray or tint adjustments indica un modo o ajustes de r/g/b, c/m/y/k, gray o tint +@msg give a name, or paint the active proxy with a saved preset indica un nombre o pinta el proxy activo con un preajuste guardado +@msg give a name, or select a stroke with a saved profile indica un nombre o selecciona un trazo con un perfil guardado +@msg give a pattern name or select an object painted with a pattern indica el nombre de un motivo o selecciona un objeto pintado con un motivo +@msg give at least one of clip, invert, disabled, linked indica al menos uno de clip, invert, disabled, linked +@msg give color, none, swatch or gradient indica color, none, swatch o gradient +@msg give dataBase64 indica dataBase64 +@msg give either at (a click) or area (a path drawn around the overlaps) indica at (un clic) o area (un trazado dibujado alrededor de las superposiciones) +@msg give formats or a preset, not both indica formats o un preajuste, no ambos +@msg give newName or delete indica newName o delete +@msg give offset or by indica offset o by +@msg give one of `to`, `rect` or `at` indica uno de `to`, `rect` o `at` +@msg give one of assets, layers, selection or fullDocument indica uno de assets, layers, selection o fullDocument +@msg give only one of onto, above, below, icon and a column place indica solo uno de onto, above, below, icon y una posición de columna +@msg give origin: [x, y], or reset: true indica origin: [x, y], o reset: true +@msg give overprintFill, overprintStroke, showCenter, imageMap, url or note indica overprintFill, overprintStroke, showCenter, imageMap, url o note +@msg give path (a file) or folder indica path (un archivo) o folder +@msg give path, or name and dataBase64 indica path, o name y dataBase64 +@msg give paths or files indica paths o files +@msg give rows, rowHeight, columns or columnWidth indica rows, rowHeight, columns o columnWidth +@msg give svg, or dataBase64 of an SVG or SVGZ file indica svg, o dataBase64 de un archivo SVG o SVGZ +@msg give text indica text +@msg give the asset a name ponle un nombre al recurso +@msg give the preset a `name` ponle un `name` al preajuste +@msg give the preset a name ponle un nombre al preajuste +@msg give the preset a name (1–64 characters) ponle un nombre al preajuste (de 1 a 64 caracteres) +@msg give the settings to change, e.g. {"formats"}]} indica los ajustes que quieres cambiar, p. ej. {"formats"}]} +@msg give the style a name ponle un nombre al estilo +@msg give two or more style `names` indica dos o más `names` de estilos +@msg give two or more swatches indica dos o más muestras +@msg give x, y, or a handle's length or angle indica x, y, o la longitud o el ángulo de un manejador +@msg give {key, value} or {values} indica {key, value} o {values} +@msg global must be true or false global debe ser true o false +@msg glyph {_1} is not drawn for {ch} with the character's style (such as All Caps, Small Caps or a numeral system) el glifo {_1} no se dibuja para {ch} con el estilo del carácter (como Todo mayúsculas, Versalitas o un sistema de numeración) +@msg glyph {g} is not an alternate of {ch} in {_1} {_2} el glifo {g} no es una alternativa de {ch} en {_1} {_2} +@msg gradient must be "objects" or "mesh" gradient debe ser "objects" o "mesh" +@msg grays must be "profile" or "black", not `{g}` grays debe ser "profile" o "black", no `{g}` +@msg gridColors must be a preset name or two colours gridColors debe ser el nombre de un preajuste o dos colores +@msg gridSize must be small, medium or large gridSize debe ser small, medium o large +@msg guide {g} is not selected la guía {g} no está seleccionada +@msg handle must be 0..3 handle debe ser 0..3 +@msg hiddenObjects {v}: "layer" (the default), "omit" or "visible" hiddenObjects {v}: "layer" (el predeterminado), "omit" o "visible" +@msg highlight a layer to merge into resalta una capa en la que combinar +@msg highlight two or more rows in one layer or group resalta dos o más filas en una misma capa o grupo +@msg highlight two or more rows to merge resalta dos o más filas para combinarlas +@msg icon docks a panel in the icon column: use window.panel.dock icon acopla un panel en la columna de iconos: usa window.panel.dock +@msg id must be a dimension id id debe ser el id de una cota +@msg image has no bounds la imagen no tiene límites +@msg image {_1} is linked already la imagen {_1} ya está vinculada +@msg imageMap `{m}`: none, client or server imageMap `{m}`: none, client o server +@msg index out of range índice fuera de rango +@msg instances must be 1..1000 instances debe ser 1..1000 +@msg invalid `color` `color` no válido +@msg invalid anchor index {v}: expected a non-negative integer índice de punto de ancla no válido {v}: se esperaba un entero no negativo +@msg invalid anchor reference {v}: expected [subpath, anchor] referencia de punto de ancla no válida {v}: se esperaba [subpath, anchor] +@msg invalid angle ángulo no válido +@msg invalid brush: {e} pincel no válido: {e} +@msg invalid color color no válido +@msg invalid colour {c} color no válido {c} +@msg invalid delta delta no válido +@msg invalid point punto no válido +@msg invalid size tamaño no válido +@msg invalid t t no válido +@msg invalid tolerance tolerancia no válida +@msg its artboards all lie beyond the canvas (more than {_1} pt from the origin) todas sus mesas de trabajo quedan fuera del lienzo (a más de {_1} pt del origen) +@msg its clipping masks are nested too deeply sus máscaras de recorte están anidadas a demasiada profundidad +@msg its metadata has no description sus metadatos no tienen descripción +@msg its metadata has no direct length sus metadatos no tienen longitud directa +@msg join two different paths une dos trazados distintos +@msg justify must be auto|left|center|right|justifyAll justify debe ser auto|left|center|right|justifyAll +@msg kbps must be a positive number, not {kbps} kbps debe ser un número positivo, no {kbps} +@msg keywords must be a list of words or a comma-separated string keywords debe ser una lista de palabras o una cadena separada por comas +@msg keywords must be at most {MAX_KEYWORD} characters, without control characters keywords debe tener como máximo {MAX_KEYWORD} caracteres, sin caracteres de control +@msg kind must be 1, 2 or 3, or give a preset `name` (see perspective.presets.list) kind debe ser 1, 2 o 3, o indica un `name` de preajuste (consulta perspective.presets.list) +@msg kind must be graphic, fillColor, strokeColor, fillGradient, strokeGradient, fillPattern, strokePattern, charStyle or paraStyle kind debe ser graphic, fillColor, strokeColor, fillGradient, strokeGradient, fillPattern, strokePattern, charStyle o paraStyle +@msg knockout must be "on", "off", "neutral" or a bool, not {v} knockout debe ser "on", "off", "neutral" o un bool, no {v} +@msg layer `{name}` has no art to export la capa `{name}` no tiene ilustración que exportar +@msg layer must name a layer or sublayer layer debe nombrar una capa o subcapa +@msg layers can't be intertwined: select the objects in them las capas no se pueden entrelazar: selecciona los objetos que contienen +@msg layers go only at the top level or in layers, objects in layers and groups las capas solo van en el nivel superior o dentro de capas, y los objetos en capas y grupos +@msg layers must be true or false layers debe ser true o false +@msg layout must be gridByRow, gridByColumn, row or column layout debe ser gridByRow, gridByColumn, row o column +@msg leading must be a number or "auto" leading debe ser un número o "auto" +@msg left/right must be non-negative widths left/right deben ser anchuras no negativas +@msg level `{t}`: 2 or 3 nivel `{t}`: 2 o 3 +@msg line {line}: more than {MAX_CSV_COLS} columns línea {line}: más de {MAX_CSV_COLS} columnas +@msg line {line}: unclosed quote línea {line}: comillas sin cerrar +@msg line {line}: value for `{var}` must match its variable kind línea {line}: el valor de `{var}` debe coincidir con el tipo de su variable +@msg lineEndings `{other}`: lf or crlf lineEndings `{other}`: lf o crlf +@msg loading profiles from disk isn't available in the browser cargar perfiles desde el disco no está disponible en el navegador +@msg margin: a {m} pt margin leaves no imageable area on the paper margin: un margen de {m} pt no deja área imprimible en el papel +@msg matrix must be finite and invertible, depth finite matrix debe ser finita e invertible, y depth finita +@msg matte: {e} matte: {e} +@msg member is for order front, forward, backward or back member es para order front, forward, backward o back +@msg missing `artboards` falta `artboards` +@msg missing `at` [x, y] falta `at` [x, y] +@msg missing `attrs` falta `attrs` +@msg missing `color` or `opacity` falta `color` u `opacity` +@msg missing `colors` falta `colors` +@msg missing `commands` falta `commands` +@msg missing `destinationFolder` falta `destinationFolder` +@msg missing `effect` id falta el id de `effect` +@msg missing `family` falta `family` +@msg missing `find` falta `find` +@msg missing `gid` (a glyph id, or null for the default glyph) falta `gid` (un id de glifo, o null para el glifo predeterminado) +@msg missing `group` falta `group` +@msg missing `id` falta `id` +@msg missing `id`: give one, or select one type object falta `id`: indica uno o selecciona un objeto de texto +@msg missing `index` (a point index, or null to clear) falta `index` (un índice de punto, o null para borrar) +@msg missing `index` (a stop index, or null to clear) falta `index` (un índice de parada, o null para borrar) +@msg missing `index` (an item index or null) falta `index` (un índice de elemento o null) +@msg missing `item` falta `item` +@msg missing `library` falta `library` +@msg missing `library` (see graphicStyle.libraries) falta `library` (consulta graphicStyle.libraries) +@msg missing `library` (see swatch.library.list) falta `library` (consulta swatch.library.list) +@msg missing `map` (rows [{from, to}] or {current}) falta `map` (filas [{from, to}] o {current}) +@msg missing `matrix` [a,b,c,d,e,f] falta `matrix` [a,b,c,d,e,f] +@msg missing `name` (see gradient.presets.list) falta `name` (consulta gradient.presets.list) +@msg missing `offset` (a distance in points) falta `offset` (una distancia en puntos) +@msg missing `path` falta `path` +@msg missing `path` (a path object id) falta `path` (un id de objeto de trazado) +@msg missing `rule` falta `rule` +@msg missing `source` id falta el id de `source` +@msg missing `start` (the byte offset of a character) falta `start` (el desplazamiento en bytes de un carácter) +@msg missing `status`: linked, embedded, missing or modified falta `status`: linked, embedded, missing o modified +@msg missing `target` id falta el id de `target` +@msg missing `text` falta `text` +@msg missing `to` falta `to` +@msg missing `to` (an index) falta `to` (un índice) +@msg missing `to`: a non-negative integer falta `to`: un entero no negativo +@msg missing `type` falta `type` +@msg missing `value` falta `value` +@msg missing `{key}` falta `{key}` +@msg missing `{k}` falta `{k}` +@msg missing anchor falta anchor +@msg missing anchors falta anchors +@msg missing anchors [[subpath, anchor]…] falta anchors [[subpath, anchor]…] +@msg missing array `{key}` falta la matriz `{key}` +@msg missing case falta case +@msg missing color falta color +@msg missing commands falta commands +@msg missing destination folder falta la carpeta de destino +@msg missing from falta from +@msg missing group falta group +@msg missing id or ids falta id o ids +@msg missing ids falta ids +@msg missing indexes falta indexes +@msg missing matrix [a,b,c,d,e,f] falta matrix [a,b,c,d,e,f] +@msg missing name falta name +@msg missing op falta op +@msg missing or invalid `color` `color` falta o no es válido +@msg missing or unknown `tool` `tool` falta o es desconocido +@msg missing point falta point +@msg missing point [x,y] falta point [x,y] +@msg missing point `{key}` ([x, y]) falta el punto `{key}` ([x, y]) +@msg missing points falta points +@msg missing points [[x,y]…] falta points [[x,y]…] +@msg missing segment falta segment +@msg missing stops falta stops +@msg missing subpaths falta subpaths +@msg missing target falta target +@msg missing to falta to +@msg missing x, y falta x, y +@msg mode is set, add or toggle, not `{other}` mode es set, add o toggle, no `{other}` +@msg mode must be "cmyk" or "rgb" mode debe ser "cmyk" o "rgb" +@msg mode must be area|onPath, got {o} mode debe ser area|onPath, se recibió {o} +@msg more than 10000 linked files: package dependencies in smaller parts más de 10000 archivos vinculados: empaqueta las dependencias en partes más pequeñas +@msg more than 256 commands más de 256 comandos +@msg more than {MAX_BATCH_FILES} data sets más de {MAX_BATCH_FILES} conjuntos de datos +@msg more than {MAX_BATCH_FILES} files más de {MAX_BATCH_FILES} archivos +@msg more than {MAX_CSV_ROWS} data rows más de {MAX_CSV_ROWS} filas de datos +@msg more than {MAX_FILES} images más de {MAX_FILES} imágenes +@msg more than {MAX_IMPORT} presets más de {MAX_IMPORT} preajustes +@msg moved must be [[x,y]…] moved debe ser [[x,y]…] +@msg name (a toolbar's name) is required name (el nombre de una barra de herramientas) es obligatorio +@msg name (a toolbar's name) must be a string name (el nombre de una barra de herramientas) debe ser una cadena +@msg name must be a toolbar's name name debe ser el nombre de una barra de herramientas +@msg names is empty names está vacío +@msg names must be an array of symbol names names debe ser una lista de nombres de símbolos +@msg need `anchor` or `segment` + `t` se necesita `anchor` o `segment` + `t` +@msg need at least one anchor se necesita al menos un punto de ancla +@msg need at least one point se necesita al menos un punto +@msg need at least two points se necesitan al menos dos puntos +@msg needs points necesita points +@msg nineSlice must be true or false nineSlice debe ser true o false +@msg nineSliceGuides must be [left, top, right, bottom], each -16..16, with left + right < 1 and top + bottom < 1 nineSliceGuides debe ser [left, top, right, bottom], cada uno -16..16, con left + right < 1 y top + bottom < 1 +@msg no PDF preset named `{n}` no hay ningún preajuste de PDF llamado `{n}` +@msg no action set is current no hay ningún conjunto de acciones actual +@msg no active data set no hay ningún conjunto de datos activo +@msg no appearance item {index} no existe el elemento de apariencia {index} +@msg no artboard {_1} no existe la mesa de trabajo {_1} +@msg no artboard {artboard} (0-based; the document has {_1}) no existe la mesa de trabajo {artboard} (empieza en 0; el documento tiene {_1}) +@msg no asset {id} no existe el recurso {id} +@msg no asset {id} (see assets.list) no existe el recurso {id} (consulta assets.list) +@msg no assets to export no hay recursos que exportar +@msg no assets yet: collect art for export first (assets.add) todavía no hay recursos: reúne antes ilustraciones para exportar (assets.add) +@msg no brush named `{n}` no hay ningún pincel llamado `{n}` +@msg no character at byte {start} no hay ningún carácter en el byte {start} +@msg no colour sin color +@msg no colour group `{group}` no existe el grupo de colores `{group}` +@msg no colour group `{name}` no existe el grupo de colores `{name}` +@msg no data sets no hay conjuntos de datos +@msg no dataset named `{from}` no hay ningún conjunto de datos llamado `{from}` +@msg no dataset named `{name}` no hay ningún conjunto de datos llamado `{name}` +@msg no datasets no hay conjuntos de datos +@msg no design named `{name}` no hay ningún diseño llamado `{name}` +@msg no design named `{n}` no hay ningún diseño llamado `{n}` +@msg no design named `{old}` no hay ningún diseño llamado `{old}` +@msg no encoder for {_1} yet todavía no hay codificador para {_1} +@msg no export preset `{name}` (see document.exportPresets.list) no existe el preajuste de exportación `{name}` (consulta document.exportPresets.list) +@msg no folder: pass `path` or set Preferences › Plug-ins & Scratch Disks › Additional Plug-ins Folder no hay carpeta: pasa `path` o define Preferencias › Plugins & Discos de memoria virtual › Carpeta de plugins adicionales +@msg no fonts to look for: they are all available no hay fuentes que buscar: todas están disponibles +@msg no formats to export no hay formatos que exportar +@msg no gradient preset `{name}` (see gradient.presets.list) no existe el preajuste de degradado `{name}` (consulta gradient.presets.list) +@msg no graphic style `{n}` in `{_1}` no existe el estilo gráfico `{n}` en `{_1}` +@msg no graphic style library `{key}` (see graphicStyle.libraries) no existe la biblioteca de estilos gráficos `{key}` (consulta graphicStyle.libraries) +@msg no guide selected no hay ninguna guía seleccionada +@msg no guide selected (or give an index) no hay ninguna guía seleccionada (o indica un índice) +@msg no guide {i} no existe la guía {i} +@msg no images in the folder no hay imágenes en la carpeta +@msg no item at index {_1} no hay ningún elemento en el índice {_1} +@msg no item at index {from} no hay ningún elemento en el índice {from} +@msg no item at one of the indices {idx} no hay ningún elemento en uno de los índices {idx} +@msg no layer no hay capa +@msg no layer {id} (see layer.list) no existe la capa {id} (consulta layer.list) +@msg no layers to export no hay capas que exportar +@msg no library `{key}` no existe la biblioteca `{key}` +@msg no metafile format no tiene formato de metarchivo +@msg no object {_1} no existe el objeto {_1} +@msg no objects no hay objetos +@msg no parent layer no hay capa principal +@msg no perspective grid preset named `{b}` (see perspective.presets.list) no hay ningún preajuste de cuadrícula de perspectiva llamado `{b}` (consulta perspective.presets.list) +@msg no perspective grid preset named `{n}` no hay ningún preajuste de cuadrícula de perspectiva llamado `{n}` +@msg no point selected (give `index`) no hay ningún punto seleccionado (indica `index`) +@msg no preset called `{from}` (see file.newPresets) no hay ningún preajuste llamado `{from}` (consulta file.newPresets) +@msg no preset called `{name}` (see file.newPresets) no hay ningún preajuste llamado `{name}` (consulta file.newPresets) +@msg no preset named `{n}` no hay ningún preajuste llamado `{n}` +@msg no print preset named `{b}` (see print.presets.list) no hay ningún preajuste de impresión llamado `{b}` (consulta print.presets.list) +@msg no print preset named `{name}` (presets: {_1}) no hay ningún preajuste de impresión llamado `{name}` (preajustes: {_1}) +@msg no print preset named `{n}` no hay ningún preajuste de impresión llamado `{n}` +@msg no profile named `{name}` no hay ningún perfil llamado `{name}` +@msg no readable files in the folder no hay archivos legibles en la carpeta +@msg no recovery copy `{f}` (see file.recovery.list) no existe la copia de recuperación `{f}` (consulta file.recovery.list) +@msg no rows no hay filas +@msg no saved PDF preset named `{name}` no hay ningún preajuste de PDF guardado llamado `{name}` +@msg no saved export preset `{name}` no existe el preajuste de exportación guardado `{name}` +@msg no saved gradient preset called {name} no hay ningún preajuste de degradado guardado llamado {name} +@msg no saved gradient presets no hay preajustes de degradado guardados +@msg no saved preset called `{name}` no hay ningún preajuste guardado llamado `{name}` +@msg no saved presets to export (name [Default] in `names` to export it) no hay preajustes guardados que exportar (nombra [Default] en `names` para exportarlo) +@msg no saved presets to export (name built-in ones in `names`) no hay preajustes guardados que exportar (nombra los integrados en `names`) +@msg no saved print preset named `{name}` no hay ningún preajuste de impresión guardado llamado `{name}` +@msg no saved profile called {name} no hay ningún perfil guardado llamado {name} +@msg no saved selection `{name}` no existe la selección guardada `{name}` +@msg no saved theme called {name} (see colorTheme.list) no hay ningún tema guardado llamado {name} (consulta colorTheme.list) +@msg no saved views no hay vistas guardadas +@msg no series {i} no existe la serie {i} +@msg no slice {n} in the image (see slice.list) no existe el sector {n} en la imagen (consulta slice.list) +@msg no source art no hay ilustración de origen +@msg no stop {i} (the gradient has {n}) no existe la parada {i} (el degradado tiene {n}) +@msg no style `{name}` no existe el estilo `{name}` +@msg no such assets (see assets.list) no existen esos recursos (consulta assets.list) +@msg no such frame anchor, or the frame would reach past the canvas no existe ese punto de ancla del marco, o el marco sobrepasaría el lienzo +@msg no such objects no existen esos objetos +@msg no such path anchor, or the path would reach past the canvas no existe ese punto de ancla del trazado, o el trazado sobrepasaría el lienzo +@msg no such rows no existen esas filas +@msg no swatch `{keep}` no existe la muestra `{keep}` +@msg no swatch `{n}` no existe la muestra `{n}` +@msg no swatch `{n}` (swatches and colour groups move separately) no existe la muestra `{n}` (las muestras y los grupos de colores se mueven por separado) +@msg no swatch library `{key}` (see swatch.library.list) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list) +@msg no swatch library `{key}` (see swatch.library.list; "document": the document's swatches) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list; "document": las muestras del documento) +@msg no swatch library `{key}` (see swatch.library.list; "{DOCUMENT_SWATCHES}": the document's swatches) no existe la biblioteca de muestras `{key}` (consulta swatch.library.list; "{DOCUMENT_SWATCHES}": las muestras del documento) +@msg no swatch named `{n}` no hay ninguna muestra llamada `{n}` +@msg no swatch or colour group `{n}` no existe la muestra ni el grupo de colores `{n}` +@msg no swatch or colour group `{n}` in `{_1}` no existe la muestra ni el grupo de colores `{n}` en `{_1}` +@msg no symbol named `{name}` no hay ningún símbolo llamado `{name}` +@msg no text objects selected no hay objetos de texto seleccionados +@msg no toolbar named `{_1}` no hay ninguna barra de herramientas llamada `{_1}` +@msg no toolbar named `{name}` no hay ninguna barra de herramientas llamada `{name}` +@msg no tracing preset `{preset}` (see imageTrace.presets) no existe el preajuste de calco `{preset}` (consulta imageTrace.presets) +@msg no user library folder here (save with a path, or without one to get the data) aquí no hay carpeta de bibliotecas de usuario (guarda con una ruta, o sin ella para obtener los datos) +@msg no variable named `{from}` no hay ninguna variable llamada `{from}` +@msg no variable named `{name}` no hay ninguna variable llamada `{name}` +@msg no variable named `{var}` no hay ninguna variable llamada `{var}` +@msg no variable named `{v}` no hay ninguna variable llamada `{v}` +@msg no view named `{name}` no hay ninguna vista llamada `{name}` +@msg node {_1} is not a graph el nodo {_1} no es un gráfico +@msg node {_1} is not an image el nodo {_1} no es una imagen +@msg node {_1} is not type el nodo {_1} no es texto +@msg not a PDF presets file (format `{_1}`) no es un archivo de preajustes de PDF (formato `{_1}`) +@msg not a PDF presets file: {e} no es un archivo de preajustes de PDF: {e} +@msg not a Word document: its WordDocument stream doesn't start with a file information block no es un documento de Word: su flujo WordDocument no empieza con un bloque de información de archivo +@msg not a Word document: its compound file has no WordDocument stream no es un documento de Word: su archivo compuesto no tiene flujo WordDocument +@msg not a Word document: its main part is not a WordprocessingML document no es un documento de Word: su parte principal no es un documento WordprocessingML +@msg not a Word document: its package has no main document part no es un documento de Word: su paquete no tiene parte de documento principal +@msg not a closed path no es un trazado cerrado +@msg not a flattener presets file (format `{_1}`) no es un archivo de preajustes de acoplador (formato `{_1}`) +@msg not a flattener presets file: {e} no es un archivo de preajustes de acoplador: {e} +@msg not a layer or group no es una capa ni un grupo +@msg not a library file: {e} no es un archivo de biblioteca: {e} +@msg not a mesh envelope point no es un punto de envolvente de malla +@msg not a perspective grid presets file (format `{_1}`) no es un archivo de preajustes de cuadrícula de perspectiva (formato `{_1}`) +@msg not a perspective grid presets file: {e} no es un archivo de preajustes de cuadrícula de perspectiva: {e} +@msg not a print presets file (format `{_1}`) no es un archivo de preajustes de impresión (formato `{_1}`) +@msg not a print presets file: {e} no es un archivo de preajustes de impresión: {e} +@msg not a stored or deflated central record no es un registro central almacenado ni comprimido con deflate +@msg not a valid SVGZ file: {e} no es un archivo SVGZ válido: {e} +@msg not an RTF file: it doesn't start with {\\rtf no es un archivo RTF: no empieza con {\\rtf +@msg not an image VectorCraft reads (see document.formats) no es una imagen que VectorCraft lea (consulta document.formats) +@msg not area type (text in a frame) outside perspective no es texto de área (texto en un marco) fuera de la perspectiva +@msg not editing an opacity mask no se está editando una máscara de opacidad +@msg not type on a path outside perspective no es texto en trazado fuera de la perspectiva +@msg nothing prints no se imprime nada +@msg nothing to bind nada que vincular +@msg nothing to change nada que cambiar +@msg nothing to change: give dx, dy, hScale, vScale or rotation nada que cambiar: indica dx, dy, hScale, vScale o rotation +@msg nothing to crop nada que recortar +@msg nothing to export nada que exportar +@msg nothing to export: the document has no visible art nada que exportar: el documento no tiene ilustración visible +@msg nothing to mark nada que marcar +@msg nothing to print: every artboard picked is blank nada que imprimir: todas las mesas de trabajo elegidas están en blanco +@msg nothing to print: the document has no art that prints nada que imprimir: el documento no tiene ilustración que se imprima +@msg object is not a path el objeto no es un trazado +@msg object transparency cannot be sampled onto highlighted characters; disable Transparency in Eyedropper Options or select the whole object la transparencia del objeto no se puede muestrear en los caracteres resaltados; desactiva Transparencia en Opciones de cuentagotas o selecciona el objeto completo +@msg object {_1} can't be set as point type el objeto {_1} no se puede establecer como texto de punto +@msg object {_1} has lost its file's contents: relink it el objeto {_1} perdió el contenido de su archivo: vuelve a vincularlo +@msg object {_1} has no path el objeto {_1} no tiene trazado +@msg object {_1} has no size el objeto {_1} no tiene tamaño +@msg object {_1} is hidden or locked, or on a locked artboard el objeto {_1} está oculto o bloqueado, o en una mesa de trabajo bloqueada +@msg object {_1} is not a placed document el objeto {_1} no es un documento colocado +@msg object {_1} is not an Intertwine group el objeto {_1} no es un grupo de Entrelazar +@msg object {_1} is not an image el objeto {_1} no es una imagen +@msg object {_1} is not an image or a linked file el objeto {_1} no es una imagen ni un archivo vinculado +@msg object {_1} is not an image or a placed document el objeto {_1} no es una imagen ni un documento colocado +@msg object {_1} is not in this Intertwine group el objeto {_1} no está en este grupo de Entrelazar +@msg object {_1} needs a 3D effect at index {index} el objeto {_1} necesita un efecto 3D en el índice {index} +@msg object {id} has anchors 0–{_1} for `corners`, not {past} el objeto {id} tiene los puntos de ancla 0–{_1} para `corners`, no {past} +@msg object {id} has {n} anchors, so no anchor {past} el objeto {id} tiene {n} puntos de ancla, así que no existe el punto de ancla {past} +@msg objects must be none, move or copy objects debe ser none, move o copy +@msg objects were left out se omitieron objetos +@msg offset out of range desplazamiento fuera de rango +@msg on must be true or false on debe ser true o false +@msg only groups, layers, type and images have a Contents (Characters) row solo los grupos, las capas, el texto y las imágenes tienen una fila Contenido (Caracteres) +@msg only interior mesh lines can be deleted solo se pueden eliminar las líneas de malla interiores +@msg only solid colours can be added (not gradients or patterns) solo se pueden agregar colores sólidos (no degradados ni motivos) +@msg only solid-colour swatches can be spot colours solo las muestras de color sólido pueden ser tintas planas +@msg only this Affinity file's embedded preview could be read: use File › Open to see it with its warning, or export SVG or PDF from Affinity first solo se pudo leer la vista previa incrustada de este archivo de Affinity: usa Archivo › Abrir para verla con su advertencia, o exporta antes SVG o PDF desde Affinity +@msg only this Affinity file's embedded preview could be read; use File › Open to see it with its warning solo se pudo leer la vista previa incrustada de este archivo de Affinity; usa Archivo › Abrir para verla con su advertencia +@msg onto, above, below, icon and a column place belong to window.panel.float and window.panel.dock onto, above, below, icon y una posición de columna corresponden a window.panel.float y window.panel.dock +@msg onto, above, below, icon and a column place take no anchor, side, zone or before onto, above, below, icon y una posición de columna no aceptan anchor, side, zone ni before +@msg onto, above, below, icon and a column place take no x, y, width or height onto, above, below, icon y una posición de columna no aceptan x, y, width ni height +@msg open a document to look for its linked files abre un documento para buscar sus archivos vinculados +@msg options must be an object (see file.formatOptions) options debe ser un objeto (consulta file.formatOptions) +@msg order must be leftToRight or rightToLeft order debe ser leftToRight o rightToLeft +@msg orientation must be portrait or landscape, not `{o}` orientation debe ser portrait o landscape, no `{o}` +@msg outlineText {v}: true or false outlineText {v}: true o false +@msg output intent profile: {e} perfil de calidad de salida: {e} +@msg output.destination: no RGB or CMYK profile is called “{name}” output.destination: ningún perfil RGB ni CMYK se llama “{name}” +@msg output.destination: {_1} files are CMYK, and “{name}” is an RGB profile output.destination: los archivos {_1} son CMYK, y “{name}” es un perfil RGB +@msg output.destination: {e} output.destination: {e} +@msg output.inks: no ink is set to print output.inks: ninguna tinta está configurada para imprimirse +@msg output.outputIntent: no profile is called “{name}”, and a {std} output intent embeds its profile output.outputIntent: ningún perfil se llama “{name}”, y una calidad de salida {std} incrusta su perfil +@msg output.outputIntent: no profile is called “{name}”: a {std} output intent embeds a profile, or names a registered printing condition (outputConditionId and registry) output.outputIntent: ningún perfil se llama “{name}”: una calidad de salida {std} incrusta un perfil o nombra una condición de impresión registrada (outputConditionId y registry) +@msg output.outputIntent: {std} files print in CMYK, and “{name}” is an RGB profile output.outputIntent: los archivos {std} se imprimen en CMYK, y “{name}” es un perfil RGB +@msg output.outputIntent: “{name}” is a grey profile, which can't be a {std} output intent output.outputIntent: “{name}” es un perfil de grises, que no puede ser una calidad de salida {std} +@msg overlap: {o} pt is half a tile or more overlap: {o} pt es medio mosaico o más +@msg overlapping Shaper paths must be in the same layer or group los trazados de Shaper superpuestos deben estar en la misma capa o el mismo grupo +@msg overlapping edits ediciones superpuestas +@msg page art conflicts with image data for {key} la ilustración de la página entra en conflicto con los datos de imagen de {key} +@msg page art conflicts with pattern {name} la ilustración de la página entra en conflicto con el motivo {name} +@msg page art conflicts with swatch {name} la ilustración de la página entra en conflicto con la muestra {name} +@msg page art is missing image data for {key} a la ilustración de la página le faltan los datos de imagen de {key} +@msg page art is missing pattern {name} a la ilustración de la página le falta el motivo {name} +@msg page art is missing swatch {name} a la ilustración de la página le falta la muestra {name} +@msg page must be a whole number from 1 page debe ser un número entero a partir de 1 +@msg page thumbnail: {e} miniatura de página: {e} +@msg page {page} of the PDF has no objects la página {page} del PDF no tiene objetos +@msg page {page}: `{file}` has {n} {artboards} página {page}: `{file}` tiene {n} {artboards} +@msg page {page}: `{name}` has {n} {pages} página {page}: `{name}` tiene {n} {pages} +@msg pages must be a range such as "2-3" or a page number, not {v} pages debe ser un intervalo como "2-3" o un número de página, no {v} +@msg pages: {e} pages: {e} +@msg panel position must be finite la posición del panel debe ser finita +@msg parameters must be an object los parámetros deben ser un objeto +@msg params must be an object params debe ser un objeto +@msg passwords can have up to {MAX_PASSWORD} bytes las contraseñas pueden tener hasta {MAX_PASSWORD} bytes +@msg path has no open end el trazado no tiene ningún extremo abierto +@msg paths must be strings paths deben ser cadenas +@msg pdfCompatible: false needs every artboard to keep the editable artwork pdfCompatible: false necesita que cada mesa de trabajo conserve la ilustración editable +@msg pdfs `{m}`: single or multiple pdfs `{m}`: single o multiple +@msg pickColorFrom is "artwork" or "swatches", not {v} pickColorFrom es "artwork" o "swatches", no {v} +@msg pins and moved must be non-empty lists of the same length pins y moved deben ser listas no vacías de la misma longitud +@msg pins must be [[x,y]…] pins debe ser [[x,y]…] +@msg pins must be finite pins deben ser finitos +@msg place is above, below or inside, not `{other}` place es above, below o inside, no `{other}` +@msg plane must be left|right|ground plane debe ser left|right|ground +@msg plane must be left|right|ground|none plane debe ser left|right|ground|none +@msg point is outside the mesh el punto está fuera de la malla +@msg points must be [t, left, right] with non-negative widths points debe ser [t, left, right] con anchuras no negativas +@msg points must be a non-empty [[x,y,pressure?]…] list points debe ser una lista [[x,y,pressure?]…] no vacía +@msg points must be a non-empty list of finite [x,y] points debe ser una lista no vacía de [x,y] finitos +@msg points must be an array or null points debe ser una matriz o null +@msg points must be finite points deben ser finitos +@msg points must be finite [x,y] pairs points deben ser pares [x,y] finitos +@msg points must contain 1–4096 coordinates points debe contener 1–4096 coordenadas +@msg position must be normal, superscript or subscript position debe ser normal, superscript o subscript +@msg position must be topLeft, topRight, bottomLeft or bottomRight position debe ser topLeft, topRight, bottomLeft o bottomRight +@msg positions must be between 0 and 100000 pt las posiciones deben estar entre 0 y 100000 pt +@msg ppi must be a positive number, not {ppi} ppi debe ser un número positivo, no {ppi} +@msg ppi must be between 1 and 2400 ppi debe estar entre 1 y 2400 +@msg preserve `{v}` is not transforms|bounds|fileDimensions|fit|fill preserve `{v}` no es transforms|bounds|fileDimensions|fit|fill +@msg preserveShape must be clippingMask|transparency preserveShape debe ser clippingMask|transparency +@msg preset `{id}`: mobile or density preajuste `{id}`: mobile o density +@msg preset must be standard, diffuse, topLeft or right preset debe ser standard, diffuse, topLeft o right +@msg preset must be the name of a print preset preset debe ser el nombre de un preajuste de impresión +@msg previewMode must be default, pixel or overprint previewMode debe ser default, pixel u overprint +@msg print settings: {e} ajustes de impresión: {e} +@msg procedures nest too deeply los procedimientos se anidan a demasiada profundidad +@msg procedures nested too deeply procedimientos anidados a demasiada profundidad +@msg quotes must be {double?, single?} quotes debe ser {double?, single?} +@msg quotes.{k} must be an opening and a closing quote, e.g. "“”" quotes.{k} debe ser unas comillas de apertura y de cierre, p. ej. "“”" +@msg rasterEffectsPpi must be 1–2400 (72 screen, 150 medium, 300 high) rasterEffectsPpi debe ser 1–2400 (72 pantalla, 150 media, 300 alta) +@msg rating must be a whole number from 0 to {MAX_RATING} rating debe ser un número entero entre 0 y {MAX_RATING} +@msg rect and {k} contradict each other: give the area or the artboards rect y {k} se contradicen: indica el área o las mesas de trabajo +@msg rect applies to raster formats, not {_1} rect se aplica a formatos rasterizados, no a {_1} +@msg rect is [x, y, width, height] in points rect es [x, y, width, height] en puntos +@msg rect must be [x, y, width, height] rect debe ser [x, y, width, height] +@msg rect must be [x, y, width, height] with a positive width and height rect debe ser [x, y, width, height] con anchura y altura positivas +@msg rect needs finite numbers and a positive width and height rect necesita números finitos y anchura y altura positivas +@msg redraw needs id redraw necesita id +@msg redraw within must be a finite distance of 0 or more within de redraw debe ser una distancia finita de 0 o más +@msg registration must be 0..8 registration debe ser 0..8 +@msg release a layer or a group suelta una capa o un grupo +@msg replace keeps the replaced object's place and transform: drop template, at and rect replace conserva la posición y la transformación del objeto sustituido: quita template, at y rect +@msg replace: select the one object to replace replace: selecciona el objeto que quieres sustituir +@msg resolution must be a number or screen|medium|high resolution debe ser un número o screen|medium|high +@msg resolution must be between 1 and 2400 ppi resolution debe estar entre 1 y 2400 ppi +@msg rotation must be a number of degrees rotation debe ser un número de grados +@msg rotation must be finite rotation debe ser finito +@msg rows and cols must be 1..50 rows y cols deben ser 1..50 +@msg rows and columns must be 1..500 rows y columns deben ser 1..500 +@msg rows of objects whose appearances differ can't be reordered together las filas de objetos cuyas apariencias difieren no se pueden reordenar juntas +@msg save the document first: Package collects a saved document guarda antes el documento: Empaquetar reúne un documento guardado +@msg save the document first: copy puts the file in its folder guarda antes el documento: copy pone el archivo en su carpeta +@msg savedPreset: {e} savedPreset: {e} +@msg scale `{s}`: a factor such as 2x, a width (100w), a height (100h) or a resolution (72ppi) scale `{s}`: un factor como 2x, una anchura (100w), una altura (100h) o una resolución (72ppi) +@msg scale must be a number above 0, at most 64 scale debe ser un número mayor que 0 y como máximo 64 +@msg scale must be non-zero scale no debe ser cero +@msg scope must be selection or all (got {other}) scope debe ser selection o all (se recibió {other}) +@msg scribble is too long el garabato es demasiado largo +@msg segment does not exist el segmento no existe +@msg select a Shaper group selecciona un grupo de Shaper +@msg select a blend to set easing or color shift selecciona una fusión para definir la aceleración o el cambio de color +@msg select a compound shape selecciona una forma compuesta +@msg select a graph selecciona un gráfico +@msg select a group or layer with visible, unlocked members selecciona un grupo o una capa con miembros visibles y desbloqueados +@msg select a layer selecciona una capa +@msg select a path selecciona un trazado +@msg select a text object selecciona un objeto de texto +@msg select an image (or an Image Trace group) selecciona una imagen (o un grupo de Calco de imagen) +@msg select an image, or pass id selecciona una imagen o pasa id +@msg select an object (or pass `id`) selecciona un objeto (o pasa `id`) +@msg select an object with a freeform gradient selecciona un objeto con un degradado de forma libre +@msg select an object with an opacity mask selecciona un objeto con una máscara de opacidad +@msg select area type selecciona texto de área +@msg select area type (text in a frame) selecciona texto de área (texto en un marco) +@msg select area type and closed paths (at least one area type object) selecciona texto de área y trazados cerrados (al menos un objeto de texto de área) +@msg select area type whose first line can fit its frame selecciona texto de área cuya primera línea quepa en su marco +@msg select artwork to add its colours selecciona ilustraciones para agregar sus colores +@msg select artwork to make a group of its colours selecciona ilustraciones para crear un grupo con sus colores +@msg select artwork to recolour, or give a colour `group` selecciona ilustraciones para volver a colorear, o indica un `group` de colores +@msg select exactly two path ends to join selecciona exactamente dos extremos de trazado para unirlos +@msg select members of a compound shape selecciona miembros de una forma compuesta +@msg select objects or give ids selecciona objetos o indica ids +@msg select objects to align to the guide selecciona objetos para alinearlos con la guía +@msg select one Intertwine group selecciona un grupo de Entrelazar +@msg select one image or pass id selecciona una imagen o pasa id +@msg select paths selecciona trazados +@msg select paths or compound paths selecciona trazados o trazados compuestos +@msg select rows or objects to collect selecciona filas u objetos para reunirlos +@msg select something to export selecciona algo que exportar +@msg select something to export (or turn off selectedOnly) selecciona algo que exportar (o desactiva selectedOnly) +@msg select text to redefine the style from selecciona el texto a partir del que redefinir el estilo +@msg select the art and, on top of it, the mask object selecciona la ilustración y, encima de ella, el objeto de máscara +@msg select the art for the design selecciona la ilustración para el diseño +@msg select the art for the pattern tile selecciona la ilustración para el mosaico del motivo +@msg select the art to add first selecciona antes la ilustración que quieres agregar +@msg select the art to collect (or give its ids) selecciona la ilustración que quieres reunir (o indica sus ids) +@msg select the content and a path on top selecciona el contenido y un trazado encima +@msg select the images to relink, or pass ids selecciona las imágenes que quieres volver a vincular o pasa ids +@msg select the images, or pass ids selecciona las imágenes o pasa ids +@msg select the linked images or placed documents, or pass ids selecciona las imágenes vinculadas o los documentos colocados, o pasa ids +@msg select the object to copy from selecciona el objeto desde el que copiar +@msg select the objects (or give their ids) selecciona los objetos (o indica sus ids) +@msg select the objects to attach to the path selecciona los objetos que quieres unir al trazado +@msg select the objects to bind selecciona los objetos que quieres vincular +@msg select two or more objects to intertwine selecciona dos o más objetos para entrelazarlos +@msg select two or more slices to combine selecciona dos o más sectores para combinarlos +@msg select type on a path selecciona texto en trazado +@msg selection `{m}`: one or each selección `{m}`: one o each +@msg settings is an object of document.exportForScreens params settings es un objeto de parámetros de document.exportForScreens +@msg settings must be an object settings debe ser un objeto +@msg show `{show}`: all, missing, modified or embedded show `{show}`: all, missing, modified o embedded +@msg show must be true or false show debe ser true o false +@msg size must be "small", "medium", "large" or a number of points over 0 up to {_1} size debe ser "small", "medium", "large" o un número de puntos mayor que 0 y de hasta {_1} +@msg size must be positive size debe ser positivo +@msg sizeMode is "fixed" or "pressure", not `{other}` sizeMode es "fixed" o "pressure", no `{other}` +@msg sizeMode is "fixed" or "pressure", not {other} sizeMode es "fixed" o "pressure", no {other} +@msg sizeVariation must be 0 or more sizeVariation debe ser 0 o más +@msg smallCaps must be true or false smallCaps debe ser true o false +@msg sort `{x}`: name, kind or status sort `{x}`: name, kind o status +@msg source paths are too large for Shaper los trazados de origen son demasiado grandes para Shaper +@msg spot, mode and group apply to solid colours only spot, mode y group solo se aplican a colores sólidos +@msg status `{s}`: linked, embedded, missing or modified status `{s}`: linked, embedded, missing o modified +@msg steps must be 1..1000 steps debe ser 1..1000 +@msg steps must be 1..{MAX_STEPS} steps debe ser 1..{MAX_STEPS} +@msg stop {i}: `plates` must be four numbers from 0 to 1 (C, M, Y, K) parada {i}: `plates` debe ser cuatro números entre 0 y 1 (C, M, Y, K) +@msg stopped before the archive was finished se detuvo antes de terminar el archivo comprimido +@msg strokeMode must be within|along|across, got {m} strokeMode debe ser within|along|across, se recibió {m} +@msg strokeOptions must be an object of stroke.set options strokeOptions debe ser un objeto de opciones de stroke.set +@msg strokeWidth must be a positive number of pixels strokeWidth debe ser un número positivo de píxeles +@msg subpath {si} is not an open subpath el subtrazado {si} no es un subtrazado abierto +@msg subpaths required when joining the same path se requieren subpaths al unir el mismo trazado +@msg swatchConflict must be "merge" or "add", not {v} swatchConflict debe ser "merge" o "add", no {v} +@msg text must be {characterSet?, platform?, removeLineReturns?, removeParagraphReturns?, replaceSpaces?} text debe ser {characterSet?, platform?, removeLineReturns?, removeParagraphReturns?, replaceSpaces?} +@msg text transform is collapsed or unrepresentable la transformación del texto está colapsada o no se puede representar +@msg text.replaceSpaces must be a whole number from 2 to 100 text.replaceSpaces debe ser un número entero entre 2 y 100 +@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: usa "{_1}" o "{_2}" +@msg textureImage: give {path} or {name, dataBase64} of an image file, or a texture as effect.list gives it textureImage: indica {path} o {name, dataBase64} de un archivo de imagen, o una textura tal como la da effect.list +@msg textureImage: {e} textureImage: {e} +@msg that makes more than {MAX_PIECES} slices eso genera más de {MAX_PIECES} sectores +@msg that object is not in the overlap ese objeto no está en la superposición +@msg the Affinity document has no page with a size el documento de Affinity no tiene ninguna página con tamaño +@msg the CMYK image couldn't be written no se pudo escribir la imagen CMYK +@msg the PDF security settings were saved without their passwords: give openPassword or permissionsPassword again, or security without passwordRequired to export unprotected los ajustes de seguridad del PDF se guardaron sin sus contraseñas: indica de nuevo openPassword o permissionsPassword, o security sin passwordRequired para exportar sin protección +@msg the RTF file has too many paragraphs or formatting changes to place as type (at most {MAX_PARAGRAPHS} paragraphs and {MAX_RUNS} runs) el archivo RTF tiene demasiados párrafos o cambios de formato para colocarlo como texto (como máximo {MAX_PARAGRAPHS} párrafos y {MAX_RUNS} tramos) +@msg the RTF file is too large to place as type (at most {_1} MB) el archivo RTF es demasiado grande para colocarlo como texto (como máximo {_1} MB) +@msg the SVG expands to more than {0} nested SVG images el SVG se expande en más de {0} imágenes SVG anidadas +@msg the SVG expands to more than {0} objects el SVG se expande en más de {0} objetos +@msg the SVG has no drawable objects el SVG no tiene objetos que se puedan dibujar +@msg the SVGZ file unpacks to more than {_1} MB el archivo SVGZ se descomprime en más de {_1} MB +@msg the Word document has more than {MAX_PAGES} pages of properties, too many to place el documento de Word tiene más de {MAX_PAGES} páginas de propiedades, demasiadas para colocarlo +@msg the Word document has more than {MAX_RUNS} runs of character or paragraph properties, too many to place el documento de Word tiene más de {MAX_RUNS} tramos de propiedades de carácter o de párrafo, demasiados para colocarlo +@msg the Word document has more than {_1} MB of formatting properties, too many to place el documento de Word tiene más de {_1} MB de propiedades de formato, demasiadas para colocarlo +@msg the Word document has too much text or formatting to place as type (at most {MAX_PARAGRAPHS} paragraphs, {MAX_RUNS} runs and {_1} MB of text) el documento de Word tiene demasiado texto o formato para colocarlo como texto (como máximo {MAX_PARAGRAPHS} párrafos, {MAX_RUNS} tramos y {_1} MB de texto) +@msg the Word document has too much text to place as type (at most {_1} MB) el documento de Word tiene demasiado texto para colocarlo como texto (como máximo {_1} MB) +@msg the Word document is encrypted or protected with a password; save it without one to place it el documento de Word está cifrado o protegido con contraseña; guárdalo sin ella para colocarlo +@msg the Word document is too large to place (its {name} stream holds more than {_1} MB) el documento de Word es demasiado grande para colocarlo (su flujo {name} contiene más de {_1} MB) +@msg the Word document was last saved with fast save, which VectorCraft doesn't read; save it again with fast save turned off el documento de Word se guardó por última vez con guardado rápido, que VectorCraft no lee; guárdalo de nuevo con el guardado rápido desactivado +@msg the Word document was saved by Word 6.0 or Word 95, which VectorCraft doesn't read; save it as a Word 97-2003 document el documento de Word se guardó con Word 6.0 o Word 95, que VectorCraft no lee; guárdalo como documento de Word 97-2003 +@msg the Word document's text is made of more than {MAX_PIECES} pieces, too many to place el texto del documento de Word consta de más de {MAX_PIECES} piezas, demasiadas para colocarlo +@msg the action set ids are not a list los ids de los conjuntos de acciones no son una lista +@msg the active paint is not a gradient la pintura activa no es un degradado +@msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size las mesas de trabajo no caben en el lienzo: usa menos mesas de trabajo, menos espaciado o un tamaño más pequeño +@msg the character's size can't be measured no se puede medir el tamaño del carácter +@msg the compound shape is too complex to expand la forma compuesta es demasiado compleja para expandirla +@msg the container of the listed objects is gone ya no existe el contenedor de los objetos enumerados +@msg the copy `{user_id}` can't be read as a library la copia `{user_id}` no se puede leer como biblioteca +@msg the copy would leave the canvas la copia saldría del lienzo +@msg the cut cannot be made on this art: {e} no se puede hacer el corte en esta ilustración: {e} +@msg the data isn't an EMF or WMF picture los datos no son una imagen EMF ni WMF +@msg the data isn't an EPS or PostScript picture los datos no son una imagen EPS ni PostScript +@msg the deferred paste is no longer available el pegado diferido ya no está disponible +@msg the design is too big to draw at every data point of this graph el diseño es demasiado grande para dibujarlo en cada punto de datos de este gráfico +@msg the design is too big to draw in every column of this graph el diseño es demasiado grande para dibujarlo en cada columna de este gráfico +@msg the dialog it was opened over is no longer open el cuadro de diálogo sobre el que se abrió ya no está abierto +@msg the dictionary stack overflowed la pila de diccionarios se desbordó +@msg the editing data's hash has no place el hash de los datos de edición no tiene lugar +@msg the entities the document declares expand to too much text las entidades que declara el documento se expanden en demasiado texto +@msg the envelope's content has no bounds el contenido de la envolvente no tiene límites +@msg the envelope's mesh is malformed la malla de la envolvente está mal formada +@msg the file holds no `variableSets` element el archivo no contiene ningún elemento `variableSets` +@msg the file is larger than {_1} MB el archivo ocupa más de {_1} MB +@msg the file is too large el archivo es demasiado grande +@msg the file was updated or encrypted already el archivo ya se actualizó o cifró +@msg the first character of a line has no character before it to kern: it moves only up and down (dy) el primer carácter de una línea no tiene ningún carácter delante con el que aplicar kerning: solo se mueve hacia arriba y hacia abajo (dy) +@msg the font {_1} is not available la fuente {_1} no está disponible +@msg the format has no file extension el formato no tiene extensión de archivo +@msg the graphic can't be read: {e} no se puede leer el gráfico: {e} +@msg the graphic is empty el gráfico está vacío +@msg the graphic's data is damaged los datos del gráfico están dañados +@msg the graphic's document has no artboard el documento del gráfico no tiene mesa de trabajo +@msg the header `{cell}` for `{name}` would read back as the variable `{other}`: rename one of them el encabezado `{cell}` de `{name}` se volvería a leer como la variable `{other}`: cambia el nombre de uno de ellos +@msg the image `{path}` isn't followed: {r} no se sigue la imagen `{path}`: {r} +@msg the image has no embedded pixels la imagen no tiene píxeles incrustados +@msg the image is empty la imagen está vacía +@msg the image is fully transparent la imagen es totalmente transparente +@msg the image is not on an artboard; pass rect la imagen no está en una mesa de trabajo; pasa rect +@msg the image's pixels are missing faltan los píxeles de la imagen +@msg the image's pixels aren't in the document los píxeles de la imagen no están en el documento +@msg the image's pixels can't be read: {e} no se pueden leer los píxeles de la imagen: {e} +@msg the image's transparency doesn't fit it la transparencia de la imagen no se ajusta a ella +@msg the job would print more than {MAX_PAGES} pages el trabajo imprimiría más de {MAX_PAGES} páginas +@msg the job would print more than {_1} pages el trabajo imprimiría más de {_1} páginas +@msg the layers hold no art to mask las capas no contienen ilustración que enmascarar +@msg the layout moved el diseño se movió +@msg the library has a group `{name}` already la biblioteca ya tiene un grupo `{name}` +@msg the library has no group `{name}` la biblioteca no tiene ningún grupo `{name}` +@msg the library has no item `{item}` la biblioteca no tiene ningún elemento `{item}` +@msg the library has no item `{other}` la biblioteca no tiene ningún elemento `{other}` +@msg the library holds {MAX_GROUPS} groups already la biblioteca ya contiene {MAX_GROUPS} grupos +@msg the library holds {MAX_ITEMS} items of this kind already la biblioteca ya contiene {MAX_ITEMS} elementos de este tipo +@msg the name is empty el nombre está vacío +@msg the object has no fill, stroke or effect el objeto no tiene relleno, trazo ni efecto +@msg the object has no graphic style (pass `name`) el objeto no tiene estilo gráfico (pasa `name`) +@msg the objects don't match the plan los objetos no coinciden con el plan +@msg the open and permissions passwords must differ las contraseñas de apertura y de permisos deben ser distintas +@msg the operand stack overflowed la pila de operandos se desbordó +@msg the page has no area la página no tiene área +@msg the page's type in an unread object's box isn't in its page art el texto de la página en el cuadro de un objeto no leído no está en la ilustración de su página +@msg the paint behind the proxy is not a gradient la pintura detrás del proxy no es un degradado +@msg the parent must be a layer or sublayer el elemento principal debe ser una capa o subcapa +@msg the path can't be extended el trazado no se puede extender +@msg the path can't be inside one of the objects to attach el trazado no puede estar dentro de uno de los objetos que se van a unir +@msg the path has no segments to measure el trazado no tiene segmentos que medir +@msg the path is empty el trazado está vacío +@msg the path is too short to shorten that much el trazado es demasiado corto para acortarlo tanto +@msg the picture has no objects la imagen no tiene objetos +@msg the program runs too long el programa se ejecuta durante demasiado tiempo +@msg the program uses too much memory el programa usa demasiada memoria +@msg the rectangle must have a width and a height el rectángulo debe tener anchura y altura +@msg the rectangle needs a size and must lie on the canvas el rectángulo necesita un tamaño y debe estar en el lienzo +@msg the selected art has no width la ilustración seleccionada no tiene anchura +@msg the selection draws nothing la selección no dibuja nada +@msg the selection has no area la selección no tiene área +@msg the selection has no art to export la selección no tiene ilustración que exportar +@msg the selection has no bounds la selección no tiene límites +@msg the selection has no graphic style la selección no tiene estilo gráfico +@msg the slice would leave the canvas el sector saldría del lienzo +@msg the spot colour couldn't be added no se pudo agregar la tinta plana +@msg the subpath has no ends to extend (it is closed or a single point) el subtrazado no tiene extremos que extender (está cerrado o es un solo punto) +@msg the symbols are nested too deeply to expand their instances los símbolos están anidados a demasiada profundidad para expandir sus instancias +@msg the text file is too large to place as type (at most {_1} MB) el archivo de texto es demasiado grande para colocarlo como texto (como máximo {_1} MB) +@msg the text is empty el texto está vacío +@msg the text is over {_1} MB el texto ocupa más de {_1} MB +@msg the top object must be a path el objeto superior debe ser un trazado +@msg the trace was cancelled se canceló el calco +@msg the trailer has no size el trailer no tiene tamaño +@msg the type object is flattened to nothing el objeto de texto se acopla en nada +@msg the value of axis `{tag}` must be a number or null el valor del eje `{tag}` debe ser un número o null +@msg the variable library declares more than {MAX_LIBRARY_DATASETS} data sets la biblioteca de variables declara más de {MAX_LIBRARY_DATASETS} conjuntos de datos +@msg the variable library declares more than {MAX_LIBRARY_ENTITIES} entities la biblioteca de variables declara más de {MAX_LIBRARY_ENTITIES} entidades +@msg the variable library declares more than {MAX_LIBRARY_VARIABLES} variables la biblioteca de variables declara más de {MAX_LIBRARY_VARIABLES} variables +@msg the variable library declares no variables la biblioteca de variables no declara variables +@msg the variable library is larger than {MAX_LIBRARY_BYTES} bytes la biblioteca de variables ocupa más de {MAX_LIBRARY_BYTES} bytes +@msg the variable library is not UTF-8 la biblioteca de variables no está en UTF-8 +@msg the variable library is not well-formed XML: {e} la biblioteca de variables no es XML bien formado: {e} +@msg the variable library nests elements more than {MAX_LIBRARY_NESTING} deep la biblioteca de variables anida elementos a más de {MAX_LIBRARY_NESTING} niveles +@msg the variable library's document type declaration holds something other than entities of plain text la declaración de tipo de documento de la biblioteca de variables contiene algo distinto de entidades de texto sin formato +@msg the variable library's entities expand to more than {MAX_LIBRARY_BYTES} bytes las entidades de la biblioteca de variables se expanden en más de {MAX_LIBRARY_BYTES} bytes +@msg the window has no dock la ventana no tiene acoplamiento +@msg the written PDF has no catalog el PDF escrito no tiene catálogo +@msg the written PDF has no cross-reference table el PDF escrito no tiene tabla de referencias cruzadas +@msg the written PDF's metadata can't be edited no se pueden editar los metadatos del PDF escrito +@msg there are no colour swatches to draw no hay muestras de color que dibujar +@msg there is already a design named `{name}` ya hay un diseño llamado `{name}` +@msg there is already a design named `{to}` ya hay un diseño llamado `{to}` +@msg there is already a toolbar named `{name}` ya hay una barra de herramientas llamada `{name}` +@msg there is already a toolbar named `{to}` ya hay una barra de herramientas llamada `{to}` +@msg there is no library: create one first no hay ninguna biblioteca: crea antes una +@msg these paths are too degenerate for Shaper estos trazados están demasiado degenerados para Shaper +@msg thumbnail: no page {v} (the {what} has {count}) miniatura: no existe la página {v} ({what} tiene {count}) +@msg tileRange of {what}: {e} tileRange de {what}: {e} +@msg title can't be empty title no puede estar vacío +@msg to (the new name) is required to (el nombre nuevo) es obligatorio +@msg to must be fill or stroke to debe ser fill o stroke +@msg to must be smooth or corner to debe ser smooth o corner +@msg too large for a zip archive: package to a folder demasiado grande para un archivo zip: empaqueta en una carpeta +@msg too many Shaper edits demasiadas ediciones de Shaper +@msg too many `points` (at most 100000) demasiados `points` (como máximo 100000) +@msg too many characters: at most {MAX_CHARS} demasiados caracteres: como máximo {MAX_CHARS} +@msg too many dots for this size: lower the frequency demasiados puntos para este tamaño: reduce la frecuencia +@msg too many filters over one file demasiados filtros sobre un archivo +@msg too many overlapping paths for Shaper demasiados trazados superpuestos para Shaper +@msg too many saved clips demasiados recortes guardados +@msg too many saved graphics states demasiados estados gráficos guardados +@msg toolbar (a toolbar's name) must be a string toolbar (el nombre de una barra de herramientas) debe ser una cadena +@msg toolbar name can't be empty el nombre de la barra de herramientas no puede estar vacío +@msg transparentImages {v}: "flatten" (the default) or "omit" transparentImages {v}: "flatten" (el predeterminado) u "omit" +@msg two saved selections would be named `{_1}` dos selecciones guardadas se llamarían `{_1}` +@msg type dimension cannot be represented with this text transform la dimensión del texto no se puede representar con esta transformación de texto +@msg type dimension must be finite la dimensión del texto debe ser finita +@msg unexpected resources recursos inesperados +@msg unknown CMYK profile `{name}` perfil CMYK desconocido `{name}` +@msg unknown File Info field `{k}` campo de Información de archivo desconocido `{k}` +@msg unknown OpenType feature `{t}` in featureChanges (the tags `features` takes) función OpenType desconocida `{t}` en featureChanges (las etiquetas que acepta `features`) +@msg unknown PDF preset `{name}` (presets: {_1}) preajuste de PDF desconocido `{name}` (preajustes: {_1}) +@msg unknown Warp style estilo de Deformación desconocido +@msg unknown alignToPath `{a}` alignToPath desconocido `{a}` +@msg unknown arrowhead {v} punta de flecha desconocida {v} +@msg unknown artboardLayout key `{k}` (layout, columns, spacing, rightToLeft) clave de artboardLayout desconocida `{k}` (layout, columns, spacing, rightToLeft) +@msg unknown attribute `{attribute}` atributo desconocido `{attribute}` +@msg unknown attribute `{k}` atributo desconocido `{k}` +@msg unknown axis `{other}` (vertical|horizontal|free) eje desconocido `{other}` (vertical|horizontal|free) +@msg unknown blend mode `{b}` modo de fusión desconocido `{b}` +@msg unknown blend mode {b} modo de fusión desconocido {b} +@msg unknown brush type `{o}` tipo de pincel desconocido `{o}` +@msg unknown category `{c}` categoría desconocida `{c}` +@msg unknown category `{c}` ({_1}) categoría desconocida `{c}` ({_1}) +@msg unknown character `{c}` carácter desconocido `{c}` +@msg unknown character style number field campo numérico de estilo de carácter desconocido +@msg unknown effect `{e}` efecto desconocido `{e}` +@msg unknown end {e} extremo desconocido {e} +@msg unknown flattenerPreset `{name}` (High Resolution, Medium Resolution, Low Resolution or a saved one: see flattener.presets.list) flattenerPreset desconocido `{name}` (High Resolution, Medium Resolution, Low Resolution o uno guardado: consulta flattener.presets.list) +@msg unknown format `{f}` (vcswatches, gpl, ase or css) formato desconocido `{f}` (vcswatches, gpl, ase o css) +@msg unknown from {f} from desconocido {f} +@msg unknown graph type `{t}` tipo de gráfico desconocido `{t}` +@msg unknown grid colours `{name}` (one of {_1}) colores de cuadrícula desconocidos `{name}` (uno de {_1}) +@msg unknown gridType `{t}` gridType desconocido `{t}` +@msg unknown highlight `{v}` resaltado desconocido `{v}` +@msg unknown intent `{i}` interpretación desconocida `{i}` +@msg unknown issue kind {id} tipo de problema desconocido {id} +@msg unknown issue kind {v} tipo de problema desconocido {v} +@msg unknown knockout state {k} estado de cobertura desconocido {k} +@msg unknown language `{language}` (one of {_1}) idioma desconocido `{language}` (uno de {_1}) +@msg unknown language `{l}` (one of {_1}) idioma desconocido `{l}` (uno de {_1}) +@msg unknown method `{m}` ({_1}) método desconocido `{m}` ({_1}) +@msg unknown mode `{other}` (gray, rgb, hsb, lab, cmyk or web) modo desconocido `{other}` (gray, rgb, hsb, lab, cmyk o web) +@msg unknown mode `{other}` (mono|cmyk) modo desconocido `{other}` (mono|cmyk) +@msg unknown mode `{other}` (rgb|cmyk|gray|global) modo desconocido `{other}` (rgb|cmyk|gray|global) +@msg unknown mode `{other}` (set, add, subtract) modo desconocido `{other}` (set, add, subtract) +@msg unknown mode `{o}` modo desconocido `{o}` +@msg unknown mode {m} modo desconocido {m} +@msg unknown model `{other}` modelo desconocido `{other}` +@msg unknown model `{other}` (keep, new or document) modelo desconocido `{other}` (keep, new o document) +@msg unknown op {o} op desconocido {o} +@msg unknown order `{o}`: toggle, front, forward, backward or back order desconocido `{o}`: toggle, front, forward, backward o back +@msg unknown overprints `{v}` (preserve, simulate or discard) overprints desconocido `{v}` (preserve, simulate o discard) +@msg unknown panel panel desconocido +@msg unknown pieLegend `{v}` (none, standard or wedges) pieLegend desconocido `{v}` (none, standard o wedges) +@msg unknown piePosition `{v}` (even, ratio or stacked) piePosition desconocido `{v}` (even, ratio o stacked) +@msg unknown pieSort `{v}` (none, all or first) pieSort desconocido `{v}` (none, all o first) +@msg unknown plate `{n}` plancha desconocida `{n}` +@msg unknown preference `{k}` preferencia desconocida `{k}` +@msg unknown profile {id} (see stroke.widthProfile.list) perfil desconocido {id} (consulta stroke.widthProfile.list) +@msg unknown proof target `{t}` destino de prueba desconocido `{t}` +@msg unknown quotes key `{k}` (double, single) clave de quotes desconocida `{k}` (double, single) +@msg unknown resolution `{v}` resolución desconocida `{v}` +@msg unknown rule `{rule}` ({_1}) regla desconocida `{rule}` ({_1}) +@msg unknown rule `{r}` (see color.harmony) regla desconocida `{r}` (consulta color.harmony) +@msg unknown setting `{k}` ajuste desconocido `{k}` +@msg unknown shape `{v}` (circle|ellipse|square|diamond|line) forma desconocida `{v}` (circle|ellipse|square|diamond|line) +@msg unknown spacing `{o}` (smooth|steps|distance) espaciado desconocido `{o}` (smooth|steps|distance) +@msg unknown tileType `{t}` ({_1}) tileType desconocido `{t}` ({_1}) +@msg unknown units unidades desconocidas +@msg unknown units `{u}` unidades desconocidas `{u}` +@msg unknown value axis `{v}` (left, right or both) eje de valores desconocido `{v}` (left, right o both) +@msg unknown variation `{v}` (tintsShades|warmCool|vividMuted) variación desconocida `{v}` (tintsShades|warmCool|vividMuted) +@msg unknown warp style `{s}` estilo de deformación desconocido `{s}` +@msg unknown {key} `{v}` (none, short or full) {key} desconocido `{v}` (none, short o full) +@msg unknown {key} profile `{n}` perfil {key} desconocido `{n}` +@msg unknown {k} key `{key}` (size, position) clave de {k} desconocida `{key}` (size, position) +@msg unreadable object objeto ilegible +@msg unsafe destination file name nombre de archivo de destino no seguro +@msg use paths or compound paths usa trazados o trazados compuestos +@msg useArtboards must be true or false, not {v} useArtboards debe ser true o false, no {v} +@msg value for `{var}` must match its variable kind el valor de `{var}` debe coincidir con el tipo de su variable +@msg variable `{_1}` is already defined la variable `{_1}` ya está definida +@msg variable `{name}` has no `trait` la variable `{name}` no tiene `trait` +@msg variable `{name}` is already defined la variable `{name}` ya está definida +@msg variable `{name}` is declared twice la variable `{name}` se declara dos veces +@msg variable `{to}` already exists ya existe la variable `{to}` +@msg view is required view es obligatorio +@msg view must be one of {_1} view debe ser uno de {_1} +@msg warpStyle can only edit an applied Warp effect warpStyle solo puede editar un efecto Deformación aplicado +@msg width and height must be more than 0 and at most {limit} width y height deben ser mayores que 0 y como máximo {limit} +@msg width factors must be finite los factores de anchura deben ser finitos +@msg width must be positive width debe ser positivo +@msg width out of range width fuera de rango +@msg width/height must be > 0 width/height deben ser > 0 +@msg x and y must be finite numbers x e y deben ser números finitos +@msg x and y must be given together x e y deben indicarse juntos +@msg zone needs an anchor: dock beside a panel with anchor, or in a new dock column with side (Start or End) zone necesita un anchor: acopla junto a un panel con anchor, o en una nueva columna de acoplamiento con side (Start o End) +@msg zoom must be positive zoom debe ser positivo +@msg {C}: no effect at index {list} {C}: no hay ningún efecto en el índice {list} +@msg {DEFAULT_PRESET} is protected and stays {DEFAULT_PRESET} está protegido y se conserva +@msg {DEFAULT_PRESET} is protected: save the settings under another name {DEFAULT_PRESET} está protegido: guarda los ajustes con otro nombre +@msg {LABEL} produced an empty result {LABEL} produjo un resultado vacío +@msg {_1} MB of document, at most {_2} MB {_1} MB de documento, como máximo {_2} MB +@msg {_1} MB of images, at most {_2} MB {_1} MB de imágenes, como máximo {_2} MB +@msg {_1} bytes of RGBA data for a {width} × {height} image {_1} bytes de datos RGBA para una imagen de {width} × {height} +@msg {_1} can't be read, or changed since it was read: relink or update it first {_1} no se puede leer o cambió desde que se leyó: vuelve a vincularlo o actualízalo antes +@msg {_1} can't go into {into} {_1} no puede ir dentro de {into} +@msg {_1} can't limit printing to low resolution: choose PDF 1.4 or later, or allow high-resolution printing {_1} no puede limitar la impresión a baja resolución: elige PDF 1.4 o posterior, o permite la impresión en alta resolución +@msg {_1} files can't be opened yet todavía no se pueden abrir archivos {_1} +@msg {_1} files can't be password-protected: remove the passwords or choose no standard los archivos {_1} no se pueden proteger con contraseña: quita las contraseñas o no elijas ningún estándar +@msg {_1} files can't be {_2} los archivos {_1} no pueden ser {_2} +@msg {_1} files can't carry editing data: turn off preserveEditing los archivos {_1} no pueden contener datos de edición: desactiva preserveEditing +@msg {_1} files can't have PDF layers: turn off createLayers los archivos {_1} no pueden tener capas PDF: desactiva createLayers +@msg {_1} files need a creation date, and this platform has no clock to give one los archivos {_1} necesitan una fecha de creación, y esta plataforma no tiene un reloj que la dé +@msg {_1} isn't a path {_1} no es un trazado +@msg {_1} options: {e} opciones de {_1}: {e} +@msg {_1} paints nothing to rasterize {_1} no pinta nada que rasterizar +@msg {_1} passwords can have up to {MAX_LEGACY_PASSWORD} ASCII characters (PDF 1.7 and later take any) las contraseñas de {_1} pueden tener hasta {MAX_LEGACY_PASSWORD} caracteres ASCII (PDF 1.7 y posteriores aceptan cualquiera) +@msg {_1} with linked images or an image map writes several files: use document.export {_1} con imágenes vinculadas o un mapa de imagen escribe varios archivos: usa document.export +@msg {_1} writes one file per artboard here: use document.export, or name one artboard {_1} escribe aquí un archivo por mesa de trabajo: usa document.export o nombra una mesa de trabajo +@msg {_1} × {_2} pixels is too large for {_3} (at most {max} pixels a side): lower the scale {_1} × {_2} píxeles es demasiado grande para {_3} (como máximo {max} píxeles por lado): reduce la escala +@msg {_1}: belongs to another account {_1}: pertenece a otra cuenta +@msg {_1}: not a folder of its own {_1}: no es una carpeta propia +@msg {_1}: not a plain file {_1}: no es un archivo normal +@msg {dest}: {e} {dest}: {e} +@msg {doc} has no folder {doc} no tiene carpeta +@msg {file} isn't linked {file} no está vinculado +@msg {folder} is not a package folder {folder} no es una carpeta de paquete +@msg {folder}: more than {max} files and folders {folder}: más de {max} archivos y carpetas +@msg {folder}: {e} {folder}: {e} +@msg {g} is not a Live Paint group {g} no es un grupo de Pintura interactiva +@msg {id} is not a slice {id} no es un sector +@msg {key} must be 0–{MAX_ADD_AROUND} pt {key} debe ser 0–{MAX_ADD_AROUND} pt +@msg {key} must be [x,y] {key} debe ser [x,y] +@msg {key} must be a percentage {min}..100 {key} debe ser un porcentaje {min}..100 +@msg {key} must be a positive number, not {n} {key} debe ser un número positivo, no {n} +@msg {key} must be a positive number, not {v} {key} debe ser un número positivo, no {v} +@msg {key} must be one of {_1} {key} debe ser uno de {_1} +@msg {key} must be {_1}, got {s} {key} debe ser {_1}, se recibió {s} +@msg {key} must name a floating panel {key} debe nombrar un panel flotante +@msg {key} must name a panel in another group {key} debe nombrar un panel de otro grupo +@msg {key} must name a panel that shows {key} debe nombrar un panel que se muestre +@msg {key} must name a registered panel {key} debe nombrar un panel registrado +@msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) los archivos {kind} no tienen transparencia, y el archivo tendría {what}: acóplalo antes (object.flattenTransparency) +@msg {kind} images can't be opened (see document.formats) las imágenes {kind} no se pueden abrir (consulta document.formats) +@msg {k} `{v}` is not one of the choices {k} `{v}` no es una de las opciones +@msg {k} has control characters{_1} {k} tiene caracteres de control{_1} +@msg {k} is too long (at most {MAX_TEXT} characters) {k} es demasiado largo (como máximo {MAX_TEXT} caracteres) +@msg {k} must be > 0 {k} debe ser > 0 +@msg {k} must be a number (pt) or a length such as "210 mm" {k} debe ser un número (pt) o una longitud como "210 mm" +@msg {k} must be a number from {min} to {max} {k} debe ser un número entre {min} y {max} +@msg {k} must be a number or "auto" {k} debe ser un número o "auto" +@msg {k} must be a string {k} debe ser una cadena +@msg {k} must be text {k} debe ser texto +@msg {k} must be true or false {k} debe ser true o false +@msg {k} must be {{size?, position?}} {k} debe ser {{size?, position?}} +@msg {k}: can't read `{s}` as a length {k}: no se puede leer `{s}` como una longitud +@msg {label} must be a number at most {max} {label} debe ser un número de como máximo {max} +@msg {label} must be a number from -1296 to 1296 {label} debe ser un número entre -1296 y 1296 +@msg {label} must be a number from 1 to 10000 {label} debe ser un número entre 1 y 10000 +@msg {name} `{s}`: {ids} {name} `{s}`: {ids} +@msg {name} is built in and can't be deleted {name} está integrado y no se puede eliminar +@msg {name}: CRC or size mismatch {name}: el CRC o el tamaño no coinciden +@msg {name}: only this Affinity file's embedded preview could be read; use File › Open to see it with its warning, or export SVG or PDF from Affinity before placing {name}: solo se pudo leer la vista previa incrustada de este archivo de Affinity; usa Archivo › Abrir para verla con su advertencia, o exporta SVG o PDF desde Affinity antes de colocarlo +@msg {name}: {e} {name}: {e} +@msg {native}; its embedded preview can't be read either ({e}) {native}; tampoco se puede leer su vista previa incrustada ({e}) +@msg {std} files are CMYK, and the file would have colours in {_1} los archivos {std} son CMYK, y el archivo tendría colores en {_1} +@msg {std} files embed their fonts, and the file would have one that isn't los archivos {std} incrustan sus fuentes, y el archivo tendría una que no lo está +@msg {target} is the file this document was read from, and reading it left things out ({what}): writing over it would lose them for good. Write another file instead, or pass acknowledgeLoss: true to replace it anyway {target} es el archivo desde el que se leyó este documento, y al leerlo se omitieron cosas ({what}): sobrescribirlo las perdería para siempre. Escribe otro archivo en su lugar o pasa acknowledgeLoss: true para sustituirlo de todos modos +@msg {ty} brushes need selected art (or params.{k}) los pinceles {ty} necesitan ilustración seleccionada (o params.{k}) +@msg {v} is not an asset id {v} no es un id de recurso +@msg {what} can't be intertwined {what} no se puede entrelazar +@msg {what} doesn't fit the paper with its bleed and marks {what} no cabe en el papel con su sangrado y sus marcas +@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} se imprimiría en más de {MAX_TILES} mosaicos: redúcelo +@msg Alignment must be one of the choices Alineación debe ser una de las opciones +@msg Line Gap must be a number Separación entre líneas debe ser un número +@msg `at` must be a point [x, y] `at` debe ser un punto [x, y] +@msg `points` must hold from 2 to 100000 points `points` debe contener entre 2 y 100000 puntos +@msg `rect` must be [x, y, width, height] `rect` debe ser [x, y, width, height] +@msg `tolerance` must be from 0 to 100 pt `tolerance` debe estar entre 0 y 100 pt +@msg `warichuAlign` must be one of {_1} `warichuAlign` debe ser uno de estos: {_1} +@msg `warichuLines` must be a whole number from {_1} to {_2} `warichuLines` debe ser un número entero entre {_1} y {_2} +@msg bad point {v}: expected [x, y] punto incorrecto {v}: se esperaba [x, y] +@msg give exactly one of `at`, `rect` and `points` indica exactamente uno de `at`, `rect` y `points` +@msg the line is too long, or the paths it passes too many, to check la línea es demasiado larga, o pasa por demasiados trazados, para comprobarla +@msg the paths are too many or too tangled to find where they cross hay demasiados trazados, o están demasiado enredados, para hallar sus cruces +@msg the rectangle or line reaches too many paths to check el rectángulo o la línea alcanza demasiados trazados para comprobarlos +@msg {name} must be a number {name} debe ser un número diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 43bfd50f1a..77ad0cbff1 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -1866,6 +1866,31 @@ fn messages_translate_by_template_and_their_parts() { assert_eq!(message(Lang::EN, nested), nested); } +/// Spanish shows the status and error messages of the script engine, the parameter checks, the +/// importers and the 3D effects in Spanish, with the values, names and command ids they carry kept. +#[test] +fn spanish_translates_engine_import_and_parameter_messages() { + let es = Lang::from_code("es").expect("registered"); + for (english, spanish) in [ + ("`colors` must be a whole number from 2 to 256", "`colors` debe ser un número entero entre 2 y 256"), + ("JSON.parse: oops (at offset 12)", "JSON.parse: oops (en el desplazamiento 12)"), + ("unknown mode `foo` (set, add, subtract)", "modo desconocido `foo` (set, add, subtract)"), + ( + "the Word document is encrypted or protected with a password; save it without one to place it", + "el documento de Word está cifrado o protegido con contraseña; guárdalo sin ella para colocarlo", + ), + ( + "object 7: with a depth of 0 the object has one face: map its graphics onto the front", + "objeto 7: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal", + ), + ("no custom arrowhead Fin (see stroke.arrowheads.list)", "no existe la punta de flecha personalizada Fin (consulta stroke.arrowheads.list)"), + ("`warichuLines` must be a whole number from 1 to 6", "`warichuLines` debe ser un número entero entre 1 y 6"), + ("the rectangle or line reaches too many paths to check", "el rectángulo o la línea alcanza demasiados trazados para comprobarlos"), + ] { + assert_eq!(message(es, english), spanish); + } +} + /// The note `recolor.apply` and the Edit Colors commands give when they leave out locked or hidden /// objects is translated whole, its counts included, in every complete-message language. #[test] diff --git a/docs/localization-parity.md b/docs/localization-parity.md index cd8dc33f30..02f4e96418 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -28,7 +28,7 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (604 messages) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,460 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists two messages whose placeholders sit side by side, which no catalog row can match) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; no gaps in the untranslated report | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | native review, layout and web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | | French | `fr` | 4,020 / 4,020 (100%) | all | Latin | no | full | — (review) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e7c1b28726..78746b4499 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -870,6 +870,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Hindi (2026-11-06): Hindi (`hi`): 7,877-row machine-assisted catalog, zero/one singular plurals, desktop font fallback and optional Devanagari craft-fonts fallback; all 55 translation tests pass; native review and a web font remain; scores and estimates unchanged. [Terminology and limitations](localization-hi.md). - Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged. - Hindi terms (2026-11-13): every row that names a variable (data merge, variable fonts and widths, environment variables) says वेरिएबल, and joining paths, anchor points, point type and lines says जोड़ें instead of शामिल हों, which stays for joining the community; a test checks both terms in every row; scores and estimates unchanged. + - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,840 of the 1,842 status and error messages the untranslated report listed for it; the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. - Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`). - Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md). - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). From e3ae1fb79fd9ff3548f6ffde6a165aad16b5428d Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Fri, 13 Nov 2026 16:01:07 -0800 Subject: [PATCH 020/247] i18n: Spanish leaves out the rows #7211, #7214 and #7116 add Open #7211, #7214 and #7116 add Spanish rows for 38 of the messages this branch translates. A second row for the same key fails bundled_catalogs_are_consistent once both sides merge, so this branch drops its 38 rows and leaves those messages to the other pull requests. The Spanish lines in docs/localization-parity.md and docs/target-app-parity.md give the new counts. --- crates/ui-egui/src/i18n/es.tsv | 38 ---------------------------------- docs/localization-parity.md | 2 +- docs/target-app-parity.md | 2 +- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c9a5e5dc08..54aeb60961 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7497,9 +7497,6 @@ breakText Glyphs Glifos @msg `{KEY}` must be a list `{KEY}` debe ser una lista @msg `{KEY}` takes at most {MAX_PARAGRAPH_INDENTS} entries (got {_1}) `{KEY}` acepta como máximo {MAX_PARAGRAPH_INDENTS} entradas (se recibió {_1}) @msg `{KEY}` takes no `{other}` beside it `{KEY}` no acepta `{other}` junto a él -@msg `{_1}` can't name a composite font `{_1}` no puede nombrar una fuente compuesta -@msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada -@msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} está compuesto en `{font}`, una fuente compuesta @msg `{base}` is larger than {_1} MB `{base}` ocupa más de {_1} MB @msg `{base}` is not in the DCS file's folder `{base}` no está en la carpeta del archivo DCS @msg `{key}` holds more than {MAX_EDIT_WORDS} words `{key}` contiene más de {MAX_EDIT_WORDS} palabras @@ -7518,20 +7515,13 @@ breakText Glyphs Glifos @msg `{key}` must name an object attached to the path of an Objects on Path group `{key}` debe nombrar un objeto unido al trazado de un grupo de Objetos en trazado @msg `{key}` names an object that is hidden or locked `{key}` nombra un objeto que está oculto o bloqueado @msg `{name}` is a file of its own, which can only be found next to the DCS file's path `{name}` es un archivo independiente, que solo se puede encontrar junto a la ruta del archivo DCS -@msg `{name}`: give the kanji part `{name}`: indica la parte kanji -@msg `{name}`: parts must be an object `{name}`: las partes deben ser un objeto -@msg `{name}`: unknown class `{k}`; the classes are kanji, kana, punctuation, symbols, roman and numerals `{name}`: clase desconocida `{k}`; las clases son kanji, kana, punctuation, symbols, roman y numerals -@msg `{name}`: unknown key `{k}` in {_1} `{name}`: clave desconocida `{k}` en {_1} -@msg `{name}`: {_1} must be an object `{name}`: {_1} debe ser un objeto @msg `{name}`: {_1}: {e} `{name}`: {_1}: {e} -@msg `{raw}` can't name a composite font (1 to {COMPOSITE_NAME_MAX} characters, no control characters) `{raw}` no puede nombrar una fuente compuesta (de 1 a {COMPOSITE_NAME_MAX} caracteres, sin caracteres de control) @msg `{u}` is no Unicode character `{u}` no es un carácter Unicode @msg `{word}` isn't in the custom dictionary `{word}` no está en el diccionario personalizado @msg a CMap has too many mappings un CMap tiene demasiadas asignaciones @msg a \\u escape needs four hexadecimal digits un escape \\u necesita cuatro dígitos hexadecimales @msg a comma in an XPath expression must separate function arguments una coma en una expresión XPath debe separar argumentos de función @msg a document holds at most {_1} SVG filters un documento contiene como máximo {_1} filtros SVG -@msg a document keeps at most {COMPOSITE_FONTS_MAX} composite fonts un documento guarda como máximo {COMPOSITE_FONTS_MAX} fuentes compuestas @msg a document with unsaved changes has no recovery copy un documento con cambios sin guardar no tiene copia de recuperación @msg a font's data is too large los datos de una fuente son demasiado grandes @msg a font's subroutines are too large las subrutinas de una fuente son demasiado grandes @@ -7579,15 +7569,11 @@ breakText Glyphs Glifos @msg character dimensions cannot be represented with the target text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de destino @msg continuation must be an array of path chunks continuation debe ser una lista de fragmentos de trazado @msg continuation requires points continuation requiere points -@msg dataBase64 is not base64 dataBase64 no está en base64 -@msg each font must be {name, parts} cada fuente debe ser {name, parts} -@msg each font needs a name cada fuente necesita un nombre @msg each path chunk must contain 1 to 4096 points cada fragmento de trazado debe contener entre 1 y 4096 puntos @msg each pick is {{at: [x, y]}} or {{rect: [x0, y0, x1, y1]}} (got {v}) cada elección es {{at: [x, y]}} o {{rect: [x0, y0, x1, y1]}} (se recibió {v}) @msg each weight must be a number of 0 or more (got {v}) cada peso debe ser un número de 0 o más (se recibió {v}) @msg finally table {t} out of range tabla finally {t} fuera de rango @msg flags cannot be given with a RegExp object no se pueden indicar indicadores con un objeto RegExp -@msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas @msg function declaration index out of range índice de declaración de función fuera de rango @msg give `char`, `text`, `code` or `unicode` indica `char`, `text`, `code` o `unicode` @msg give `count` or `spacing`, not both indica `count` o `spacing`, no ambos @@ -7595,10 +7581,8 @@ breakText Glyphs Glifos @msg give `path`, an SVG file, or `svg`, SVG text indica `path`, un archivo SVG, o `svg`, texto SVG @msg give `xml`, one SVG <filter> element indica `xml`, un elemento SVG <filter> @msg give exactly one of `path`, `data` and `dataBase64` indica exactamente uno de `path`, `data` y `dataBase64` -@msg give fonts: [{name, parts}…] indica fonts: [{name, parts}…] @msg give index or indexes, not both indica index o indexes, no ambos @msg give one <filter> element indica un elemento <filter> -@msg give one of path, data or dataBase64 indica uno de path, data o dataBase64 @msg give opacity or blend indica opacity o blend @msg handler at {_1} expects {_2} values but its range starts with {d} el controlador en {_1} espera {_2} valores, pero su rango empieza con {d} @msg handler depth too large profundidad de controlador demasiado grande @@ -7643,8 +7627,6 @@ breakText Glyphs Glifos @msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` @msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt @msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` -@msg names must be a list of names names debe ser una lista de nombres -@msg names must be strings names deben ser cadenas @msg needs a closing quote after the name necesita unas comillas de cierre después del nombre @msg needs a name necesita un nombre @msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes @@ -7656,9 +7638,6 @@ breakText Glyphs Glifos @msg no SVG filter at index {k} no hay ningún filtro SVG en el índice {k} @msg no arrowheads file here aquí no hay ningún archivo de puntas de flecha @msg no character has code {code} ningún carácter tiene el código {code} -@msg no composite font no hay ninguna fuente compuesta -@msg no composite font named `{n}` no hay ninguna fuente compuesta llamada `{n}` -@msg no composite fonts to export no hay fuentes compuestas que exportar @msg no custom arrowhead {name} (see stroke.arrowheads.list) no existe la punta de flecha personalizada {name} (consulta stroke.arrowheads.list) @msg no file to open no hay ningún archivo que abrir @msg no instructions sin instrucciones @@ -7670,8 +7649,6 @@ breakText Glyphs Glifos @msg node {_1} already has the text variable `{_2}` el nodo {_1} ya tiene la variable de texto `{_2}` @msg not a DCS file no es un archivo DCS @msg not a RegExp object no es un objeto RegExp -@msg not a composite fonts file: no compositeFonts list no es un archivo de fuentes compuestas: no hay lista compositeFonts -@msg not a composite fonts file: {e} no es un archivo de fuentes compuestas: {e} @msg not a regular expression no es una expresión regular @msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número @msg nothing to repeat nada que repetir @@ -7686,7 +7663,6 @@ breakText Glyphs Glifos @msg operand too large operando demasiado grande @msg order is a whole number from 0 to {others}, not `{v}` order es un número entero entre 0 y {others}, no `{v}` @msg path chunks must share their boundary point los fragmentos de trazado deben compartir su punto límite -@msg path is empty el trazado está vacío @msg pdfCompatible: false needs the artboards to keep the editable artwork when useArtboards is false pdfCompatible: false necesita que las mesas de trabajo conserven la ilustración editable cuando useArtboards es false @msg point x must be a number el punto x debe ser un número @msg point y must be a number el punto y debe ser un número @@ -7738,10 +7714,6 @@ breakText Glyphs Glifos @msg the document has no SVG filter named {r} el documento no tiene ningún filtro SVG llamado {r} @msg the document has no color swatches el documento no tiene muestras de color @msg the document's swatches hold {_1} colors; the document reduction takes at most 255 las muestras del documento contienen {_1} colores; la reducción del documento acepta como máximo 255 -@msg the file holds more than {COMPOSITE_FONTS_MAX} composite fonts el archivo contiene más de {COMPOSITE_FONTS_MAX} fuentes compuestas -@msg the file holds no composite fonts el archivo no contiene fuentes compuestas -@msg the file holds two composite fonts named `{_1}` el archivo contiene dos fuentes compuestas llamadas `{_1}` -@msg the file is larger than 4 MB el archivo ocupa más de 4 MB @msg the file isn't valid SVG: {e} el archivo no es un SVG válido: {e} @msg the file names no plate el archivo no nombra ninguna plancha @msg the function's prototype is not an object el prototipo de la función no es un objeto @@ -7787,10 +7759,8 @@ breakText Glyphs Glifos @msg toString is not a function toString no es una función @msg too many arguments demasiados argumentos @msg too many quantifiers demasiados cuantificadores -@msg two composite fonts are named `{_1}` dos fuentes compuestas se llaman `{_1}` @msg unknown OpenType feature `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; prefix - to turn off; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom and aalt take an alternate's number as `tag=N` with N from 0 to {_1}, as `salt=2`) función OpenType desconocida `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; antepón - para desactivarla; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom y aalt aceptan el número de una alternativa como `tag=N` con N entre 0 y {_1}, como `salt=2`) @msg unknown dither `{d}` (diffusion, pattern, noise or none) tramado desconocido `{d}` (diffusion, pattern, noise o none) -@msg unknown key `{k}`; a font takes name and parts clave desconocida `{k}`; una fuente acepta name y parts @msg unknown panel `{panel}` panel desconocido `{panel}` @msg unknown parameter `{key}` parámetro desconocido `{key}` @msg unknown parameter `{within}settings.{format}`; {why} parámetro desconocido `{within}settings.{format}`; {why} @@ -7810,13 +7780,7 @@ breakText Glyphs Glifos @msg {k}: a custom arrowhead's path needs an area to fill and at most {most} anchors and {most} subpaths, each anchor within {far} head units of its tip {k}: el trazado de una punta de flecha personalizada necesita un área que rellenar y como máximo {most} puntos de ancla y {most} subtrazados, cada punto de ancla a no más de {far} unidades de cabeza de su punta @msg {k}: bad custom arrowhead path: {e} {k}: trazado de punta de flecha personalizada incorrecto: {e} @msg {k}: bad custom arrowhead: {e} {k}: punta de flecha personalizada incorrecta: {e} -@msg {k}: baseline must be {_1} to {_2}% {k}: baseline debe estar entre {_1} y {_2}% @msg {k}: custom must be a name {k}: custom debe ser un nombre -@msg {k}: give a font {k}: indica una fuente -@msg {k}: only kana can be scaled at the center {k}: solo el kana se puede escalar desde el centro -@msg {k}: only kana, roman and numerals can be scaled {k}: solo se pueden escalar kana, roman y numerals -@msg {k}: scale must be {_1} to {_2}% {k}: scale debe estar entre {_1} y {_2}% -@msg {k}: size must be {_1} to {_2}% {k}: size debe estar entre {_1} y {_2}% @msg {path}: copy takes a DCS file only when its plates are inside it; relink to it where its plate files are {path}: copy solo acepta un archivo DCS cuando sus planchas están dentro de él; vuelve a vincularlo donde estén sus archivos de planchas @msg {path}: larger than {_1} MB {path}: ocupa más de {_1} MB @msg {shown} is not an XPath 1.0 function {shown} no es una función de XPath 1.0 @@ -8085,7 +8049,6 @@ breakText Glyphs Glifos @msg `{name}` is a working space: choose another with edit.colorSettings first `{name}` es un espacio de trabajo de color: elige antes otro con edit.colorSettings @msg `{name}` is built in and stays `{name}` está integrado y se conserva @msg `{name}` takes a paint of its own kind (colour, gradient or pattern) `{name}` acepta una pintura de su mismo tipo (color, degradado o motivo) -@msg `{name}`: Minimum must not exceed Desired, nor Desired Maximum `{name}`: Mínimo no debe superar a Deseado, ni Deseado a Máximo @msg `{n}` can't be deleted `{n}` no se puede eliminar @msg `{n}` can't be merged `{n}` no se puede combinar @msg `{n}` can't be moved `{n}` no se puede mover @@ -8836,7 +8799,6 @@ breakText Glyphs Glifos @msg select a graph selecciona un gráfico @msg select a group or layer with visible, unlocked members selecciona un grupo o una capa con miembros visibles y desbloqueados @msg select a layer selecciona una capa -@msg select a path selecciona un trazado @msg select a text object selecciona un objeto de texto @msg select an image (or an Image Trace group) selecciona una imagen (o un grupo de Calco de imagen) @msg select an image, or pass id selecciona una imagen o pasa id diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 02f4e96418..f847b9451d 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -28,7 +28,7 @@ Chinese by `imachus`). Only Georgian is recorded as reviewed by a native speaker |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,460 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists two messages whose placeholders sit side by side, which no catalog row can match) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,430 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists 50 missing messages for it) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; no gaps in the untranslated report | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | native review, layout and web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | | French | `fr` | 4,020 / 4,020 (100%) | all | Latin | no | full | — (review) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 962dabffda..18d8500c63 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -876,7 +876,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Hindi wording (2026-11-13): rows outside the plug-in messages keep their English's meaning, quantities and clauses, and use the catalog's save, swatch, crop, resolution, path and type terms; a test checks those terms and the point unit in every row; native review remains; scores and estimates unchanged. - Hindi terms (2026-11-13): every row that names a variable (data merge, variable fonts and widths, environment variables) says वेरिएबल, and joining paths, anchor points, point type and lines says जोड़ें instead of शामिल हों, which stays for joining the community; a test checks both terms in every row; scores and estimates unchanged. - Hindi English words (2026-11-13): 264 rows no longer keep English words in their sentences, repeat a parameter's name in Hindi or garble them, among them "unknown align", which now names the alignment; lists of accepted values such as `(left|right|top|bottom)` stay as their English writes them; two tests check every row; native review remains; scores and estimates unchanged. - - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,840 of the 1,842 status and error messages the untranslated report listed for it; the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. + - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,802 of the 1,842 status and error messages the untranslated report listed for it; 38 are the composite font, select-a-path and justification order errors that open #7211, #7214 and #7116 translate, and the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. - Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`). - Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md). - The History panel, Edit › Undo and Edit › Redo translate the names of the steps that apply or redefine a character or paragraph style and of the step that redefines a graphic style: each such step keeps its template (`Apply {name}`, `Redefine {name}`, `Redefine Graphic Style “{name}”`) and the style's name, every complete catalog has a row for each template, and the panel and the menu show the style's name as the document holds it, except the Normal styles' names, which they show in the interface language (`steps_named_after_a_style_list_the_template_around_the_name`, `undo_and_redo_name_a_style_step_around_the_style_name`). From d9fcdba9161af5bc26010b2ea650634b43bc9421 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Fri, 13 Nov 2026 19:08:16 -0800 Subject: [PATCH 021/247] Library panels: built-in swatch, graphic style and symbol names show in the UI language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A built-in swatch, gradient, pattern, graphic style or symbol library's panel now shows its item and color group names in the UI language, as the brush library panels already do. Find matches the name shown or the English name. A numbered swatch such as "Warm Gray 3" shows its group's translated name followed by the number; color values such as K=35 and #33cc99 are shown as they are. User Defined and Other Library... libraries keep their stored names, and a click, a drag and the Add to commands still use the English name. - LibraryKind::label returns Cow so a label can be composed; i18n::numbered_label translates the name before a trailing number. - Every complete catalog gets rows for the built-in names it lacked. - The Hindi row for "Vivid" now reads चटक. --- crates/ui-egui/src/i18n.rs | 18 ++ crates/ui-egui/src/i18n/bg.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/bs.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/ca.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/cs.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/da.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/de.tsv | 241 ++++++++++++++++++ crates/ui-egui/src/i18n/el.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/es.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/fi.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/fr.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/hi.tsv | 236 ++++++++++++++++- crates/ui-egui/src/i18n/hu.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/id.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/it.tsv | 239 +++++++++++++++++ crates/ui-egui/src/i18n/ja.tsv | 239 +++++++++++++++++ crates/ui-egui/src/i18n/ka.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/ko.tsv | 239 +++++++++++++++++ crates/ui-egui/src/i18n/nl.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/pl.tsv | 236 +++++++++++++++++ crates/ui-egui/src/i18n/pt-br.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/ru.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/sv.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/tests.rs | 91 +++++++ crates/ui-egui/src/i18n/tr.tsv | 234 +++++++++++++++++ crates/ui-egui/src/i18n/uk.tsv | 239 +++++++++++++++++ crates/ui-egui/src/i18n/vi.tsv | 239 +++++++++++++++++ crates/ui-egui/src/i18n/zh-hans.tsv | 237 +++++++++++++++++ crates/ui-egui/src/i18n/zh-hant.tsv | 239 +++++++++++++++++ crates/ui-egui/src/panels/brushes.rs | 5 +- crates/ui-egui/src/panels/graphic_styles.rs | 11 +- crates/ui-egui/src/panels/library_panel.rs | 9 +- .../ui-egui/src/panels/library_panel/tests.rs | 34 +++ .../ui-egui/src/panels/swatches/libraries.rs | 15 +- crates/ui-egui/src/panels/symbols.rs | 11 +- .../src/panels/tests_style_libraries.rs | 28 ++ .../src/panels/tests_symbol_libraries.rs | 26 ++ docs/target-app-parity.md | 1 + 38 files changed, 6597 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 9d15012784..429de0cb28 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -29,6 +29,7 @@ mod catalog; +use std::borrow::Cow; use std::sync::OnceLock; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -651,6 +652,23 @@ pub fn label_or_name(lang: Lang, s: &str, built_in: bool) -> &str { if built_in { tr(lang, s) } else { s } } +/// A built-in name that may end in a number ("Warm Gray 3") in `lang`: its own row, or the row of +/// the name before the number followed by the number as it is. Any other name, a color value +/// such as `K=35` among them, comes back as it is. +pub fn numbered_label(lang: Lang, s: &str) -> Cow<'_, str> { + if let Some(shown) = lang.catalog().plain(s) { + return Cow::Borrowed(shown); + } + if let Some((head, n)) = s.rsplit_once(' ') + && !n.is_empty() + && n.bytes().all(|b| b.is_ascii_digit()) + && let Some(shown) = lang.catalog().plain(head) + { + return Cow::Owned(format!("{shown} {n}")); + } + Cow::Borrowed(s) +} + /// How deep [`message`] translates placeholder values that are messages themselves. The status /// bar's line for an EPS file that can't be opened has five levels: `Couldn't open {name}: {e}`, /// the loader's `can't open …: {e}` (matched by `{path}: {e}`), the reader's `this PostScript file diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 1f469c69c9..4136f6c002 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6241,6 +6241,240 @@ axis Y Axis Y ос Stars Звезди Triangles Триъгълници Sparkles Искри + Warm Gray Топло сиво + Cool Gray Студено сиво + Neutrals Неутрални + Ivory Слонова кост + Linen Лен + Oat Овес + Greige Грейж + Stone Камък + Taupe Сиво-кафяво + Slate Шисти + Clay Глина + Terracotta Теракота + Ochre Охра + Umber Умбра + Sand Пясък + Olive Маслинено + Moss Мъх + Rosy Розовеещо + Neutral Неутрално + Golden Златисто + Pastel Пастелни + Pastel Red Пастелно червено + Pastel Orange Пастелно оранжево + Pastel Amber Пастелно кехлибарено + Pastel Yellow Пастелно жълто + Pastel Lime Пастелно лаймово + Pastel Green Пастелно зелено + Pastel Teal Пастелно синьо-зелено + Pastel Cyan Пастелен циан + Pastel Azure Пастелно лазурно + Pastel Blue Пастелно синьо + Pastel Violet Пастелно виолетово + Pastel Magenta Пастелна магента + Soft Red Меко червено + Soft Orange Меко оранжево + Soft Amber Меко кехлибарено + Soft Yellow Меко жълто + Soft Lime Меко лаймово + Soft Green Меко зелено + Soft Teal Меко синьо-зелено + Soft Cyan Мек циан + Soft Azure Меко лазурно + Soft Blue Меко синьо + Soft Violet Меко виолетово + Soft Magenta Мека магента + Vivid Red Ярко червено + Vivid Orange Ярко оранжево + Vivid Amber Ярко кехлибарено + Vivid Yellow Ярко жълто + Vivid Lime Ярко лаймово + Vivid Green Ярко зелено + Vivid Teal Ярко синьо-зелено + Vivid Cyan Ярък циан + Vivid Azure Ярко лазурно + Vivid Blue Ярко синьо + Vivid Violet Ярко виолетово + Vivid Magenta Ярка магента + Deep Наситени + Deep Red Тъмночервено + Deep Orange Тъмнооранжево + Deep Amber Тъмно кехлибарено + Deep Yellow Тъмножълто + Deep Lime Тъмно лаймово + Deep Green Тъмнозелено + Deep Teal Тъмно синьо-зелено + Deep Cyan Тъмен циан + Deep Azure Тъмно лазурно + Deep Blue Тъмносиньо + Deep Violet Тъмновиолетово + Deep Magenta Тъмна магента + Gold Злато + Silver Сребро + Bronze Бронз + Copper Мед + Brass Месинг + Rose Gold Розово злато + Gunmetal Оръжеен метал + Platinum Платина + Pewter Калай + Ember Жарава + Lagoon Лагуна + Dusk Здрач + Clay to Teal От глина до синьо-зелено + Plum to Olive От слива до маслинено + Complementary Coral Коралово, комплементарни + Split Complementary Coral Коралово, сплит-комплементарни + Analogous Coral Коралово, аналогови + Triad Coral Коралово, триада + Tetrad Coral Коралово, тетрада + Pentagram Coral Коралово, петограм + Complementary Teal Синьо-зелено, комплементарни + Split Complementary Teal Синьо-зелено, сплит-комплементарни + Analogous Teal Синьо-зелено, аналогови + Triad Teal Синьо-зелено, триада + Tetrad Teal Синьо-зелено, тетрада + Pentagram Teal Синьо-зелено, петограм + Soft Spectrum Мек спектър + Red to Amber От червено до кехлибарено + Orange to Yellow От оранжево до жълто + Amber to Lime От кехлибарено до лаймово + Yellow to Green От жълто до зелено + Lime to Teal От лаймово до синьо-зелено + Green to Cyan От зелено до циан + Teal to Azure От синьо-зелено до лазурно + Cyan to Blue От циан до синьо + Azure to Violet От лазурно до виолетово + Blue to Magenta От синьо до магента + Violet to Red От виолетово до червено + Magenta to Orange От магента до оранжево + Dawn Зазоряване + Noon Пладне + Sunset Залез + Night Нощ + Overcast Облачно + White to Black От бяло до черно + Light Grays Светлосиви + Dark Grays Тъмносиви + Warm Grays Топли сиви + Cool Grays Студени сиви + Fade to Transparent Преливане към прозрачно + White Fade Бяло преливане + Vignette Винетка + Mist Мъгла + Petal Венчелистче + Fern Папрат + Smoke Дим + Honey Пчелен мед + Seafoam Морска пяна + Lavender Лавандула + Driftwood Изхвърлено дърво + Ink Wash Лавиран туш + Tide Прилив + Bloom Цъфтеж + Dew Роса + Pollen Прашец + Lichen Лишей + Prism Veil Призмен воал + Opal Ribbon Опалова лента + Pearl Flash Перлен проблясък + Aurora Foil Фолио полярно сияние + Iris Sheen Ирисов отблясък + Frost Spectrum Скрежен спектър + Silver Tide Сребърен прилив + Rose Quartz Gleam Блясък на розов кварц + Moonstone Shift Преливане на лунен камък + Violet Edge Виолетов ръб + Mint Halo Ментов ореол + Amber Corona Кехлибарена корона + Polar Glint Полярен проблясък + Pastel Orbit Пастелна орбита + Coral and Navy Коралово и тъмносиньо + Plum and Lime Слива и лайм + Teal and Gold Синьо-зелено и злато + Indigo and Peach Индиго и праскова + Forest and Rose Гора и роза + Red Glow Червено сияние + Orange Glow Оранжево сияние + Amber Glow Кехлибарено сияние + Yellow Glow Жълто сияние + Lime Glow Лаймово сияние + Green Glow Зелено сияние + Teal Glow Синьо-зелено сияние + Cyan Glow Цианово сияние + Azure Glow Лазурно сияние + Blue Glow Синьо сияние + Violet Glow Виолетово сияние + Magenta Glow Магентено сияние + Polka Dots Едри точки + Vertical Stripes Вертикални ивици + Horizontal Stripes Хоризонтални ивици + Diagonal Stripes Диагонални ивици + Checkerboard Шахматна дъска + Diamonds Ромбове + Crosses Кръстчета + Coarse Grit Едро зърно + Stipple Пунктир + Scratches Драскотини + Sparse Flecks Редки петънца + Dense Flecks Гъсти петънца + Sine Bands Синусоидни ленти + Ripple Lines Вълнисти линии + Interference Rings Интерференчни пръстени + Offset Rings Отместени пръстени + Warped Checks Изкривени квадрати + Pinched Stripes Притиснати ивици + Chevron Pulse Пулсиращи шеврони + Radiating Lenses Излъчващи лещи + Soft Shadow Мека сянка + Hard Shadow Твърда сянка + Lifted Card Повдигната карта + Neon Tube Неонова тръба + Inner Light Вътрешна светлина + Feathered Размити ръбове + Haze Омара + Double Rule Двойна линия + Triple Rule Тройна линия + Dashed Border Пунктирана рамка + Dotted Border Точкова рамка + Offset Keyline Отместен контур + Inset Keyline Вътрешен контур + Outside Stroke Външен щрих + Pointer Показалец + Highlighter Маркер + Sketchy Line Скицирана линия + Scribble Fill Драскано запълване + Wobble Клатене + Zig Zag Edge Зигзагообразен ръб + Wavy Edge Вълнист ръб + Puffy Надут + Starburst Звезден взрив + Glossy Лъскав + Brushed Metal Шлифован метал + Spotlight Прожектор + Sunset Band Ивица на залеза + Sea Glass Морско стъкло + Pearl Перла + Chrome Rim Хромиран кант + Glow Orb Светеща сфера + Pill Badge Значка-капсула + Round Badge Кръгла значка + Flag Wave Развяващо се знаме + Bulge Издутина + Twisted Усукан + Echo Ехо + Spiral Copies Копия по спирала + Multiply Tint Оттенък умножение + Darken Veil Воал потъмняване + Ghosted Призрачен + Two Tone Двуцветен + Overlay Glaze Глазура прекриване + Screen Light Светлина екран + Soft Light Wash Лавиране мека светлина + Burst Взрив + Rounded Square Закръглен квадрат Save Brush Library… Запази библиотека с четки… @msg no empty artboards to delete няма празни работни области за изтриване Scale Presets Пресети за мащаб diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a23133933a..6f344aba18 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6294,6 +6294,240 @@ axis Y Axis Y osa Stars Zvijezde Triangles Trouglovi Sparkles Iskrice + Warm Gray Topla siva + Cool Gray Hladna siva + Neutrals Neutralne + Ivory Slonovača + Linen Lan + Oat Zob + Greige Greige + Stone Kamen + Taupe Taupe + Slate Škriljac + Clay Glina + Terracotta Terakota + Ochre Oker + Umber Umbra + Sand Pijesak + Olive Maslinasta + Moss Mahovina + Rosy Ružičasta + Neutral Neutralna + Golden Zlatna + Pastel Pastelne + Pastel Red Pastelna crvena + Pastel Orange Pastelna narandžasta + Pastel Amber Pastelni jantar + Pastel Yellow Pastelna žuta + Pastel Lime Pastelna limeta + Pastel Green Pastelna zelena + Pastel Teal Pastelna plavozelena + Pastel Cyan Pastelni cijan + Pastel Azure Pastelna azurna + Pastel Blue Pastelna plava + Pastel Violet Pastelna ljubičasta + Pastel Magenta Pastelna magenta + Soft Red Blaga crvena + Soft Orange Blaga narandžasta + Soft Amber Blagi jantar + Soft Yellow Blaga žuta + Soft Lime Blaga limeta + Soft Green Blaga zelena + Soft Teal Blaga plavozelena + Soft Cyan Blagi cijan + Soft Azure Blaga azurna + Soft Blue Blaga plava + Soft Violet Blaga ljubičasta + Soft Magenta Blaga magenta + Vivid Red Živa crvena + Vivid Orange Živa narandžasta + Vivid Amber Živi jantar + Vivid Yellow Živa žuta + Vivid Lime Živa limeta + Vivid Green Živa zelena + Vivid Teal Živa plavozelena + Vivid Cyan Živi cijan + Vivid Azure Živa azurna + Vivid Blue Živa plava + Vivid Violet Živa ljubičasta + Vivid Magenta Živa magenta + Deep Tamne + Deep Red Tamnocrvena + Deep Orange Tamnonarandžasta + Deep Amber Tamni jantar + Deep Yellow Tamnožuta + Deep Lime Tamna limeta + Deep Green Tamnozelena + Deep Teal Tamna plavozelena + Deep Cyan Tamni cijan + Deep Azure Tamna azurna + Deep Blue Tamnoplava + Deep Violet Tamnoljubičasta + Deep Magenta Tamna magenta + Gold Zlato + Silver Srebro + Bronze Bronza + Copper Bakar + Brass Mesing + Rose Gold Rozo zlato + Gunmetal Čelično siva + Platinum Platina + Pewter Kalaj + Ember Žar + Lagoon Laguna + Dusk Sumrak + Clay to Teal Od gline do plavozelene + Plum to Olive Od šljive do maslinaste + Complementary Coral Koralna, komplementarne + Split Complementary Coral Koralna, podijeljene komplementarne + Analogous Coral Koralna, analogne + Triad Coral Koralna, trijada + Tetrad Coral Koralna, tetrada + Pentagram Coral Koralna, pentagram + Complementary Teal Plavozelena, komplementarne + Split Complementary Teal Plavozelena, podijeljene komplementarne + Analogous Teal Plavozelena, analogne + Triad Teal Plavozelena, trijada + Tetrad Teal Plavozelena, tetrada + Pentagram Teal Plavozelena, pentagram + Soft Spectrum Blagi spektar + Red to Amber Od crvene do jantara + Orange to Yellow Od narandžaste do žute + Amber to Lime Od jantara do limete + Yellow to Green Od žute do zelene + Lime to Teal Od limete do plavozelene + Green to Cyan Od zelene do cijana + Teal to Azure Od plavozelene do azurne + Cyan to Blue Od cijana do plave + Azure to Violet Od azurne do ljubičaste + Blue to Magenta Od plave do magente + Violet to Red Od ljubičaste do crvene + Magenta to Orange Od magente do narandžaste + Dawn Zora + Noon Podne + Sunset Zalazak sunca + Night Noć + Overcast Oblačno + White to Black Od bijele do crne + Light Grays Svijetle sive + Dark Grays Tamne sive + Warm Grays Tople sive + Cool Grays Hladne sive + Fade to Transparent Prelaz u providno + White Fade Bijeli prelaz + Vignette Vinjeta + Mist Izmaglica + Petal Latica + Fern Paprat + Smoke Dim + Honey Med + Seafoam Morska pjena + Lavender Lavanda + Driftwood Naplavljeno drvo + Ink Wash Lavirani tuš + Tide Plima + Bloom Cvjetanje + Dew Rosa + Pollen Polen + Lichen Lišaj + Prism Veil Prizmatični veo + Opal Ribbon Opalna traka + Pearl Flash Biserni bljesak + Aurora Foil Folija polarne svjetlosti + Iris Sheen Sjaj irisa + Frost Spectrum Mrazni spektar + Silver Tide Srebrna plima + Rose Quartz Gleam Sjaj ružičastog kvarca + Moonstone Shift Prelivanje mjesečevog kamena + Violet Edge Ljubičasta ivica + Mint Halo Oreol boje mente + Amber Corona Jantarna korona + Polar Glint Polarni odsjaj + Pastel Orbit Pastelna orbita + Coral and Navy Koralna i mornarsko plava + Plum and Lime Šljiva i limeta + Teal and Gold Plavozelena i zlatna + Indigo and Peach Indigo i breskva + Forest and Rose Šuma i ruža + Red Glow Crveni sjaj + Orange Glow Narandžasti sjaj + Amber Glow Jantarni sjaj + Yellow Glow Žuti sjaj + Lime Glow Sjaj limete + Green Glow Zeleni sjaj + Teal Glow Plavozeleni sjaj + Cyan Glow Cijan sjaj + Azure Glow Azurni sjaj + Blue Glow Plavi sjaj + Violet Glow Ljubičasti sjaj + Magenta Glow Magenta sjaj + Polka Dots Tufne + Vertical Stripes Vertikalne pruge + Horizontal Stripes Horizontalne pruge + Diagonal Stripes Dijagonalne pruge + Checkerboard Šahovska tabla + Diamonds Rombovi + Crosses Krstići + Coarse Grit Grubo zrno + Stipple Tačkanje + Scratches Ogrebotine + Sparse Flecks Rijetke mrlje + Dense Flecks Guste mrlje + Sine Bands Sinusne trake + Ripple Lines Talasaste linije + Interference Rings Interferentni prstenovi + Offset Rings Pomaknuti prstenovi + Warped Checks Iskrivljene kocke + Pinched Stripes Stisnute pruge + Chevron Pulse Pulsirajući ševroni + Radiating Lenses Zračeća sočiva + Soft Shadow Meka sjena + Hard Shadow Oštra sjena + Lifted Card Podignuta kartica + Neon Tube Neonska cijev + Inner Light Unutrašnje svjetlo + Feathered Omekšane ivice + Haze Sumaglica + Double Rule Dvostruka linija + Triple Rule Trostruka linija + Dashed Border Isprekidani okvir + Dotted Border Tačkasti okvir + Offset Keyline Pomaknuta kontura + Inset Keyline Unutrašnja kontura + Outside Stroke Vanjski potez + Pointer Pokazivač + Highlighter Marker + Sketchy Line Skicirana linija + Scribble Fill Išarana ispuna + Wobble Klimanje + Zig Zag Edge Cik-cak ivica + Wavy Edge Talasasta ivica + Puffy Napuhan + Starburst Zvjezdana eksplozija + Glossy Sjajan + Brushed Metal Brušeni metal + Spotlight Reflektor + Sunset Band Traka zalaska sunca + Sea Glass Morsko staklo + Pearl Biser + Chrome Rim Hromirani rub + Glow Orb Svjetleća kugla + Pill Badge Značka u obliku pilule + Round Badge Okrugla značka + Flag Wave Vijoreća zastava + Bulge Ispupčenje + Twisted Uvrnut + Echo Eho + Spiral Copies Kopije u spirali + Multiply Tint Nijansa množenja + Darken Veil Veo potamnjivanja + Ghosted Sablasno + Two Tone Dvobojno + Overlay Glaze Glazura prekrivanja + Screen Light Svjetlo ekrana + Soft Light Wash Laviranje mekim svjetlom + Burst Prasak + Rounded Square Zaobljeni kvadrat Save Brush Library… Sačuvaj biblioteku četkica… @msg `{_1}` has no brushes to apply `{_1}` nema četkica za primjenu @msg missing `library` (see brush.libraries) nedostaje `library` (pogledajte brush.libraries) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 373eb0b79d..2df0d3428c 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3976,6 +3976,240 @@ digits Malayalam Malaiàlam Stars Estrelles Triangles Triangles Sparkles Espurnes + Warm Gray Gris càlid + Cool Gray Gris fred + Neutrals Neutres + Ivory Ivori + Linen Lli + Oat Civada + Greige Greige + Stone Pedra + Taupe Talp + Slate Pissarra + Clay Argila + Terracotta Terracota + Ochre Ocre + Umber Ombra + Sand Sorra + Olive Oliva + Moss Molsa + Rosy Rosat + Neutral Neutre + Golden Daurat + Pastel Pastel + Pastel Red Vermell pastel + Pastel Orange Taronja pastel + Pastel Amber Ambre pastel + Pastel Yellow Groc pastel + Pastel Lime Llima pastel + Pastel Green Verd pastel + Pastel Teal Verd blavós pastel + Pastel Cyan Cian pastel + Pastel Azure Atzur pastel + Pastel Blue Blau pastel + Pastel Violet Violeta pastel + Pastel Magenta Magenta pastel + Soft Red Vermell suau + Soft Orange Taronja suau + Soft Amber Ambre suau + Soft Yellow Groc suau + Soft Lime Llima suau + Soft Green Verd suau + Soft Teal Verd blavós suau + Soft Cyan Cian suau + Soft Azure Atzur suau + Soft Blue Blau suau + Soft Violet Violeta suau + Soft Magenta Magenta suau + Vivid Red Vermell viu + Vivid Orange Taronja viu + Vivid Amber Ambre viu + Vivid Yellow Groc viu + Vivid Lime Llima viu + Vivid Green Verd viu + Vivid Teal Verd blavós viu + Vivid Cyan Cian viu + Vivid Azure Atzur viu + Vivid Blue Blau viu + Vivid Violet Violeta viu + Vivid Magenta Magenta viu + Deep Foscos + Deep Red Vermell fosc + Deep Orange Taronja fosc + Deep Amber Ambre fosc + Deep Yellow Groc fosc + Deep Lime Llima fosc + Deep Green Verd fosc + Deep Teal Verd blavós fosc + Deep Cyan Cian fosc + Deep Azure Atzur fosc + Deep Blue Blau fosc + Deep Violet Violeta fosc + Deep Magenta Magenta fosc + Gold Or + Silver Plata + Bronze Bronze + Copper Coure + Brass Llautó + Rose Gold Or rosa + Gunmetal Gris metall + Platinum Platí + Pewter Peltre + Ember Brasa + Lagoon Llacuna + Dusk Capvespre + Clay to Teal Argila a verd blavós + Plum to Olive Pruna a oliva + Complementary Coral Corall complementari + Split Complementary Coral Corall complementari dividit + Analogous Coral Corall anàleg + Triad Coral Corall en tríada + Tetrad Coral Corall en tètrada + Pentagram Coral Corall en pentagrama + Complementary Teal Verd blavós complementari + Split Complementary Teal Verd blavós complementari dividit + Analogous Teal Verd blavós anàleg + Triad Teal Verd blavós en tríada + Tetrad Teal Verd blavós en tètrada + Pentagram Teal Verd blavós en pentagrama + Soft Spectrum Espectre suau + Red to Amber Vermell a ambre + Orange to Yellow Taronja a groc + Amber to Lime Ambre a llima + Yellow to Green Groc a verd + Lime to Teal Llima a verd blavós + Green to Cyan Verd a cian + Teal to Azure Verd blavós a atzur + Cyan to Blue Cian a blau + Azure to Violet Atzur a violeta + Blue to Magenta Blau a magenta + Violet to Red Violeta a vermell + Magenta to Orange Magenta a taronja + Dawn Alba + Noon Migdia + Sunset Posta de sol + Night Nit + Overcast Ennuvolat + White to Black Blanc a negre + Light Grays Grisos clars + Dark Grays Grisos foscos + Warm Grays Grisos càlids + Cool Grays Grisos freds + Fade to Transparent Esvaïment a transparent + White Fade Esvaïment blanc + Vignette Vinyeta + Mist Boira + Petal Pètal + Fern Falguera + Smoke Fum + Honey Mel + Seafoam Escuma de mar + Lavender Espígol + Driftwood Fusta de deriva + Ink Wash Aiguada de tinta + Tide Marea + Bloom Floració + Dew Rosada + Pollen Pol·len + Lichen Liquen + Prism Veil Vel prismàtic + Opal Ribbon Cinta d’òpal + Pearl Flash Llampec nacrat + Aurora Foil Làmina aurora + Iris Sheen Lluentor iris + Frost Spectrum Espectre gebrat + Silver Tide Marea platejada + Rose Quartz Gleam Resplendor de quars rosa + Moonstone Shift Reflex de pedra de lluna + Violet Edge Vora violeta + Mint Halo Halo menta + Amber Corona Corona ambre + Polar Glint Espurneig polar + Pastel Orbit Òrbita pastel + Coral and Navy Corall i blau marí + Plum and Lime Pruna i llima + Teal and Gold Verd blavós i or + Indigo and Peach Indi i préssec + Forest and Rose Bosc i rosa + Red Glow Resplendor vermella + Orange Glow Resplendor taronja + Amber Glow Resplendor ambre + Yellow Glow Resplendor groga + Lime Glow Resplendor llima + Green Glow Resplendor verda + Teal Glow Resplendor verd blavós + Cyan Glow Resplendor cian + Azure Glow Resplendor atzur + Blue Glow Resplendor blava + Violet Glow Resplendor violeta + Magenta Glow Resplendor magenta + Polka Dots Pics + Vertical Stripes Ratlles verticals + Horizontal Stripes Ratlles horitzontals + Diagonal Stripes Ratlles diagonals + Checkerboard Escaquer + Diamonds Rombes + Crosses Creus + Coarse Grit Gra gruixut + Stipple Puntejat + Scratches Ratllades + Sparse Flecks Taques disperses + Dense Flecks Taques denses + Sine Bands Bandes sinusoidals + Ripple Lines Línies ondulades + Interference Rings Anells d’interferència + Offset Rings Anells desplaçats + Warped Checks Quadres deformats + Pinched Stripes Ratlles pinçades + Chevron Pulse Pols de galons + Radiating Lenses Lents radiants + Soft Shadow Ombra suau + Hard Shadow Ombra dura + Lifted Card Targeta elevada + Neon Tube Tub de neó + Inner Light Llum interior + Feathered Difuminat + Haze Calitja + Double Rule Filet doble + Triple Rule Filet triple + Dashed Border Vora discontínua + Dotted Border Vora puntejada + Offset Keyline Filet desplaçat + Inset Keyline Filet interior + Outside Stroke Traç exterior + Pointer Punter + Highlighter Retolador + Sketchy Line Línia esbossada + Scribble Fill Emplenament gargotejat + Wobble Tremolós + Zig Zag Edge Vora en ziga-zaga + Wavy Edge Vora ondulada + Puffy Inflat + Starburst Esclat estel·lar + Glossy Brillant + Brushed Metal Metall raspallat + Spotlight Focus + Sunset Band Banda de posta de sol + Sea Glass Vidre de mar + Pearl Perla + Chrome Rim Vora cromada + Glow Orb Orbe lluminós + Pill Badge Insígnia de càpsula + Round Badge Insígnia rodona + Flag Wave Bandera onejant + Bulge Bombament + Twisted Recargolat + Echo Eco + Spiral Copies Còpies en espiral + Multiply Tint Tint multiplica + Darken Veil Vel enfosqueix + Ghosted Fantasma + Two Tone Bicolor + Overlay Glaze Veladura superposició + Screen Light Llum pantalla + Soft Light Wash Aiguada llum suau + Burst Esclat + Rounded Square Quadrat arrodonit Scatter: Dispersió: Scissors Tisores Scissors Tool Eina de tisores diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 7178be3143..28375af85a 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6795,6 +6795,240 @@ axis Y Axis osa Y Stars Hvězdy Triangles Trojúhelníky Sparkles Jiskry + Warm Gray Teplá šedá + Cool Gray Studená šedá + Neutrals Neutrální tóny + Ivory Slonovina + Linen Len + Oat Oves + Greige Greige + Stone Kámen + Taupe Taupe + Slate Břidlice + Clay Hlína + Terracotta Terakota + Ochre Okr + Umber Umbra + Sand Písek + Olive Olivová + Moss Mech + Rosy Růžová + Neutral Neutrální + Golden Zlatavá + Pastel Pastelové + Pastel Red Pastelová červená + Pastel Orange Pastelová oranžová + Pastel Amber Pastelová jantarová + Pastel Yellow Pastelová žlutá + Pastel Lime Pastelová limetková + Pastel Green Pastelová zelená + Pastel Teal Pastelová modrozelená + Pastel Cyan Pastelová azurová + Pastel Azure Pastelová blankytná + Pastel Blue Pastelová modrá + Pastel Violet Pastelová fialová + Pastel Magenta Pastelová purpurová + Soft Red Jemná červená + Soft Orange Jemná oranžová + Soft Amber Jemná jantarová + Soft Yellow Jemná žlutá + Soft Lime Jemná limetková + Soft Green Jemná zelená + Soft Teal Jemná modrozelená + Soft Cyan Jemná azurová + Soft Azure Jemná blankytná + Soft Blue Jemná modrá + Soft Violet Jemná fialová + Soft Magenta Jemná purpurová + Vivid Red Sytá červená + Vivid Orange Sytá oranžová + Vivid Amber Sytá jantarová + Vivid Yellow Sytá žlutá + Vivid Lime Sytá limetková + Vivid Green Sytá zelená + Vivid Teal Sytá modrozelená + Vivid Cyan Sytá azurová + Vivid Azure Sytá blankytná + Vivid Blue Sytá modrá + Vivid Violet Sytá fialová + Vivid Magenta Sytá purpurová + Deep Tmavé + Deep Red Tmavě červená + Deep Orange Tmavě oranžová + Deep Amber Tmavě jantarová + Deep Yellow Tmavě žlutá + Deep Lime Tmavě limetková + Deep Green Tmavě zelená + Deep Teal Tmavě modrozelená + Deep Cyan Tmavě azurová + Deep Azure Tmavě blankytná + Deep Blue Tmavě modrá + Deep Violet Tmavě fialová + Deep Magenta Tmavě purpurová + Gold Zlato + Silver Stříbro + Bronze Bronz + Copper Měď + Brass Mosaz + Rose Gold Růžové zlato + Gunmetal Ocelově šedá + Platinum Platina + Pewter Cín + Ember Žhavé uhlíky + Lagoon Laguna + Dusk Soumrak + Clay to Teal Hlína do modrozelené + Plum to Olive Švestka do olivové + Complementary Coral Korálová, komplementární + Split Complementary Coral Korálová, rozdělená komplementární + Analogous Coral Korálová, analogická + Triad Coral Korálová, triáda + Tetrad Coral Korálová, tetráda + Pentagram Coral Korálová, pentagram + Complementary Teal Modrozelená, komplementární + Split Complementary Teal Modrozelená, rozdělená komplementární + Analogous Teal Modrozelená, analogická + Triad Teal Modrozelená, triáda + Tetrad Teal Modrozelená, tetráda + Pentagram Teal Modrozelená, pentagram + Soft Spectrum Jemné spektrum + Red to Amber Červená do jantarové + Orange to Yellow Oranžová do žluté + Amber to Lime Jantarová do limetkové + Yellow to Green Žlutá do zelené + Lime to Teal Limetková do modrozelené + Green to Cyan Zelená do azurové + Teal to Azure Modrozelená do blankytné + Cyan to Blue Azurová do modré + Azure to Violet Blankytná do fialové + Blue to Magenta Modrá do purpurové + Violet to Red Fialová do červené + Magenta to Orange Purpurová do oranžové + Dawn Svítání + Noon Poledne + Sunset Západ slunce + Night Noc + Overcast Zataženo + White to Black Bílá do černé + Light Grays Světlé šedé + Dark Grays Tmavé šedé + Warm Grays Teplé šedé + Cool Grays Studené šedé + Fade to Transparent Přechod do průhledné + White Fade Bílý přechod + Vignette Viněta + Mist Opar + Petal Okvětní lístek + Fern Kapradí + Smoke Kouř + Honey Med + Seafoam Mořská pěna + Lavender Levandule + Driftwood Naplavené dřevo + Ink Wash Tušová lavírovka + Tide Příliv + Bloom Rozkvět + Dew Rosa + Pollen Pyl + Lichen Lišejník + Prism Veil Hranolový závoj + Opal Ribbon Opálová stuha + Pearl Flash Perleťový záblesk + Aurora Foil Polární fólie + Iris Sheen Duhový lesk + Frost Spectrum Ojíněné spektrum + Silver Tide Stříbrný příliv + Rose Quartz Gleam Lesk růženínu + Moonstone Shift Měsíční třpyt + Violet Edge Fialový okraj + Mint Halo Mátová svatozář + Amber Corona Jantarová koróna + Polar Glint Polární záblesk + Pastel Orbit Pastelová dráha + Coral and Navy Korálová a námořnická modrá + Plum and Lime Švestková a limetková + Teal and Gold Modrozelená a zlatá + Indigo and Peach Indigo a broskvová + Forest and Rose Lesní a růžová + Red Glow Červená záře + Orange Glow Oranžová záře + Amber Glow Jantarová záře + Yellow Glow Žlutá záře + Lime Glow Limetková záře + Green Glow Zelená záře + Teal Glow Modrozelená záře + Cyan Glow Azurová záře + Azure Glow Blankytná záře + Blue Glow Modrá záře + Violet Glow Fialová záře + Magenta Glow Purpurová záře + Polka Dots Puntíky + Vertical Stripes Svislé pruhy + Horizontal Stripes Vodorovné pruhy + Diagonal Stripes Šikmé pruhy + Checkerboard Šachovnice + Diamonds Kosočtverce + Crosses Křížky + Coarse Grit Hrubé zrno + Stipple Tečkování + Scratches Škrábance + Sparse Flecks Řídké skvrnky + Dense Flecks Husté skvrnky + Sine Bands Sinusové pásy + Ripple Lines Zvlněné čáry + Interference Rings Interferenční kruhy + Offset Rings Posunuté kruhy + Warped Checks Zkreslené kostky + Pinched Stripes Sevřené pruhy + Chevron Pulse Pulzující krokve + Radiating Lenses Paprsčité čočky + Soft Shadow Měkký stín + Hard Shadow Ostrý stín + Lifted Card Zvednutá karta + Neon Tube Neonová trubice + Inner Light Vnitřní světlo + Feathered Měkké okraje + Haze Mlžný opar + Double Rule Dvojitá linka + Triple Rule Trojitá linka + Dashed Border Čárkovaný okraj + Dotted Border Tečkovaný okraj + Offset Keyline Posunutá obrysová linka + Inset Keyline Vnitřní obrysová linka + Outside Stroke Vnější tah + Pointer Ukazatel + Highlighter Zvýrazňovač + Sketchy Line Skicovitá čára + Scribble Fill Čmáraná výplň + Wobble Kolísání + Zig Zag Edge Klikatý okraj + Wavy Edge Vlnitý okraj + Puffy Nafouknutý + Starburst Hvězdný výbuch + Glossy Lesklý + Brushed Metal Kartáčovaný kov + Spotlight Reflektor + Sunset Band Pás západu slunce + Sea Glass Mořské sklo + Pearl Perla + Chrome Rim Chromový lem + Glow Orb Zářící koule + Pill Badge Odznak tvaru pilulky + Round Badge Kulatý odznak + Flag Wave Vlající vlajka + Bulge Vyboulení + Twisted Zkroucený + Echo Ozvěna + Spiral Copies Kopie ve spirále + Multiply Tint Odstín násobení + Darken Veil Ztmavující závoj + Ghosted Průsvitný + Two Tone Dvoubarevný + Overlay Glaze Glazura překrytí + Screen Light Světlo závoje + Soft Light Wash Lavírka měkkého světla + Burst Výbuch + Rounded Square Zaoblený čtverec Save Brush Library… Uložit knihovnu štětců… @msg `{_1}` has no brushes to apply `{_1}` nemá žádné štětce k použití @msg missing `library` (see brush.libraries) chybí `library` (viz brush.libraries) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 433c6af3d6..435472e180 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6257,6 +6257,240 @@ axis Y Axis Y-akse Stars Stjerner Triangles Trekanter Sparkles Gnister + Warm Gray Varm grå + Cool Gray Kølig grå + Neutrals Neutrale toner + Ivory Elfenben + Linen Hør + Oat Havre + Greige Greige + Stone Sten + Taupe Taupe + Slate Skifer + Clay Ler + Terracotta Terrakotta + Ochre Okker + Umber Umbra + Sand Sand + Olive Oliven + Moss Mos + Rosy Rosa + Neutral Neutral + Golden Gylden + Pastel Pastel + Pastel Red Pastelrød + Pastel Orange Pastelorange + Pastel Amber Pastelrav + Pastel Yellow Pastelgul + Pastel Lime Pastellime + Pastel Green Pastelgrøn + Pastel Teal Pastelblågrøn + Pastel Cyan Pastelcyan + Pastel Azure Pastelazur + Pastel Blue Pastelblå + Pastel Violet Pastelviolet + Pastel Magenta Pastelmagenta + Soft Red Blød rød + Soft Orange Blød orange + Soft Amber Blød rav + Soft Yellow Blød gul + Soft Lime Blød lime + Soft Green Blød grøn + Soft Teal Blød blågrøn + Soft Cyan Blød cyan + Soft Azure Blød azur + Soft Blue Blød blå + Soft Violet Blød violet + Soft Magenta Blød magenta + Vivid Red Intens rød + Vivid Orange Intens orange + Vivid Amber Intens rav + Vivid Yellow Intens gul + Vivid Lime Intens lime + Vivid Green Intens grøn + Vivid Teal Intens blågrøn + Vivid Cyan Intens cyan + Vivid Azure Intens azur + Vivid Blue Intens blå + Vivid Violet Intens violet + Vivid Magenta Intens magenta + Deep Dybe + Deep Red Dyb rød + Deep Orange Dyb orange + Deep Amber Dyb rav + Deep Yellow Dyb gul + Deep Lime Dyb lime + Deep Green Dyb grøn + Deep Teal Dyb blågrøn + Deep Cyan Dyb cyan + Deep Azure Dyb azur + Deep Blue Dyb blå + Deep Violet Dyb violet + Deep Magenta Dyb magenta + Gold Guld + Silver Sølv + Bronze Bronze + Copper Kobber + Brass Messing + Rose Gold Rosaguld + Gunmetal Gunmetal + Platinum Platin + Pewter Tin + Ember Glød + Lagoon Lagune + Dusk Skumring + Clay to Teal Ler til blågrøn + Plum to Olive Blomme til oliven + Complementary Coral Koral komplementær + Split Complementary Coral Koral delt komplementær + Analogous Coral Koral analog + Triad Coral Koral triade + Tetrad Coral Koral tetrad + Pentagram Coral Koral pentagram + Complementary Teal Blågrøn komplementær + Split Complementary Teal Blågrøn delt komplementær + Analogous Teal Blågrøn analog + Triad Teal Blågrøn triade + Tetrad Teal Blågrøn tetrad + Pentagram Teal Blågrøn pentagram + Soft Spectrum Blødt spektrum + Red to Amber Rød til rav + Orange to Yellow Orange til gul + Amber to Lime Rav til lime + Yellow to Green Gul til grøn + Lime to Teal Lime til blågrøn + Green to Cyan Grøn til cyan + Teal to Azure Blågrøn til azur + Cyan to Blue Cyan til blå + Azure to Violet Azur til violet + Blue to Magenta Blå til magenta + Violet to Red Violet til rød + Magenta to Orange Magenta til orange + Dawn Daggry + Noon Middag + Sunset Solnedgang + Night Nat + Overcast Overskyet + White to Black Hvid til sort + Light Grays Lyse gråtoner + Dark Grays Mørke gråtoner + Warm Grays Varme gråtoner + Cool Grays Kølige gråtoner + Fade to Transparent Udtoning til gennemsigtig + White Fade Hvid udtoning + Vignette Vignet + Mist Dis + Petal Kronblad + Fern Bregne + Smoke Røg + Honey Honning + Seafoam Havskum + Lavender Lavendel + Driftwood Drivtømmer + Ink Wash Tuschlavering + Tide Tidevand + Bloom Blomstring + Dew Dug + Pollen Pollen + Lichen Lav + Prism Veil Prismeslør + Opal Ribbon Opalbånd + Pearl Flash Perleglimt + Aurora Foil Nordlysfolie + Iris Sheen Irisglans + Frost Spectrum Frostspektrum + Silver Tide Sølvtidevand + Rose Quartz Gleam Rosakvartsglans + Moonstone Shift Månestensskær + Violet Edge Violet kant + Mint Halo Mynteglorie + Amber Corona Ravkorona + Polar Glint Polarglimt + Pastel Orbit Pastelbane + Coral and Navy Koral og marineblå + Plum and Lime Blomme og lime + Teal and Gold Blågrøn og guld + Indigo and Peach Indigo og fersken + Forest and Rose Skov og rosa + Red Glow Rød glød + Orange Glow Orange glød + Amber Glow Ravglød + Yellow Glow Gul glød + Lime Glow Limeglød + Green Glow Grøn glød + Teal Glow Blågrøn glød + Cyan Glow Cyanglød + Azure Glow Azurglød + Blue Glow Blå glød + Violet Glow Violet glød + Magenta Glow Magentaglød + Polka Dots Prikker + Vertical Stripes Lodrette striber + Horizontal Stripes Vandrette striber + Diagonal Stripes Diagonale striber + Checkerboard Skakbræt + Diamonds Ruder + Crosses Kryds + Coarse Grit Groft korn + Stipple Punktering + Scratches Ridser + Sparse Flecks Spredte pletter + Dense Flecks Tætte pletter + Sine Bands Sinusbånd + Ripple Lines Bølgelinjer + Interference Rings Interferensringe + Offset Rings Forskudte ringe + Warped Checks Forvredne tern + Pinched Stripes Klemte striber + Chevron Pulse Chevronpuls + Radiating Lenses Strålende linser + Soft Shadow Blød skygge + Hard Shadow Hård skygge + Lifted Card Løftet kort + Neon Tube Neonrør + Inner Light Indre lys + Feathered Blød kant + Haze Dunst + Double Rule Dobbelt streg + Triple Rule Tredobbelt streg + Dashed Border Stiplet kant + Dotted Border Prikket kant + Offset Keyline Forskudt konturlinje + Inset Keyline Indre konturlinje + Outside Stroke Ydre streg + Pointer Viser + Highlighter Overstregningstusch + Sketchy Line Skitseagtig linje + Scribble Fill Kruseduldefyld + Wobble Slinger + Zig Zag Edge Zigzagkant + Wavy Edge Bølget kant + Puffy Oppustet + Starburst Stjerneudbrud + Glossy Blank + Brushed Metal Børstet metal + Spotlight Spotlys + Sunset Band Solnedgangsbånd + Sea Glass Havglas + Pearl Perle + Chrome Rim Kromkant + Glow Orb Lyskugle + Pill Badge Pillemærke + Round Badge Rundt mærke + Flag Wave Vajende flag + Bulge Bule + Twisted Snoet + Echo Ekko + Spiral Copies Spiralkopier + Multiply Tint Multiplikationstone + Darken Veil Mørkere slør + Ghosted Spøgelsesagtig + Two Tone Tofarvet + Overlay Glaze Overlejringsglasur + Screen Light Skærmlys + Soft Light Wash Blødt lys-lavering + Burst Udbrud + Rounded Square Afrundet kvadrat Save Brush Library… Gem penselbibliotek… @msg no empty artboards to delete ingen tomme tegneflader at slette Scale Presets Skaleringsforudindstillinger diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 951f6f9c37..bf00843a25 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6387,6 +6387,247 @@ axis Y Axis Y-Achse Stars Sterne Triangles Dreiecke Sparkles Funkeln + Warm Gray Warmgrau + Cool Gray Kühlgrau + Neutrals Neutraltöne + Ivory Elfenbein + Linen Leinen + Oat Hafer + Greige Greige + Stone Stein + Taupe Taupe + Slate Schiefer + Clay Ton + Terracotta Terrakotta + Ochre Ocker + Umber Umbra + Sand Sand + Olive Oliv + Moss Moos + Rosy Rosig + Neutral Neutral + Golden Golden + Pastel Pastell + Pastel Red Pastellrot + Pastel Orange Pastellorange + Pastel Amber Pastellbernstein + Pastel Yellow Pastellgelb + Pastel Lime Pastelllimette + Pastel Green Pastellgrün + Pastel Teal Pastellpetrol + Pastel Cyan Pastellcyan + Pastel Azure Pastellazur + Pastel Blue Pastellblau + Pastel Violet Pastellviolett + Pastel Magenta Pastellmagenta + Soft Red Sanftes Rot + Soft Orange Sanftes Orange + Soft Amber Sanfter Bernstein + Soft Yellow Sanftes Gelb + Soft Lime Sanfte Limette + Soft Green Sanftes Grün + Soft Teal Sanftes Petrol + Soft Cyan Sanftes Cyan + Soft Azure Sanftes Azur + Soft Blue Sanftes Blau + Soft Violet Sanftes Violett + Soft Magenta Sanftes Magenta + Vivid Red Leuchtendes Rot + Vivid Orange Leuchtendes Orange + Vivid Amber Leuchtender Bernstein + Vivid Yellow Leuchtendes Gelb + Vivid Lime Leuchtende Limette + Vivid Green Leuchtendes Grün + Vivid Teal Leuchtendes Petrol + Vivid Cyan Leuchtendes Cyan + Vivid Azure Leuchtendes Azur + Vivid Blue Leuchtendes Blau + Vivid Violet Leuchtendes Violett + Vivid Magenta Leuchtendes Magenta + Deep Tief + Deep Red Tiefrot + Deep Orange Tieforange + Deep Amber Tiefbernstein + Deep Yellow Tiefgelb + Deep Lime Tieflimette + Deep Green Tiefgrün + Deep Teal Tiefpetrol + Deep Cyan Tiefcyan + Deep Azure Tiefazur + Deep Blue Tiefblau + Deep Violet Tiefviolett + Deep Magenta Tiefmagenta + Gold Gold + Silver Silber + Bronze Bronze + Copper Kupfer + Brass Messing + Rose Gold Roségold + Gunmetal Anthrazitmetall + Platinum Platin + Pewter Zinn + Ember Glut + Lagoon Lagune + Dusk Abenddämmerung + Clay to Teal Ton zu Petrol + Plum to Olive Pflaume zu Oliv + Complementary Coral Koralle komplementär + Split Complementary Coral Koralle geteilt komplementär + Analogous Coral Koralle analog + Triad Coral Koralle Triade + Tetrad Coral Koralle Tetrade + Pentagram Coral Koralle Pentagramm + Complementary Teal Petrol komplementär + Split Complementary Teal Petrol geteilt komplementär + Analogous Teal Petrol analog + Triad Teal Petrol Triade + Tetrad Teal Petrol Tetrade + Pentagram Teal Petrol Pentagramm + Soft Spectrum Sanftes Spektrum + Red to Amber Rot zu Bernstein + Orange to Yellow Orange zu Gelb + Amber to Lime Bernstein zu Limette + Yellow to Green Gelb zu Grün + Lime to Teal Limette zu Petrol + Green to Cyan Grün zu Cyan + Teal to Azure Petrol zu Azur + Cyan to Blue Cyan zu Blau + Azure to Violet Azur zu Violett + Blue to Magenta Blau zu Magenta + Violet to Red Violett zu Rot + Magenta to Orange Magenta zu Orange + Dawn Morgendämmerung + Noon Mittag + Sunset Sonnenuntergang + Night Nacht + Overcast Bewölkt + White to Black Weiß zu Schwarz + Light Grays Helle Grautöne + Dark Grays Dunkle Grautöne + Warm Grays Warme Grautöne + Cool Grays Kühle Grautöne + Fade to Transparent Verlauf zu transparent + White Fade Weißer Verlauf + Vignette Vignette + Mist Nebel + Petal Blütenblatt + Fern Farn + Smoke Rauch + Honey Honig + Seafoam Meerschaum + Lavender Lavendel + Driftwood Treibholz + Ink Wash Tuschelavierung + Tide Gezeiten + Bloom Blüte + Dew Tau + Pollen Pollen + Lichen Flechte + Prism Veil Prismenschleier + Opal Ribbon Opalband + Pearl Flash Perlmuttblitz + Aurora Foil Polarlichtfolie + Iris Sheen Irisschimmer + Frost Spectrum Frostspektrum + Silver Tide Silberflut + Rose Quartz Gleam Rosenquarzglanz + Moonstone Shift Mondsteinschimmer + Violet Edge Violetter Rand + Mint Halo Minzhof + Amber Corona Bernsteinkorona + Polar Glint Polarglanz + Pastel Orbit Pastellorbit + Coral and Navy Koralle und Marineblau + Plum and Lime Pflaume und Limette + Teal and Gold Petrol und Gold + Indigo and Peach Indigo und Pfirsich + Forest and Rose Wald und Rosé + Red Glow Rotes Leuchten + Orange Glow Oranges Leuchten + Amber Glow Bernsteinleuchten + Yellow Glow Gelbes Leuchten + Lime Glow Limettenleuchten + Green Glow Grünes Leuchten + Teal Glow Petrolleuchten + Cyan Glow Cyanleuchten + Azure Glow Azurleuchten + Blue Glow Blaues Leuchten + Violet Glow Violettes Leuchten + Magenta Glow Magentaleuchten + Polka Dots Tupfen + Vertical Stripes Senkrechte Streifen + Horizontal Stripes Waagerechte Streifen + Diagonal Stripes Diagonale Streifen + Checkerboard Schachbrett + Diamonds Rauten + Crosses Kreuze + Coarse Grit Grobe Körnung + Stipple Punktierung + Scratches Kratzer + Sparse Flecks Lockere Sprenkel + Dense Flecks Dichte Sprenkel + Sine Bands Sinusbänder + Ripple Lines Wellenlinien + Interference Rings Interferenzringe + Offset Rings Versetzte Ringe + Warped Checks Verzerrte Karos + Pinched Stripes Eingeschnürte Streifen + Chevron Pulse Winkelpuls + Radiating Lenses Strahlende Linsen + Soft Shadow Weicher Schatten + Hard Shadow Harter Schatten + Lifted Card Angehobene Karte + Neon Tube Neonröhre + Inner Light Inneres Licht + Feathered Weiche Kante + Haze Dunst + Double Rule Doppellinie + Triple Rule Dreifachlinie + Dashed Border Gestrichelter Rahmen + Dotted Border Gepunkteter Rahmen + Offset Keyline Versetzte Kontur + Inset Keyline Innere Kontur + Outside Stroke Außenkontur + Pointer Zeiger + Highlighter Textmarker + Sketchy Line Skizzenlinie + Scribble Fill Kritzelfüllung + Wobble Wackeln + Zig Zag Edge Zickzackkante + Wavy Edge Wellenkante + Puffy Aufgebläht + Starburst Sternexplosion + Glossy Glänzend + Brushed Metal Gebürstetes Metall + Spotlight Spotlicht + Sunset Band Abendrotband + Sea Glass Meerglas + Pearl Perle + Chrome Rim Chromrand + Glow Orb Leuchtkugel + Pill Badge Pillenabzeichen + Round Badge Rundes Abzeichen + Flag Wave Flaggenwelle + Bulge Wölbung + Twisted Verdreht + Echo Echo + Spiral Copies Spiralkopien + Multiply Tint Multiplizieren-Tönung + Darken Veil Abdunkeln-Schleier + Ghosted Geisterhaft + Two Tone Zweifarbig + Overlay Glaze Ineinanderkopieren-Lasur + Screen Light Negativ-multiplizieren-Licht + Soft Light Wash Weiches-Licht-Lavierung + Burst Strahlenkranz + Rounded Square Abgerundetes Quadrat + Bar Balken + Fine Dots Feine Punkte + Hexagon Sechseck + Speckle Sprenkel + Spectrum Spektrum + Triangle Dreieck + Vivid Leuchtend Save Brush Library… Pinsel-Bibliothek speichern… @msg `{_1}` has no brushes to apply `{_1}` hat keine Pinsel zum Anwenden @msg missing `library` (see brush.libraries) `library` fehlt (siehe brush.libraries) diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 62e3adc491..0dfddd132a 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6747,6 +6747,240 @@ axis Y Axis Άξονας Y Stars Αστέρια Triangles Τρίγωνα Sparkles Σπίθες + Warm Gray Θερμό γκρι + Cool Gray Ψυχρό γκρι + Neutrals Ουδέτερα + Ivory Ελεφαντόδοντο + Linen Λινό + Oat Βρόμη + Greige Γκρεζ + Stone Πέτρα + Taupe Γκριζοκαφέ + Slate Σχιστόλιθος + Clay Πηλός + Terracotta Τερακότα + Ochre Ώχρα + Umber Σκιά + Sand Άμμος + Olive Λαδί + Moss Βρύα + Rosy Ροδαλό + Neutral Ουδέτερο + Golden Χρυσαφί + Pastel Παστέλ + Pastel Red Παστέλ κόκκινο + Pastel Orange Παστέλ πορτοκαλί + Pastel Amber Παστέλ κεχριμπαρί + Pastel Yellow Παστέλ κίτρινο + Pastel Lime Παστέλ λάιμ + Pastel Green Παστέλ πράσινο + Pastel Teal Παστέλ γαλαζοπράσινο + Pastel Cyan Παστέλ κυανό + Pastel Azure Παστέλ γαλάζιο + Pastel Blue Παστέλ μπλε + Pastel Violet Παστέλ βιολετί + Pastel Magenta Παστέλ ματζέντα + Soft Red Απαλό κόκκινο + Soft Orange Απαλό πορτοκαλί + Soft Amber Απαλό κεχριμπαρί + Soft Yellow Απαλό κίτρινο + Soft Lime Απαλό λάιμ + Soft Green Απαλό πράσινο + Soft Teal Απαλό γαλαζοπράσινο + Soft Cyan Απαλό κυανό + Soft Azure Απαλό γαλάζιο + Soft Blue Απαλό μπλε + Soft Violet Απαλό βιολετί + Soft Magenta Απαλό ματζέντα + Vivid Red Έντονο κόκκινο + Vivid Orange Έντονο πορτοκαλί + Vivid Amber Έντονο κεχριμπαρί + Vivid Yellow Έντονο κίτρινο + Vivid Lime Έντονο λάιμ + Vivid Green Έντονο πράσινο + Vivid Teal Έντονο γαλαζοπράσινο + Vivid Cyan Έντονο κυανό + Vivid Azure Έντονο γαλάζιο + Vivid Blue Έντονο μπλε + Vivid Violet Έντονο βιολετί + Vivid Magenta Έντονο ματζέντα + Deep Βαθιά + Deep Red Βαθύ κόκκινο + Deep Orange Βαθύ πορτοκαλί + Deep Amber Βαθύ κεχριμπαρί + Deep Yellow Βαθύ κίτρινο + Deep Lime Βαθύ λάιμ + Deep Green Βαθύ πράσινο + Deep Teal Βαθύ γαλαζοπράσινο + Deep Cyan Βαθύ κυανό + Deep Azure Βαθύ γαλάζιο + Deep Blue Βαθύ μπλε + Deep Violet Βαθύ βιολετί + Deep Magenta Βαθύ ματζέντα + Gold Χρυσό + Silver Ασημί + Bronze Μπρούντζος + Copper Χαλκός + Brass Ορείχαλκος + Rose Gold Ροζ χρυσό + Gunmetal Ατσαλί + Platinum Πλατίνα + Pewter Κασσίτερος + Ember Θράκα + Lagoon Λιμνοθάλασσα + Dusk Σούρουπο + Clay to Teal Από πηλό σε γαλαζοπράσινο + Plum to Olive Από δαμασκηνί σε λαδί + Complementary Coral Κοραλλί, συμπληρωματικά + Split Complementary Coral Κοραλλί, διαίρεση συμπληρωματικών + Analogous Coral Κοραλλί, ανάλογα + Triad Coral Κοραλλί, τριάδα + Tetrad Coral Κοραλλί, τετράδα + Pentagram Coral Κοραλλί, πεντάγραμμο + Complementary Teal Γαλαζοπράσινο, συμπληρωματικά + Split Complementary Teal Γαλαζοπράσινο, διαίρεση συμπληρωματικών + Analogous Teal Γαλαζοπράσινο, ανάλογα + Triad Teal Γαλαζοπράσινο, τριάδα + Tetrad Teal Γαλαζοπράσινο, τετράδα + Pentagram Teal Γαλαζοπράσινο, πεντάγραμμο + Soft Spectrum Απαλό φάσμα + Red to Amber Από κόκκινο σε κεχριμπαρί + Orange to Yellow Από πορτοκαλί σε κίτρινο + Amber to Lime Από κεχριμπαρί σε λάιμ + Yellow to Green Από κίτρινο σε πράσινο + Lime to Teal Από λάιμ σε γαλαζοπράσινο + Green to Cyan Από πράσινο σε κυανό + Teal to Azure Από γαλαζοπράσινο σε γαλάζιο + Cyan to Blue Από κυανό σε μπλε + Azure to Violet Από γαλάζιο σε βιολετί + Blue to Magenta Από μπλε σε ματζέντα + Violet to Red Από βιολετί σε κόκκινο + Magenta to Orange Από ματζέντα σε πορτοκαλί + Dawn Αυγή + Noon Μεσημέρι + Sunset Ηλιοβασίλεμα + Night Νύχτα + Overcast Συννεφιά + White to Black Από λευκό σε μαύρο + Light Grays Ανοιχτά γκρι + Dark Grays Σκούρα γκρι + Warm Grays Θερμά γκρι + Cool Grays Ψυχρά γκρι + Fade to Transparent Σβήσιμο σε διαφανές + White Fade Λευκό σβήσιμο + Vignette Βινιέτα + Mist Ομίχλη + Petal Πέταλο + Fern Φτέρη + Smoke Καπνός + Honey Μέλι + Seafoam Αφρός θάλασσας + Lavender Λεβάντα + Driftwood Ξύλο θάλασσας + Ink Wash Αραιωμένο μελάνι + Tide Παλίρροια + Bloom Άνθιση + Dew Δροσιά + Pollen Γύρη + Lichen Λειχήνα + Prism Veil Πέπλο πρίσματος + Opal Ribbon Κορδέλα οπαλίου + Pearl Flash Μαργαριταρένια λάμψη + Aurora Foil Φύλλο σέλαος + Iris Sheen Ιριδίζουσα γυαλάδα + Frost Spectrum Παγωμένο φάσμα + Silver Tide Ασημένια παλίρροια + Rose Quartz Gleam Λάμψη ροζ χαλαζία + Moonstone Shift Ανταύγεια σεληνόπετρας + Violet Edge Βιολετί άκρη + Mint Halo Άλως μέντας + Amber Corona Κεχριμπαρένιο στέμμα + Polar Glint Πολική αναλαμπή + Pastel Orbit Παστέλ τροχιά + Coral and Navy Κοραλλί και ναυτικό μπλε + Plum and Lime Δαμασκηνί και λάιμ + Teal and Gold Γαλαζοπράσινο και χρυσό + Indigo and Peach Λουλακί και ροδακινί + Forest and Rose Δάσος και τριαντάφυλλο + Red Glow Κόκκινη λάμψη + Orange Glow Πορτοκαλί λάμψη + Amber Glow Κεχριμπαρένια λάμψη + Yellow Glow Κίτρινη λάμψη + Lime Glow Λάμψη λάιμ + Green Glow Πράσινη λάμψη + Teal Glow Γαλαζοπράσινη λάμψη + Cyan Glow Κυανή λάμψη + Azure Glow Γαλάζια λάμψη + Blue Glow Μπλε λάμψη + Violet Glow Βιολετί λάμψη + Magenta Glow Λάμψη ματζέντα + Polka Dots Πουά + Vertical Stripes Κάθετες ρίγες + Horizontal Stripes Οριζόντιες ρίγες + Diagonal Stripes Διαγώνιες ρίγες + Checkerboard Σκακιέρα + Diamonds Ρόμβοι + Crosses Σταυροί + Coarse Grit Χοντρός κόκκος + Stipple Στικτό + Scratches Γρατσουνιές + Sparse Flecks Αραιές κηλίδες + Dense Flecks Πυκνές κηλίδες + Sine Bands Ημιτονοειδείς ζώνες + Ripple Lines Γραμμές κυματισμού + Interference Rings Δακτύλιοι συμβολής + Offset Rings Μετατοπισμένοι δακτύλιοι + Warped Checks Παραμορφωμένο καρό + Pinched Stripes Στενεμένες ρίγες + Chevron Pulse Παλμός σεβρόν + Radiating Lenses Ακτινωτοί φακοί + Soft Shadow Απαλή σκιά + Hard Shadow Σκληρή σκιά + Lifted Card Ανυψωμένη κάρτα + Neon Tube Σωλήνας νέον + Inner Light Εσωτερικό φως + Feathered Απαλές άκρες + Haze Θολούρα + Double Rule Διπλή γραμμή + Triple Rule Τριπλή γραμμή + Dashed Border Διακεκομμένο περίγραμμα + Dotted Border Περίγραμμα με τελείες + Offset Keyline Μετατοπισμένη γραμμή περιγράμματος + Inset Keyline Εσωτερική γραμμή περιγράμματος + Outside Stroke Εξωτερική πινελιά + Pointer Δείκτης + Highlighter Μαρκαδόρος υπογράμμισης + Sketchy Line Γραμμή σκίτσου + Scribble Fill Γέμισμα με μουτζούρες + Wobble Τρεμούλιασμα + Zig Zag Edge Ζιγκζάγκ άκρη + Wavy Edge Κυματιστή άκρη + Puffy Φουσκωτό + Starburst Έκρηξη αστεριού + Glossy Γυαλιστερό + Brushed Metal Βουρτσισμένο μέταλλο + Spotlight Προβολέας + Sunset Band Ζώνη ηλιοβασιλέματος + Sea Glass Γυαλί θάλασσας + Pearl Μαργαριτάρι + Chrome Rim Χρωμιωμένο χείλος + Glow Orb Φωτεινή σφαίρα + Pill Badge Σήμα κάψουλα + Round Badge Στρογγυλό σήμα + Flag Wave Κυματιστή σημαία + Bulge Διόγκωση + Twisted Στριμμένο + Echo Ηχώ + Spiral Copies Αντίγραφα σε σπείρα + Multiply Tint Απόχρωση πολλαπλασιασμού + Darken Veil Πέπλο σκοτεινιάσματος + Ghosted Φαντασματικό + Two Tone Δίχρωμο + Overlay Glaze Βερνίκι επικάλυψης + Screen Light Φως αρνητικού πολλαπλασιασμού + Soft Light Wash Αραίωση απαλού φωτός + Burst Έκρηξη + Rounded Square Στρογγυλεμένο τετράγωνο Save Brush Library… Αποθήκευση βιβλιοθήκης πινέλων… @msg `{_1}` has no brushes to apply Η `{_1}` δεν έχει πινέλα για εφαρμογή @msg missing `library` (see brush.libraries) λείπει το `library` (δείτε brush.libraries) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index d1c6aa53af..b05b0cf626 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6738,6 +6738,240 @@ axis Y Axis Eje Y Stars Estrellas Triangles Triángulos Sparkles Destellos + Warm Gray Gris cálido + Cool Gray Gris frío + Neutrals Neutros + Ivory Marfil + Linen Lino + Oat Avena + Greige Greige + Stone Piedra + Taupe Topo + Slate Pizarra + Clay Arcilla + Terracotta Terracota + Ochre Ocre + Umber Sombra + Sand Arena + Olive Oliva + Moss Musgo + Rosy Rosado + Neutral Neutro + Golden Dorado + Pastel Pastel + Pastel Red Rojo pastel + Pastel Orange Naranja pastel + Pastel Amber Ámbar pastel + Pastel Yellow Amarillo pastel + Pastel Lime Lima pastel + Pastel Green Verde pastel + Pastel Teal Verde azulado pastel + Pastel Cyan Cian pastel + Pastel Azure Azur pastel + Pastel Blue Azul pastel + Pastel Violet Violeta pastel + Pastel Magenta Magenta pastel + Soft Red Rojo suave + Soft Orange Naranja suave + Soft Amber Ámbar suave + Soft Yellow Amarillo suave + Soft Lime Lima suave + Soft Green Verde suave + Soft Teal Verde azulado suave + Soft Cyan Cian suave + Soft Azure Azur suave + Soft Blue Azul suave + Soft Violet Violeta suave + Soft Magenta Magenta suave + Vivid Red Rojo vivo + Vivid Orange Naranja vivo + Vivid Amber Ámbar vivo + Vivid Yellow Amarillo vivo + Vivid Lime Lima vivo + Vivid Green Verde vivo + Vivid Teal Verde azulado vivo + Vivid Cyan Cian vivo + Vivid Azure Azur vivo + Vivid Blue Azul vivo + Vivid Violet Violeta vivo + Vivid Magenta Magenta vivo + Deep Oscuros + Deep Red Rojo oscuro + Deep Orange Naranja oscuro + Deep Amber Ámbar oscuro + Deep Yellow Amarillo oscuro + Deep Lime Lima oscuro + Deep Green Verde oscuro + Deep Teal Verde azulado oscuro + Deep Cyan Cian oscuro + Deep Azure Azur oscuro + Deep Blue Azul oscuro + Deep Violet Violeta oscuro + Deep Magenta Magenta oscuro + Gold Oro + Silver Plata + Bronze Bronce + Copper Cobre + Brass Latón + Rose Gold Oro rosa + Gunmetal Gris metal + Platinum Platino + Pewter Peltre + Ember Brasa + Lagoon Laguna + Dusk Anochecer + Clay to Teal Arcilla a verde azulado + Plum to Olive Ciruela a oliva + Complementary Coral Coral complementario + Split Complementary Coral Coral complementario dividido + Analogous Coral Coral análogo + Triad Coral Coral en tríada + Tetrad Coral Coral en tétrada + Pentagram Coral Coral en pentagrama + Complementary Teal Verde azulado complementario + Split Complementary Teal Verde azulado complementario dividido + Analogous Teal Verde azulado análogo + Triad Teal Verde azulado en tríada + Tetrad Teal Verde azulado en tétrada + Pentagram Teal Verde azulado en pentagrama + Soft Spectrum Espectro suave + Red to Amber Rojo a ámbar + Orange to Yellow Naranja a amarillo + Amber to Lime Ámbar a lima + Yellow to Green Amarillo a verde + Lime to Teal Lima a verde azulado + Green to Cyan Verde a cian + Teal to Azure Verde azulado a azur + Cyan to Blue Cian a azul + Azure to Violet Azur a violeta + Blue to Magenta Azul a magenta + Violet to Red Violeta a rojo + Magenta to Orange Magenta a naranja + Dawn Amanecer + Noon Mediodía + Sunset Puesta de sol + Night Noche + Overcast Nublado + White to Black Blanco a negro + Light Grays Grises claros + Dark Grays Grises oscuros + Warm Grays Grises cálidos + Cool Grays Grises fríos + Fade to Transparent Fundido a transparente + White Fade Fundido blanco + Vignette Viñeta + Mist Neblina + Petal Pétalo + Fern Helecho + Smoke Humo + Honey Miel + Seafoam Espuma de mar + Lavender Lavanda + Driftwood Madera de deriva + Ink Wash Aguada de tinta + Tide Marea + Bloom Floración + Dew Rocío + Pollen Polen + Lichen Liquen + Prism Veil Velo prismático + Opal Ribbon Cinta de ópalo + Pearl Flash Destello nacarado + Aurora Foil Lámina aurora + Iris Sheen Brillo iris + Frost Spectrum Espectro escarchado + Silver Tide Marea plateada + Rose Quartz Gleam Brillo de cuarzo rosa + Moonstone Shift Reflejo de piedra lunar + Violet Edge Borde violeta + Mint Halo Halo menta + Amber Corona Corona ámbar + Polar Glint Destello polar + Pastel Orbit Órbita pastel + Coral and Navy Coral y azul marino + Plum and Lime Ciruela y lima + Teal and Gold Verde azulado y oro + Indigo and Peach Índigo y melocotón + Forest and Rose Bosque y rosa + Red Glow Resplandor rojo + Orange Glow Resplandor naranja + Amber Glow Resplandor ámbar + Yellow Glow Resplandor amarillo + Lime Glow Resplandor lima + Green Glow Resplandor verde + Teal Glow Resplandor verde azulado + Cyan Glow Resplandor cian + Azure Glow Resplandor azur + Blue Glow Resplandor azul + Violet Glow Resplandor violeta + Magenta Glow Resplandor magenta + Polka Dots Lunares + Vertical Stripes Rayas verticales + Horizontal Stripes Rayas horizontales + Diagonal Stripes Rayas diagonales + Checkerboard Tablero de ajedrez + Diamonds Rombos + Crosses Cruces + Coarse Grit Grano grueso + Stipple Punteado + Scratches Arañazos + Sparse Flecks Motas dispersas + Dense Flecks Motas densas + Sine Bands Bandas sinusoidales + Ripple Lines Líneas onduladas + Interference Rings Anillos de interferencia + Offset Rings Anillos desplazados + Warped Checks Cuadros deformados + Pinched Stripes Rayas pellizcadas + Chevron Pulse Pulso de chevrones + Radiating Lenses Lentes radiantes + Soft Shadow Sombra suave + Hard Shadow Sombra dura + Lifted Card Tarjeta elevada + Neon Tube Tubo de neón + Inner Light Luz interior + Feathered Difuminado + Haze Bruma + Double Rule Filete doble + Triple Rule Filete triple + Dashed Border Borde discontinuo + Dotted Border Borde punteado + Offset Keyline Filete desplazado + Inset Keyline Filete interior + Outside Stroke Trazo exterior + Pointer Puntero + Highlighter Rotulador + Sketchy Line Línea esbozada + Scribble Fill Relleno garabateado + Wobble Tembloroso + Zig Zag Edge Borde en zigzag + Wavy Edge Borde ondulado + Puffy Hinchado + Starburst Estallido estelar + Glossy Brillante + Brushed Metal Metal cepillado + Spotlight Foco + Sunset Band Banda de atardecer + Sea Glass Vidrio marino + Pearl Perla + Chrome Rim Borde cromado + Glow Orb Orbe luminoso + Pill Badge Insignia de píldora + Round Badge Insignia redonda + Flag Wave Bandera ondeante + Bulge Abultamiento + Twisted Retorcido + Echo Eco + Spiral Copies Copias en espiral + Multiply Tint Tinte multiplicar + Darken Veil Velo oscurecer + Ghosted Fantasma + Two Tone Bicolor + Overlay Glaze Veladura superponer + Screen Light Luz trama + Soft Light Wash Aguada luz suave + Burst Estallido + Rounded Square Cuadrado redondeado Save Brush Library… Guardar biblioteca de pinceles… @msg `{_1}` has no brushes to apply `{_1}` no tiene pinceles para aplicar @msg missing `library` (see brush.libraries) falta `library` (consulte brush.libraries) diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 45e47fd355..c23baf586a 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6825,6 +6825,240 @@ axis Y Axis Y-akseli Stars Tähdet Triangles Kolmiot Sparkles Kipinät + Warm Gray Lämmin harmaa + Cool Gray Viileä harmaa + Neutrals Neutraalit + Ivory Norsunluu + Linen Pellava + Oat Kaura + Greige Greige + Stone Kivi + Taupe Taupe + Slate Liuskekivi + Clay Savi + Terracotta Terrakotta + Ochre Okra + Umber Umbra + Sand Hiekka + Olive Oliivi + Moss Sammal + Rosy Ruusuinen + Neutral Neutraali + Golden Kultainen + Pastel Pastelli + Pastel Red Pastellinpunainen + Pastel Orange Pastellinoranssi + Pastel Amber Pastellinmeripihka + Pastel Yellow Pastellinkeltainen + Pastel Lime Pastellinlime + Pastel Green Pastellinvihreä + Pastel Teal Pastellinsinivihreä + Pastel Cyan Pastellinsyaani + Pastel Azure Pastellinasuuri + Pastel Blue Pastellinsininen + Pastel Violet Pastellinvioletti + Pastel Magenta Pastellinmagenta + Soft Red Pehmeä punainen + Soft Orange Pehmeä oranssi + Soft Amber Pehmeä meripihka + Soft Yellow Pehmeä keltainen + Soft Lime Pehmeä lime + Soft Green Pehmeä vihreä + Soft Teal Pehmeä sinivihreä + Soft Cyan Pehmeä syaani + Soft Azure Pehmeä asuuri + Soft Blue Pehmeä sininen + Soft Violet Pehmeä violetti + Soft Magenta Pehmeä magenta + Vivid Red Eloisa punainen + Vivid Orange Eloisa oranssi + Vivid Amber Eloisa meripihka + Vivid Yellow Eloisa keltainen + Vivid Lime Eloisa lime + Vivid Green Eloisa vihreä + Vivid Teal Eloisa sinivihreä + Vivid Cyan Eloisa syaani + Vivid Azure Eloisa asuuri + Vivid Blue Eloisa sininen + Vivid Violet Eloisa violetti + Vivid Magenta Eloisa magenta + Deep Syvät + Deep Red Syvä punainen + Deep Orange Syvä oranssi + Deep Amber Syvä meripihka + Deep Yellow Syvä keltainen + Deep Lime Syvä lime + Deep Green Syvä vihreä + Deep Teal Syvä sinivihreä + Deep Cyan Syvä syaani + Deep Azure Syvä asuuri + Deep Blue Syvä sininen + Deep Violet Syvä violetti + Deep Magenta Syvä magenta + Gold Kulta + Silver Hopea + Bronze Pronssi + Copper Kupari + Brass Messinki + Rose Gold Ruusukulta + Gunmetal Tykkimetalli + Platinum Platina + Pewter Tina + Ember Hiillos + Lagoon Laguuni + Dusk Iltahämärä + Clay to Teal Savesta sinivihreään + Plum to Olive Luumusta oliiviin + Complementary Coral Koralli, vastaväri + Split Complementary Coral Koralli, jaettu vastaväri + Analogous Coral Koralli, analoginen + Triad Coral Koralli, triadi + Tetrad Coral Koralli, tetradi + Pentagram Coral Koralli, pentagrammi + Complementary Teal Sinivihreä, vastaväri + Split Complementary Teal Sinivihreä, jaettu vastaväri + Analogous Teal Sinivihreä, analoginen + Triad Teal Sinivihreä, triadi + Tetrad Teal Sinivihreä, tetradi + Pentagram Teal Sinivihreä, pentagrammi + Soft Spectrum Pehmeä spektri + Red to Amber Punaisesta meripihkaan + Orange to Yellow Oranssista keltaiseen + Amber to Lime Meripihkasta limeen + Yellow to Green Keltaisesta vihreään + Lime to Teal Limestä sinivihreään + Green to Cyan Vihreästä syaaniin + Teal to Azure Sinivihreästä asuuriin + Cyan to Blue Syaanista siniseen + Azure to Violet Asuurista violettiin + Blue to Magenta Sinisestä magentaan + Violet to Red Violetista punaiseen + Magenta to Orange Magentasta oranssiin + Dawn Aamunkoitto + Noon Keskipäivä + Sunset Auringonlasku + Night Yö + Overcast Pilvinen + White to Black Valkoisesta mustaan + Light Grays Vaaleat harmaat + Dark Grays Tummat harmaat + Warm Grays Lämpimät harmaat + Cool Grays Viileät harmaat + Fade to Transparent Häivytys läpinäkyvään + White Fade Valkoinen häivytys + Vignette Vinjetti + Mist Usva + Petal Terälehti + Fern Saniainen + Smoke Savu + Honey Hunaja + Seafoam Merivaahto + Lavender Laventeli + Driftwood Ajopuu + Ink Wash Tussilaveeraus + Tide Vuorovesi + Bloom Kukinta + Dew Kaste + Pollen Siitepöly + Lichen Jäkälä + Prism Veil Prismaharso + Opal Ribbon Opaalinauha + Pearl Flash Helmiäisvälähdys + Aurora Foil Revontulifolio + Iris Sheen Iiriskiilto + Frost Spectrum Huurrespektri + Silver Tide Hopeavuoksi + Rose Quartz Gleam Ruusukvartsin hohde + Moonstone Shift Kuukiven väreily + Violet Edge Violetti reuna + Mint Halo Mintunvärinen kehä + Amber Corona Meripihkakorona + Polar Glint Napakiilto + Pastel Orbit Pastellirata + Coral and Navy Koralli ja laivastonsininen + Plum and Lime Luumu ja lime + Teal and Gold Sinivihreä ja kulta + Indigo and Peach Indigo ja persikka + Forest and Rose Metsä ja ruusu + Red Glow Punainen hehku + Orange Glow Oranssi hehku + Amber Glow Meripihkan hehku + Yellow Glow Keltainen hehku + Lime Glow Limen hehku + Green Glow Vihreä hehku + Teal Glow Sinivihreä hehku + Cyan Glow Syaani hehku + Azure Glow Asuurin hehku + Blue Glow Sininen hehku + Violet Glow Violetti hehku + Magenta Glow Magentan hehku + Polka Dots Pallokuvio + Vertical Stripes Pystyraidat + Horizontal Stripes Vaakaraidat + Diagonal Stripes Vinoraidat + Checkerboard Shakkiruudukko + Diamonds Vinoneliöt + Crosses Ristit + Coarse Grit Karkea rae + Stipple Pisteytys + Scratches Naarmut + Sparse Flecks Harvat täplät + Dense Flecks Tiheät täplät + Sine Bands Siniaaltovyöt + Ripple Lines Väreviivat + Interference Rings Interferenssirenkaat + Offset Rings Siirretyt renkaat + Warped Checks Vääristyneet ruudut + Pinched Stripes Puristetut raidat + Chevron Pulse Nuolikuviopulssi + Radiating Lenses Säteilevät linssit + Soft Shadow Pehmeä varjo + Hard Shadow Terävä varjo + Lifted Card Kohotettu kortti + Neon Tube Neonputki + Inner Light Sisävalo + Feathered Pehmeäreunainen + Haze Utu + Double Rule Kaksoisviiva + Triple Rule Kolmoisviiva + Dashed Border Katkoviivareuna + Dotted Border Pisteviivareuna + Offset Keyline Siirretty ääriviiva + Inset Keyline Sisäinen ääriviiva + Outside Stroke Ulkoreunan viiva + Pointer Osoitin + Highlighter Korostuskynä + Sketchy Line Luonnosviiva + Scribble Fill Töherrystäyttö + Wobble Huojunta + Zig Zag Edge Siksakreuna + Wavy Edge Aaltoreuna + Puffy Pullistunut + Starburst Tähtiräjähdys + Glossy Kiiltävä + Brushed Metal Harjattu metalli + Spotlight Kohdevalo + Sunset Band Auringonlaskun vyö + Sea Glass Merilasi + Pearl Helmi + Chrome Rim Kromireuna + Glow Orb Hehkupallo + Pill Badge Pillerimerkki + Round Badge Pyöreä merkki + Flag Wave Liehuva lippu + Bulge Pullistuma + Twisted Kierretty + Echo Kaiku + Spiral Copies Spiraalikopiot + Multiply Tint Kerro-sävy + Darken Veil Tummenna-harso + Ghosted Haamumainen + Two Tone Kaksivärinen + Overlay Glaze Sulautus-lasite + Screen Light Rasteri-valo + Soft Light Wash Pehmeä valo -laveeraus + Burst Purkaus + Rounded Square Pyöristetty neliö Save Brush Library… Tallenna sivellinkirjasto… @msg `{_1}` has no brushes to apply Kohteessa `{_1}` ei ole käytettäviä siveltimiä @msg missing `library` (see brush.libraries) `library` puuttuu (katso brush.libraries) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 057dce6872..820e1d2f26 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6790,6 +6790,240 @@ axis Y Axis Axe Y Stars Étoiles Triangles Triangles Sparkles Étincelles + Warm Gray Gris chaud + Cool Gray Gris froid + Neutrals Neutres + Ivory Ivoire + Linen Lin + Oat Avoine + Greige Grège + Stone Pierre + Taupe Taupe + Slate Ardoise + Clay Argile + Terracotta Terre cuite + Ochre Ocre + Umber Terre d’ombre + Sand Sable + Olive Olive + Moss Mousse + Rosy Rosé + Neutral Neutre + Golden Doré + Pastel Pastel + Pastel Red Rouge pastel + Pastel Orange Orange pastel + Pastel Amber Ambre pastel + Pastel Yellow Jaune pastel + Pastel Lime Citron vert pastel + Pastel Green Vert pastel + Pastel Teal Sarcelle pastel + Pastel Cyan Cyan pastel + Pastel Azure Azur pastel + Pastel Blue Bleu pastel + Pastel Violet Violet pastel + Pastel Magenta Magenta pastel + Soft Red Rouge doux + Soft Orange Orange doux + Soft Amber Ambre doux + Soft Yellow Jaune doux + Soft Lime Citron vert doux + Soft Green Vert doux + Soft Teal Sarcelle doux + Soft Cyan Cyan doux + Soft Azure Azur doux + Soft Blue Bleu doux + Soft Violet Violet doux + Soft Magenta Magenta doux + Vivid Red Rouge vif + Vivid Orange Orange vif + Vivid Amber Ambre vif + Vivid Yellow Jaune vif + Vivid Lime Citron vert vif + Vivid Green Vert vif + Vivid Teal Sarcelle vif + Vivid Cyan Cyan vif + Vivid Azure Azur vif + Vivid Blue Bleu vif + Vivid Violet Violet vif + Vivid Magenta Magenta vif + Deep Foncés + Deep Red Rouge foncé + Deep Orange Orange foncé + Deep Amber Ambre foncé + Deep Yellow Jaune foncé + Deep Lime Citron vert foncé + Deep Green Vert foncé + Deep Teal Sarcelle foncé + Deep Cyan Cyan foncé + Deep Azure Azur foncé + Deep Blue Bleu foncé + Deep Violet Violet foncé + Deep Magenta Magenta foncé + Gold Or + Silver Argent + Bronze Bronze + Copper Cuivre + Brass Laiton + Rose Gold Or rose + Gunmetal Gris canon + Platinum Platine + Pewter Étain + Ember Braise + Lagoon Lagon + Dusk Crépuscule + Clay to Teal Argile à sarcelle + Plum to Olive Prune à olive + Complementary Coral Corail complémentaire + Split Complementary Coral Corail complémentaire divisée + Analogous Coral Corail analogue + Triad Coral Corail en triade + Tetrad Coral Corail en tétrade + Pentagram Coral Corail en pentagramme + Complementary Teal Sarcelle complémentaire + Split Complementary Teal Sarcelle complémentaire divisée + Analogous Teal Sarcelle analogue + Triad Teal Sarcelle en triade + Tetrad Teal Sarcelle en tétrade + Pentagram Teal Sarcelle en pentagramme + Soft Spectrum Spectre doux + Red to Amber Rouge à ambre + Orange to Yellow Orange à jaune + Amber to Lime Ambre à citron vert + Yellow to Green Jaune à vert + Lime to Teal Citron vert à sarcelle + Green to Cyan Vert à cyan + Teal to Azure Sarcelle à azur + Cyan to Blue Cyan à bleu + Azure to Violet Azur à violet + Blue to Magenta Bleu à magenta + Violet to Red Violet à rouge + Magenta to Orange Magenta à orange + Dawn Aube + Noon Midi + Sunset Coucher de soleil + Night Nuit + Overcast Ciel couvert + White to Black Blanc à noir + Light Grays Gris clairs + Dark Grays Gris foncés + Warm Grays Gris chauds + Cool Grays Gris froids + Fade to Transparent Fondu vers transparent + White Fade Fondu blanc + Vignette Vignette + Mist Brume + Petal Pétale + Fern Fougère + Smoke Fumée + Honey Miel + Seafoam Écume + Lavender Lavande + Driftwood Bois flotté + Ink Wash Lavis d’encre + Tide Marée + Bloom Floraison + Dew Rosée + Pollen Pollen + Lichen Lichen + Prism Veil Voile prismatique + Opal Ribbon Ruban opale + Pearl Flash Éclat nacré + Aurora Foil Feuille aurore + Iris Sheen Reflet iris + Frost Spectrum Spectre givré + Silver Tide Marée argentée + Rose Quartz Gleam Lueur quartz rose + Moonstone Shift Reflet pierre de lune + Violet Edge Bord violet + Mint Halo Halo menthe + Amber Corona Couronne ambrée + Polar Glint Scintillement polaire + Pastel Orbit Orbite pastel + Coral and Navy Corail et marine + Plum and Lime Prune et citron vert + Teal and Gold Sarcelle et or + Indigo and Peach Indigo et pêche + Forest and Rose Forêt et rose + Red Glow Lueur rouge + Orange Glow Lueur orange + Amber Glow Lueur ambre + Yellow Glow Lueur jaune + Lime Glow Lueur citron vert + Green Glow Lueur verte + Teal Glow Lueur sarcelle + Cyan Glow Lueur cyan + Azure Glow Lueur azur + Blue Glow Lueur bleue + Violet Glow Lueur violette + Magenta Glow Lueur magenta + Polka Dots Pois + Vertical Stripes Rayures verticales + Horizontal Stripes Rayures horizontales + Diagonal Stripes Rayures diagonales + Checkerboard Damier + Diamonds Losanges + Crosses Croix + Coarse Grit Grain grossier + Stipple Pointillé + Scratches Éraflures + Sparse Flecks Mouchetures éparses + Dense Flecks Mouchetures denses + Sine Bands Bandes sinusoïdales + Ripple Lines Lignes ondulées + Interference Rings Anneaux d’interférence + Offset Rings Anneaux décalés + Warped Checks Damier déformé + Pinched Stripes Rayures pincées + Chevron Pulse Chevrons pulsés + Radiating Lenses Lentilles rayonnantes + Soft Shadow Ombre douce + Hard Shadow Ombre dure + Lifted Card Carte surélevée + Neon Tube Tube néon + Inner Light Lumière intérieure + Feathered Estompé sur les bords + Haze Brouillard + Double Rule Double filet + Triple Rule Triple filet + Dashed Border Bordure en tirets + Dotted Border Bordure pointillée + Offset Keyline Filet décalé + Inset Keyline Filet intérieur + Outside Stroke Contour extérieur + Pointer Pointeur + Highlighter Surligneur + Sketchy Line Trait esquissé + Scribble Fill Fond griffonné + Wobble Tremblé + Zig Zag Edge Bord en zigzag + Wavy Edge Bord ondulé + Puffy Gonflé + Starburst Éclat d’étoile + Glossy Brillant + Brushed Metal Métal brossé + Spotlight Projecteur + Sunset Band Bande coucher de soleil + Sea Glass Verre de mer + Pearl Perle + Chrome Rim Bord chromé + Glow Orb Orbe lumineux + Pill Badge Badge pilule + Round Badge Badge rond + Flag Wave Drapeau ondulant + Bulge Renflement + Twisted Torsadé + Echo Écho + Spiral Copies Copies en spirale + Multiply Tint Teinte produit + Darken Veil Voile obscurcir + Ghosted Fantôme + Two Tone Bicolore + Overlay Glaze Glacis incrustation + Screen Light Lumière superposition + Soft Light Wash Lavis lumière tamisée + Burst Éclat + Rounded Square Carré arrondi Save Brush Library… Enregistrer la bibliothèque de formes… @msg `{_1}` has no brushes to apply `{_1}` n'a aucune forme à appliquer @msg missing `library` (see brush.libraries) `library` manquant (voir brush.libraries) diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 9d056e085a..391c7d23fe 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -460,6 +460,240 @@ antiAlias Sharp शार्प Stars तारे Triangles त्रिभुज Sparkles चमक + Warm Gray वार्म ग्रे + Cool Gray कूल ग्रे + Neutrals न्यूट्रल रंग + Ivory हाथीदाँत + Linen लिनन + Oat जई + Greige ग्रेज + Stone पत्थर + Taupe टोप + Slate स्लेट + Clay मिट्टी + Terracotta टेराकोटा + Ochre गेरू + Umber अम्बर मिट्टी + Sand रेत + Olive जैतूनी + Moss काई + Rosy गुलाबी आभा + Neutral न्यूट्रल + Golden सुनहरा + Pastel पेस्टल + Pastel Red पेस्टल लाल + Pastel Orange पेस्टल नारंगी + Pastel Amber पेस्टल एम्बर + Pastel Yellow पेस्टल पीला + Pastel Lime पेस्टल लाइम + Pastel Green पेस्टल हरा + Pastel Teal पेस्टल टील + Pastel Cyan पेस्टल सियान + Pastel Azure पेस्टल आसमानी + Pastel Blue पेस्टल नीला + Pastel Violet पेस्टल बैंगनी + Pastel Magenta पेस्टल मैजेंटा + Soft Red सॉफ़्ट लाल + Soft Orange सॉफ़्ट नारंगी + Soft Amber सॉफ़्ट एम्बर + Soft Yellow सॉफ़्ट पीला + Soft Lime सॉफ़्ट लाइम + Soft Green सॉफ़्ट हरा + Soft Teal सॉफ़्ट टील + Soft Cyan सॉफ़्ट सियान + Soft Azure सॉफ़्ट आसमानी + Soft Blue सॉफ़्ट नीला + Soft Violet सॉफ़्ट बैंगनी + Soft Magenta सॉफ़्ट मैजेंटा + Vivid Red चटक लाल + Vivid Orange चटक नारंगी + Vivid Amber चटक एम्बर + Vivid Yellow चटक पीला + Vivid Lime चटक लाइम + Vivid Green चटक हरा + Vivid Teal चटक टील + Vivid Cyan चटक सियान + Vivid Azure चटक आसमानी + Vivid Blue चटक नीला + Vivid Violet चटक बैंगनी + Vivid Magenta चटक मैजेंटा + Deep गहरे + Deep Red गहरा लाल + Deep Orange गहरा नारंगी + Deep Amber गहरा एम्बर + Deep Yellow गहरा पीला + Deep Lime गहरा लाइम + Deep Green गहरा हरा + Deep Teal गहरा टील + Deep Cyan गहरा सियान + Deep Azure गहरा आसमानी + Deep Blue गहरा नीला + Deep Violet गहरा बैंगनी + Deep Magenta गहरा मैजेंटा + Gold सोना + Silver चाँदी + Bronze काँसा + Copper ताँबा + Brass पीतल + Rose Gold रोज़ गोल्ड + Gunmetal गनमेटल + Platinum प्लैटिनम + Pewter प्यूटर + Ember अंगारा + Lagoon लैगून + Dusk साँझ + Clay to Teal मिट्टी से टील + Plum to Olive आलूबुखारा से जैतूनी + Complementary Coral कोरल, पूरक + Split Complementary Coral कोरल, विभाजित पूरक + Analogous Coral कोरल, अनुरूप + Triad Coral कोरल, त्रिदाद + Tetrad Coral कोरल, चतुष्क + Pentagram Coral कोरल, पेंटाग्राम + Complementary Teal टील, पूरक + Split Complementary Teal टील, विभाजित पूरक + Analogous Teal टील, अनुरूप + Triad Teal टील, त्रिदाद + Tetrad Teal टील, चतुष्क + Pentagram Teal टील, पेंटाग्राम + Soft Spectrum सॉफ़्ट स्पेक्ट्रम + Red to Amber लाल से एम्बर + Orange to Yellow नारंगी से पीला + Amber to Lime एम्बर से लाइम + Yellow to Green पीला से हरा + Lime to Teal लाइम से टील + Green to Cyan हरा से सियान + Teal to Azure टील से आसमानी + Cyan to Blue सियान से नीला + Azure to Violet आसमानी से बैंगनी + Blue to Magenta नीला से मैजेंटा + Violet to Red बैंगनी से लाल + Magenta to Orange मैजेंटा से नारंगी + Dawn भोर + Noon दोपहर + Sunset सूर्यास्त + Night रात + Overcast बादल + White to Black सफ़ेद से काला + Light Grays हल्के ग्रे + Dark Grays गहरे ग्रे + Warm Grays वार्म ग्रे रंग + Cool Grays कूल ग्रे रंग + Fade to Transparent पारदर्शी तक फ़ेड + White Fade सफ़ेद फ़ेड + Vignette विनेट + Mist धुंध + Petal पंखुड़ी + Fern फ़र्न + Smoke धुआँ + Honey शहद + Seafoam समुद्री झाग + Lavender लैवेंडर + Driftwood बहती लकड़ी + Ink Wash स्याही वॉश + Tide ज्वार + Bloom खिलना + Dew ओस + Pollen पराग + Lichen लाइकेन + Prism Veil प्रिज़्म परदा + Opal Ribbon ओपल रिबन + Pearl Flash मोती चमक + Aurora Foil ऑरोरा फ़ॉइल + Iris Sheen आइरिस आभा + Frost Spectrum पाला स्पेक्ट्रम + Silver Tide चाँदी ज्वार + Rose Quartz Gleam रोज़ क्वार्ट्ज़ दमक + Moonstone Shift चंद्रमणि झिलमिल + Violet Edge बैंगनी किनारा + Mint Halo पुदीना हलो + Amber Corona एम्बर कोरोना + Polar Glint ध्रुवीय झलक + Pastel Orbit पेस्टल कक्षा + Coral and Navy कोरल व नेवी + Plum and Lime आलूबुखारा व लाइम + Teal and Gold टील व सोना + Indigo and Peach इंडिगो व आड़ू + Forest and Rose जंगल व गुलाब + Red Glow लाल ग्लो + Orange Glow नारंगी ग्लो + Amber Glow एम्बर ग्लो + Yellow Glow पीला ग्लो + Lime Glow लाइम ग्लो + Green Glow हरा ग्लो + Teal Glow टील ग्लो + Cyan Glow सियान ग्लो + Azure Glow आसमानी ग्लो + Blue Glow नीला ग्लो + Violet Glow बैंगनी ग्लो + Magenta Glow मैजेंटा ग्लो + Polka Dots पोल्का डॉट्स + Vertical Stripes खड़ी धारियाँ + Horizontal Stripes आड़ी धारियाँ + Diagonal Stripes तिरछी धारियाँ + Checkerboard चेकरबोर्ड + Diamonds डायमंड + Crosses क्रॉस + Coarse Grit मोटा दाना + Stipple बिंदुकारी + Scratches खरोंचें + Sparse Flecks विरल छींटे + Dense Flecks घने छींटे + Sine Bands साइन पट्टियाँ + Ripple Lines लहर रेखाएँ + Interference Rings व्यतिकरण छल्ले + Offset Rings खिसके छल्ले + Warped Checks मुड़े चेक + Pinched Stripes सिकुड़ी धारियाँ + Chevron Pulse शेवरॉन स्पंदन + Radiating Lenses विकिरित लेंस + Soft Shadow सॉफ़्ट छाया + Hard Shadow कड़ी छाया + Lifted Card उठा कार्ड + Neon Tube नियॉन ट्यूब + Inner Light भीतरी रोशनी + Feathered फ़ेदर किया + Haze कुहासा + Double Rule दोहरी रेखा + Triple Rule तिहरी रेखा + Dashed Border डैश बॉर्डर + Dotted Border डॉट बॉर्डर + Offset Keyline खिसकी कीलाइन + Inset Keyline भीतरी कीलाइन + Outside Stroke बाहरी स्ट्रोक + Pointer पॉइंटर + Highlighter हाइलाइटर + Sketchy Line स्केच रेखा + Scribble Fill स्क्रिबल फ़िल + Wobble डगमग + Zig Zag Edge ज़िगज़ैग किनारा + Wavy Edge लहरदार किनारा + Puffy फूला + Starburst तारा विस्फोट + Glossy चमकदार + Brushed Metal ब्रश्ड मेटल + Spotlight स्पॉटलाइट + Sunset Band सूर्यास्त पट्टी + Sea Glass समुद्री काँच + Pearl मोती + Chrome Rim क्रोम किनारा + Glow Orb ग्लो गोला + Pill Badge पिल बैज + Round Badge गोल बैज + Flag Wave लहराता झंडा + Bulge उभार + Twisted ऐंठा + Echo प्रतिध्वनि + Spiral Copies सर्पिल कॉपियाँ + Multiply Tint मल्टिप्लाई टिंट + Darken Veil डार्कन परदा + Ghosted धुंधला + Two Tone दो टोन + Overlay Glaze ओवरले ग्लेज़ + Screen Light स्क्रीन रोशनी + Soft Light Wash सॉफ़्ट लाइट वॉश + Burst विस्फोट + Rounded Square गोल कोनों वाला वर्ग Art using a deleted global swatch keeps its colour. हटाए गए ग्लोबल स्वॉच वाला आर्टवर्क अपना रंग बनाए रखता है। Artboard आर्टबोर्ड Artboard {n} of {total} {total} में से आर्टबोर्ड {n} @@ -5486,7 +5720,7 @@ antiAlias Sharp शार्प Visibility दृश्यता Visible & Printable Layers दृश्यमान और प्रिंट करने योग्य लेयरें Visible Layers दृश्यमान लेयरें - Vivid विद + Vivid चटक Volume आयतन W: W: Warm गर्म diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index c2f1a52cd9..6ac62c7474 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6778,6 +6778,240 @@ axis Y Axis Y tengely Stars Csillagok Triangles Háromszögek Sparkles Szikrák + Warm Gray Meleg szürke + Cool Gray Hideg szürke + Neutrals Semleges tónusok + Ivory Elefántcsont + Linen Len + Oat Zab + Greige Greige + Stone Kő + Taupe Tópszürke + Slate Pala + Clay Agyag + Terracotta Terrakotta + Ochre Okker + Umber Umbra + Sand Homok + Olive Olíva + Moss Moha + Rosy Rózsás + Neutral Semleges + Golden Aranyos + Pastel Pasztell + Pastel Red Pasztellpiros + Pastel Orange Pasztellnarancs + Pastel Amber Pasztellborostyán + Pastel Yellow Pasztellsárga + Pastel Lime Pasztell-lime + Pastel Green Pasztellzöld + Pastel Teal Pasztell kékeszöld + Pastel Cyan Pasztellcián + Pastel Azure Pasztellazúr + Pastel Blue Pasztellkék + Pastel Violet Pasztellibolya + Pastel Magenta Pasztellmagenta + Soft Red Lágy piros + Soft Orange Lágy narancs + Soft Amber Lágy borostyán + Soft Yellow Lágy sárga + Soft Lime Lágy lime + Soft Green Lágy zöld + Soft Teal Lágy kékeszöld + Soft Cyan Lágy cián + Soft Azure Lágy azúr + Soft Blue Lágy kék + Soft Violet Lágy ibolya + Soft Magenta Lágy magenta + Vivid Red Élénk piros + Vivid Orange Élénk narancs + Vivid Amber Élénk borostyán + Vivid Yellow Élénk sárga + Vivid Lime Élénk lime + Vivid Green Élénk zöld + Vivid Teal Élénk kékeszöld + Vivid Cyan Élénk cián + Vivid Azure Élénk azúr + Vivid Blue Élénk kék + Vivid Violet Élénk ibolya + Vivid Magenta Élénk magenta + Deep Mély + Deep Red Mélypiros + Deep Orange Mélynarancs + Deep Amber Mély borostyán + Deep Yellow Mélysárga + Deep Lime Mély lime + Deep Green Mélyzöld + Deep Teal Mély kékeszöld + Deep Cyan Mély cián + Deep Azure Mély azúr + Deep Blue Mélykék + Deep Violet Mély ibolya + Deep Magenta Mély magenta + Gold Arany + Silver Ezüst + Bronze Bronz + Copper Réz + Brass Sárgaréz + Rose Gold Rozéarany + Gunmetal Ágyúfém + Platinum Platina + Pewter Ón + Ember Parázs + Lagoon Lagúna + Dusk Alkonyat + Clay to Teal Agyagtól kékeszöldig + Plum to Olive Szilvától olíváig + Complementary Coral Korall, kiegészítő + Split Complementary Coral Korall, felosztott kiegészítő + Analogous Coral Korall, analóg + Triad Coral Korall, triád + Tetrad Coral Korall, tetrád + Pentagram Coral Korall, pentagram + Complementary Teal Kékeszöld, kiegészítő + Split Complementary Teal Kékeszöld, felosztott kiegészítő + Analogous Teal Kékeszöld, analóg + Triad Teal Kékeszöld, triád + Tetrad Teal Kékeszöld, tetrád + Pentagram Teal Kékeszöld, pentagram + Soft Spectrum Lágy spektrum + Red to Amber Pirostól borostyánig + Orange to Yellow Narancstól sárgáig + Amber to Lime Borostyántól lime-ig + Yellow to Green Sárgától zöldig + Lime to Teal Lime-tól kékeszöldig + Green to Cyan Zöldtől ciánig + Teal to Azure Kékeszöldtől azúrig + Cyan to Blue Ciántól kékig + Azure to Violet Azúrtól ibolyáig + Blue to Magenta Kéktől magentáig + Violet to Red Ibolyától pirosig + Magenta to Orange Magentától narancsig + Dawn Hajnal + Noon Dél + Sunset Naplemente + Night Éjszaka + Overcast Borult ég + White to Black Fehértől feketéig + Light Grays Világos szürkék + Dark Grays Sötét szürkék + Warm Grays Meleg szürkék + Cool Grays Hideg szürkék + Fade to Transparent Áttűnés átlátszóba + White Fade Fehér áttűnés + Vignette Vignetta + Mist Köd + Petal Szirom + Fern Páfrány + Smoke Füst + Honey Méz + Seafoam Tajték + Lavender Levendula + Driftwood Uszadékfa + Ink Wash Tuslavírozás + Tide Árapály + Bloom Virágzás + Dew Harmat + Pollen Virágpor + Lichen Zuzmó + Prism Veil Prizmafátyol + Opal Ribbon Opálszalag + Pearl Flash Gyöngyházvillanás + Aurora Foil Sarki fény fólia + Iris Sheen Íriszfény + Frost Spectrum Deres spektrum + Silver Tide Ezüst dagály + Rose Quartz Gleam Rózsakvarc csillogás + Moonstone Shift Holdkő játék + Violet Edge Ibolya szegély + Mint Halo Menta fényudvar + Amber Corona Borostyán korona + Polar Glint Sarki csillanás + Pastel Orbit Pasztell pálya + Coral and Navy Korall és tengerészkék + Plum and Lime Szilva és lime + Teal and Gold Kékeszöld és arany + Indigo and Peach Indigó és barack + Forest and Rose Erdő és rózsa + Red Glow Piros izzás + Orange Glow Narancs izzás + Amber Glow Borostyán izzás + Yellow Glow Sárga izzás + Lime Glow Lime izzás + Green Glow Zöld izzás + Teal Glow Kékeszöld izzás + Cyan Glow Cián izzás + Azure Glow Azúr izzás + Blue Glow Kék izzás + Violet Glow Ibolya izzás + Magenta Glow Magenta izzás + Polka Dots Pöttyök + Vertical Stripes Függőleges csíkok + Horizontal Stripes Vízszintes csíkok + Diagonal Stripes Átlós csíkok + Checkerboard Sakktábla + Diamonds Rombuszok + Crosses Keresztek + Coarse Grit Durva szemcse + Stipple Pontozás + Scratches Karcolások + Sparse Flecks Ritka pöttyözés + Dense Flecks Sűrű pöttyözés + Sine Bands Szinuszsávok + Ripple Lines Fodrozódó vonalak + Interference Rings Interferenciagyűrűk + Offset Rings Eltolt gyűrűk + Warped Checks Torzított kockák + Pinched Stripes Összecsípett csíkok + Chevron Pulse Chevronlüktetés + Radiating Lenses Sugárzó lencsék + Soft Shadow Lágy árnyék + Hard Shadow Éles árnyék + Lifted Card Kiemelt kártya + Neon Tube Neoncső + Inner Light Belső fény + Feathered Lágy szélű + Haze Pára + Double Rule Dupla vonal + Triple Rule Tripla vonal + Dashed Border Szaggatott szegély + Dotted Border Pontozott szegély + Offset Keyline Eltolt körvonal + Inset Keyline Belső körvonal + Outside Stroke Külső körvonal + Pointer Mutató + Highlighter Kiemelő + Sketchy Line Vázlatos vonal + Scribble Fill Firkált kitöltés + Wobble Remegés + Zig Zag Edge Cikcakkos szél + Wavy Edge Hullámos szél + Puffy Puffadt + Starburst Csillagrobbanás + Glossy Fényes + Brushed Metal Szálcsiszolt fém + Spotlight Reflektor + Sunset Band Naplementesáv + Sea Glass Tengeri üveg + Pearl Gyöngy + Chrome Rim Krómperem + Glow Orb Izzó gömb + Pill Badge Kapszula jelvény + Round Badge Kerek jelvény + Flag Wave Lobogó zászló + Bulge Kidudorodás + Twisted Csavart + Echo Visszhang + Spiral Copies Spirális másolatok + Multiply Tint Szorzás árnyalat + Darken Veil Sötétítés fátyol + Ghosted Áttetsző + Two Tone Kéttónusú + Overlay Glaze Átfedés máz + Screen Light Képernyő fény + Soft Light Wash Lágy fény lavírozás + Burst Robbanás + Rounded Square Lekerekített négyzet Save Brush Library… Ecsetkönyvtár mentése… @msg `{_1}` has no brushes to apply A(z) `{_1}` nem tartalmaz alkalmazható ecsetet @msg missing `library` (see brush.libraries) hiányzik a `library` (lásd: brush.libraries) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index a36c629332..6409d26f2c 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6257,6 +6257,240 @@ axis Y Axis Sumbu Y Stars Bintang Triangles Segitiga Sparkles Kilauan + Warm Gray Abu-abu hangat + Cool Gray Abu-abu sejuk + Neutrals Warna netral + Ivory Gading + Linen Linen + Oat Gandum + Greige Greige + Stone Batu + Taupe Taupe + Slate Batu tulis + Clay Tanah liat + Terracotta Terakota + Ochre Oker + Umber Umber + Sand Pasir + Olive Zaitun + Moss Lumut + Rosy Kemerahan + Neutral Netral + Golden Keemasan + Pastel Pastel + Pastel Red Merah pastel + Pastel Orange Oranye pastel + Pastel Amber Amber pastel + Pastel Yellow Kuning pastel + Pastel Lime Limau pastel + Pastel Green Hijau pastel + Pastel Teal Hijau toska pastel + Pastel Cyan Sian pastel + Pastel Azure Biru langit pastel + Pastel Blue Biru pastel + Pastel Violet Violet pastel + Pastel Magenta Magenta pastel + Soft Red Merah lembut + Soft Orange Oranye lembut + Soft Amber Amber lembut + Soft Yellow Kuning lembut + Soft Lime Limau lembut + Soft Green Hijau lembut + Soft Teal Hijau toska lembut + Soft Cyan Sian lembut + Soft Azure Biru langit lembut + Soft Blue Biru lembut + Soft Violet Violet lembut + Soft Magenta Magenta lembut + Vivid Red Merah cerah + Vivid Orange Oranye cerah + Vivid Amber Amber cerah + Vivid Yellow Kuning cerah + Vivid Lime Limau cerah + Vivid Green Hijau cerah + Vivid Teal Hijau toska cerah + Vivid Cyan Sian cerah + Vivid Azure Biru langit cerah + Vivid Blue Biru cerah + Vivid Violet Violet cerah + Vivid Magenta Magenta cerah + Deep Pekat + Deep Red Merah pekat + Deep Orange Oranye pekat + Deep Amber Amber pekat + Deep Yellow Kuning pekat + Deep Lime Limau pekat + Deep Green Hijau pekat + Deep Teal Hijau toska pekat + Deep Cyan Sian pekat + Deep Azure Biru langit pekat + Deep Blue Biru pekat + Deep Violet Violet pekat + Deep Magenta Magenta pekat + Gold Emas + Silver Perak + Bronze Perunggu + Copper Tembaga + Brass Kuningan + Rose Gold Emas mawar + Gunmetal Abu-abu logam + Platinum Platina + Pewter Timah + Ember Bara + Lagoon Laguna + Dusk Senja + Clay to Teal Tanah liat ke hijau toska + Plum to Olive Prem ke zaitun + Complementary Coral Koral komplementer + Split Complementary Coral Koral komplementer terpisah + Analogous Coral Koral analog + Triad Coral Koral triad + Tetrad Coral Koral tetrad + Pentagram Coral Koral pentagram + Complementary Teal Hijau toska komplementer + Split Complementary Teal Hijau toska komplementer terpisah + Analogous Teal Hijau toska analog + Triad Teal Hijau toska triad + Tetrad Teal Hijau toska tetrad + Pentagram Teal Hijau toska pentagram + Soft Spectrum Spektrum lembut + Red to Amber Merah ke amber + Orange to Yellow Oranye ke kuning + Amber to Lime Amber ke limau + Yellow to Green Kuning ke hijau + Lime to Teal Limau ke hijau toska + Green to Cyan Hijau ke sian + Teal to Azure Hijau toska ke biru langit + Cyan to Blue Sian ke biru + Azure to Violet Biru langit ke violet + Blue to Magenta Biru ke magenta + Violet to Red Violet ke merah + Magenta to Orange Magenta ke oranye + Dawn Fajar + Noon Tengah hari + Sunset Matahari terbenam + Night Malam + Overcast Mendung + White to Black Putih ke hitam + Light Grays Abu-abu terang + Dark Grays Abu-abu gelap + Warm Grays Gradasi abu-abu hangat + Cool Grays Gradasi abu-abu sejuk + Fade to Transparent Memudar ke transparan + White Fade Pudar putih + Vignette Vinyet + Mist Kabut + Petal Kelopak + Fern Pakis + Smoke Asap + Honey Madu + Seafoam Buih laut + Lavender Lavender + Driftwood Kayu apung + Ink Wash Sapuan tinta + Tide Pasang surut + Bloom Mekar + Dew Embun + Pollen Serbuk sari + Lichen Lumut kerak + Prism Veil Selubung prisma + Opal Ribbon Pita opal + Pearl Flash Kilatan mutiara + Aurora Foil Foil aurora + Iris Sheen Kilau iris + Frost Spectrum Spektrum beku + Silver Tide Pasang perak + Rose Quartz Gleam Kilau kuarsa mawar + Moonstone Shift Kilau batu bulan + Violet Edge Tepi violet + Mint Halo Halo mint + Amber Corona Korona amber + Polar Glint Kerlip kutub + Pastel Orbit Orbit pastel + Coral and Navy Koral dan biru dongker + Plum and Lime Prem dan limau + Teal and Gold Hijau toska dan emas + Indigo and Peach Nila dan persik + Forest and Rose Hutan dan mawar + Red Glow Pendar merah + Orange Glow Pendar oranye + Amber Glow Pendar amber + Yellow Glow Pendar kuning + Lime Glow Pendar limau + Green Glow Pendar hijau + Teal Glow Pendar hijau toska + Cyan Glow Pendar sian + Azure Glow Pendar biru langit + Blue Glow Pendar biru + Violet Glow Pendar violet + Magenta Glow Pendar magenta + Polka Dots Polkadot + Vertical Stripes Garis vertikal + Horizontal Stripes Garis horizontal + Diagonal Stripes Garis diagonal + Checkerboard Papan catur + Diamonds Belah ketupat + Crosses Silang + Coarse Grit Butiran kasar + Stipple Titik-titik + Scratches Goresan + Sparse Flecks Bintik jarang + Dense Flecks Bintik rapat + Sine Bands Pita sinus + Ripple Lines Garis riak + Interference Rings Cincin interferensi + Offset Rings Cincin bergeser + Warped Checks Kotak melengkung + Pinched Stripes Garis terjepit + Chevron Pulse Denyut chevron + Radiating Lenses Lensa memancar + Soft Shadow Bayangan lembut + Hard Shadow Bayangan tajam + Lifted Card Kartu terangkat + Neon Tube Tabung neon + Inner Light Cahaya dalam + Feathered Tepi lembut + Haze Kabut tipis + Double Rule Garis ganda + Triple Rule Garis rangkap tiga + Dashed Border Bingkai putus-putus + Dotted Border Bingkai bertitik + Offset Keyline Garis kontur bergeser + Inset Keyline Garis kontur dalam + Outside Stroke Goresan luar + Pointer Penunjuk + Highlighter Stabilo + Sketchy Line Garis sketsa + Scribble Fill Isian coretan + Wobble Goyang + Zig Zag Edge Tepi zigzag + Wavy Edge Tepi bergelombang + Puffy Menggembung + Starburst Ledakan bintang + Glossy Mengilap + Brushed Metal Logam disikat + Spotlight Lampu sorot + Sunset Band Pita senja + Sea Glass Kaca laut + Pearl Mutiara + Chrome Rim Bingkai krom + Glow Orb Bola berpendar + Pill Badge Lencana pil + Round Badge Lencana bulat + Flag Wave Bendera berkibar + Bulge Menggelembung + Twisted Terpuntir + Echo Gema + Spiral Copies Salinan spiral + Multiply Tint Rona multiply + Darken Veil Selubung menggelapkan + Ghosted Samar + Two Tone Dua warna + Overlay Glaze Glasir menimpa + Screen Light Cahaya layar + Soft Light Wash Sapuan cahaya lembut + Burst Ledakan + Rounded Square Persegi bulat Save Brush Library… Simpan pustaka kuas… @msg no empty artboards to delete tidak ada artboard kosong untuk dihapus Scale Presets Preset skala diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 0ac2816b07..c01745f673 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6421,6 +6421,245 @@ axis Y Axis Asse Y Stars Stelle Triangles Triangoli Sparkles Scintille + Warm Gray Grigio caldo + Cool Gray Grigio freddo + Neutrals Neutri + Ivory Avorio + Linen Lino + Oat Avena + Greige Greige + Stone Pietra + Taupe Tortora + Slate Ardesia + Clay Argilla + Terracotta Terracotta + Ochre Ocra + Umber Terra d'ombra + Sand Sabbia + Olive Oliva + Moss Muschio + Rosy Rosato + Neutral Neutro + Golden Dorato + Pastel Pastello + Pastel Red Rosso pastello + Pastel Orange Arancione pastello + Pastel Amber Ambra pastello + Pastel Yellow Giallo pastello + Pastel Lime Lime pastello + Pastel Green Verde pastello + Pastel Teal Verde acqua pastello + Pastel Cyan Ciano pastello + Pastel Azure Azzurro pastello + Pastel Blue Blu pastello + Pastel Violet Viola pastello + Pastel Magenta Magenta pastello + Soft Red Rosso tenue + Soft Orange Arancione tenue + Soft Amber Ambra tenue + Soft Yellow Giallo tenue + Soft Lime Lime tenue + Soft Green Verde tenue + Soft Teal Verde acqua tenue + Soft Cyan Ciano tenue + Soft Azure Azzurro tenue + Soft Blue Blu tenue + Soft Violet Viola tenue + Soft Magenta Magenta tenue + Vivid Red Rosso vivo + Vivid Orange Arancione vivo + Vivid Amber Ambra vivo + Vivid Yellow Giallo vivo + Vivid Lime Lime vivo + Vivid Green Verde vivo + Vivid Teal Verde acqua vivo + Vivid Cyan Ciano vivo + Vivid Azure Azzurro vivo + Vivid Blue Blu vivo + Vivid Violet Viola vivo + Vivid Magenta Magenta vivo + Deep Scuri + Deep Red Rosso scuro + Deep Orange Arancione scuro + Deep Amber Ambra scuro + Deep Yellow Giallo scuro + Deep Lime Lime scuro + Deep Green Verde scuro + Deep Teal Verde acqua scuro + Deep Cyan Ciano scuro + Deep Azure Azzurro scuro + Deep Blue Blu scuro + Deep Violet Viola scuro + Deep Magenta Magenta scuro + Gold Oro + Silver Argento + Bronze Bronzo + Copper Rame + Brass Ottone + Rose Gold Oro rosa + Gunmetal Canna di fucile + Platinum Platino + Pewter Peltro + Ember Brace + Lagoon Laguna + Dusk Crepuscolo + Clay to Teal Argilla a verde acqua + Plum to Olive Prugna a oliva + Complementary Coral Corallo complementare + Split Complementary Coral Corallo complementare diviso + Analogous Coral Corallo analogo + Triad Coral Corallo in triade + Tetrad Coral Corallo in tetrade + Pentagram Coral Corallo in pentagramma + Complementary Teal Verde acqua complementare + Split Complementary Teal Verde acqua complementare diviso + Analogous Teal Verde acqua analogo + Triad Teal Verde acqua in triade + Tetrad Teal Verde acqua in tetrade + Pentagram Teal Verde acqua in pentagramma + Soft Spectrum Spettro tenue + Red to Amber Da rosso ad ambra + Orange to Yellow Da arancione a giallo + Amber to Lime Da ambra a lime + Yellow to Green Da giallo a verde + Lime to Teal Da lime a verde acqua + Green to Cyan Da verde a ciano + Teal to Azure Da verde acqua ad azzurro + Cyan to Blue Da ciano a blu + Azure to Violet Da azzurro a viola + Blue to Magenta Da blu a magenta + Violet to Red Da viola a rosso + Magenta to Orange Da magenta ad arancione + Dawn Alba + Noon Mezzogiorno + Sunset Tramonto + Night Notte + Overcast Nuvoloso + White to Black Da bianco a nero + Light Grays Grigi chiari + Dark Grays Grigi scuri + Warm Grays Grigi caldi + Cool Grays Grigi freddi + Fade to Transparent Dissolvenza a trasparente + White Fade Dissolvenza bianca + Vignette Vignettatura + Mist Foschia + Petal Petalo + Fern Felce + Smoke Fumo + Honey Miele + Seafoam Schiuma di mare + Lavender Lavanda + Driftwood Legno di mare + Ink Wash Acquerello a inchiostro + Tide Marea + Bloom Fioritura + Dew Rugiada + Pollen Polline + Lichen Lichene + Prism Veil Velo prismatico + Opal Ribbon Nastro opale + Pearl Flash Lampo perlato + Aurora Foil Lamina aurora + Iris Sheen Riflesso iride + Frost Spectrum Spettro brinato + Silver Tide Marea argentata + Rose Quartz Gleam Bagliore quarzo rosa + Moonstone Shift Riflesso pietra di luna + Violet Edge Bordo viola + Mint Halo Alone menta + Amber Corona Corona ambrata + Polar Glint Luccichio polare + Pastel Orbit Orbita pastello + Coral and Navy Corallo e blu navy + Plum and Lime Prugna e lime + Teal and Gold Verde acqua e oro + Indigo and Peach Indaco e pesca + Forest and Rose Foresta e rosa + Red Glow Bagliore rosso + Orange Glow Bagliore arancione + Amber Glow Bagliore ambra + Yellow Glow Bagliore giallo + Lime Glow Bagliore lime + Green Glow Bagliore verde + Teal Glow Bagliore verde acqua + Cyan Glow Bagliore ciano + Azure Glow Bagliore azzurro + Blue Glow Bagliore blu + Violet Glow Bagliore viola + Magenta Glow Bagliore magenta + Polka Dots Pois + Vertical Stripes Righe verticali + Horizontal Stripes Righe orizzontali + Diagonal Stripes Righe diagonali + Checkerboard Scacchiera + Diamonds Rombi + Crosses Croci + Coarse Grit Grana grossa + Stipple Puntinato + Scratches Graffi + Sparse Flecks Macchioline rade + Dense Flecks Macchioline fitte + Sine Bands Bande sinusoidali + Ripple Lines Linee increspate + Interference Rings Anelli di interferenza + Offset Rings Anelli sfalsati + Warped Checks Quadretti deformati + Pinched Stripes Righe strozzate + Chevron Pulse Impulso a chevron + Radiating Lenses Lenti radianti + Soft Shadow Ombra morbida + Hard Shadow Ombra netta + Lifted Card Scheda sollevata + Neon Tube Tubo al neon + Inner Light Luce interna + Feathered Sfumato + Haze Velatura + Double Rule Filetto doppio + Triple Rule Filetto triplo + Dashed Border Bordo tratteggiato + Dotted Border Bordo punteggiato + Offset Keyline Filetto sfalsato + Inset Keyline Filetto interno + Outside Stroke Traccia esterna + Pointer Puntatore + Highlighter Evidenziatore + Sketchy Line Linea abbozzata + Scribble Fill Riempimento scarabocchiato + Wobble Tremolio + Zig Zag Edge Bordo a zigzag + Wavy Edge Bordo ondulato + Puffy Gonfio + Starburst Esplosione stellare + Glossy Lucido + Brushed Metal Metallo spazzolato + Spotlight Riflettore + Sunset Band Fascia tramonto + Sea Glass Vetro di mare + Pearl Perla + Chrome Rim Bordo cromato + Glow Orb Sfera luminosa + Pill Badge Badge a pillola + Round Badge Badge rotondo + Flag Wave Bandiera ondeggiante + Bulge Rigonfiamento + Twisted Ritorto + Echo Eco + Spiral Copies Copie a spirale + Multiply Tint Tinta moltiplica + Darken Veil Velo scurisci + Ghosted Fantasma + Two Tone Bicolore + Overlay Glaze Velatura sovrapponi + Screen Light Luce schermo + Soft Light Wash Acquerello luce soffusa + Burst Esplosione + Rounded Square Quadrato arrotondato + Bar Barra + Hexagon Esagono + Spectrum Spettro + Triangle Triangolo + Vivid Vivi Save Brush Library… Salva libreria pennelli… @msg `{_1}` has no brushes to apply `{_1}` non ha pennelli da applicare @msg missing `library` (see brush.libraries) manca `library` (vedi brush.libraries) diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 71de1ce91c..63a657e74d 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -6487,6 +6487,245 @@ axis Y Axis Y 軸 Stars 星 Triangles 三角形 Sparkles きらめき + Warm Gray ウォームグレー + Cool Gray クールグレー + Neutrals ニュートラル系 + Ivory アイボリー + Linen リネン + Oat オート + Greige グレージュ + Stone ストーン + Taupe トープ + Slate スレート + Clay クレイ + Terracotta テラコッタ + Ochre オーカー + Umber 焦げ茶 + Sand サンド + Olive オリーブ + Moss モス + Rosy ロージー + Neutral ニュートラル + Golden ゴールデン + Pastel パステル + Pastel Red パステルレッド + Pastel Orange パステルオレンジ + Pastel Amber パステルアンバー + Pastel Yellow パステルイエロー + Pastel Lime パステルライム + Pastel Green パステルグリーン + Pastel Teal パステルティール + Pastel Cyan パステルシアン + Pastel Azure パステルアジュール + Pastel Blue パステルブルー + Pastel Violet パステルバイオレット + Pastel Magenta パステルマゼンタ + Soft Red ソフトレッド + Soft Orange ソフトオレンジ + Soft Amber ソフトアンバー + Soft Yellow ソフトイエロー + Soft Lime ソフトライム + Soft Green ソフトグリーン + Soft Teal ソフトティール + Soft Cyan ソフトシアン + Soft Azure ソフトアジュール + Soft Blue ソフトブルー + Soft Violet ソフトバイオレット + Soft Magenta ソフトマゼンタ + Vivid Red ビビッドレッド + Vivid Orange ビビッドオレンジ + Vivid Amber ビビッドアンバー + Vivid Yellow ビビッドイエロー + Vivid Lime ビビッドライム + Vivid Green ビビッドグリーン + Vivid Teal ビビッドティール + Vivid Cyan ビビッドシアン + Vivid Azure ビビッドアジュール + Vivid Blue ビビッドブルー + Vivid Violet ビビッドバイオレット + Vivid Magenta ビビッドマゼンタ + Deep ディープ + Deep Red ディープレッド + Deep Orange ディープオレンジ + Deep Amber ディープアンバー + Deep Yellow ディープイエロー + Deep Lime ディープライム + Deep Green ディープグリーン + Deep Teal ディープティール + Deep Cyan ディープシアン + Deep Azure ディープアジュール + Deep Blue ディープブルー + Deep Violet ディープバイオレット + Deep Magenta ディープマゼンタ + Gold ゴールド + Silver シルバー + Bronze ブロンズ + Copper カッパー + Brass ブラス + Rose Gold ローズゴールド + Gunmetal ガンメタル + Platinum プラチナ + Pewter ピューター + Ember 残り火 + Lagoon ラグーン + Dusk 夕暮れ + Clay to Teal クレイからティール + Plum to Olive プラムからオリーブ + Complementary Coral コーラル (補色) + Split Complementary Coral コーラル (分割補色) + Analogous Coral コーラル (類似色) + Triad Coral コーラル (トライアド) + Tetrad Coral コーラル (テトラード) + Pentagram Coral コーラル (ペンタグラム) + Complementary Teal ティール (補色) + Split Complementary Teal ティール (分割補色) + Analogous Teal ティール (類似色) + Triad Teal ティール (トライアド) + Tetrad Teal ティール (テトラード) + Pentagram Teal ティール (ペンタグラム) + Soft Spectrum ソフトスペクトル + Red to Amber レッドからアンバー + Orange to Yellow オレンジからイエロー + Amber to Lime アンバーからライム + Yellow to Green イエローからグリーン + Lime to Teal ライムからティール + Green to Cyan グリーンからシアン + Teal to Azure ティールからアジュール + Cyan to Blue シアンからブルー + Azure to Violet アジュールからバイオレット + Blue to Magenta ブルーからマゼンタ + Violet to Red バイオレットからレッド + Magenta to Orange マゼンタからオレンジ + Dawn 夜明け + Noon 正午 + Sunset 夕焼け + Night 夜 + Overcast 曇り空 + White to Black ホワイトからブラック + Light Grays ライトグレー + Dark Grays ダークグレー + Warm Grays ウォームグレー系 + Cool Grays クールグレー系 + Fade to Transparent 透明へフェード + White Fade ホワイトフェード + Vignette ビネット + Mist ミスト + Petal 花びら + Fern シダ + Smoke スモーク + Honey ハニー + Seafoam シーフォーム + Lavender ラベンダー + Driftwood 流木 + Ink Wash 墨のにじみ + Tide 潮 + Bloom 開花 + Dew 露 + Pollen 花粉 + Lichen 地衣 + Prism Veil プリズムベール + Opal Ribbon オパールリボン + Pearl Flash パールフラッシュ + Aurora Foil オーロラ箔 + Iris Sheen 虹彩の光沢 + Frost Spectrum 霜のスペクトル + Silver Tide 銀の潮 + Rose Quartz Gleam ローズクォーツの輝き + Moonstone Shift ムーンストーンの揺らめき + Violet Edge バイオレットの縁 + Mint Halo ミントのハロー + Amber Corona アンバーのコロナ + Polar Glint 極光のきらめき + Pastel Orbit パステルの軌道 + Coral and Navy コーラルとネイビー + Plum and Lime プラムとライム + Teal and Gold ティールとゴールド + Indigo and Peach インディゴとピーチ + Forest and Rose フォレストとローズ + Red Glow レッドグロー + Orange Glow オレンジグロー + Amber Glow アンバーグロー + Yellow Glow イエローグロー + Lime Glow ライムグロー + Green Glow グリーングロー + Teal Glow ティールグロー + Cyan Glow シアングロー + Azure Glow アジュールグロー + Blue Glow ブルーグロー + Violet Glow バイオレットグロー + Magenta Glow マゼンタグロー + Polka Dots 水玉 + Vertical Stripes 縦ストライプ + Horizontal Stripes 横ストライプ + Diagonal Stripes 斜めストライプ + Checkerboard 市松模様 + Diamonds ダイヤ柄 + Crosses 十字柄 + Coarse Grit 粗い粒子 + Stipple 点描 + Scratches 引っかき傷 + Sparse Flecks まばらな斑点 + Dense Flecks 密な斑点 + Sine Bands 正弦波の帯 + Ripple Lines 波紋線 + Interference Rings 干渉リング + Offset Rings ずれたリング + Warped Checks ゆがんだチェック + Pinched Stripes すぼまったストライプ + Chevron Pulse 山形パルス + Radiating Lenses 放射状レンズ + Soft Shadow ソフトシャドウ + Hard Shadow ハードシャドウ + Lifted Card 浮き上がったカード + Neon Tube ネオン管 + Inner Light 内側の光 + Feathered ぼかし + Haze もや + Double Rule 二重罫線 + Triple Rule 三重罫線 + Dashed Border 破線の枠 + Dotted Border 点線の枠 + Offset Keyline オフセットキーライン + Inset Keyline 内側キーライン + Outside Stroke 外側の線 + Pointer ポインター + Highlighter 蛍光ペン + Sketchy Line スケッチ風の線 + Scribble Fill 落書き風塗り + Wobble 揺らぎ + Zig Zag Edge ジグザグの縁 + Wavy Edge 波形の縁 + Puffy ふくらみ + Starburst スターバースト + Glossy 光沢 + Brushed Metal ヘアライン金属 + Spotlight スポットライト + Sunset Band 夕焼けの帯 + Sea Glass シーグラス + Pearl パール + Chrome Rim クロームの縁 + Glow Orb 光る球 + Pill Badge ピル型バッジ + Round Badge 丸型バッジ + Flag Wave 旗のなびき + Bulge 膨らみ + Twisted ねじれ + Echo エコー + Spiral Copies らせん状のコピー + Multiply Tint 乗算の色合い + Darken Veil 比較 (暗) のベール + Ghosted 半透明 + Two Tone ツートーン + Overlay Glaze オーバーレイの釉 + Screen Light スクリーンの光 + Soft Light Wash ソフトライトのにじみ + Burst バースト + Rounded Square 角丸の正方形 + Bar バー + Hexagon 六角形 + Spectrum スペクトル + Triangle 三角形 + Vivid ビビッド Save Brush Library… ブラシライブラリを保存… @msg `{_1}` has no brushes to apply `{_1}` に適用できるブラシがありません @msg missing `library` (see brush.libraries) `library` がありません (brush.libraries を参照) diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 2cff51d94b..34e8ce4608 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6746,6 +6746,240 @@ axis Y Axis Y ღერძი Stars ვარსკვლავები Triangles სამკუთხედები Sparkles ნაპერწკლები + Warm Gray თბილი ნაცრისფერი + Cool Gray ცივი ნაცრისფერი + Neutrals ნეიტრალურები + Ivory სპილოს ძვალი + Linen სელი + Oat შვრია + Greige ნაცრისფერ-ბეჟი + Stone ქვა + Taupe ნაცრისფერ-ყავისფერი + Slate ფიქალი + Clay თიხა + Terracotta ტერაკოტა + Ochre ოხრა + Umber უმბრა + Sand ქვიშა + Olive ზეთისხილისფერი + Moss ხავსი + Rosy ვარდისფრადი + Neutral ნეიტრალური + Golden ოქროსფერი + Pastel პასტელური + Pastel Red პასტელური წითელი + Pastel Orange პასტელური ნარინჯისფერი + Pastel Amber პასტელური ქარვისფერი + Pastel Yellow პასტელური ყვითელი + Pastel Lime პასტელური ლაიმისფერი + Pastel Green პასტელური მწვანე + Pastel Teal პასტელური ზღვისფერი + Pastel Cyan პასტელური ცისფერი + Pastel Azure პასტელური ლაჟვარდისფერი + Pastel Blue პასტელური ლურჯი + Pastel Violet პასტელური იისფერი + Pastel Magenta პასტელური მეწამული + Soft Red რბილი წითელი + Soft Orange რბილი ნარინჯისფერი + Soft Amber რბილი ქარვისფერი + Soft Yellow რბილი ყვითელი + Soft Lime რბილი ლაიმისფერი + Soft Green რბილი მწვანე + Soft Teal რბილი ზღვისფერი + Soft Cyan რბილი ცისფერი + Soft Azure რბილი ლაჟვარდისფერი + Soft Blue რბილი ლურჯი + Soft Violet რბილი იისფერი + Soft Magenta რბილი მეწამული + Vivid Red ცოცხალი წითელი + Vivid Orange ცოცხალი ნარინჯისფერი + Vivid Amber ცოცხალი ქარვისფერი + Vivid Yellow ცოცხალი ყვითელი + Vivid Lime ცოცხალი ლაიმისფერი + Vivid Green ცოცხალი მწვანე + Vivid Teal ცოცხალი ზღვისფერი + Vivid Cyan ცოცხალი ცისფერი + Vivid Azure ცოცხალი ლაჟვარდისფერი + Vivid Blue ცოცხალი ლურჯი + Vivid Violet ცოცხალი იისფერი + Vivid Magenta ცოცხალი მეწამული + Deep მუქი + Deep Red მუქი წითელი + Deep Orange მუქი ნარინჯისფერი + Deep Amber მუქი ქარვისფერი + Deep Yellow მუქი ყვითელი + Deep Lime მუქი ლაიმისფერი + Deep Green მუქი მწვანე + Deep Teal მუქი ზღვისფერი + Deep Cyan მუქი ცისფერი + Deep Azure მუქი ლაჟვარდისფერი + Deep Blue მუქი ლურჯი + Deep Violet მუქი იისფერი + Deep Magenta მუქი მეწამული + Gold ოქრო + Silver ვერცხლი + Bronze ბრინჯაო + Copper სპილენძი + Brass თითბერი + Rose Gold ვარდისფერი ოქრო + Gunmetal ფოლადისფერი + Platinum პლატინა + Pewter კალა + Ember ნაკვერჩხალი + Lagoon ლაგუნა + Dusk ბინდი + Clay to Teal თიხიდან ზღვისფრამდე + Plum to Olive ქლიავიდან ზეთისხილისფრამდე + Complementary Coral მარჯნისფერი, დამატებითი + Split Complementary Coral მარჯნისფერი, გაყოფილი დამატებითი + Analogous Coral მარჯნისფერი, ანალოგიური + Triad Coral მარჯნისფერი, ტრიადა + Tetrad Coral მარჯნისფერი, ტეტრადა + Pentagram Coral მარჯნისფერი, პენტაგრამა + Complementary Teal ზღვისფერი, დამატებითი + Split Complementary Teal ზღვისფერი, გაყოფილი დამატებითი + Analogous Teal ზღვისფერი, ანალოგიური + Triad Teal ზღვისფერი, ტრიადა + Tetrad Teal ზღვისფერი, ტეტრადა + Pentagram Teal ზღვისფერი, პენტაგრამა + Soft Spectrum რბილი სპექტრი + Red to Amber წითლიდან ქარვისფრამდე + Orange to Yellow ნარინჯისფრიდან ყვითლამდე + Amber to Lime ქარვისფრიდან ლაიმისფრამდე + Yellow to Green ყვითლიდან მწვანემდე + Lime to Teal ლაიმისფრიდან ზღვისფრამდე + Green to Cyan მწვანიდან ცისფრამდე + Teal to Azure ზღვისფრიდან ლაჟვარდისფრამდე + Cyan to Blue ცისფრიდან ლურჯამდე + Azure to Violet ლაჟვარდისფრიდან იისფრამდე + Blue to Magenta ლურჯიდან მეწამულამდე + Violet to Red იისფრიდან წითლამდე + Magenta to Orange მეწამულიდან ნარინჯისფრამდე + Dawn განთიადი + Noon შუადღე + Sunset მზის ჩასვლა + Night ღამე + Overcast მოღრუბლული + White to Black თეთრიდან შავამდე + Light Grays ღია ნაცრისფრები + Dark Grays მუქი ნაცრისფრები + Warm Grays თბილი ნაცრისფრები + Cool Grays ცივი ნაცრისფრები + Fade to Transparent გადასვლა გამჭვირვალემდე + White Fade თეთრი გადასვლა + Vignette ვინიეტი + Mist ნისლი + Petal ფურცელი + Fern გვიმრა + Smoke კვამლი + Honey თაფლი + Seafoam ზღვის ქაფი + Lavender ლავანდა + Driftwood ზღვის მიერ გამორიყული ხე + Ink Wash მელნის რეცხვა + Tide მოქცევა + Bloom ყვავილობა + Dew ცვარი + Pollen მტვერი + Lichen მღიერი + Prism Veil პრიზმული საბურველი + Opal Ribbon ოპალის ლენტი + Pearl Flash მარგალიტის ელვა + Aurora Foil ჩრდილოეთის ციალის ფოლგა + Iris Sheen ირისის ლაპლაპი + Frost Spectrum ყინვის სპექტრი + Silver Tide ვერცხლისფერი მოქცევა + Rose Quartz Gleam ვარდისფერი კვარცის ბზინვა + Moonstone Shift მთვარის ქვის ციმციმი + Violet Edge იისფერი კიდე + Mint Halo პიტნისფერი შარავანდი + Amber Corona ქარვისფერი გვირგვინი + Polar Glint პოლარული ელვარება + Pastel Orbit პასტელური ორბიტა + Coral and Navy მარჯნისფერი და მუქი ლურჯი + Plum and Lime ქლიავისფერი და ლაიმისფერი + Teal and Gold ზღვისფერი და ოქროსფერი + Indigo and Peach ინდიგო და ატმისფერი + Forest and Rose ტყე და ვარდი + Red Glow წითელი ნათება + Orange Glow ნარინჯისფერი ნათება + Amber Glow ქარვისფერი ნათება + Yellow Glow ყვითელი ნათება + Lime Glow ლაიმისფერი ნათება + Green Glow მწვანე ნათება + Teal Glow ზღვისფერი ნათება + Cyan Glow ცისფერი ნათება + Azure Glow ლაჟვარდისფერი ნათება + Blue Glow ლურჯი ნათება + Violet Glow იისფერი ნათება + Magenta Glow მეწამული ნათება + Polka Dots ბარდისებრი წერტილები + Vertical Stripes ვერტიკალური ზოლები + Horizontal Stripes ჰორიზონტალური ზოლები + Diagonal Stripes დიაგონალური ზოლები + Checkerboard ჭადრაკის დაფა + Diamonds რომბები + Crosses ჯვრები + Coarse Grit მსხვილი მარცვალი + Stipple წერტილოვანი დაჩრდილვა + Scratches ნაკაწრები + Sparse Flecks იშვიათი ლაქები + Dense Flecks ხშირი ლაქები + Sine Bands სინუსოიდური ზოლები + Ripple Lines ტალღოვანი ხაზები + Interference Rings ინტერფერენციის რგოლები + Offset Rings წანაცვლებული რგოლები + Warped Checks დამახინჯებული უჯრები + Pinched Stripes შევიწროებული ზოლები + Chevron Pulse შევრონების პულსი + Radiating Lenses მანათობელი ლინზები + Soft Shadow რბილი ჩრდილი + Hard Shadow მკვეთრი ჩრდილი + Lifted Card აწეული ბარათი + Neon Tube ნეონის მილი + Inner Light შიდა სინათლე + Feathered რბილი კიდეებით + Haze ბურუსი + Double Rule ორმაგი ხაზი (ჩარჩო) + Triple Rule სამმაგი ხაზი + Dashed Border შტრიხებიანი საზღვარი + Dotted Border წერტილოვანი საზღვარი + Offset Keyline წანაცვლებული კონტური + Inset Keyline შიდა კონტური + Outside Stroke გარე შტრიხი + Pointer მაჩვენებელი + Highlighter მარკერი + Sketchy Line ესკიზური ხაზი + Scribble Fill ჯღაბნით შევსება + Wobble რხევა + Zig Zag Edge ზიგზაგისებრი კიდე + Wavy Edge ტალღოვანი კიდე + Puffy გაბერილი + Starburst ვარსკვლავის აფეთქება + Glossy პრიალა + Brushed Metal გახეხილი ლითონი + Spotlight პროჟექტორი + Sunset Band მზის ჩასვლის ზოლი + Sea Glass ზღვის მინა + Pearl მარგალიტი + Chrome Rim ქრომის არშია + Glow Orb მანათობელი სფერო + Pill Badge კაფსულის ნიშანი + Round Badge მრგვალი ნიშანი + Flag Wave აფრიალებული დროშა + Bulge გამობერილობა + Twisted დაგრეხილი + Echo ექო + Spiral Copies ასლები სპირალზე + Multiply Tint გამრავლების ელფერი + Darken Veil ჩამუქების საბურველი + Ghosted მოჩვენებითი + Two Tone ორფეროვანი + Overlay Glaze გადაფარვის ჭიქური + Screen Light ეკრანის სინათლე + Soft Light Wash რბილი სინათლის რეცხვა + Burst აფეთქება + Rounded Square მომრგვალებული კვადრატი Save Brush Library… ფუნჯების ბიბლიოთეკის შენახვა… @msg `{_1}` has no brushes to apply `{_1}`-ში გამოსაყენებელი ფუნჯები არ არის @msg missing `library` (see brush.libraries) `library` აკლია (იხ. brush.libraries) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 4715a413f4..ba9558df54 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6382,6 +6382,245 @@ axis Y Axis Y축 Stars 별 Triangles 삼각형 Sparkles 반짝임 + Warm Gray 따뜻한 회색 + Cool Gray 차가운 회색 + Neutrals 뉴트럴 + Ivory 아이보리 + Linen 리넨 + Oat 오트 + Greige 그레이지 + Stone 스톤 + Taupe 토프 + Slate 슬레이트 + Clay 점토 + Terracotta 테라코타 + Ochre 황토색 + Umber 엄버 + Sand 모래 + Olive 올리브 + Moss 이끼 + Rosy 장밋빛 + Neutral 중성 + Golden 황금빛 + Pastel 파스텔 + Pastel Red 파스텔 빨강 + Pastel Orange 파스텔 주황 + Pastel Amber 파스텔 호박색 + Pastel Yellow 파스텔 노랑 + Pastel Lime 파스텔 라임 + Pastel Green 파스텔 초록 + Pastel Teal 파스텔 청록 + Pastel Cyan 파스텔 시안 + Pastel Azure 파스텔 하늘색 + Pastel Blue 파스텔 파랑 + Pastel Violet 파스텔 보라 + Pastel Magenta 파스텔 마젠타 + Soft Red 부드러운 빨강 + Soft Orange 부드러운 주황 + Soft Amber 부드러운 호박색 + Soft Yellow 부드러운 노랑 + Soft Lime 부드러운 라임 + Soft Green 부드러운 초록 + Soft Teal 부드러운 청록 + Soft Cyan 부드러운 시안 + Soft Azure 부드러운 하늘색 + Soft Blue 부드러운 파랑 + Soft Violet 부드러운 보라 + Soft Magenta 부드러운 마젠타 + Vivid Red 선명한 빨강 + Vivid Orange 선명한 주황 + Vivid Amber 선명한 호박색 + Vivid Yellow 선명한 노랑 + Vivid Lime 선명한 라임 + Vivid Green 선명한 초록 + Vivid Teal 선명한 청록 + Vivid Cyan 선명한 시안 + Vivid Azure 선명한 하늘색 + Vivid Blue 선명한 파랑 + Vivid Violet 선명한 보라 + Vivid Magenta 선명한 마젠타 + Deep 짙은 색 + Deep Red 짙은 빨강 + Deep Orange 짙은 주황 + Deep Amber 짙은 호박색 + Deep Yellow 짙은 노랑 + Deep Lime 짙은 라임 + Deep Green 짙은 초록 + Deep Teal 짙은 청록 + Deep Cyan 짙은 시안 + Deep Azure 짙은 하늘색 + Deep Blue 짙은 파랑 + Deep Violet 짙은 보라 + Deep Magenta 짙은 마젠타 + Gold 금 + Silver 은 + Bronze 청동 + Copper 구리 + Brass 황동 + Rose Gold 로즈 골드 + Gunmetal 건메탈 + Platinum 백금 + Pewter 백랍 + Ember 잔불 + Lagoon 석호 + Dusk 땅거미 + Clay to Teal 점토에서 청록으로 + Plum to Olive 자두색에서 올리브로 + Complementary Coral 코럴, 보색 + Split Complementary Coral 코럴, 분할 보색 + Analogous Coral 코럴, 유사색 + Triad Coral 코럴, 3색 조화 + Tetrad Coral 코럴, 4색 조화 + Pentagram Coral 코럴, 오각별 + Complementary Teal 청록, 보색 + Split Complementary Teal 청록, 분할 보색 + Analogous Teal 청록, 유사색 + Triad Teal 청록, 3색 조화 + Tetrad Teal 청록, 4색 조화 + Pentagram Teal 청록, 오각별 + Soft Spectrum 부드러운 스펙트럼 + Red to Amber 빨강에서 호박색으로 + Orange to Yellow 주황에서 노랑으로 + Amber to Lime 호박색에서 라임으로 + Yellow to Green 노랑에서 초록으로 + Lime to Teal 라임에서 청록으로 + Green to Cyan 초록에서 시안으로 + Teal to Azure 청록에서 하늘색으로 + Cyan to Blue 시안에서 파랑으로 + Azure to Violet 하늘색에서 보라로 + Blue to Magenta 파랑에서 마젠타로 + Violet to Red 보라에서 빨강으로 + Magenta to Orange 마젠타에서 주황으로 + Dawn 새벽 + Noon 정오 + Sunset 노을 + Night 밤 + Overcast 흐린 하늘 + White to Black 흰색에서 검정으로 + Light Grays 밝은 회색 + Dark Grays 어두운 회색 + Warm Grays 따뜻한 회색 계열 + Cool Grays 차가운 회색 계열 + Fade to Transparent 투명으로 페이드 + White Fade 흰색 페이드 + Vignette 비네트 + Mist 안개 + Petal 꽃잎 + Fern 고사리 + Smoke 연기 + Honey 꿀 + Seafoam 바다 거품 + Lavender 라벤더 + Driftwood 유목 + Ink Wash 수묵 번짐 + Tide 조수 + Bloom 개화 + Dew 이슬 + Pollen 꽃가루 + Lichen 지의류 + Prism Veil 프리즘 베일 + Opal Ribbon 오팔 리본 + Pearl Flash 진주 섬광 + Aurora Foil 오로라 호일 + Iris Sheen 무지갯빛 광택 + Frost Spectrum 서리 스펙트럼 + Silver Tide 은빛 물결 + Rose Quartz Gleam 로즈 쿼츠 광채 + Moonstone Shift 월장석 일렁임 + Violet Edge 보라 가장자리 + Mint Halo 민트 후광 + Amber Corona 호박색 코로나 + Polar Glint 극지의 반짝임 + Pastel Orbit 파스텔 궤도 + Coral and Navy 코럴과 네이비 + Plum and Lime 자두색과 라임 + Teal and Gold 청록과 금색 + Indigo and Peach 인디고와 복숭아색 + Forest and Rose 숲과 장미 + Red Glow 빨강 광채 + Orange Glow 주황 광채 + Amber Glow 호박색 광채 + Yellow Glow 노랑 광채 + Lime Glow 라임 광채 + Green Glow 초록 광채 + Teal Glow 청록 광채 + Cyan Glow 시안 광채 + Azure Glow 하늘색 광채 + Blue Glow 파랑 광채 + Violet Glow 보라 광채 + Magenta Glow 마젠타 광채 + Polka Dots 물방울무늬 + Vertical Stripes 세로 줄무늬 + Horizontal Stripes 가로 줄무늬 + Diagonal Stripes 사선 줄무늬 + Checkerboard 체커보드 + Diamonds 마름모 + Crosses 십자 + Coarse Grit 거친 입자 + Stipple 점묘 + Scratches 긁힌 자국 + Sparse Flecks 성긴 반점 + Dense Flecks 촘촘한 반점 + Sine Bands 사인파 띠 + Ripple Lines 물결선 + Interference Rings 간섭 고리 + Offset Rings 어긋난 고리 + Warped Checks 뒤틀린 체크 + Pinched Stripes 오므린 줄무늬 + Chevron Pulse 셰브런 펄스 + Radiating Lenses 방사형 렌즈 + Soft Shadow 부드러운 그림자 + Hard Shadow 선명한 그림자 + Lifted Card 들린 카드 + Neon Tube 네온관 + Inner Light 안쪽 빛 + Feathered 가장자리 흐림 + Haze 아지랑이 + Double Rule 이중 괘선 + Triple Rule 삼중 괘선 + Dashed Border 파선 테두리 + Dotted Border 점선 테두리 + Offset Keyline 오프셋 윤곽선 + Inset Keyline 안쪽 윤곽선 + Outside Stroke 바깥쪽 획 + Pointer 포인터 + Highlighter 형광펜 + Sketchy Line 스케치 선 + Scribble Fill 낙서 칠 + Wobble 흔들림 + Zig Zag Edge 지그재그 가장자리 + Wavy Edge 물결 가장자리 + Puffy 부풀림 + Starburst 별 폭발 + Glossy 광택 + Brushed Metal 브러시드 메탈 + Spotlight 스포트라이트 + Sunset Band 노을 띠 + Sea Glass 바다 유리 + Pearl 진주 + Chrome Rim 크롬 테 + Glow Orb 빛나는 구 + Pill Badge 알약 배지 + Round Badge 원형 배지 + Flag Wave 펄럭이는 깃발 + Bulge 불룩 + Twisted 비틀림 + Echo 메아리 + Spiral Copies 나선형 복사본 + Multiply Tint 곱하기 색조 + Darken Veil 어둡게 베일 + Ghosted 반투명 + Two Tone 투톤 + Overlay Glaze 오버레이 유약 + Screen Light 스크린 빛 + Soft Light Wash 소프트 라이트 번짐 + Burst 폭발 + Rounded Square 둥근 사각형 + Bar 막대 + Hexagon 육각형 + Spectrum 스펙트럼 + Triangle 삼각형 + Vivid 선명한 색 Save Brush Library… 브러시 라이브러리 저장… @msg `{_1}` has no brushes to apply `{_1}`에 적용할 브러시가 없습니다 @msg missing `library` (see brush.libraries) `library`가 없습니다(brush.libraries 참조) diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 94957fb782..160ac5fc23 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -6879,6 +6879,240 @@ axis Y Axis Y-as Stars Sterren Triangles Driehoeken Sparkles Fonkelingen + Warm Gray Warm grijs + Cool Gray Koel grijs + Neutrals Neutrale tinten + Ivory Ivoor + Linen Linnen + Oat Haver + Greige Greige + Stone Steen + Taupe Taupe + Slate Leisteen + Clay Klei + Terracotta Terracotta + Ochre Oker + Umber Omber + Sand Zand + Olive Olijf + Moss Mos + Rosy Rozig + Neutral Neutraal + Golden Goudkleurig + Pastel Pastel + Pastel Red Pastelrood + Pastel Orange Pasteloranje + Pastel Amber Pastelamber + Pastel Yellow Pastelgeel + Pastel Lime Pastellimoen + Pastel Green Pastelgroen + Pastel Teal Pastelblauwgroen + Pastel Cyan Pastelcyaan + Pastel Azure Pastelazuur + Pastel Blue Pastelblauw + Pastel Violet Pastelviolet + Pastel Magenta Pastelmagenta + Soft Red Zacht rood + Soft Orange Zacht oranje + Soft Amber Zacht amber + Soft Yellow Zacht geel + Soft Lime Zacht limoen + Soft Green Zacht groen + Soft Teal Zacht blauwgroen + Soft Cyan Zacht cyaan + Soft Azure Zacht azuur + Soft Blue Zacht blauw + Soft Violet Zacht violet + Soft Magenta Zacht magenta + Vivid Red Levendig rood + Vivid Orange Levendig oranje + Vivid Amber Levendig amber + Vivid Yellow Levendig geel + Vivid Lime Levendig limoen + Vivid Green Levendig groen + Vivid Teal Levendig blauwgroen + Vivid Cyan Levendig cyaan + Vivid Azure Levendig azuur + Vivid Blue Levendig blauw + Vivid Violet Levendig violet + Vivid Magenta Levendig magenta + Deep Diep + Deep Red Dieprood + Deep Orange Dieporanje + Deep Amber Diepamber + Deep Yellow Diepgeel + Deep Lime Dieplimoen + Deep Green Diepgroen + Deep Teal Diepblauwgroen + Deep Cyan Diepcyaan + Deep Azure Diepazuur + Deep Blue Diepblauw + Deep Violet Diepviolet + Deep Magenta Diepmagenta + Gold Goud + Silver Zilver + Bronze Brons + Copper Koper + Brass Messing + Rose Gold Roségoud + Gunmetal Antraciet metaal + Platinum Platina + Pewter Tin + Ember Gloed + Lagoon Lagune + Dusk Schemering + Clay to Teal Klei naar blauwgroen + Plum to Olive Pruim naar olijf + Complementary Coral Koraal complementair + Split Complementary Coral Koraal gesplitst complementair + Analogous Coral Koraal analoog + Triad Coral Koraal triade + Tetrad Coral Koraal tetrade + Pentagram Coral Koraal pentagram + Complementary Teal Blauwgroen complementair + Split Complementary Teal Blauwgroen gesplitst complementair + Analogous Teal Blauwgroen analoog + Triad Teal Blauwgroen triade + Tetrad Teal Blauwgroen tetrade + Pentagram Teal Blauwgroen pentagram + Soft Spectrum Zacht spectrum + Red to Amber Rood naar amber + Orange to Yellow Oranje naar geel + Amber to Lime Amber naar limoen + Yellow to Green Geel naar groen + Lime to Teal Limoen naar blauwgroen + Green to Cyan Groen naar cyaan + Teal to Azure Blauwgroen naar azuur + Cyan to Blue Cyaan naar blauw + Azure to Violet Azuur naar violet + Blue to Magenta Blauw naar magenta + Violet to Red Violet naar rood + Magenta to Orange Magenta naar oranje + Dawn Dageraad + Noon Middag + Sunset Zonsondergang + Night Nacht + Overcast Bewolkt + White to Black Wit naar zwart + Light Grays Lichte grijstinten + Dark Grays Donkere grijstinten + Warm Grays Warme grijstinten + Cool Grays Koele grijstinten + Fade to Transparent Vervagen naar transparant + White Fade Witte vervaging + Vignette Vignet + Mist Nevel + Petal Bloemblad + Fern Varen + Smoke Rook + Honey Honing + Seafoam Zeeschuim + Lavender Lavendel + Driftwood Drijfhout + Ink Wash Inktwassing + Tide Getij + Bloom Bloei + Dew Dauw + Pollen Stuifmeel + Lichen Korstmos + Prism Veil Prismasluier + Opal Ribbon Opaallint + Pearl Flash Parelflits + Aurora Foil Noorderlichtfolie + Iris Sheen Irisglans + Frost Spectrum IJzig spectrum + Silver Tide Zilveren getij + Rose Quartz Gleam Rozenkwartsglans + Moonstone Shift Maansteenglans + Violet Edge Violette rand + Mint Halo Munthalo + Amber Corona Ambercorona + Polar Glint Poolschittering + Pastel Orbit Pastelbaan + Coral and Navy Koraal en marineblauw + Plum and Lime Pruim en limoen + Teal and Gold Blauwgroen en goud + Indigo and Peach Indigo en perzik + Forest and Rose Bos en roze + Red Glow Rode gloed + Orange Glow Oranje gloed + Amber Glow Amberkleurige gloed + Yellow Glow Gele gloed + Lime Glow Limoengloed + Green Glow Groene gloed + Teal Glow Blauwgroene gloed + Cyan Glow Cyaangloed + Azure Glow Azuurgloed + Blue Glow Blauwe gloed + Violet Glow Violette gloed + Magenta Glow Magentagloed + Polka Dots Stippen + Vertical Stripes Verticale strepen + Horizontal Stripes Horizontale strepen + Diagonal Stripes Diagonale strepen + Checkerboard Dambord + Diamonds Ruiten + Crosses Kruisjes + Coarse Grit Grove korrel + Stipple Stippeling + Scratches Krassen + Sparse Flecks Verspreide spikkels + Dense Flecks Dichte spikkels + Sine Bands Sinusbanden + Ripple Lines Rimpellijnen + Interference Rings Interferentieringen + Offset Rings Verschoven ringen + Warped Checks Vervormde ruiten + Pinched Stripes Ingesnoerde strepen + Chevron Pulse Chevronpuls + Radiating Lenses Stralende lenzen + Soft Shadow Zachte schaduw + Hard Shadow Harde schaduw + Lifted Card Opgetilde kaart + Neon Tube Neonbuis + Inner Light Binnenlicht + Feathered Zachte rand + Haze Waas + Double Rule Dubbele lijn + Triple Rule Driedubbele lijn + Dashed Border Gestreepte rand + Dotted Border Gestippelde rand + Offset Keyline Verschoven contour + Inset Keyline Binnencontour + Outside Stroke Buitenlijn + Pointer Aanwijzer + Highlighter Markeerstift + Sketchy Line Schetslijn + Scribble Fill Krabbelvulling + Wobble Wiebel + Zig Zag Edge Zigzagrand + Wavy Edge Golvende rand + Puffy Opgeblazen + Starburst Sterrenuitbarsting + Glossy Glanzend + Brushed Metal Geborsteld metaal + Spotlight Spotlight + Sunset Band Zonsondergangband + Sea Glass Zeeglas + Pearl Parel + Chrome Rim Chromen rand + Glow Orb Gloeibol + Pill Badge Pilbadge + Round Badge Ronde badge + Flag Wave Wapperende vlag + Bulge Bolling + Twisted Gedraaid + Echo Echo + Spiral Copies Spiraalkopieën + Multiply Tint Vermenigvuldigen-tint + Darken Veil Donkerder-sluier + Ghosted Doorschijnend + Two Tone Tweekleurig + Overlay Glaze Bedekken-glazuur + Screen Light Scherm-licht + Soft Light Wash Zacht-licht-wassing + Burst Uitbarsting + Rounded Square Afgerond vierkant Save Brush Library… Penseelbibliotheek opslaan… @msg no empty artboards to delete geen lege tekengebieden om te verwijderen Scale Presets Schaalvoorinstellingen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 48f2671c2d..cf5adafd9b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6650,6 +6650,242 @@ axis Y Axis Oś Y Stars Gwiazdy Triangles Trójkąty Sparkles Iskry + Warm Gray Ciepła szarość + Cool Gray Chłodna szarość + Neutrals Barwy neutralne + Ivory Kość słoniowa + Linen Len + Oat Owies + Greige Greige + Stone Kamień + Taupe Taupe + Slate Łupek + Clay Glina + Terracotta Terakota + Ochre Ochra + Umber Umbra + Sand Piasek + Olive Oliwka + Moss Mech + Rosy Różowawy + Neutral Neutralny + Golden Złocisty + Pastel Pastelowe + Pastel Red Pastelowy czerwony + Pastel Orange Pastelowy pomarańczowy + Pastel Amber Pastelowy bursztynowy + Pastel Yellow Pastelowy żółty + Pastel Lime Pastelowa limonka + Pastel Green Pastelowy zielony + Pastel Teal Pastelowy morski + Pastel Cyan Pastelowy cyjan + Pastel Azure Pastelowy lazurowy + Pastel Blue Pastelowy niebieski + Pastel Violet Pastelowy fioletowy + Pastel Magenta Pastelowa magenta + Soft Red Łagodny czerwony + Soft Orange Łagodny pomarańczowy + Soft Amber Łagodny bursztynowy + Soft Yellow Łagodny żółty + Soft Lime Łagodna limonka + Soft Green Łagodny zielony + Soft Teal Łagodny morski + Soft Cyan Łagodny cyjan + Soft Azure Łagodny lazurowy + Soft Blue Łagodny niebieski + Soft Violet Łagodny fioletowy + Soft Magenta Łagodna magenta + Vivid Red Żywy czerwony + Vivid Orange Żywy pomarańczowy + Vivid Amber Żywy bursztynowy + Vivid Yellow Żywy żółty + Vivid Lime Żywa limonka + Vivid Green Żywy zielony + Vivid Teal Żywy morski + Vivid Cyan Żywy cyjan + Vivid Azure Żywy lazurowy + Vivid Blue Żywy niebieski + Vivid Violet Żywy fioletowy + Vivid Magenta Żywa magenta + Deep Głębokie + Deep Red Głęboki czerwony + Deep Orange Głęboki pomarańczowy + Deep Amber Głęboki bursztynowy + Deep Yellow Głęboki żółty + Deep Lime Głęboka limonka + Deep Green Głęboki zielony + Deep Teal Głęboki morski + Deep Cyan Głęboki cyjan + Deep Azure Głęboki lazurowy + Deep Blue Głęboki niebieski + Deep Violet Głęboki fioletowy + Deep Magenta Głęboka magenta + Gold Złoto + Silver Srebro + Bronze Brąz + Copper Miedź + Brass Mosiądz + Rose Gold Różowe złoto + Gunmetal Grafitowy metal + Platinum Platyna + Pewter Cyna + Ember Żar + Lagoon Laguna + Dusk Zmierzch + Clay to Teal Od gliny do morskiego + Plum to Olive Od śliwki do oliwki + Complementary Coral Koralowy, dopełniające + Split Complementary Coral Koralowy, rozdzielone dopełniające + Analogous Coral Koralowy, analogiczne + Triad Coral Koralowy, triada + Tetrad Coral Koralowy, tetrada + Pentagram Coral Koralowy, pentagram + Complementary Teal Morski, dopełniające + Split Complementary Teal Morski, rozdzielone dopełniające + Analogous Teal Morski, analogiczne + Triad Teal Morski, triada + Tetrad Teal Morski, tetrada + Pentagram Teal Morski, pentagram + Soft Spectrum Łagodne spektrum + Red to Amber Od czerwonego do bursztynowego + Orange to Yellow Od pomarańczowego do żółtego + Amber to Lime Od bursztynowego do limonki + Yellow to Green Od żółtego do zielonego + Lime to Teal Od limonki do morskiego + Green to Cyan Od zielonego do cyjanu + Teal to Azure Od morskiego do lazurowego + Cyan to Blue Od cyjanu do niebieskiego + Azure to Violet Od lazurowego do fioletowego + Blue to Magenta Od niebieskiego do magenty + Violet to Red Od fioletowego do czerwonego + Magenta to Orange Od magenty do pomarańczowego + Dawn Świt + Noon Południe + Sunset Zachód słońca + Night Noc + Overcast Zachmurzenie + White to Black Od białego do czarnego + Light Grays Jasne szarości + Dark Grays Ciemne szarości + Warm Grays Ciepłe szarości + Cool Grays Chłodne szarości + Fade to Transparent Zanikanie do przezroczystości + White Fade Białe zanikanie + Vignette Winieta + Mist Mgła + Petal Płatek + Fern Paproć + Smoke Dym + Honey Miód + Seafoam Morska piana + Lavender Lawenda + Driftwood Drewno wyrzucone przez morze + Ink Wash Lawowanie tuszem + Tide Przypływ + Bloom Rozkwit + Dew Rosa + Pollen Pyłek + Lichen Porost + Prism Veil Pryzmatyczny welon + Opal Ribbon Opalowa wstęga + Pearl Flash Perłowy błysk + Aurora Foil Folia zorzy + Iris Sheen Połysk irysu + Frost Spectrum Szronione spektrum + Silver Tide Srebrny przypływ + Rose Quartz Gleam Blask kwarcu różowego + Moonstone Shift Opalizacja kamienia księżycowego + Violet Edge Fioletowa krawędź + Mint Halo Miętowa aureola + Amber Corona Bursztynowa korona + Polar Glint Polarny błysk + Pastel Orbit Pastelowa orbita + Coral and Navy Koralowy i granatowy + Plum and Lime Śliwka i limonka + Teal and Gold Morski i złoty + Indigo and Peach Indygo i brzoskwinia + Forest and Rose Las i róża + Red Glow Czerwona poświata + Orange Glow Pomarańczowa poświata + Amber Glow Bursztynowa poświata + Yellow Glow Żółta poświata + Lime Glow Limonkowa poświata + Green Glow Zielona poświata + Teal Glow Morska poświata + Cyan Glow Cyjanowa poświata + Azure Glow Lazurowa poświata + Blue Glow Niebieska poświata + Violet Glow Fioletowa poświata + Magenta Glow Magentowa poświata + Polka Dots Groszki + Vertical Stripes Pionowe paski + Horizontal Stripes Poziome paski + Diagonal Stripes Ukośne paski + Checkerboard Szachownica + Diamonds Romby + Crosses Krzyżyki + Coarse Grit Gruboziarnisty + Stipple Punktowanie + Scratches Rysy + Sparse Flecks Rzadkie plamki + Dense Flecks Gęste plamki + Sine Bands Pasma sinusoidalne + Ripple Lines Linie zmarszczek + Interference Rings Pierścienie interferencyjne + Offset Rings Przesunięte pierścienie + Warped Checks Zniekształcona krata + Pinched Stripes Ściśnięte paski + Chevron Pulse Pulsujące jodełki + Radiating Lenses Promieniujące soczewki + Soft Shadow Miękki cień + Hard Shadow Twardy cień + Lifted Card Uniesiona karta + Neon Tube Neonówka + Inner Light Wewnętrzne światło + Feathered Wtopione krawędzie + Haze Opar + Double Rule Podwójna linia + Triple Rule Potrójna linia + Dashed Border Kreskowana ramka + Dotted Border Kropkowana ramka + Offset Keyline Przesunięty kontur + Inset Keyline Wewnętrzny kontur + Outside Stroke Obrys zewnętrzny + Pointer Wskaźnik + Highlighter Zakreślacz + Sketchy Line Szkicowa linia + Scribble Fill Wypełnienie bazgrołami + Wobble Chwianie + Zig Zag Edge Krawędź zygzakowata + Wavy Edge Falista krawędź + Puffy Napuszony + Starburst Wybuch gwiazdy + Glossy Błyszczący + Brushed Metal Szczotkowany metal + Spotlight Reflektor + Sunset Band Pas zachodu słońca + Sea Glass Szkło morskie + Pearl Perła + Chrome Rim Chromowany brzeg + Glow Orb Świecąca kula + Pill Badge Odznaka w kształcie pigułki + Round Badge Okrągła odznaka + Flag Wave Powiewająca flaga + Bulge Wybrzuszenie + Twisted Skręcony + Echo Echo + Spiral Copies Kopie po spirali + Multiply Tint Odcień mnożenia + Darken Veil Welon ciemniej + Ghosted Widmowy + Two Tone Dwutonowy + Overlay Glaze Glazura nakładki + Screen Light Światło mnożenia odwrotnego + Soft Light Wash Lawowanie łagodnym światłem + Burst Wybuch + Rounded Square Zaokrąglony kwadrat + Spectrum Spektrum + Vivid Żywe Save Brush Library… Zapisz bibliotekę pędzli… @msg `{_1}` has no brushes to apply `{_1}` nie ma pędzli do zastosowania @msg missing `library` (see brush.libraries) brak `library` (zobacz brush.libraries) diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index f6e54552d4..d7ff9c14e5 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6710,6 +6710,240 @@ axis Y Axis Eixo Y Stars Estrelas Triangles Triângulos Sparkles Brilhos + Warm Gray Cinza Quente + Cool Gray Cinza Frio + Neutrals Neutros + Ivory Marfim + Linen Linho + Oat Aveia + Greige Greige + Stone Pedra + Taupe Taupe + Slate Ardósia + Clay Argila + Terracotta Terracota + Ochre Ocre + Umber Sombra + Sand Areia + Olive Oliva + Moss Musgo + Rosy Rosado + Neutral Neutro + Golden Dourado + Pastel Pastel + Pastel Red Vermelho Pastel + Pastel Orange Laranja Pastel + Pastel Amber Âmbar Pastel + Pastel Yellow Amarelo Pastel + Pastel Lime Lima Pastel + Pastel Green Verde Pastel + Pastel Teal Verde-azulado Pastel + Pastel Cyan Ciano Pastel + Pastel Azure Azure Pastel + Pastel Blue Azul Pastel + Pastel Violet Violeta Pastel + Pastel Magenta Magenta Pastel + Soft Red Vermelho Suave + Soft Orange Laranja Suave + Soft Amber Âmbar Suave + Soft Yellow Amarelo Suave + Soft Lime Lima Suave + Soft Green Verde Suave + Soft Teal Verde-azulado Suave + Soft Cyan Ciano Suave + Soft Azure Azure Suave + Soft Blue Azul Suave + Soft Violet Violeta Suave + Soft Magenta Magenta Suave + Vivid Red Vermelho Vívido + Vivid Orange Laranja Vívido + Vivid Amber Âmbar Vívido + Vivid Yellow Amarelo Vívido + Vivid Lime Lima Vívido + Vivid Green Verde Vívido + Vivid Teal Verde-azulado Vívido + Vivid Cyan Ciano Vívido + Vivid Azure Azure Vívido + Vivid Blue Azul Vívido + Vivid Violet Violeta Vívido + Vivid Magenta Magenta Vívido + Deep Profundas + Deep Red Vermelho Profundo + Deep Orange Laranja Profundo + Deep Amber Âmbar Profundo + Deep Yellow Amarelo Profundo + Deep Lime Lima Profundo + Deep Green Verde Profundo + Deep Teal Verde-azulado Profundo + Deep Cyan Ciano Profundo + Deep Azure Azure Profundo + Deep Blue Azul Profundo + Deep Violet Violeta Profundo + Deep Magenta Magenta Profundo + Gold Ouro + Silver Prata + Bronze Bronze + Copper Cobre + Brass Latão + Rose Gold Ouro Rosé + Gunmetal Grafite Metálico + Platinum Platina + Pewter Estanho + Ember Brasa + Lagoon Lagoa + Dusk Anoitecer + Clay to Teal Argila a Verde-azulado + Plum to Olive Ameixa a Oliva + Complementary Coral Coral Complementar + Split Complementary Coral Coral Complementar Dividida + Analogous Coral Coral Análoga + Triad Coral Coral em Tríade + Tetrad Coral Coral em Tétrade + Pentagram Coral Coral em Pentagrama + Complementary Teal Verde-azulado Complementar + Split Complementary Teal Verde-azulado Complementar Dividida + Analogous Teal Verde-azulado Análoga + Triad Teal Verde-azulado em Tríade + Tetrad Teal Verde-azulado em Tétrade + Pentagram Teal Verde-azulado em Pentagrama + Soft Spectrum Espectro Suave + Red to Amber Vermelho a Âmbar + Orange to Yellow Laranja a Amarelo + Amber to Lime Âmbar a Lima + Yellow to Green Amarelo a Verde + Lime to Teal Lima a Verde-azulado + Green to Cyan Verde a Ciano + Teal to Azure Verde-azulado a Azure + Cyan to Blue Ciano a Azul + Azure to Violet Azure a Violeta + Blue to Magenta Azul a Magenta + Violet to Red Violeta a Vermelho + Magenta to Orange Magenta a Laranja + Dawn Amanhecer + Noon Meio-dia + Sunset Pôr do Sol + Night Noite + Overcast Nublado + White to Black Branco a Preto + Light Grays Cinzas Claros + Dark Grays Cinzas Escuros + Warm Grays Cinzas Quentes + Cool Grays Cinzas Frios + Fade to Transparent Esmaecer a Transparente + White Fade Esmaecer Branco + Vignette Vinheta + Mist Névoa + Petal Pétala + Fern Samambaia + Smoke Fumaça + Honey Mel + Seafoam Espuma do Mar + Lavender Lavanda + Driftwood Madeira Flutuante + Ink Wash Aguada de Nanquim + Tide Maré + Bloom Florescer + Dew Orvalho + Pollen Pólen + Lichen Líquen + Prism Veil Véu Prismático + Opal Ribbon Fita de Opala + Pearl Flash Lampejo Perolado + Aurora Foil Folha Aurora + Iris Sheen Brilho Íris + Frost Spectrum Espectro Gelado + Silver Tide Maré Prateada + Rose Quartz Gleam Reflexo de Quartzo Rosa + Moonstone Shift Reflexo de Pedra da Lua + Violet Edge Borda Violeta + Mint Halo Halo Menta + Amber Corona Coroa Âmbar + Polar Glint Cintilação Polar + Pastel Orbit Órbita Pastel + Coral and Navy Coral e Azul-marinho + Plum and Lime Ameixa e Lima + Teal and Gold Verde-azulado e Ouro + Indigo and Peach Índigo e Pêssego + Forest and Rose Floresta e Rosa + Red Glow Brilho Vermelho + Orange Glow Brilho Laranja + Amber Glow Brilho Âmbar + Yellow Glow Brilho Amarelo + Lime Glow Brilho Lima + Green Glow Brilho Verde + Teal Glow Brilho Verde-azulado + Cyan Glow Brilho Ciano + Azure Glow Brilho Azure + Blue Glow Brilho Azul + Violet Glow Brilho Violeta + Magenta Glow Brilho Magenta + Polka Dots Bolinhas + Vertical Stripes Listras Verticais + Horizontal Stripes Listras Horizontais + Diagonal Stripes Listras Diagonais + Checkerboard Xadrez + Diamonds Losangos + Crosses Cruzes + Coarse Grit Grão Grosso + Stipple Pontilhado + Scratches Arranhões + Sparse Flecks Pintas Esparsas + Dense Flecks Pintas Densas + Sine Bands Faixas Senoidais + Ripple Lines Linhas Ondulantes + Interference Rings Anéis de Interferência + Offset Rings Anéis Deslocados + Warped Checks Xadrez Deformado + Pinched Stripes Listras Estranguladas + Chevron Pulse Pulso de Chevrons + Radiating Lenses Lentes Radiantes + Soft Shadow Sombra Suave + Hard Shadow Sombra Dura + Lifted Card Cartão Elevado + Neon Tube Tubo de Neon + Inner Light Luz Interna + Feathered Bordas Suaves + Haze Bruma + Double Rule Fio Duplo + Triple Rule Fio Triplo + Dashed Border Borda Tracejada + Dotted Border Borda Pontilhada + Offset Keyline Fio Deslocado + Inset Keyline Fio Interno + Outside Stroke Traçado Externo + Pointer Ponteiro + Highlighter Marca-texto + Sketchy Line Linha Esboçada + Scribble Fill Preenchimento Rabiscado + Wobble Tremido + Zig Zag Edge Borda em Zigue-zague + Wavy Edge Borda Ondulada + Puffy Inflado + Starburst Explosão Estelar + Glossy Brilhante + Brushed Metal Metal Escovado + Spotlight Holofote + Sunset Band Faixa de Pôr do Sol + Sea Glass Vidro do Mar + Pearl Pérola + Chrome Rim Borda Cromada + Glow Orb Orbe Luminoso + Pill Badge Selo Pílula + Round Badge Selo Redondo + Flag Wave Bandeira Ondulada + Bulge Protuberância + Twisted Torcido + Echo Eco + Spiral Copies Cópias em Espiral + Multiply Tint Tinta Multiplicar + Darken Veil Véu Escurecer + Ghosted Fantasma + Two Tone Bicolor + Overlay Glaze Veladura Sobrepor + Screen Light Luz Tela + Soft Light Wash Aguada Luz Suave + Burst Explosão + Rounded Square Quadrado Arredondado Save Brush Library… Salvar Biblioteca de Pincéis… @msg `{_1}` has no brushes to apply `{_1}` não tem pincéis para aplicar @msg missing `library` (see brush.libraries) falta `library` (consulte brush.libraries) diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 8dc8336089..db4e3365b4 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6406,6 +6406,240 @@ axis Y Axis Ось Y Stars Звёзды Triangles Треугольники Sparkles Искры + Warm Gray Тёплый серый + Cool Gray Холодный серый + Neutrals Нейтральные + Ivory Слоновая кость + Linen Лён + Oat Овёс + Greige Грейж + Stone Камень + Taupe Серо-коричневый + Slate Сланец + Clay Глина + Terracotta Терракота + Ochre Охра + Umber Умбра + Sand Песок + Olive Оливковый + Moss Мох + Rosy Розоватый + Neutral Нейтральный + Golden Золотистый + Pastel Пастельные + Pastel Red Пастельный красный + Pastel Orange Пастельный оранжевый + Pastel Amber Пастельный янтарный + Pastel Yellow Пастельный жёлтый + Pastel Lime Пастельный лаймовый + Pastel Green Пастельный зелёный + Pastel Teal Пастельный сине-зелёный + Pastel Cyan Пастельный голубой + Pastel Azure Пастельный лазурный + Pastel Blue Пастельный синий + Pastel Violet Пастельный фиолетовый + Pastel Magenta Пастельный пурпурный + Soft Red Мягкий красный + Soft Orange Мягкий оранжевый + Soft Amber Мягкий янтарный + Soft Yellow Мягкий жёлтый + Soft Lime Мягкий лаймовый + Soft Green Мягкий зелёный + Soft Teal Мягкий сине-зелёный + Soft Cyan Мягкий голубой + Soft Azure Мягкий лазурный + Soft Blue Мягкий синий + Soft Violet Мягкий фиолетовый + Soft Magenta Мягкий пурпурный + Vivid Red Яркий красный + Vivid Orange Яркий оранжевый + Vivid Amber Яркий янтарный + Vivid Yellow Яркий жёлтый + Vivid Lime Яркий лаймовый + Vivid Green Яркий зелёный + Vivid Teal Яркий сине-зелёный + Vivid Cyan Яркий голубой + Vivid Azure Яркий лазурный + Vivid Blue Яркий синий + Vivid Violet Яркий фиолетовый + Vivid Magenta Яркий пурпурный + Deep Глубокие + Deep Red Тёмно-красный + Deep Orange Тёмно-оранжевый + Deep Amber Тёмно-янтарный + Deep Yellow Тёмно-жёлтый + Deep Lime Тёмно-лаймовый + Deep Green Тёмно-зелёный + Deep Teal Тёмный сине-зелёный + Deep Cyan Тёмно-голубой + Deep Azure Тёмно-лазурный + Deep Blue Тёмно-синий + Deep Violet Тёмно-фиолетовый + Deep Magenta Тёмно-пурпурный + Gold Золото + Silver Серебро + Bronze Бронза + Copper Медь + Brass Латунь + Rose Gold Розовое золото + Gunmetal Оружейный металл + Platinum Платина + Pewter Олово + Ember Тлеющие угли + Lagoon Лагуна + Dusk Сумерки + Clay to Teal От глины к сине-зелёному + Plum to Olive От сливового к оливковому + Complementary Coral Коралловый, дополнительная + Split Complementary Coral Коралловый, расщепленная дополнительная + Analogous Coral Коралловый, аналоговая + Triad Coral Коралловый, триада + Tetrad Coral Коралловый, тетрада + Pentagram Coral Коралловый, пентаграмма + Complementary Teal Сине-зелёный, дополнительная + Split Complementary Teal Сине-зелёный, расщепленная дополнительная + Analogous Teal Сине-зелёный, аналоговая + Triad Teal Сине-зелёный, триада + Tetrad Teal Сине-зелёный, тетрада + Pentagram Teal Сине-зелёный, пентаграмма + Soft Spectrum Мягкий спектр + Red to Amber От красного к янтарному + Orange to Yellow От оранжевого к жёлтому + Amber to Lime От янтарного к лаймовому + Yellow to Green От жёлтого к зелёному + Lime to Teal От лаймового к сине-зелёному + Green to Cyan От зелёного к голубому + Teal to Azure От сине-зелёного к лазурному + Cyan to Blue От голубого к синему + Azure to Violet От лазурного к фиолетовому + Blue to Magenta От синего к пурпурному + Violet to Red От фиолетового к красному + Magenta to Orange От пурпурного к оранжевому + Dawn Рассвет + Noon Полдень + Sunset Закат + Night Ночь + Overcast Пасмурно + White to Black От белого к чёрному + Light Grays Светло-серые + Dark Grays Тёмно-серые + Warm Grays Тёплые серые + Cool Grays Холодные серые + Fade to Transparent Переход в прозрачность + White Fade Белый переход + Vignette Виньетка + Mist Дымка + Petal Лепесток + Fern Папоротник + Smoke Дым + Honey Мёд + Seafoam Морская пена + Lavender Лаванда + Driftwood Плавник + Ink Wash Размывка тушью + Tide Прилив + Bloom Цветение + Dew Роса + Pollen Пыльца + Lichen Лишайник + Prism Veil Призматическая вуаль + Opal Ribbon Опаловая лента + Pearl Flash Жемчужная вспышка + Aurora Foil Фольга северного сияния + Iris Sheen Радужный отлив + Frost Spectrum Морозный спектр + Silver Tide Серебряный прилив + Rose Quartz Gleam Блеск розового кварца + Moonstone Shift Перелив лунного камня + Violet Edge Фиолетовый край + Mint Halo Мятный ореол + Amber Corona Янтарная корона + Polar Glint Полярный блик + Pastel Orbit Пастельная орбита + Coral and Navy Коралловый и тёмно-синий + Plum and Lime Сливовый и лаймовый + Teal and Gold Сине-зелёный и золотой + Indigo and Peach Индиго и персиковый + Forest and Rose Лесной и розовый + Red Glow Красное свечение + Orange Glow Оранжевое свечение + Amber Glow Янтарное свечение + Yellow Glow Жёлтое свечение + Lime Glow Лаймовое свечение + Green Glow Зелёное свечение + Teal Glow Сине-зелёное свечение + Cyan Glow Голубое свечение + Azure Glow Лазурное свечение + Blue Glow Синее свечение + Violet Glow Фиолетовое свечение + Magenta Glow Пурпурное свечение + Polka Dots Горошек + Vertical Stripes Вертикальные полосы + Horizontal Stripes Горизонтальные полосы + Diagonal Stripes Диагональные полосы + Checkerboard Шахматная доска + Diamonds Ромбы + Crosses Крестики + Coarse Grit Крупное зерно + Stipple Пунктир + Scratches Царапины + Sparse Flecks Редкие крапинки + Dense Flecks Густые крапинки + Sine Bands Синусоидальные полосы + Ripple Lines Линии ряби + Interference Rings Интерференционные кольца + Offset Rings Смещённые кольца + Warped Checks Искажённая клетка + Pinched Stripes Сжатые полосы + Chevron Pulse Пульсирующие шевроны + Radiating Lenses Лучистые линзы + Soft Shadow Мягкая тень + Hard Shadow Жёсткая тень + Lifted Card Приподнятая карточка + Neon Tube Неоновая трубка + Inner Light Внутренний свет + Feathered Растушёванный + Haze Марево + Double Rule Двойная линейка + Triple Rule Тройная линейка + Dashed Border Штриховая рамка + Dotted Border Точечная рамка + Offset Keyline Смещённый контур + Inset Keyline Внутренний контур + Outside Stroke Внешняя обводка + Pointer Указатель + Highlighter Маркер + Sketchy Line Набросочная линия + Scribble Fill Заливка каракулями + Wobble Дрожание + Zig Zag Edge Зигзагообразный край + Wavy Edge Волнистый край + Puffy Пухлый + Starburst Звёздный взрыв + Glossy Глянцевый + Brushed Metal Шлифованный металл + Spotlight Прожектор + Sunset Band Полоса заката + Sea Glass Морское стекло + Pearl Жемчуг + Chrome Rim Хромированный ободок + Glow Orb Светящийся шар + Pill Badge Значок-капсула + Round Badge Круглый значок + Flag Wave Развевающийся флаг + Bulge Выпуклость + Twisted Закрученный + Echo Эхо + Spiral Copies Копии по спирали + Multiply Tint Оттенок умножения + Darken Veil Затемняющая вуаль + Ghosted Призрачный + Two Tone Двухцветный + Overlay Glaze Глазурь перекрытия + Screen Light Свет растра + Soft Light Wash Размывка мягким светом + Burst Вспышка + Rounded Square Скруглённый квадрат Save Brush Library… Сохранить библиотеку кистей… @msg `{_1}` has no brushes to apply В `{_1}` нет кистей для применения @msg missing `library` (see brush.libraries) не указан `library` (см. brush.libraries) diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index cfb9d9734b..ceba4579b4 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6775,6 +6775,240 @@ axis Y Axis Y-axel Stars Stjärnor Triangles Trianglar Sparkles Gnistor + Warm Gray Varmgrå + Cool Gray Kallgrå + Neutrals Neutrala toner + Ivory Elfenben + Linen Linne + Oat Havre + Greige Greige + Stone Sten + Taupe Taupe + Slate Skiffer + Clay Lera + Terracotta Terrakotta + Ochre Ockra + Umber Umbra + Sand Sand + Olive Oliv + Moss Mossa + Rosy Rosig + Neutral Neutral + Golden Gyllene + Pastel Pastell + Pastel Red Pastellröd + Pastel Orange Pastellorange + Pastel Amber Pastellbärnsten + Pastel Yellow Pastellgul + Pastel Lime Pastellime + Pastel Green Pastellgrön + Pastel Teal Pastellblågrön + Pastel Cyan Pastellcyan + Pastel Azure Pastellazur + Pastel Blue Pastellblå + Pastel Violet Pastellviolett + Pastel Magenta Pastellmagenta + Soft Red Mjuk röd + Soft Orange Mjuk orange + Soft Amber Mjuk bärnsten + Soft Yellow Mjuk gul + Soft Lime Mjuk lime + Soft Green Mjuk grön + Soft Teal Mjuk blågrön + Soft Cyan Mjuk cyan + Soft Azure Mjuk azur + Soft Blue Mjuk blå + Soft Violet Mjuk violett + Soft Magenta Mjuk magenta + Vivid Red Livfull röd + Vivid Orange Livfull orange + Vivid Amber Livfull bärnsten + Vivid Yellow Livfull gul + Vivid Lime Livfull lime + Vivid Green Livfull grön + Vivid Teal Livfull blågrön + Vivid Cyan Livfull cyan + Vivid Azure Livfull azur + Vivid Blue Livfull blå + Vivid Violet Livfull violett + Vivid Magenta Livfull magenta + Deep Djupa + Deep Red Djupröd + Deep Orange Djuporange + Deep Amber Djup bärnsten + Deep Yellow Djupgul + Deep Lime Djup lime + Deep Green Djupgrön + Deep Teal Djup blågrön + Deep Cyan Djup cyan + Deep Azure Djup azur + Deep Blue Djupblå + Deep Violet Djupviolett + Deep Magenta Djup magenta + Gold Guld + Silver Silver + Bronze Brons + Copper Koppar + Brass Mässing + Rose Gold Roséguld + Gunmetal Gunmetal + Platinum Platina + Pewter Tenn + Ember Glöd + Lagoon Lagun + Dusk Skymning + Clay to Teal Lera till blågrön + Plum to Olive Plommon till oliv + Complementary Coral Korall komplementär + Split Complementary Coral Korall delade komplementfärger + Analogous Coral Korall analog + Triad Coral Korall triad + Tetrad Coral Korall tetrad + Pentagram Coral Korall pentagram + Complementary Teal Blågrön komplementär + Split Complementary Teal Blågrön delade komplementfärger + Analogous Teal Blågrön analog + Triad Teal Blågrön triad + Tetrad Teal Blågrön tetrad + Pentagram Teal Blågrön pentagram + Soft Spectrum Mjukt spektrum + Red to Amber Röd till bärnsten + Orange to Yellow Orange till gul + Amber to Lime Bärnsten till lime + Yellow to Green Gul till grön + Lime to Teal Lime till blågrön + Green to Cyan Grön till cyan + Teal to Azure Blågrön till azur + Cyan to Blue Cyan till blå + Azure to Violet Azur till violett + Blue to Magenta Blå till magenta + Violet to Red Violett till röd + Magenta to Orange Magenta till orange + Dawn Gryning + Noon Middag + Sunset Solnedgång + Night Natt + Overcast Mulet + White to Black Vit till svart + Light Grays Ljusa gråtoner + Dark Grays Mörka gråtoner + Warm Grays Varma gråtoner + Cool Grays Kalla gråtoner + Fade to Transparent Tona till genomskinlig + White Fade Vit toning + Vignette Vinjett + Mist Dimma + Petal Kronblad + Fern Ormbunke + Smoke Rök + Honey Honung + Seafoam Havsskum + Lavender Lavendel + Driftwood Drivved + Ink Wash Tuschlavering + Tide Tidvatten + Bloom Blomning + Dew Dagg + Pollen Pollen + Lichen Lav + Prism Veil Prismaslöja + Opal Ribbon Opalband + Pearl Flash Pärlblixt + Aurora Foil Norrskensfolie + Iris Sheen Irisglans + Frost Spectrum Frostspektrum + Silver Tide Silvertidvatten + Rose Quartz Gleam Rosenkvartsglans + Moonstone Shift Månstensskimmer + Violet Edge Violett kant + Mint Halo Mintgloria + Amber Corona Bärnstenskorona + Polar Glint Polarglimt + Pastel Orbit Pastellbana + Coral and Navy Korall och marinblå + Plum and Lime Plommon och lime + Teal and Gold Blågrön och guld + Indigo and Peach Indigo och persika + Forest and Rose Skog och rosa + Red Glow Rött sken + Orange Glow Orange sken + Amber Glow Bärnstenssken + Yellow Glow Gult sken + Lime Glow Limesken + Green Glow Grönt sken + Teal Glow Blågrönt sken + Cyan Glow Cyansken + Azure Glow Azursken + Blue Glow Blått sken + Violet Glow Violett sken + Magenta Glow Magentasken + Polka Dots Prickar + Vertical Stripes Lodräta ränder + Horizontal Stripes Vågräta ränder + Diagonal Stripes Diagonala ränder + Checkerboard Schackruta + Diamonds Ruter + Crosses Kors + Coarse Grit Grovt korn + Stipple Punktering + Scratches Repor + Sparse Flecks Glesa fläckar + Dense Flecks Täta fläckar + Sine Bands Sinusband + Ripple Lines Krusningslinjer + Interference Rings Interferensringar + Offset Rings Förskjutna ringar + Warped Checks Förvrängda rutor + Pinched Stripes Klämda ränder + Chevron Pulse Chevronpuls + Radiating Lenses Strålande linser + Soft Shadow Mjuk skugga + Hard Shadow Hård skugga + Lifted Card Upplyft kort + Neon Tube Neonrör + Inner Light Inre ljus + Feathered Mjuk kant + Haze Dis + Double Rule Dubbel linje + Triple Rule Trippel linje + Dashed Border Streckad kant + Dotted Border Prickad kant + Offset Keyline Förskjuten konturlinje + Inset Keyline Inre konturlinje + Outside Stroke Yttre linje + Pointer Visare + Highlighter Överstrykningspenna + Sketchy Line Skissartad linje + Scribble Fill Klotterfyllning + Wobble Vingel + Zig Zag Edge Sicksackkant + Wavy Edge Vågig kant + Puffy Uppblåst + Starburst Stjärnexplosion + Glossy Blank + Brushed Metal Borstad metall + Spotlight Strålkastare + Sunset Band Solnedgångsband + Sea Glass Havsglas + Pearl Pärla + Chrome Rim Kromkant + Glow Orb Lysande klot + Pill Badge Pillermärke + Round Badge Runt märke + Flag Wave Vajande flagga + Bulge Utbuktning + Twisted Vriden + Echo Eko + Spiral Copies Spiralkopior + Multiply Tint Multiplicera-ton + Darken Veil Mörkare-slöja + Ghosted Spöklik + Two Tone Tvåfärgad + Overlay Glaze Överlägg-glasyr + Screen Light Skärm-ljus + Soft Light Wash Mjukt ljus-lavering + Burst Utbrott + Rounded Square Rundad kvadrat Save Brush Library… Spara penselbibliotek… @msg `{_1}` has no brushes to apply `{_1}` har inga penslar att använda @msg missing `library` (see brush.libraries) `library` saknas (se brush.libraries) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 705fc68db2..3fc3016b6b 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -375,6 +375,97 @@ fn built_in_library_brush_names_are_in_complete_catalogs() { assert!(bad.is_empty(), "{}", bad.join("\n")); } +/// The complete catalogs that lack a row for one of `names`, with the names each lacks; `shown` +/// tells whether a catalog shows a name translated. +fn lacking(names: &[String], shown: impl Fn(&Catalog, &str) -> bool) -> Vec<String> { + let mut bad = vec![]; + for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { + let missing: Vec<&String> = names.iter().filter(|n| !shown(lang.catalog(), n.as_str())).collect(); + if !missing.is_empty() { + bad.push(format!("{} is missing {missing:?}", lang.code)); + } + } + bad +} + +/// Sorted, without repeats. +fn distinct(mut names: Vec<String>) -> Vec<String> { + names.sort(); + names.dedup(); + names +} + +/// A built-in graphic style library's panel lists its styles in the UI language, so every style of +/// every built-in library has a row in each complete catalog. +#[test] +fn built_in_library_style_names_are_in_complete_catalogs() { + use vectorcraft_engine::cmd::stylelib; + let session = vectorcraft_engine::Session::new(); + let names = distinct( + vectorcraft_doc::style_libs::STYLE_LIBRARIES + .iter() + .filter_map(|b| stylelib::library(&session, b.id)) + .flat_map(|(_, lib)| lib.styles.iter().map(|s| s.name.clone()).collect::<Vec<_>>()) + .collect(), + ); + assert_eq!(names.len(), 80, "{names:?}"); + let bad = lacking(&names, |c, n| c.plain(n).is_some()); + assert!(bad.is_empty(), "{}", bad.join("\n")); +} + +/// A built-in symbol library's panel lists its symbols in the UI language, so every symbol of +/// every built-in library has a row in each complete catalog. +#[test] +fn built_in_library_symbol_names_are_in_complete_catalogs() { + use vectorcraft_engine::cmd::symbollib; + let session = vectorcraft_engine::Session::new(); + let names = distinct( + symbollib::BUILTIN + .iter() + .filter_map(|b| symbollib::library(&session, b.id)) + .flat_map(|(_, lib)| lib.doc.symbols.iter().map(|s| s.name.clone()).collect::<Vec<_>>()) + .collect(), + ); + assert_eq!(names.len(), 26, "{names:?}"); + let bad = lacking(&names, |c, n| c.plain(n).is_some()); + assert!(bad.is_empty(), "{}", bad.join("\n")); +} + +/// A built-in swatch, gradient or pattern library's panel lists its swatches and color groups in +/// the UI language, so each name has a row in each complete catalog, or is a numbered name +/// ("Warm Gray 3") whose name before the number has one. Names that are color values (`#33cc99`, +/// `K=35`) are shown as they are. +#[test] +fn built_in_library_swatch_names_are_in_complete_catalogs() { + use vectorcraft_color::libraries::{GRADIENT_LIBRARIES, SWATCH_LIBRARIES, builtin_library}; + use vectorcraft_engine::cmd::patternlib::{self, PATTERN_LIBRARIES}; + let mut libs: Vec<_> = SWATCH_LIBRARIES.iter().chain(GRADIENT_LIBRARIES).filter_map(|b| builtin_library(b.id)).collect(); + libs.extend(PATTERN_LIBRARIES.iter().filter_map(|b| patternlib::library(b.id)).map(|(_, lib)| lib)); + assert_eq!(libs.len(), SWATCH_LIBRARIES.len() + GRADIENT_LIBRARIES.len() + PATTERN_LIBRARIES.len()); + let all = libs.iter().flat_map(|lib| lib.iter().map(|w| w.name.clone()).chain(lib.groups.iter().map(|g| g.name.clone())).collect::<Vec<_>>()); + let names = distinct(all.filter(|n| !n.starts_with('#') && !n.starts_with("K=")).collect()); + assert_eq!(names.len(), 384, "{names:?}"); + let numbered = |c: &Catalog, n: &str| { + n.rsplit_once(' ').is_some_and(|(head, d)| !d.is_empty() && d.bytes().all(|b| b.is_ascii_digit()) && c.plain(head).is_some()) + }; + let bad = lacking(&names, |c, n| c.plain(n).is_some() || numbered(c, n)); + assert!(bad.is_empty(), "{}", bad.join("\n")); +} + +/// A numbered built-in name shows its name before the number translated and the number as it +/// is; a name with a row of its own uses that row, and any other name comes back unchanged. +#[test] +fn numbered_labels_translate_the_name_before_the_number() { + let fr = Lang::from_code("fr").expect("fr registered"); + assert_eq!(numbered_label(fr, "Grays"), tr(fr, "Grays")); + assert_ne!(tr(fr, "Grays"), "Grays"); + assert_eq!(numbered_label(fr, "Grays 12"), format!("{} 12", tr(fr, "Grays"))); + for kept in ["K=35", "#33cc99", "Grays x", "Grays ", "Not A Catalog Name 3"] { + assert_eq!(numbered_label(fr, kept), kept); + } + assert_eq!(numbered_label(Lang::EN, "Grays 12"), "Grays 12"); +} + /// Preference choices and the marquee's E hint share the same translated labels. #[test] fn marquee_selection_labels_are_in_complete_catalogs() { diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 2b3e843ba3..032ecc8392 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6751,6 +6751,240 @@ axis Y Axis Y ekseni Stars Yıldızlar Triangles Üçgenler Sparkles Parıltılar + Warm Gray Sıcak Gri + Cool Gray Soğuk Gri + Neutrals Nötrler + Ivory Fildişi + Linen Keten + Oat Yulaf + Greige Grej + Stone Taş + Taupe Vizon + Slate Arduvaz + Clay Kil + Terracotta Terrakota + Ochre Aşı Boyası + Umber Toprak Kahve + Sand Kum + Olive Zeytin + Moss Yosun + Rosy Pembemsi + Neutral Nötr + Golden Altın Sarısı + Pastel Pastel + Pastel Red Pastel Kırmızı + Pastel Orange Pastel Turuncu + Pastel Amber Pastel Kehribar + Pastel Yellow Pastel Sarı + Pastel Lime Pastel Limon Yeşili + Pastel Green Pastel Yeşil + Pastel Teal Pastel Petrol Mavisi + Pastel Cyan Pastel Camgöbeği + Pastel Azure Pastel Gök Mavisi + Pastel Blue Pastel Mavi + Pastel Violet Pastel Menekşe + Pastel Magenta Pastel Macenta + Soft Red Yumuşak Kırmızı + Soft Orange Yumuşak Turuncu + Soft Amber Yumuşak Kehribar + Soft Yellow Yumuşak Sarı + Soft Lime Yumuşak Limon Yeşili + Soft Green Yumuşak Yeşil + Soft Teal Yumuşak Petrol Mavisi + Soft Cyan Yumuşak Camgöbeği + Soft Azure Yumuşak Gök Mavisi + Soft Blue Yumuşak Mavi + Soft Violet Yumuşak Menekşe + Soft Magenta Yumuşak Macenta + Vivid Red Canlı Kırmızı + Vivid Orange Canlı Turuncu + Vivid Amber Canlı Kehribar + Vivid Yellow Canlı Sarı + Vivid Lime Canlı Limon Yeşili + Vivid Green Canlı Yeşil + Vivid Teal Canlı Petrol Mavisi + Vivid Cyan Canlı Camgöbeği + Vivid Azure Canlı Gök Mavisi + Vivid Blue Canlı Mavi + Vivid Violet Canlı Menekşe + Vivid Magenta Canlı Macenta + Deep Koyu + Deep Red Koyu Kırmızı + Deep Orange Koyu Turuncu + Deep Amber Koyu Kehribar + Deep Yellow Koyu Sarı + Deep Lime Koyu Limon Yeşili + Deep Green Koyu Yeşil + Deep Teal Koyu Petrol Mavisi + Deep Cyan Koyu Camgöbeği + Deep Azure Koyu Gök Mavisi + Deep Blue Koyu Mavi + Deep Violet Koyu Menekşe + Deep Magenta Koyu Macenta + Gold Altın + Silver Gümüş + Bronze Bronz + Copper Bakır + Brass Pirinç + Rose Gold Rose Altın + Gunmetal Füme Metal + Platinum Platin + Pewter Kalay + Ember Kor + Lagoon Lagün + Dusk Alacakaranlık + Clay to Teal Kilden Petrol Mavisine + Plum to Olive Erikten Zeytine + Complementary Coral Mercan Tamamlayıcı + Split Complementary Coral Mercan Bölünmüş Tamamlayıcı + Analogous Coral Mercan Benzer + Triad Coral Mercan Üçlü + Tetrad Coral Mercan Dörtlü + Pentagram Coral Mercan Pentagram + Complementary Teal Petrol Mavisi Tamamlayıcı + Split Complementary Teal Petrol Mavisi Bölünmüş Tamamlayıcı + Analogous Teal Petrol Mavisi Benzer + Triad Teal Petrol Mavisi Üçlü + Tetrad Teal Petrol Mavisi Dörtlü + Pentagram Teal Petrol Mavisi Pentagram + Soft Spectrum Yumuşak Spektrum + Red to Amber Kırmızıdan Kehribara + Orange to Yellow Turuncudan Sarıya + Amber to Lime Kehribardan Limon Yeşiline + Yellow to Green Sarıdan Yeşile + Lime to Teal Limon Yeşilinden Petrol Mavisine + Green to Cyan Yeşilden Camgöbeğine + Teal to Azure Petrol Mavisinden Gök Mavisine + Cyan to Blue Camgöbeğinden Maviye + Azure to Violet Gök Mavisinden Menekşeye + Blue to Magenta Maviden Macentaya + Violet to Red Menekşeden Kırmızıya + Magenta to Orange Macentadan Turuncuya + Dawn Şafak + Noon Öğle + Sunset Gün Batımı + Night Gece + Overcast Kapalı Hava + White to Black Beyazdan Siyaha + Light Grays Açık Griler + Dark Grays Koyu Griler + Warm Grays Sıcak Griler + Cool Grays Soğuk Griler + Fade to Transparent Saydama Geçiş + White Fade Beyaz Geçiş + Vignette Vinyet + Mist Pus + Petal Taç Yaprağı + Fern Eğrelti + Smoke Duman + Honey Bal + Seafoam Deniz Köpüğü + Lavender Lavanta + Driftwood Dalga Odunu + Ink Wash Mürekkep Lavisi + Tide Gelgit + Bloom Çiçeklenme + Dew Çiy + Pollen Polen + Lichen Liken + Prism Veil Prizma Tül + Opal Ribbon Opal Şerit + Pearl Flash İnci Parıltısı + Aurora Foil Kutup Işığı Folyosu + Iris Sheen İris Parlaklığı + Frost Spectrum Kırağı Spektrumu + Silver Tide Gümüş Gelgit + Rose Quartz Gleam Pembe Kuvars Işıltısı + Moonstone Shift Aytaşı Yansıması + Violet Edge Menekşe Kenar + Mint Halo Nane Hale + Amber Corona Kehribar Korona + Polar Glint Kutup Pırıltısı + Pastel Orbit Pastel Yörünge + Coral and Navy Mercan ve Lacivert + Plum and Lime Erik ve Limon Yeşili + Teal and Gold Petrol Mavisi ve Altın + Indigo and Peach Çivit ve Şeftali + Forest and Rose Orman ve Gül + Red Glow Kırmızı Işıma + Orange Glow Turuncu Işıma + Amber Glow Kehribar Işıma + Yellow Glow Sarı Işıma + Lime Glow Limon Yeşili Işıma + Green Glow Yeşil Işıma + Teal Glow Petrol Mavisi Işıma + Cyan Glow Camgöbeği Işıma + Azure Glow Gök Mavisi Işıma + Blue Glow Mavi Işıma + Violet Glow Menekşe Işıma + Magenta Glow Macenta Işıma + Polka Dots Puantiye + Vertical Stripes Dikey Çizgiler + Horizontal Stripes Yatay Çizgiler + Diagonal Stripes Çapraz Çizgiler + Checkerboard Dama Tahtası + Diamonds Baklavalar + Crosses Artılar + Coarse Grit İri Gren + Stipple Noktalama + Scratches Çizikler + Sparse Flecks Seyrek Benekler + Dense Flecks Sık Benekler + Sine Bands Sinüs Bantları + Ripple Lines Dalgacık Çizgileri + Interference Rings Girişim Halkaları + Offset Rings Kaydırılmış Halkalar + Warped Checks Bükülmüş Kareler + Pinched Stripes Sıkıştırılmış Çizgiler + Chevron Pulse Şerit Darbesi + Radiating Lenses Işıyan Mercekler + Soft Shadow Yumuşak Gölge + Hard Shadow Sert Gölge + Lifted Card Kaldırılmış Kart + Neon Tube Neon Tüp + Inner Light İç Işık + Feathered Yumuşak Kenarlı + Haze Sis + Double Rule Çift Çizgi Kenar + Triple Rule Üçlü Çizgi Kenar + Dashed Border Kesik Çizgili Kenarlık + Dotted Border Noktalı Kenarlık + Offset Keyline Kaydırılmış Kontur + Inset Keyline İç Kontur + Outside Stroke Dış Kontur + Pointer İşaretçi + Highlighter Fosforlu Kalem + Sketchy Line Eskiz Çizgisi + Scribble Fill Karalama Dolgu + Wobble Titreşim + Zig Zag Edge Zikzak Kenar + Wavy Edge Dalgalı Kenar + Puffy Kabarık + Starburst Yıldız Patlaması + Glossy Parlak + Brushed Metal Fırçalanmış Metal + Spotlight Spot Işık + Sunset Band Gün Batımı Bandı + Sea Glass Deniz Camı + Pearl İnci + Chrome Rim Krom Kenar + Glow Orb Işıyan Küre + Pill Badge Hap Rozet + Round Badge Yuvarlak Rozet + Flag Wave Dalgalanan Bayrak + Bulge Şişkinlik + Twisted Bükülmüş + Echo Yankı + Spiral Copies Sarmal Kopyalar + Multiply Tint Çarp Tonu + Darken Veil Koyulaştır Örtüsü + Ghosted Hayalet + Two Tone İki Renkli + Overlay Glaze Kaplama Sırı + Screen Light Ekran Işığı + Soft Light Wash Yumuşak Işık Lavisi + Burst Patlama + Rounded Square Yuvarlatılmış Kare Save Brush Library… Fırça Kitaplığını Kaydet… @msg `{_1}` has no brushes to apply `{_1}` içinde uygulanacak fırça yok @msg missing `library` (see brush.libraries) `library` eksik (bkz. brush.libraries) diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 50690fa0c7..2bf1d61dff 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6401,6 +6401,245 @@ axis Y Axis Вісь Y Stars Зірки Triangles Трикутники Sparkles Іскри + Warm Gray Теплий сірий + Cool Gray Холодний сірий + Neutrals Нейтральні + Ivory Слонова кістка + Linen Льон + Oat Овес + Greige Грейж + Stone Камінь + Taupe Сіро-коричневий + Slate Сланець + Clay Глина + Terracotta Теракота + Ochre Охра + Umber Умбра + Sand Пісок + Olive Оливковий + Moss Мох + Rosy Рожевуватий + Neutral Нейтральний + Golden Золотистий + Pastel Пастельні + Pastel Red Пастельний червоний + Pastel Orange Пастельний помаранчевий + Pastel Amber Пастельний бурштиновий + Pastel Yellow Пастельний жовтий + Pastel Lime Пастельний лаймовий + Pastel Green Пастельний зелений + Pastel Teal Пастельний синьо-зелений + Pastel Cyan Пастельний блакитний + Pastel Azure Пастельний лазуровий + Pastel Blue Пастельний синій + Pastel Violet Пастельний фіолетовий + Pastel Magenta Пастельний пурпурний + Soft Red М’який червоний + Soft Orange М’який помаранчевий + Soft Amber М’який бурштиновий + Soft Yellow М’який жовтий + Soft Lime М’який лаймовий + Soft Green М’який зелений + Soft Teal М’який синьо-зелений + Soft Cyan М’який блакитний + Soft Azure М’який лазуровий + Soft Blue М’який синій + Soft Violet М’який фіолетовий + Soft Magenta М’який пурпурний + Vivid Red Яскравий червоний + Vivid Orange Яскравий помаранчевий + Vivid Amber Яскравий бурштиновий + Vivid Yellow Яскравий жовтий + Vivid Lime Яскравий лаймовий + Vivid Green Яскравий зелений + Vivid Teal Яскравий синьо-зелений + Vivid Cyan Яскравий блакитний + Vivid Azure Яскравий лазуровий + Vivid Blue Яскравий синій + Vivid Violet Яскравий фіолетовий + Vivid Magenta Яскравий пурпурний + Deep Глибокі + Deep Red Темно-червоний + Deep Orange Темно-помаранчевий + Deep Amber Темно-бурштиновий + Deep Yellow Темно-жовтий + Deep Lime Темно-лаймовий + Deep Green Темно-зелений + Deep Teal Темний синьо-зелений + Deep Cyan Темно-блакитний + Deep Azure Темно-лазуровий + Deep Blue Темно-синій + Deep Violet Темно-фіолетовий + Deep Magenta Темно-пурпурний + Gold Золото + Silver Срібло + Bronze Бронза + Copper Мідь + Brass Латунь + Rose Gold Рожеве золото + Gunmetal Збройовий метал + Platinum Платина + Pewter Олово + Ember Жар + Lagoon Лагуна + Dusk Сутінки + Clay to Teal Від глини до синьо-зеленого + Plum to Olive Від сливового до оливкового + Complementary Coral Кораловий, доповняльна + Split Complementary Coral Кораловий, розщеплена доповняльна + Analogous Coral Кораловий, аналогова + Triad Coral Кораловий, тріада + Tetrad Coral Кораловий, тетрада + Pentagram Coral Кораловий, пентаграма + Complementary Teal Синьо-зелений, доповняльна + Split Complementary Teal Синьо-зелений, розщеплена доповняльна + Analogous Teal Синьо-зелений, аналогова + Triad Teal Синьо-зелений, тріада + Tetrad Teal Синьо-зелений, тетрада + Pentagram Teal Синьо-зелений, пентаграма + Soft Spectrum М’який спектр + Red to Amber Від червоного до бурштинового + Orange to Yellow Від помаранчевого до жовтого + Amber to Lime Від бурштинового до лаймового + Yellow to Green Від жовтого до зеленого + Lime to Teal Від лаймового до синьо-зеленого + Green to Cyan Від зеленого до блакитного + Teal to Azure Від синьо-зеленого до лазурового + Cyan to Blue Від блакитного до синього + Azure to Violet Від лазурового до фіолетового + Blue to Magenta Від синього до пурпурного + Violet to Red Від фіолетового до червоного + Magenta to Orange Від пурпурного до помаранчевого + Dawn Світанок + Noon Полудень + Sunset Захід сонця + Night Ніч + Overcast Похмуро + White to Black Від білого до чорного + Light Grays Світло-сірі + Dark Grays Темно-сірі + Warm Grays Теплі сірі + Cool Grays Холодні сірі + Fade to Transparent Перехід у прозорість + White Fade Білий перехід + Vignette Віньєтка + Mist Серпанок + Petal Пелюстка + Fern Папороть + Smoke Дим + Honey Мед + Seafoam Морська піна + Lavender Лаванда + Driftwood Викинуте морем дерево + Ink Wash Розмивка тушшю + Tide Приплив + Bloom Цвітіння + Dew Роса + Pollen Пилок + Lichen Лишайник + Prism Veil Призматична вуаль + Opal Ribbon Опалова стрічка + Pearl Flash Перлинний спалах + Aurora Foil Фольга полярного сяйва + Iris Sheen Райдужний полиск + Frost Spectrum Морозний спектр + Silver Tide Срібний приплив + Rose Quartz Gleam Блиск рожевого кварцу + Moonstone Shift Перелив місячного каменю + Violet Edge Фіолетовий край + Mint Halo М’ятний ореол + Amber Corona Бурштинова корона + Polar Glint Полярний відблиск + Pastel Orbit Пастельна орбіта + Coral and Navy Кораловий і темно-синій + Plum and Lime Сливовий і лаймовий + Teal and Gold Синьо-зелений і золотий + Indigo and Peach Індиго і персиковий + Forest and Rose Лісовий і рожевий + Red Glow Червоне сяйво + Orange Glow Помаранчеве сяйво + Amber Glow Бурштинове сяйво + Yellow Glow Жовте сяйво + Lime Glow Лаймове сяйво + Green Glow Зелене сяйво + Teal Glow Синьо-зелене сяйво + Cyan Glow Блакитне сяйво + Azure Glow Лазурове сяйво + Blue Glow Синє сяйво + Violet Glow Фіолетове сяйво + Magenta Glow Пурпурне сяйво + Polka Dots Горошок + Vertical Stripes Вертикальні смуги + Horizontal Stripes Горизонтальні смуги + Diagonal Stripes Діагональні смуги + Checkerboard Шахівниця + Diamonds Ромби + Crosses Хрестики + Coarse Grit Велике зерно + Stipple Пунктир + Scratches Подряпини + Sparse Flecks Рідкі цятки + Dense Flecks Густі цятки + Sine Bands Синусоїдні смуги + Ripple Lines Лінії брижів + Interference Rings Інтерференційні кільця + Offset Rings Зміщені кільця + Warped Checks Викривлена клітинка + Pinched Stripes Стиснуті смуги + Chevron Pulse Пульсуючі шеврони + Radiating Lenses Променисті лінзи + Soft Shadow М’яка тінь + Hard Shadow Різка тінь + Lifted Card Піднята картка + Neon Tube Неонова трубка + Inner Light Внутрішнє світло + Feathered Розтушований + Haze Імла + Double Rule Подвійна лінійка + Triple Rule Потрійна лінійка + Dashed Border Штрихова рамка + Dotted Border Точкова рамка + Offset Keyline Зміщений контур + Inset Keyline Внутрішній контур + Outside Stroke Зовнішня обвідка + Pointer Вказівник + Highlighter Маркер + Sketchy Line Ескізна лінія + Scribble Fill Заливка каракулями + Wobble Тремтіння + Zig Zag Edge Зигзагоподібний край + Wavy Edge Хвилястий край + Puffy Пухкий + Starburst Зоряний вибух + Glossy Глянцевий + Brushed Metal Шліфований метал + Spotlight Прожектор + Sunset Band Смуга заходу + Sea Glass Морське скло + Pearl Перлина + Chrome Rim Хромований обідок + Glow Orb Сяйна куля + Pill Badge Значок-капсула + Round Badge Круглий значок + Flag Wave Майоріючий прапор + Bulge Опуклість + Twisted Закручений + Echo Відлуння + Spiral Copies Копії по спіралі + Multiply Tint Відтінок множення + Darken Veil Затемнювальна вуаль + Ghosted Примарний + Two Tone Двоколірний + Overlay Glaze Глазур накладання + Screen Light Світло екрана + Soft Light Wash Розмивка м’яким світлом + Burst Спалах + Rounded Square Округлений квадрат + Bar Панель + Hexagon Шестикутник + Spectrum Спектр + Triangle Трикутник + Vivid Яскраві Save Brush Library… Зберегти бібліотеку пензлів… @msg `{_1}` has no brushes to apply У `{_1}` немає пензлів для застосування @msg missing `library` (see brush.libraries) не вказано `library` (див. brush.libraries) diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d8469bce53..b6c99efc4e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6402,6 +6402,245 @@ axis Y Axis Trục Y Stars Ngôi sao Triangles Tam giác Sparkles Lấp lánh + Warm Gray Xám ấm + Cool Gray Xám lạnh + Neutrals Màu trung tính + Ivory Ngà + Linen Vải lanh + Oat Yến mạch + Greige Xám be + Stone Đá + Taupe Nâu xám + Slate Đá phiến + Clay Đất sét + Terracotta Đất nung + Ochre Đất son + Umber Nâu đất + Sand Cát + Olive Ô liu + Moss Rêu + Rosy Hồng phớt + Neutral Trung tính + Golden Vàng óng + Pastel Màu phấn + Pastel Red Đỏ phấn + Pastel Orange Cam phấn + Pastel Amber Hổ phách phấn + Pastel Yellow Vàng phấn + Pastel Lime Vàng chanh phấn + Pastel Green Xanh lá phấn + Pastel Teal Xanh mòng két phấn + Pastel Cyan Xanh lơ phấn + Pastel Azure Xanh da trời phấn + Pastel Blue Xanh dương phấn + Pastel Violet Tím phấn + Pastel Magenta Đỏ hồng phấn + Soft Red Đỏ dịu + Soft Orange Cam dịu + Soft Amber Hổ phách dịu + Soft Yellow Vàng dịu + Soft Lime Vàng chanh dịu + Soft Green Xanh lá dịu + Soft Teal Xanh mòng két dịu + Soft Cyan Xanh lơ dịu + Soft Azure Xanh da trời dịu + Soft Blue Xanh dương dịu + Soft Violet Tím dịu + Soft Magenta Đỏ hồng dịu + Vivid Red Đỏ rực + Vivid Orange Cam rực + Vivid Amber Hổ phách rực + Vivid Yellow Vàng rực + Vivid Lime Vàng chanh rực + Vivid Green Xanh lá rực + Vivid Teal Xanh mòng két rực + Vivid Cyan Xanh lơ rực + Vivid Azure Xanh da trời rực + Vivid Blue Xanh dương rực + Vivid Violet Tím rực + Vivid Magenta Đỏ hồng rực + Deep Đậm + Deep Red Đỏ đậm + Deep Orange Cam đậm + Deep Amber Hổ phách đậm + Deep Yellow Vàng đậm + Deep Lime Vàng chanh đậm + Deep Green Xanh lá đậm + Deep Teal Xanh mòng két đậm + Deep Cyan Xanh lơ đậm + Deep Azure Xanh da trời đậm + Deep Blue Xanh dương đậm + Deep Violet Tím đậm + Deep Magenta Đỏ hồng đậm + Gold Vàng kim + Silver Bạc + Bronze Đồng thiếc + Copper Đồng đỏ + Brass Đồng thau + Rose Gold Vàng hồng + Gunmetal Xám thép + Platinum Bạch kim + Pewter Thiếc + Ember Than hồng + Lagoon Đầm phá + Dusk Hoàng hôn + Clay to Teal Đất sét sang xanh mòng két + Plum to Olive Mận sang ô liu + Complementary Coral San hô, bổ sung + Split Complementary Coral San hô, bổ sung tách + Analogous Coral San hô, tương đồng + Triad Coral San hô, bộ ba + Tetrad Coral San hô, bộ bốn + Pentagram Coral San hô, ngôi sao năm cánh + Complementary Teal Xanh mòng két, bổ sung + Split Complementary Teal Xanh mòng két, bổ sung tách + Analogous Teal Xanh mòng két, tương đồng + Triad Teal Xanh mòng két, bộ ba + Tetrad Teal Xanh mòng két, bộ bốn + Pentagram Teal Xanh mòng két, ngôi sao năm cánh + Soft Spectrum Quang phổ dịu + Red to Amber Đỏ sang hổ phách + Orange to Yellow Cam sang vàng + Amber to Lime Hổ phách sang vàng chanh + Yellow to Green Vàng sang xanh lá + Lime to Teal Vàng chanh sang xanh mòng két + Green to Cyan Xanh lá sang xanh lơ + Teal to Azure Xanh mòng két sang xanh da trời + Cyan to Blue Xanh lơ sang xanh dương + Azure to Violet Xanh da trời sang tím + Blue to Magenta Xanh dương sang đỏ hồng + Violet to Red Tím sang đỏ + Magenta to Orange Đỏ hồng sang cam + Dawn Bình minh + Noon Giữa trưa + Sunset Hoàng hôn rực + Night Đêm + Overcast Trời âm u + White to Black Trắng sang đen + Light Grays Xám nhạt + Dark Grays Xám sẫm + Warm Grays Các sắc xám ấm + Cool Grays Các sắc xám lạnh + Fade to Transparent Mờ dần sang trong suốt + White Fade Mờ dần sang trắng + Vignette Viền tối + Mist Sương mù + Petal Cánh hoa + Fern Dương xỉ + Smoke Khói + Honey Mật ong + Seafoam Bọt biển + Lavender Oải hương + Driftwood Gỗ trôi dạt + Ink Wash Mực loang + Tide Thủy triều + Bloom Nở hoa + Dew Sương + Pollen Phấn hoa + Lichen Địa y + Prism Veil Màn lăng kính + Opal Ribbon Dải opal + Pearl Flash Ánh ngọc trai + Aurora Foil Lá cực quang + Iris Sheen Ánh óng ánh + Frost Spectrum Quang phổ sương giá + Silver Tide Triều bạc + Rose Quartz Gleam Ánh thạch anh hồng + Moonstone Shift Ánh đá mặt trăng + Violet Edge Viền tím + Mint Halo Quầng bạc hà + Amber Corona Vành hổ phách + Polar Glint Ánh cực + Pastel Orbit Quỹ đạo màu phấn + Coral and Navy San hô và xanh hải quân + Plum and Lime Mận và vàng chanh + Teal and Gold Xanh mòng két và vàng kim + Indigo and Peach Chàm và đào + Forest and Rose Rừng và hoa hồng + Red Glow Ánh đỏ + Orange Glow Ánh cam + Amber Glow Ánh hổ phách + Yellow Glow Ánh vàng + Lime Glow Ánh vàng chanh + Green Glow Ánh xanh lá + Teal Glow Ánh xanh mòng két + Cyan Glow Ánh xanh lơ + Azure Glow Ánh xanh da trời + Blue Glow Ánh xanh dương + Violet Glow Ánh tím + Magenta Glow Ánh đỏ hồng + Polka Dots Chấm bi + Vertical Stripes Sọc dọc + Horizontal Stripes Sọc ngang + Diagonal Stripes Sọc chéo + Checkerboard Bàn cờ + Diamonds Hình thoi + Crosses Chữ thập + Coarse Grit Hạt thô + Stipple Chấm điểm + Scratches Vết xước + Sparse Flecks Đốm thưa + Dense Flecks Đốm dày + Sine Bands Dải hình sin + Ripple Lines Đường gợn sóng + Interference Rings Vòng giao thoa + Offset Rings Vòng lệch + Warped Checks Ô vuông méo + Pinched Stripes Sọc thắt + Chevron Pulse Nhịp chữ V + Radiating Lenses Thấu kính tỏa tia + Soft Shadow Bóng mềm + Hard Shadow Bóng cứng + Lifted Card Thẻ nổi + Neon Tube Ống neon + Inner Light Ánh sáng bên trong + Feathered Viền mềm + Haze Mờ sương + Double Rule Đường kẻ đôi + Triple Rule Đường kẻ ba + Dashed Border Viền nét đứt + Dotted Border Viền chấm + Offset Keyline Đường viền lệch + Inset Keyline Đường viền trong + Outside Stroke Nét ngoài + Pointer Con trỏ + Highlighter Bút dạ quang + Sketchy Line Nét phác thảo + Scribble Fill Tô nguệch ngoạc + Wobble Chao đảo + Zig Zag Edge Mép răng cưa + Wavy Edge Mép lượn sóng + Puffy Phồng + Starburst Nổ sao + Glossy Bóng loáng + Brushed Metal Kim loại xước + Spotlight Đèn chiếu + Sunset Band Dải hoàng hôn + Sea Glass Thủy tinh biển + Pearl Ngọc trai + Chrome Rim Vành crôm + Glow Orb Quả cầu phát sáng + Pill Badge Huy hiệu viên thuốc + Round Badge Huy hiệu tròn + Flag Wave Cờ bay + Bulge Phình + Twisted Xoắn + Echo Tiếng vọng + Spiral Copies Bản sao xoắn ốc + Multiply Tint Sắc nhân + Darken Veil Màn làm tối + Ghosted Mờ ảo + Two Tone Hai tông + Overlay Glaze Men phủ lên + Screen Light Ánh màn hình + Soft Light Wash Loang ánh sáng mềm + Burst Bùng nổ + Rounded Square Hình vuông bo góc + Bar Thanh + Hexagon Lục giác + Spectrum Quang phổ + Triangle Tam giác + Vivid Rực rỡ Save Brush Library… Lưu thư viện cọ… @msg `{_1}` has no brushes to apply `{_1}` không có cọ nào để áp dụng @msg missing `library` (see brush.libraries) thiếu `library` (xem brush.libraries) diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d9d9110276..0e8b64a3e6 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6634,6 +6634,243 @@ axis Y Axis Y 轴 Stars 星形 Triangles 三角形 Sparkles 闪光 + Warm Gray 暖灰 + Cool Gray 冷灰 + Neutrals 中性色 + Ivory 象牙白 + Linen 亚麻 + Oat 燕麦 + Greige 灰米色 + Stone 石色 + Taupe 灰褐 + Slate 石板灰 + Clay 陶土 + Terracotta 赤陶 + Ochre 赭石 + Umber 棕土 + Sand 沙色 + Olive 橄榄 + Moss 苔藓 + Rosy 玫瑰调 + Neutral 中性 + Golden 金黄 + Pastel 粉彩 + Pastel Red 粉彩红 + Pastel Orange 粉彩橙 + Pastel Amber 粉彩琥珀 + Pastel Yellow 粉彩黄 + Pastel Lime 粉彩青柠 + Pastel Green 粉彩绿 + Pastel Teal 粉彩蓝绿 + Pastel Cyan 粉彩青 + Pastel Azure 粉彩天蓝 + Pastel Blue 粉彩蓝 + Pastel Violet 粉彩紫罗兰 + Pastel Magenta 粉彩洋红 + Soft Red 柔和红 + Soft Orange 柔和橙 + Soft Amber 柔和琥珀 + Soft Yellow 柔和黄 + Soft Lime 柔和青柠 + Soft Green 柔和绿 + Soft Teal 柔和蓝绿 + Soft Cyan 柔和青 + Soft Azure 柔和天蓝 + Soft Blue 柔和蓝 + Soft Violet 柔和紫罗兰 + Soft Magenta 柔和洋红 + Vivid Red 鲜艳红 + Vivid Orange 鲜艳橙 + Vivid Amber 鲜艳琥珀 + Vivid Yellow 鲜艳黄 + Vivid Lime 鲜艳青柠 + Vivid Green 鲜艳绿 + Vivid Teal 鲜艳蓝绿 + Vivid Cyan 鲜艳青 + Vivid Azure 鲜艳天蓝 + Vivid Blue 鲜艳蓝 + Vivid Violet 鲜艳紫罗兰 + Vivid Magenta 鲜艳洋红 + Deep 深色 + Deep Red 深红 + Deep Orange 深橙 + Deep Amber 深琥珀 + Deep Yellow 深黄 + Deep Lime 深青柠 + Deep Green 深绿 + Deep Teal 深蓝绿 + Deep Cyan 深青 + Deep Azure 深天蓝 + Deep Blue 深蓝 + Deep Violet 深紫罗兰 + Deep Magenta 深洋红 + Gold 金 + Silver 银 + Bronze 青铜 + Copper 铜 + Brass 黄铜 + Rose Gold 玫瑰金 + Gunmetal 枪灰 + Platinum 铂金 + Pewter 锡镴 + Ember 余烬 + Lagoon 泻湖 + Dusk 黄昏 + Clay to Teal 陶土到蓝绿 + Plum to Olive 梅紫到橄榄 + Complementary Coral 珊瑚色,互补色 + Split Complementary Coral 珊瑚色,分裂互补色 + Analogous Coral 珊瑚色,类似色 + Triad Coral 珊瑚色,三色组 + Tetrad Coral 珊瑚色,四色组 + Pentagram Coral 珊瑚色,五角星 + Complementary Teal 蓝绿,互补色 + Split Complementary Teal 蓝绿,分裂互补色 + Analogous Teal 蓝绿,类似色 + Triad Teal 蓝绿,三色组 + Tetrad Teal 蓝绿,四色组 + Pentagram Teal 蓝绿,五角星 + Soft Spectrum 柔和光谱 + Red to Amber 红到琥珀 + Orange to Yellow 橙到黄 + Amber to Lime 琥珀到青柠 + Yellow to Green 黄到绿 + Lime to Teal 青柠到蓝绿 + Green to Cyan 绿到青 + Teal to Azure 蓝绿到天蓝 + Cyan to Blue 青到蓝 + Azure to Violet 天蓝到紫罗兰 + Blue to Magenta 蓝到洋红 + Violet to Red 紫罗兰到红 + Magenta to Orange 洋红到橙 + Dawn 黎明 + Noon 正午 + Sunset 日落 + Night 夜晚 + Overcast 阴天 + White to Black 白到黑 + Light Grays 浅灰 + Dark Grays 深灰 + Warm Grays 暖灰系 + Cool Grays 冷灰系 + Fade to Transparent 渐隐到透明 + White Fade 白色渐隐 + Vignette 暗角 + Mist 薄雾 + Petal 花瓣 + Fern 蕨 + Smoke 烟 + Honey 蜂蜜 + Seafoam 海沫 + Lavender 薰衣草 + Driftwood 浮木 + Ink Wash 水墨 + Tide 潮汐 + Bloom 绽放 + Dew 露珠 + Pollen 花粉 + Lichen 地衣 + Prism Veil 棱镜纱 + Opal Ribbon 蛋白石丝带 + Pearl Flash 珍珠闪光 + Aurora Foil 极光箔 + Iris Sheen 虹彩光泽 + Frost Spectrum 霜之光谱 + Silver Tide 银潮 + Rose Quartz Gleam 粉晶微光 + Moonstone Shift 月光石流光 + Violet Edge 紫罗兰边 + Mint Halo 薄荷光晕 + Amber Corona 琥珀日冕 + Polar Glint 极地闪烁 + Pastel Orbit 粉彩轨道 + Coral and Navy 珊瑚色与海军蓝 + Plum and Lime 梅紫与青柠 + Teal and Gold 蓝绿与金 + Indigo and Peach 靛蓝与桃色 + Forest and Rose 森林与玫瑰 + Red Glow 红色辉光 + Orange Glow 橙色辉光 + Amber Glow 琥珀辉光 + Yellow Glow 黄色辉光 + Lime Glow 青柠辉光 + Green Glow 绿色辉光 + Teal Glow 蓝绿辉光 + Cyan Glow 青色辉光 + Azure Glow 天蓝辉光 + Blue Glow 蓝色辉光 + Violet Glow 紫罗兰辉光 + Magenta Glow 洋红辉光 + Polka Dots 波点 + Vertical Stripes 竖条纹 + Horizontal Stripes 横条纹 + Diagonal Stripes 斜条纹 + Checkerboard 棋盘格 + Diamonds 菱形 + Crosses 十字 + Coarse Grit 粗颗粒 + Stipple 点画 + Scratches 划痕 + Sparse Flecks 稀疏斑点 + Dense Flecks 密集斑点 + Sine Bands 正弦带 + Ripple Lines 涟漪线 + Interference Rings 干涉环 + Offset Rings 错位环 + Warped Checks 扭曲方格 + Pinched Stripes 收缩条纹 + Chevron Pulse 人字脉冲 + Radiating Lenses 放射透镜 + Soft Shadow 柔和阴影 + Hard Shadow 硬阴影 + Lifted Card 浮起卡片 + Neon Tube 霓虹灯管 + Inner Light 内光 + Feathered 羽化 + Haze 雾霭 + Double Rule 双线 + Triple Rule 三线 + Dashed Border 虚线边框 + Dotted Border 点线边框 + Offset Keyline 偏移轮廓线 + Inset Keyline 内缩轮廓线 + Outside Stroke 外描边 + Pointer 指针 + Highlighter 荧光笔 + Sketchy Line 草图线 + Scribble Fill 涂鸦填充 + Wobble 摇晃 + Zig Zag Edge 锯齿边 + Wavy Edge 波浪边 + Puffy 鼓起 + Starburst 星爆 + Glossy 光泽 + Brushed Metal 拉丝金属 + Spotlight 聚光灯 + Sunset Band 日落条带 + Sea Glass 海玻璃 + Pearl 珍珠 + Chrome Rim 镀铬边 + Glow Orb 发光球 + Pill Badge 胶囊徽章 + Round Badge 圆形徽章 + Flag Wave 飘扬的旗帜 + Bulge 凸起 + Twisted 扭转 + Echo 回声 + Spiral Copies 螺旋副本 + Multiply Tint 正片叠底色调 + Darken Veil 变暗薄纱 + Ghosted 半透明 + Two Tone 双色调 + Overlay Glaze 叠加釉 + Screen Light 滤色光 + Soft Light Wash 柔光晕染 + Burst 爆发 + Rounded Square 圆角正方形 + Bar 条形 + Hexagon 六边形 + Triangle 三角 Save Brush Library… 保存画笔库… @msg `{_1}` has no brushes to apply `{_1}` 中没有可应用的画笔 @msg missing `library` (see brush.libraries) 缺少 `library`(请参阅 brush.libraries) diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index a0d987fe69..3593e2e60a 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6440,6 +6440,245 @@ axis Y Axis Y 軸 Stars 星形 Triangles 三角形 Sparkles 閃光 + Warm Gray 暖灰 + Cool Gray 冷灰 + Neutrals 中性色 + Ivory 象牙白 + Linen 亞麻 + Oat 燕麥 + Greige 灰米色 + Stone 石色 + Taupe 灰褐 + Slate 石板灰 + Clay 陶土 + Terracotta 赤陶 + Ochre 赭石 + Umber 棕土 + Sand 沙色 + Olive 橄欖 + Moss 苔蘚 + Rosy 玫瑰調 + Neutral 中性 + Golden 金黃 + Pastel 粉彩 + Pastel Red 粉彩紅 + Pastel Orange 粉彩橙 + Pastel Amber 粉彩琥珀 + Pastel Yellow 粉彩黃 + Pastel Lime 粉彩萊姆 + Pastel Green 粉彩綠 + Pastel Teal 粉彩藍綠 + Pastel Cyan 粉彩青 + Pastel Azure 粉彩天藍 + Pastel Blue 粉彩藍 + Pastel Violet 粉彩紫羅蘭 + Pastel Magenta 粉彩洋紅 + Soft Red 柔和紅 + Soft Orange 柔和橙 + Soft Amber 柔和琥珀 + Soft Yellow 柔和黃 + Soft Lime 柔和萊姆 + Soft Green 柔和綠 + Soft Teal 柔和藍綠 + Soft Cyan 柔和青 + Soft Azure 柔和天藍 + Soft Blue 柔和藍 + Soft Violet 柔和紫羅蘭 + Soft Magenta 柔和洋紅 + Vivid Red 鮮豔紅 + Vivid Orange 鮮豔橙 + Vivid Amber 鮮豔琥珀 + Vivid Yellow 鮮豔黃 + Vivid Lime 鮮豔萊姆 + Vivid Green 鮮豔綠 + Vivid Teal 鮮豔藍綠 + Vivid Cyan 鮮豔青 + Vivid Azure 鮮豔天藍 + Vivid Blue 鮮豔藍 + Vivid Violet 鮮豔紫羅蘭 + Vivid Magenta 鮮豔洋紅 + Deep 深色 + Deep Red 深紅 + Deep Orange 深橙 + Deep Amber 深琥珀 + Deep Yellow 深黃 + Deep Lime 深萊姆 + Deep Green 深綠 + Deep Teal 深藍綠 + Deep Cyan 深青 + Deep Azure 深天藍 + Deep Blue 深藍 + Deep Violet 深紫羅蘭 + Deep Magenta 深洋紅 + Gold 金 + Silver 銀 + Bronze 青銅 + Copper 銅 + Brass 黃銅 + Rose Gold 玫瑰金 + Gunmetal 槍灰 + Platinum 白金 + Pewter 錫鑞 + Ember 餘燼 + Lagoon 潟湖 + Dusk 黃昏 + Clay to Teal 陶土到藍綠 + Plum to Olive 梅紫到橄欖 + Complementary Coral 珊瑚色,互補色 + Split Complementary Coral 珊瑚色,分割互補色 + Analogous Coral 珊瑚色,類似色 + Triad Coral 珊瑚色,三色組 + Tetrad Coral 珊瑚色,四色組 + Pentagram Coral 珊瑚色,五角星 + Complementary Teal 藍綠,互補色 + Split Complementary Teal 藍綠,分割互補色 + Analogous Teal 藍綠,類似色 + Triad Teal 藍綠,三色組 + Tetrad Teal 藍綠,四色組 + Pentagram Teal 藍綠,五角星 + Soft Spectrum 柔和光譜 + Red to Amber 紅到琥珀 + Orange to Yellow 橙到黃 + Amber to Lime 琥珀到萊姆 + Yellow to Green 黃到綠 + Lime to Teal 萊姆到藍綠 + Green to Cyan 綠到青 + Teal to Azure 藍綠到天藍 + Cyan to Blue 青到藍 + Azure to Violet 天藍到紫羅蘭 + Blue to Magenta 藍到洋紅 + Violet to Red 紫羅蘭到紅 + Magenta to Orange 洋紅到橙 + Dawn 黎明 + Noon 正午 + Sunset 日落 + Night 夜晚 + Overcast 陰天 + White to Black 白到黑 + Light Grays 淺灰 + Dark Grays 深灰 + Warm Grays 暖灰系 + Cool Grays 冷灰系 + Fade to Transparent 漸隱到透明 + White Fade 白色漸隱 + Vignette 暈影 + Mist 薄霧 + Petal 花瓣 + Fern 蕨 + Smoke 煙 + Honey 蜂蜜 + Seafoam 海沫 + Lavender 薰衣草 + Driftwood 漂流木 + Ink Wash 水墨 + Tide 潮汐 + Bloom 綻放 + Dew 露珠 + Pollen 花粉 + Lichen 地衣 + Prism Veil 稜鏡紗 + Opal Ribbon 蛋白石緞帶 + Pearl Flash 珍珠閃光 + Aurora Foil 極光箔 + Iris Sheen 虹彩光澤 + Frost Spectrum 霜之光譜 + Silver Tide 銀潮 + Rose Quartz Gleam 粉晶微光 + Moonstone Shift 月光石流光 + Violet Edge 紫羅蘭邊 + Mint Halo 薄荷光暈 + Amber Corona 琥珀日冕 + Polar Glint 極地閃爍 + Pastel Orbit 粉彩軌道 + Coral and Navy 珊瑚色與海軍藍 + Plum and Lime 梅紫與萊姆 + Teal and Gold 藍綠與金 + Indigo and Peach 靛藍與桃色 + Forest and Rose 森林與玫瑰 + Red Glow 紅色光暈 + Orange Glow 橙色光暈 + Amber Glow 琥珀光暈 + Yellow Glow 黃色光暈 + Lime Glow 萊姆光暈 + Green Glow 綠色光暈 + Teal Glow 藍綠光暈 + Cyan Glow 青色光暈 + Azure Glow 天藍光暈 + Blue Glow 藍色光暈 + Violet Glow 紫羅蘭光暈 + Magenta Glow 洋紅光暈 + Polka Dots 圓點 + Vertical Stripes 直條紋 + Horizontal Stripes 橫條紋 + Diagonal Stripes 斜條紋 + Checkerboard 棋盤格 + Diamonds 菱形 + Crosses 十字 + Coarse Grit 粗顆粒 + Stipple 點畫 + Scratches 刮痕 + Sparse Flecks 稀疏斑點 + Dense Flecks 密集斑點 + Sine Bands 正弦帶 + Ripple Lines 漣漪線 + Interference Rings 干涉環 + Offset Rings 錯位環 + Warped Checks 扭曲方格 + Pinched Stripes 收縮條紋 + Chevron Pulse 人字脈衝 + Radiating Lenses 放射透鏡 + Soft Shadow 柔和陰影 + Hard Shadow 硬陰影 + Lifted Card 浮起卡片 + Neon Tube 霓虹燈管 + Inner Light 內光 + Feathered 羽化 + Haze 霧靄 + Double Rule 雙線 + Triple Rule 三線 + Dashed Border 虛線邊框 + Dotted Border 點線邊框 + Offset Keyline 位移輪廓線 + Inset Keyline 內縮輪廓線 + Outside Stroke 外側筆畫 + Pointer 指標 + Highlighter 螢光筆 + Sketchy Line 草圖線 + Scribble Fill 塗鴉填色 + Wobble 搖晃 + Zig Zag Edge 鋸齒邊 + Wavy Edge 波浪邊 + Puffy 鼓起 + Starburst 星爆 + Glossy 光澤 + Brushed Metal 拉絲金屬 + Spotlight 聚光燈 + Sunset Band 日落條帶 + Sea Glass 海玻璃 + Pearl 珍珠 + Chrome Rim 鍍鉻邊 + Glow Orb 發光球 + Pill Badge 膠囊徽章 + Round Badge 圓形徽章 + Flag Wave 飄揚的旗幟 + Bulge 凸起 + Twisted 扭轉 + Echo 回聲 + Spiral Copies 螺旋副本 + Multiply Tint 色彩增值色調 + Darken Veil 變暗薄紗 + Ghosted 半透明 + Two Tone 雙色調 + Overlay Glaze 覆蓋釉 + Screen Light 濾色光 + Soft Light Wash 柔光暈染 + Burst 爆發 + Rounded Square 圓角正方形 + Bar 長條 + Hexagon 六邊形 + Spectrum 光譜 + Triangle 三角 + Vivid 鮮豔 Save Brush Library… 儲存筆刷資料庫… @msg `{_1}` has no brushes to apply `{_1}` 中沒有可套用的筆刷 @msg missing `library` (see brush.libraries) 未提供 `library`(請參閱 brush.libraries) diff --git a/crates/ui-egui/src/panels/brushes.rs b/crates/ui-egui/src/panels/brushes.rs index 0b540a4ba5..0e41752551 100644 --- a/crates/ui-egui/src/panels/brushes.rs +++ b/crates/ui-egui/src/panels/brushes.rs @@ -7,6 +7,7 @@ //! on macOS) onto such a brush replaces its art. Brush libraries open in library panels //! ([`BrushLibraries`]). +use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; @@ -654,8 +655,8 @@ impl LibraryKind for BrushLibraries { } /// A built-in library's brush in the UI language; a User Defined or loaded library's brush as /// it is named. - fn label<'a>(id: &str, name: &'a str) -> &'a str { - super::label_or_name(name, brushlib::BUILTIN.iter().any(|b| b.id == id)) + fn label<'a>(id: &str, name: &'a str) -> Cow<'a, str> { + super::label_or_name(name, brushlib::BUILTIN.iter().any(|b| b.id == id)).into() } /// The brush's stroke preview, drawn with the library's resources. fn draw(_: &VectorcraftApp, ui: &Ui, r: egui::Rect, b: &LibBrush, selected: bool, hovered: bool) { diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index b87f291e67..85e1381c6f 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -9,6 +9,7 @@ //! the same tiles ([`picker`]). Graphic style libraries open in library panels //! ([`GraphicStyleLibraries`]). +use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashMap; use std::sync::Arc; @@ -726,10 +727,16 @@ impl LibraryKind for GraphicStyleLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option<String> { app.session.style_libraries.path(id).map(str::to_string) } - fn rows<'a>(lib: &'a Self::Lib, _: &str, query: &str) -> Vec<Row<'a, LibStyle>> { - let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query); + /// Find matches a style's name as shown and as stored. + fn rows<'a>(lib: &'a Self::Lib, id: &str, query: &str) -> Vec<Row<'a, LibStyle>> { + let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query) || Self::label(id, n).to_lowercase().contains(query); lib.iter().filter(|s| found(&s.style().name)).map(|s| Row { name: &s.style().name, item: Some(s) }).collect() } + /// A built-in library's style in the UI language; a User Defined or loaded library's style as + /// it is named. + fn label<'a>(id: &str, name: &'a str) -> Cow<'a, str> { + super::label_or_name(name, STYLE_LIBRARIES.iter().any(|b| b.id == id)).into() + } /// The style on the Graphic Styles panel's preview shape. fn draw(app: &VectorcraftApp, ui: &Ui, r: Rect, s: &LibStyle, selected: bool, hovered: bool) { let paints = Paints { patterns: &s.lib.patterns, brushes: None }; diff --git a/crates/ui-egui/src/panels/library_panel.rs b/crates/ui-egui/src/panels/library_panel.rs index fdfb2f7c3b..0942fafad7 100644 --- a/crates/ui-egui/src/panels/library_panel.rs +++ b/crates/ui-egui/src/panels/library_panel.rs @@ -13,6 +13,7 @@ //! panel whose library can't be found shows the library as missing, with its file and Locate //! Library… (`ui.libraryPanel.locate`). The find text and the selection are panel state. +use std::borrow::Cow; use std::sync::{Mutex, PoisonError}; use egui::{Rect, Sense, Ui}; @@ -108,8 +109,8 @@ pub(crate) trait LibraryKind { fn rows<'a>(lib: &'a Self::Lib, id: &str, query: &str) -> Vec<Row<'a, Self::Item>>; /// Row `name` of library `id` as its list row and tooltips show it (by default as it is). The /// row keeps `name` for its tile, selection, clicks, drags and the commands they run. - fn label<'a>(_id: &str, name: &'a str) -> &'a str { - name + fn label<'a>(_id: &str, name: &'a str) -> Cow<'a, str> { + Cow::Borrowed(name) } /// An item's thumbnail in `r`. fn draw(app: &VectorcraftApp, ui: &Ui, r: Rect, item: &Self::Item, selected: bool, hovered: bool); @@ -665,7 +666,7 @@ fn body<K: LibraryKind>(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { None => super::swatches::draw_folder(ui, chip), } let label = K::label(id, row.name); - list_row_name(ui, r, chip, label); + list_row_name(ui, r, chip, &label); drag_out::<K>(ui, &resp, id, row); let tip = || row.item.map_or_else(|| label.to_string(), |i| format!("{label} ({})", K::describe(i))); click(ui, resp, row, &tip); @@ -678,7 +679,7 @@ fn body<K: LibraryKind>(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { None => folder_tile(ui, cell, is_sel(row.name)), } drag_out::<K>(ui, &resp, id, row); - click(ui, resp, row, &|| K::label(id, row.name).to_string()); + click(ui, resp, row, &|| K::label(id, row.name).into_owned()); } } }); diff --git a/crates/ui-egui/src/panels/library_panel/tests.rs b/crates/ui-egui/src/panels/library_panel/tests.rs index 5d6fef049b..991cb8d0d0 100644 --- a/crates/ui-egui/src/panels/library_panel/tests.rs +++ b/crates/ui-egui/src/panels/library_panel/tests.rs @@ -719,3 +719,37 @@ fn the_list_fills_a_tall_panel_above_its_footer() { let loose = list(None); assert!(loose.height() <= 220.5, "unsized, the list keeps its height: {loose:?}"); } + +/// A built-in swatch library lists its swatches and color groups in the UI language, a numbered +/// swatch with its number as it is, and Find matches the name shown and the swatch's own name. A +/// click adds the swatch under its own name. A color value, and a User Defined or loaded +/// library's names, are shown as they are. +#[test] +fn built_in_library_swatches_are_listed_in_the_ui_language() { + let mut app = app(); + let ctx = context(); + crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); + app.run("window.swatchLibrary", json!({"library": "earth-tones"})).unwrap(); + app.run("ui.libraryPanel", json!({"panel": shown(&app), "view": "smallList"})).unwrap(); + let mut texts = vec![]; + for time in [0.0, 0.25] { + let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0))); + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect, ..Default::default() }, |ui| show_window(&mut app, ui.ctx())); + out.textures_delta.clear(); + texts = + out.shapes.iter().filter_map(|c| if let egui::Shape::Text(t) = &c.shape { Some(t.galley.text().to_string()) } else { None }).collect(); + } + assert!(texts.iter().any(|t| t == "Argile") && texts.iter().any(|t| t == "Argile 1"), "{texts:?}"); + assert!(!texts.iter().any(|t| t == "Clay" || t == "Clay 1"), "{texts:?}"); + let lib = SwatchLibraries::get(&app, "earth-tones").unwrap().1; + for query in ["argile 2", "clay 2"] { + let rows = SwatchLibraries::rows(&lib, "earth-tones", query); + assert_eq!(rows.iter().map(|r| r.name).collect::<Vec<_>>(), ["Clay", "Clay 2"], "{query}"); + } + assert!(SwatchLibraries::rows(&lib, "loaded/1", "argile").is_empty(), "another library's swatch is matched by its own name only"); + assert_eq!(SwatchLibraries::label("grays-neutrals", "K=35"), "K=35"); + assert_eq!(SwatchLibraries::label("user/1", "Clay 3"), "Clay 3"); + click(&mut app, &ctx, "Clay 1", Modifiers::NONE, 1.0); + assert!(app.session.doc().unwrap().doc.swatch("Clay 1").is_some(), "added under its own name"); + crate::i18n::set_current(crate::i18n::Lang::EN); +} diff --git a/crates/ui-egui/src/panels/swatches/libraries.rs b/crates/ui-egui/src/panels/swatches/libraries.rs index 864f6ae7e0..2c0215d146 100644 --- a/crates/ui-egui/src/panels/swatches/libraries.rs +++ b/crates/ui-egui/src/panels/swatches/libraries.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use super::actions::deletable; use super::dnd::selection; use super::tiles::{describe, global_mark, list_icons, pattern_thumb_in}; @@ -82,9 +84,10 @@ impl LibraryKind for SwatchLibraries { app.session.swatch_libraries.path(id).map(str::to_string) } /// Ungrouped swatches, then each colour group's folder and swatches (a group whose name - /// matches shows all of them), as in the Swatches panel. - fn rows<'a>(lib: &'a Self::Lib, _: &str, query: &str) -> Vec<Row<'a, Swatch>> { - let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query); + /// matches shows all of them), as in the Swatches panel. Find matches a name as shown and as + /// stored. + fn rows<'a>(lib: &'a Self::Lib, id: &str, query: &str) -> Vec<Row<'a, Swatch>> { + let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query) || Self::label(id, n).to_lowercase().contains(query); let row = |w: &'a Swatch| Row { name: &w.name, item: Some(w) }; let mut out: Vec<Row<Swatch>> = lib.swatches.iter().filter(|w| found(&w.name)).map(row).collect(); for g in &lib.groups { @@ -97,6 +100,12 @@ impl LibraryKind for SwatchLibraries { } out } + /// A built-in library's swatch or color group in the UI language, a numbered one ("Warm Gray + /// 3") with its number as it is; a User Defined or loaded library's as it is named. + fn label<'a>(id: &str, name: &'a str) -> Cow<'a, str> { + let built_in = SWATCH_LIBRARIES.iter().chain(GRADIENT_LIBRARIES).any(|b| b.id == id) || PATTERN_LIBRARIES.iter().any(|b| b.id == id); + if built_in { crate::i18n::numbered_label(crate::i18n::current(), name) } else { Cow::Borrowed(name) } + } fn draw(_: &VectorcraftApp, ui: &Ui, r: Rect, w: &Swatch, selected: bool, hovered: bool) { swatch_tile(ui, r, &w.paint, selected, hovered); // A built-in pattern library's pattern, drawn from the library. diff --git a/crates/ui-egui/src/panels/symbols.rs b/crates/ui-egui/src/panels/symbols.rs index ad081ddfcd..e3e28c2c02 100644 --- a/crates/ui-egui/src/panels/symbols.rs +++ b/crates/ui-egui/src/panels/symbols.rs @@ -2,6 +2,7 @@ //! selects a symbol (it becomes the Symbol Sprayer's current symbol); double-click opens it in symbol editing mode. Symbol //! libraries open in library panels ([`SymbolLibraries`]). +use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; @@ -496,10 +497,16 @@ impl LibraryKind for SymbolLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option<String> { app.session.symbol_libraries.path(id).map(str::to_string) } - fn rows<'a>(lib: &'a Self::Lib, _: &str, query: &str) -> Vec<Row<'a, LibSymbol>> { - let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query); + /// Find matches a symbol's name as shown and as stored. + fn rows<'a>(lib: &'a Self::Lib, id: &str, query: &str) -> Vec<Row<'a, LibSymbol>> { + let found = |n: &str| query.is_empty() || n.to_lowercase().contains(query) || Self::label(id, n).to_lowercase().contains(query); lib.iter().filter(|s| found(s.name())).map(|s| Row { name: s.name(), item: Some(s) }).collect() } + /// A built-in library's symbol in the UI language; a User Defined or loaded library's symbol as + /// it is named. + fn label<'a>(id: &str, name: &'a str) -> Cow<'a, str> { + super::label_or_name(name, symbollib::BUILTIN.iter().any(|b| b.id == id)).into() + } /// The symbol's art on white, as the Symbols panel shows it. fn draw(_: &VectorcraftApp, ui: &Ui, r: egui::Rect, s: &LibSymbol, selected: bool, hovered: bool) { chip(ui, &s.lib.doc, &library_symbols(&s.lib), r, s.name()); diff --git a/crates/ui-egui/src/panels/tests_style_libraries.rs b/crates/ui-egui/src/panels/tests_style_libraries.rs index 2adeda9812..569c1765a7 100644 --- a/crates/ui-egui/src/panels/tests_style_libraries.rs +++ b/crates/ui-egui/src/panels/tests_style_libraries.rs @@ -210,3 +210,31 @@ fn saving_to_a_file_and_opening_a_vcstyles_file() { assert_eq!(other.submenu, Some("Other Libraries")); assert_eq!(GraphicStyleLibraries::get(&app, &open.id).unwrap().1.len(), app.session.doc().unwrap().doc.graphic_styles.len()); } + +/// A built-in library lists its styles in the UI language, and Find matches the name shown and the +/// style's own name. A click applies the style under its own name. Another library's styles are +/// matched by their own names only. +#[test] +fn built_in_library_styles_are_listed_in_the_ui_language() { + let mut app = app(); + let ctx = context(); + crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 80, "height": 40})).unwrap(); + app.run("window.graphicStyleLibrary", json!({"library": "shadows-glows"})).unwrap(); + let panel = last_open(&app.ui).map(LibraryPanel::panel).unwrap_or_default(); + app.run("ui.libraryPanel", json!({"panel": panel, "view": "smallList"})).unwrap(); + frame(&ctx, vec![], Modifiers::NONE, 0.0, |ui| library_panel::show_window(&mut app, ui.ctx())); + let texts = frame(&ctx, vec![], Modifiers::NONE, 0.25, |ui| library_panel::show_window(&mut app, ui.ctx())); + assert!(texts.iter().any(|t| t == "Ombre douce"), "{texts:?}"); + assert!(!texts.iter().any(|t| t == "Soft Shadow"), "{texts:?}"); + let lib = GraphicStyleLibraries::get(&app, "shadows-glows").unwrap().1; + for query in ["ombre douce", "soft shadow"] { + let rows = GraphicStyleLibraries::rows(&lib, "shadows-glows", query); + assert_eq!(rows.iter().map(|r| r.name).collect::<Vec<_>>(), ["Soft Shadow"], "{query}"); + } + assert!(GraphicStyleLibraries::rows(&lib, "loaded/1", "ombre douce").is_empty(), "another library's style is matched by its own name only"); + click(&mut app, &ctx, "Soft Shadow", Modifiers::NONE, 1.0); + let (g, _) = app.session.selection_graphic_style().expect("applied to the selection"); + assert_eq!(g.name, "Soft Shadow"); + crate::i18n::set_current(crate::i18n::Lang::EN); +} diff --git a/crates/ui-egui/src/panels/tests_symbol_libraries.rs b/crates/ui-egui/src/panels/tests_symbol_libraries.rs index 9c58bc49c7..f75460b109 100644 --- a/crates/ui-egui/src/panels/tests_symbol_libraries.rs +++ b/crates/ui-egui/src/panels/tests_symbol_libraries.rs @@ -225,3 +225,29 @@ fn other_library_opens_a_documents_symbols_and_reports_unreadable_files() { assert!(last_open(&app.ui).is_none()); let _ = std::fs::remove_dir_all(dir); } + +/// A built-in library lists its symbols in the UI language, and Find matches the name shown and the +/// symbol's own name. A click adds the symbol under its own name. Another library's symbols are +/// matched by their own names only. +#[test] +fn built_in_library_symbols_are_listed_in_the_ui_language() { + let mut app = app(); + let ctx = context(); + crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); + app.run("window.symbolLibrary", json!({"library": "basic-shapes"})).unwrap(); + let panel = last_open(&app.ui).map(LibraryPanel::panel).unwrap_or_default(); + app.run("ui.libraryPanel", json!({"panel": panel, "view": "smallList"})).unwrap(); + frame(&ctx, vec![], 0.0, |ui| library_panel::show_window(&mut app, ui.ctx())); + let texts = frame(&ctx, vec![], 0.25, |ui| library_panel::show_window(&mut app, ui.ctx())); + assert!(texts.iter().any(|t| t == "Éclat") && texts.iter().any(|t| t == "Étoile"), "{texts:?}"); + assert!(!texts.iter().any(|t| t == "Burst"), "{texts:?}"); + let lib = SymbolLibraries::get(&app, "basic-shapes").unwrap().1; + for query in ["éclat", "burst"] { + let rows = SymbolLibraries::rows(&lib, "basic-shapes", query); + assert_eq!(rows.iter().map(|r| r.name).collect::<Vec<_>>(), ["Burst"], "{query}"); + } + assert!(SymbolLibraries::rows(&lib, "loaded/1", "éclat").is_empty(), "another library's symbol is matched by its own name only"); + click(&mut app, &ctx, "Star", Modifiers::NONE, 1.0); + assert_eq!(symbols(&app), ["Star"]); + crate::i18n::set_current(crate::i18n::Lang::EN); +} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 296bd84b2b..a4ff21b79f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -949,6 +949,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). - **Dry Media library** ([help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Dry Media holds four art brushes with textured strokes like dry drawing materials, each 100 pt long: Chalk Grain (about 8 pt high), Graphite Pencil (about 2.3 pt), Wax Crayon (about 5.5 pt) and Charcoal Dust (about 7 pt). The brushes, their names, sizes and art are VectorCraft's own: each is filled vector paths from a fixed seed, at most 80 paths and 500 anchors, stretched along the path with Tints colorization, and the chalk and crayon art has even-odd gaps where the paper shows (`brush.libraries`, `brush.addFromLibrary`; `the_dry_media_library_holds_grainy_art_brushes_with_bounded_art`). - **Brush names in library panels**: a built-in brush library's panel shows its brushes' names in the UI language, in its list rows and tooltips, and its Find field matches the name shown or the English name. This is VectorCraft's own rule. A User Defined or Other Library… library's brushes, and the document's Brushes panel, show names as they are stored. A click, a drag, Add to Brushes and `brush.addFromLibrary` still use the English name, so the brush comes into the document under that name (`built_in_library_brushes_are_listed_in_the_ui_language`, `built_in_library_brush_names_are_in_complete_catalogs`). + - **Swatch, graphic style and symbol names in library panels**: a built-in swatch, gradient, pattern, graphic style or symbol library's panel shows its item and color group names in the UI language, and its Find field matches the name shown or the English name. A numbered swatch such as "Warm Gray 3" shows its group's name in the UI language followed by the number, and a color value such as `K=35` or `#33cc99` is shown as it is. This is VectorCraft's own rule. A User Defined or Other Library… library's items show names as they are stored. A click, a drag and the Add to commands still use the English name, so the item comes into the document under that name (`built_in_library_swatches_are_listed_in_the_ui_language`, `built_in_library_styles_are_listed_in_the_ui_language`, `built_in_library_symbols_are_listed_in_the_ui_language`, `numbered_labels_translate_the_name_before_the_number`). - A canvas context menu: right-click selects the object under the pointer and lists what applies to the selection (Undo/Redo, clipboard, group, isolation, join, Remove Anchor Points when anchors are selected, masks, compound paths, guides, Transform, Arrange, Select, Export Selection, and on type Bullets and Numbering and Spelling › Auto Spell Check, checked while it is on), or the view commands on empty canvas. - A right-click over locked objects adds an Unlock submenu to the canvas context menu. The submenu lists up to 20 locked objects under the pointer, topmost first, by the name the Layers panel shows, and choosing one unlocks it (`layer.setProps`). A locked group is listed as one item. Objects on hidden, locked or template layers are not listed. - The canvas context menu lists Object › Path › Smooth… while the selection holds a path, in a group or a compound path too. It opens the Smooth slider, as the Object menu does (`right_click_on_a_path_opens_the_smooth_slider`, `smooth_follows_the_selections_paths`). From 9a0a9846e8608cfaea2f3218dc77cf56ae1a427e Mon Sep 17 00:00:00 2001 From: yoriswind <yoriswind@yahoo.com> Date: Fri, 13 Nov 2026 22:39:54 -0800 Subject: [PATCH 022/247] M3: Show Color spectrum mode on hover (#7235) --- crates/ui-egui/src/panels/color.rs | 2 +- .../ui-egui/tests/color_working_components.rs | 124 +++++++++++++++++- docs/roadmap.md | 2 + docs/target-app-parity.md | 2 + 4 files changed, 128 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 0ad9c369fd..8b0340e18f 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -655,7 +655,7 @@ enum SpectrumHit { fn spectrum(ui: &mut Ui, mode: Mode, size: egui::Vec2) -> Option<SpectrumHit> { let t = Tokens::get(ui.ctx()); let (r, _) = ui.allocate_exact_size(size, Sense::hover()); - let resp = ui.interact(r, ui.scope_id().with("color-spectrum"), Sense::click_and_drag()); + let resp = ui.interact(r, ui.scope_id().with("color-spectrum"), Sense::click_and_drag()).on_hover_text(mode.label()); ui.painter().add(widgets::color_mesh(r, (72, 12), &|x, y| to32(&spectrum_at(mode, x, y)))); ui.painter().rect_stroke(r, 0.0, Stroke::new(1.0, t.border), StrokeKind::Outside); if let Some(p) = resp.hover_pos() { diff --git a/crates/ui-egui/tests/color_working_components.rs b/crates/ui-egui/tests/color_working_components.rs index 83b0e01267..5bde152bde 100644 --- a/crates/ui-egui/tests/color_working_components.rs +++ b/crates/ui-egui/tests/color_working_components.rs @@ -4,12 +4,14 @@ use std::sync::{Mutex, MutexGuard}; +use egui::{Rect, vec2}; use serde_json::json; use vectorcraft_color::Color; use vectorcraft_color::cms::{self, ColorSettings, DISPLAY_P3, PROPHOTO_RGB, SRGB, WIDE_GAMUT_RGB}; use vectorcraft_engine::Session; +use vectorcraft_tools::params::color_json; use vectorcraft_ui_egui::VectorcraftApp; -use vectorcraft_ui_egui::panels::color::{Mode, components, from_components, hex_digits, parse_hex, web_safe}; +use vectorcraft_ui_egui::panels::color::{Mode, components, convert_to, from_components, hex_digits, parse_hex, show, web_safe}; // This integration binary contains only these tests; its app-wide CMS is independent of other // test binaries. Serialize its cases and restore settings even when an assertion fails. @@ -186,3 +188,123 @@ fn color_panel_slider_preserves_native_channels_and_undo() { harness.state_mut().run("edit.undo", json!({})).unwrap(); native(harness.state().session.proxy_paints().0.color().unwrap(), [0.5, 0.3, 0.2]); } + +/// An ordinary selected rectangle for Color panel hover and Shift-click checks. +fn spectrum_app() -> VectorcraftApp { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + app +} + +/// Every string actually painted by a headless frame, including a settled hover tooltip. +fn spectrum_painted_texts(output: &egui::FullOutput) -> Vec<String> { + fn collect(shape: &egui::Shape, texts: &mut Vec<String>) { + match shape { + egui::Shape::Text(t) => texts.push(t.galley.text().to_string()), + egui::Shape::Vec(shapes) => shapes.iter().for_each(|shape| collect(shape, texts)), + _ => {} + } + } + let mut texts = vec![]; + output.shapes.iter().for_each(|shape| collect(&shape.shape, &mut texts)); + texts +} + +/// Draw the real Color panel and return a point over its spectrum and the frame's text. +fn spectrum_frame( + app: &mut VectorcraftApp, + ctx: &egui::Context, + time: f64, + events: Vec<egui::Event>, + modifiers: egui::Modifiers, +) -> (egui::Pos2, Vec<String>) { + let screen = Rect::from_min_size(egui::Pos2::ZERO, vec2(260.0, 700.0)); + let events = std::iter::once(egui::Event::ModifiersChanged(modifiers)).chain(events).collect(); + let mut at = None; + let input = egui::RawInput { screen_rect: Some(screen), time: Some(time), events, ..Default::default() }; + let mut output = ctx.run_ui(input, |ui| { + show(app, ui); + at = if app.ui.color_hide_options { + // The existing hidden-options spectrum test uses this point right of the proxy. + let row = ui.min_rect(); + Some(egui::pos2(row.right() - 4.0, row.center().y)) + } else { + ctx.read_response(ui.scope_id().with("color-spectrum")).map(|r| r.rect.center()) + }; + }); + output.textures_delta.clear(); + (at.expect("the spectrum is drawn"), spectrum_painted_texts(&output)) +} + +/// The panel's drawn text after the pointer has rested on or away from the spectrum. +fn spectrum_hover_texts(app: &mut VectorcraftApp, ctx: &egui::Context, over: bool) -> (egui::Pos2, Vec<String>) { + let away = egui::pos2(255.0, 695.0); + let time = ctx.input(|i| i.time) + 1.0; + let none = egui::Modifiers::NONE; + let (at, _) = spectrum_frame(app, ctx, time, vec![egui::Event::PointerMoved(away)], none); + let pos = if over { at } else { away }; + spectrum_frame(app, ctx, time + 0.1, vec![egui::Event::PointerMoved(pos)], none); + // Allow the tooltip delay and its following layout pass, as the Appearance panel tests do. + spectrum_frame(app, ctx, time + 2.0, vec![], none); + (at, spectrum_frame(app, ctx, time + 2.1, vec![], none).1) +} + +#[test] +fn spectrum_tooltip_names_its_displayed_mode() { + let _space = WorkingSpace::new(SRGB); + for hidden in [false, true] { + for mode in [Mode::Grayscale, Mode::Rgb, Mode::Hsb, Mode::Cmyk, Mode::WebSafe, Mode::Lab] { + let mut app = spectrum_app(); + let color = convert_to(mode, &Color::rgb8(51, 102, 153)); + app.run("paint.setFill", json!({"color": color_json(&color), "keepModel": true})).unwrap(); + // Lab follows the selected paint even when the stored mode is RGB. + app.ui.color_mode = Some(if mode == Mode::Lab { Mode::Rgb } else { mode }); + app.ui.color_hide_options = hidden; + let ctx = egui::Context::default(); + ctx.global_style_mut(|style| style.interaction.tooltip_delay = 0.1); + let paints = app.session.proxy_paints(); + let undo = app.session.active().unwrap().history.undo.len(); + let (_, away) = spectrum_hover_texts(&mut app, &ctx, false); + assert!(!away.iter().any(|text| text == mode.label()), "{mode:?}, hidden {hidden}: no tooltip away from the spectrum: {away:?}"); + let (_, hovered) = spectrum_hover_texts(&mut app, &ctx, true); + assert_eq!( + hovered.iter().filter(|text| text.as_str() == mode.label()).count(), + 1, + "{mode:?}, hidden {hidden}: the tooltip names the displayed mode: {hovered:?}" + ); + let (_, away) = spectrum_hover_texts(&mut app, &ctx, false); + assert!(!away.iter().any(|text| text == mode.label()), "{mode:?}, hidden {hidden}: the tooltip hides again: {away:?}"); + assert_eq!(app.session.proxy_paints(), paints, "hovering changes no paint"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo, "hovering adds no undo step"); + } + } +} + +#[test] +fn spectrum_tooltip_follows_shift_cycle_without_painting() { + let _space = WorkingSpace::new(SRGB); + for hidden in [false, true] { + let mut app = spectrum_app(); + app.run("paint.setFill", json!({"color": "#336699"})).unwrap(); + app.ui.color_mode = Some(Mode::Rgb); + app.ui.color_hide_options = hidden; + let ctx = egui::Context::default(); + ctx.global_style_mut(|style| style.interaction.tooltip_delay = 0.1); + let paints = app.session.proxy_paints(); + let undo = app.session.active().unwrap().history.undo.len(); + let (pos, hovered) = spectrum_hover_texts(&mut app, &ctx, true); + assert!(hovered.iter().any(|text| text == "RGB")); + let modifiers = egui::Modifiers::SHIFT; + let button = |pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; + let time = ctx.input(|i| i.time) + 1.0; + spectrum_frame(&mut app, &ctx, time, vec![egui::Event::PointerMoved(pos), button(true)], modifiers); + spectrum_frame(&mut app, &ctx, time + 0.1, vec![button(false)], modifiers); + spectrum_frame(&mut app, &ctx, time + 0.2, vec![], egui::Modifiers::NONE); + assert_eq!(app.ui.color_mode, Some(Mode::Hsb)); + let (_, hovered) = spectrum_hover_texts(&mut app, &ctx, true); + assert!(hovered.iter().any(|text| text == "HSB") && !hovered.iter().any(|text| text == "RGB"), "hidden {hidden}: {hovered:?}"); + assert_eq!(app.session.proxy_paints(), paints, "RGB to HSB changes no paint"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo, "cycling to HSB adds no undo step"); + } +} diff --git a/docs/roadmap.md b/docs/roadmap.md index 74dac90ec8..83ba7b326e 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,5 +1,7 @@ # Roadmap: milestones and what's next +The Color panel spectrum shows its current color mode on hover, including after Shift-clicking to switch modes and with Hide Options enabled (part of #7235). Spectrum rendering and vertical resizing remain open. Scores and estimates unchanged. + > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-13 · **Change:** minor (Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 296bd84b2b..91f749fc4b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,5 +1,7 @@ # Parity with Adobe Illustrator +The Color panel spectrum shows its current color mode on hover, including after Shift-clicking to switch modes and with Hide Options enabled (part of #7235). Spectrum rendering and vertical resizing remain open. Scores and estimates unchanged. + > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-13 · **Change:** minor (Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). From 2515725d8796fdba2d5dff374d6d53eff8e7db94 Mon Sep 17 00:00:00 2001 From: yoriswind <yoriswind@yahoo.com> Date: Sat, 14 Nov 2026 00:20:47 -0800 Subject: [PATCH 023/247] M3: Translate Color spectrum mode tooltip --- crates/ui-egui/src/panels/color.rs | 2 +- .../ui-egui/tests/color_working_components.rs | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 8b0340e18f..71677ffb1c 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -655,7 +655,7 @@ enum SpectrumHit { fn spectrum(ui: &mut Ui, mode: Mode, size: egui::Vec2) -> Option<SpectrumHit> { let t = Tokens::get(ui.ctx()); let (r, _) = ui.allocate_exact_size(size, Sense::hover()); - let resp = ui.interact(r, ui.scope_id().with("color-spectrum"), Sense::click_and_drag()).on_hover_text(mode.label()); + let resp = ui.interact(r, ui.scope_id().with("color-spectrum"), Sense::click_and_drag()).on_hover_text(tl!(mode.label())); ui.painter().add(widgets::color_mesh(r, (72, 12), &|x, y| to32(&spectrum_at(mode, x, y)))); ui.painter().rect_stroke(r, 0.0, Stroke::new(1.0, t.border), StrokeKind::Outside); if let Some(p) = resp.hover_pos() { diff --git a/crates/ui-egui/tests/color_working_components.rs b/crates/ui-egui/tests/color_working_components.rs index 5bde152bde..0bf18bc721 100644 --- a/crates/ui-egui/tests/color_working_components.rs +++ b/crates/ui-egui/tests/color_working_components.rs @@ -308,3 +308,49 @@ fn spectrum_tooltip_follows_shift_cycle_without_painting() { assert_eq!(app.session.active().unwrap().history.undo.len(), undo, "cycling to HSB adds no undo step"); } } + +/// Spectrum hover text uses the selected UI language, in both panel layouts. +#[test] +fn spectrum_tooltip_uses_the_interface_language() { + use vectorcraft_ui_egui::i18n::{self, Lang}; + + // i18n is process-global in this integration binary. Every case holds the CMS lock. + // Restore the language before WorkingSpace releases that lock, including after a panic. + let _space = WorkingSpace::new(SRGB); + struct Language(Lang); + impl Drop for Language { + fn drop(&mut self) { + i18n::set_current(self.0); + } + } + let _language = Language(i18n::current()); + let german = Lang::from_code("de").unwrap(); + let mode = Mode::Grayscale; + let expected = "Graustufen"; + assert_eq!(i18n::tr(german, mode.label()), expected, "use an existing, distinct catalog translation"); + + for hidden in [false, true] { + let mut app = spectrum_app(); + app.session.prefs.interface_language = german.code().into(); + // The host normally does this in tick_frame; this harness draws the panel directly. + assert_eq!(app.ui_language(), german); + i18n::set_current(app.ui_language()); + let color = convert_to(mode, &Color::rgb8(51, 102, 153)); + app.run("paint.setFill", json!({"color": color_json(&color), "keepModel": true})).unwrap(); + app.ui.color_mode = Some(mode); + app.ui.color_hide_options = hidden; + let ctx = egui::Context::default(); + ctx.global_style_mut(|style| style.interaction.tooltip_delay = 0.1); + let paints = app.session.proxy_paints(); + let undo = app.session.active().unwrap().history.undo.len(); + let (_, away) = spectrum_hover_texts(&mut app, &ctx, false); + assert!(!away.iter().any(|text| text == expected), "hidden {hidden}: no translated tooltip away: {away:?}"); + let (_, hovered) = spectrum_hover_texts(&mut app, &ctx, true); + assert_eq!(hovered.iter().filter(|text| text.as_str() == expected).count(), 1, "hidden {hidden}: translated tooltip: {hovered:?}"); + assert!(!hovered.iter().any(|text| text == mode.label()), "hidden {hidden}: no untranslated tooltip: {hovered:?}"); + let (_, away) = spectrum_hover_texts(&mut app, &ctx, false); + assert!(!away.iter().any(|text| text == expected), "hidden {hidden}: translated tooltip hides again: {away:?}"); + assert_eq!(app.session.proxy_paints(), paints, "translated hover changes no paint"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo, "translated hover adds no undo step"); + } +} From ff98a9cebf19b75eef9b282bf276559187deca2e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 05:27:42 -0800 Subject: [PATCH 024/247] i18n: add Gujarati rows for the Artboard tool's add-button tooltips The Artboard tool's two edge-button tooltips had no gu row, so the complete-catalog test for them failed once gu became a complete catalog. --- crates/ui-egui/src/i18n/gu.tsv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 716d851655..c6dedae9d9 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -570,6 +570,8 @@ Click the art with the Gradient tool to add or select points. પોઇન્ટ ઉમેરવા કે પસંદ કરવા ગ્રેડિયન્ટ ટૂલ વડે આર્ટવર્ક પર ક્લિક કરો. Click the first point પહેલા પોઇન્ટ પર ક્લિક કરો Click the ramp or a type button to apply a gradient. ગ્રેડિયન્ટ લાગુ કરવા માટે રૅમ્પ અથવા ટાઇપ બટન પર ક્લિક કરો. + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art આ બાજુ આર્ટબોર્ડ ઉમેરવા ક્લિક કરો, આ આર્ટબોર્ડને તેની આર્ટ સાથે ડુપ્લિકેટ કરવા Alt-ક્લિક કરો + Click to add an artboard on this side આ બાજુ આર્ટબોર્ડ ઉમેરવા ક્લિક કરો Click to apply to the selected type પસંદ કરેલા ટેક્સ્ટ પર લાગુ કરવા ક્લિક કરો Click to choose a swatch, Shift-click to mix a colour સ્વેચ પસંદ કરવા ક્લિક કરો, રંગ મિક્સ કરવા Shift-ક્લિક કરો Click to edit સંપાદન માટે ક્લિક કરો From 8896339305a436e89125228095f5542020900c6c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 05:51:56 -0800 Subject: [PATCH 025/247] i18n: Gujarati has rows for the built-in library swatch, graphic style and symbol names --- crates/ui-egui/src/i18n/gu.tsv | 269 +++++++++++++++++++++++++++++++++ 1 file changed, 269 insertions(+) diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 716d851655..405fdeb831 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4680,3 +4680,272 @@ swatch [Registration] [રજિસ્ટ્રેશન] Repeat Objects પુનરાવર્તિત ઑબ્જેક્ટ્સ @msg `{path}` must be one of {_1}, not {got} `{path}` એ {_1}માંથી એક હોવું જોઈએ, {got} નહીં Path Length પાથની લંબાઈ +# Built-in library names: graphic styles, swatches, gradients, patterns and symbols. + Boss Alert બૉસ ચેતવણી + Brushed Metal બ્રશ કરેલી ધાતુ + Bulge ઉપસાવ + Burn Aura બળતી આભા + Chrome Rim ક્રોમ કિનાર + Coin Shine સિક્કાની ચમક + Crosshatch ક્રોસહેચ + Damage Flash નુકસાન ઝબકારો + Darken Veil ઘેરો પડદો + Dashed Border ડેશવાળી કિનારી + Dotted Border ટપકાંવાળી કિનારી + Double Rule બેવડી રેખા + Echo પડઘો + Ember અંગારો + Feathered ફેધર કરેલું + Flag Wave ધ્વજ લહેર + Freeze Edge થીજેલી કિનારી + Ghosted ઝાંખું + Glossy ચળકતું + Glow Orb ઝળહળતો ગોળો + Hard Shadow તીક્ષ્ણ પડછાયો + Haze ધુમ્મસ + Health Fill હેલ્થ ભરણ + Highlighter હાઇલાઇટર + Inner Light આંતરિક પ્રકાશ + Inset Keyline અંદરની કીલાઇન + Lifted Card ઊંચકેલું કાર્ડ + Mana Glow મના ઝળહળાટ + Multiply Tint ગુણાકાર ટિન્ટ + Neon Tube નિયોન ટ્યુબ + Offset Keyline ઑફસેટ કીલાઇન + Outside Stroke બહારનો સ્ટ્રોક + Overlay Glaze ઓવરલે ગ્લેઝ + Pearl મોતી + Pill Badge ગોળી બેજ + Pointer પોઇન્ટર + Poison Tint ઝેરી ટિન્ટ + Puffy ફૂલેલું + Quest Outline ક્વેસ્ટ રૂપરેખા + Round Badge ગોળ બેજ + Screen Light સ્ક્રીન પ્રકાશ + Scribble Fill લીટીવાળું ભરણ + Sea Glass દરિયાઈ કાચ + Shield Buff ઢાલ બફ + Sketchy Line સ્કેચ જેવી રેખા + Soft Light Wash સૉફ્ટ લાઇટ વૉશ + Soft Shadow નરમ પડછાયો + Spiral Copies સર્પાકાર નકલો + Spotlight સ્પોટલાઇટ + Starburst તારા વિસ્ફોટ + Stealth Fade છૂપું ઝાંખું થવું + Stun Pulse સ્ટન પલ્સ + Sunset Band સૂર્યાસ્ત પટ્ટો + Triple Rule ત્રિવિધ રેખા + Twisted વળ ચડાવેલું + Two Tone બે રંગી + Wavy Edge લહેરિયાં કિનારી + Wobble ડગમગ + Zig Zag Edge ઝિગઝૅગ કિનારી + Amber Corona એમ્બર કોરોના + Amber Glow એમ્બર ઝળહળાટ + Amber to Lime એમ્બરથી લાઇમ + Analogous Coral સમીપવર્તી કોરલ + Analogous Teal સમીપવર્તી ટીલ + Aurora Foil અરોરા ફોઇલ + Azure Glow આસમાની ઝળહળાટ + Azure to Violet આસમાનીથી વાયોલેટ + Bloom મહોર + Blue Glow વાદળી ઝળહળાટ + Blue to Magenta વાદળીથી મેજેન્ટા + Brass પિત્તળ + Bronze કાંસું + Charcoal ચારકોલ + Checkerboard ચેકરબોર્ડ + Chevron Pulse શેવરોન પલ્સ + Chrome ક્રોમ + Clay માટી + Clay to Teal માટીથી ટીલ + Coarse Grit બરછટ કણ + Complementary Coral પૂરક કોરલ + Complementary Teal પૂરક ટીલ + Cool Gray ઠંડો ગ્રે + Cool Grays ઠંડા ગ્રે + Copper કોપર + Coral and Navy કોરલ અને નેવી + Crosses ચોકડીઓ + Cyan Glow સાયન ઝળહળાટ + Cyan to Blue સાયનથી વાદળી + Dark Grays ઘેરા ગ્રે + Dawn પરોઢ + Deep ઘેરો + Deep Amber ઘેરો એમ્બર + Deep Azure ઘેરો આસમાની + Deep Blue ઘેરો વાદળી + Deep Cyan ઘેરો સાયન + Deep Green ઘેરો લીલો + Deep Lime ઘેરો લાઇમ + Deep Magenta ઘેરો મેજેન્ટા + Deep Orange ઘેરો નારંગી + Deep Red ઘેરો લાલ + Deep Teal ઘેરો ટીલ + Deep Violet ઘેરો વાયોલેટ + Deep Yellow ઘેરો પીળો + Dense Flecks ગાઢ છાંટા + Dew ઝાકળ + Diagonal Stripes ત્રાંસા પટ્ટા + Diamonds હીરા + Driftwood તરતું લાકડું + Dusk સંધ્યા + Fade to Transparent પારદર્શક સુધી ઝાંખું + Fern ફર્ન + Fine Dots ઝીણાં ટપકાં + Forest and Rose જંગલ અને રોઝ + Frost Spectrum હિમ સ્પેક્ટ્રમ + Gold સોનું + Golden સોનેરી + Green Glow લીલો ઝળહળાટ + Green to Cyan લીલાથી સાયન + Greige ગ્રેઝ + Gunmetal ગનમેટલ + Honey મધ + Horizontal Stripes આડા પટ્ટા + Indigo and Peach ઈન્ડિગો અને પીચ + Ink Wash શાહી વૉશ + Interference Rings વ્યતિકરણ વલયો + Iris Sheen આઇરિસ ચમક + Ivory હાથીદાંત + Lagoon લગૂન + Lavender લવંડર + Lichen લાઇકેન + Light Grays આછા ગ્રે + Lime Glow લાઇમ ઝળહળાટ + Lime to Teal લાઇમથી ટીલ + Linen લિનન + Magenta Glow મેજેન્ટા ઝળહળાટ + Magenta to Orange મેજેન્ટાથી નારંગી + Mint Halo ફુદીના પ્રભામંડળ + Mist ધૂંધ + Moonstone Shift ચંદ્રમણિ ઝલક + Moss શેવાળ + Neutral તટસ્થ + Neutrals તટસ્થ રંગો + Night રાત + Noon બપોર + Oat ઓટ + Ochre ગેરુ + Offset Rings ઑફસેટ વલયો + Olive ઓલિવ + Opal Ribbon ઓપલ રિબન + Orange Glow નારંગી ઝળહળાટ + Orange to Yellow નારંગીથી પીળો + Overcast વાદળછાયું + Pastel પેસ્ટલ + Pastel Amber પેસ્ટલ એમ્બર + Pastel Azure પેસ્ટલ આસમાની + Pastel Blue પેસ્ટલ વાદળી + Pastel Cyan પેસ્ટલ સાયન + Pastel Green પેસ્ટલ લીલો + Pastel Lime પેસ્ટલ લાઇમ + Pastel Magenta પેસ્ટલ મેજેન્ટા + Pastel Orange પેસ્ટલ નારંગી + Pastel Orbit પેસ્ટલ ભ્રમણકક્ષા + Pastel Red પેસ્ટલ લાલ + Pastel Teal પેસ્ટલ ટીલ + Pastel Violet પેસ્ટલ વાયોલેટ + Pastel Yellow પેસ્ટલ પીળો + Pearl Flash મોતી ઝબકાર + Pentagram Coral પેન્ટાગ્રામ કોરલ + Pentagram Teal પેન્ટાગ્રામ ટીલ + Petal પાંખડી + Pewter પ્યુટર + Pinched Stripes દબાયેલા પટ્ટા + Platinum પ્લેટિનમ + Plum and Lime પ્લમ અને લાઇમ + Plum to Olive પ્લમથી ઓલિવ + Polar Glint ધ્રુવીય ચમક + Polka Dots પોલ્કા ટપકાં + Pollen પરાગ + Prism Veil પ્રિઝમ પડદો + Radiating Lenses પ્રસરતા લેન્સ + Red Glow લાલ ઝળહળાટ + Red to Amber લાલથી એમ્બર + Ripple Lines લહેર રેખાઓ + Rose Gold રોઝ ગોલ્ડ + Rose Quartz Gleam રોઝ ક્વાર્ટ્ઝ ચમક + Rosy ગુલાબી + Sand રેતી + Scratches ઉઝરડા + Seafoam દરિયાઈ ફીણ + Silver ચાંદી + Silver Tide ચાંદી ભરતી + Sine Bands સાઇન પટ્ટા + Slate સ્લેટ + Smoke ધુમાડો + Soft Amber સૉફ્ટ એમ્બર + Soft Azure સૉફ્ટ આસમાની + Soft Blue સૉફ્ટ વાદળી + Soft Cyan સૉફ્ટ સાયન + Soft Green સૉફ્ટ લીલો + Soft Lime સૉફ્ટ લાઇમ + Soft Magenta સૉફ્ટ મેજેન્ટા + Soft Orange સૉફ્ટ નારંગી + Soft Red સૉફ્ટ લાલ + Soft Spectrum સૉફ્ટ સ્પેક્ટ્રમ + Soft Teal સૉફ્ટ ટીલ + Soft Violet સૉફ્ટ વાયોલેટ + Soft Yellow સૉફ્ટ પીળો + Sparse Flecks છૂટાછવાયા છાંટા + Speckle ટપકીઓ + Spectrum સ્પેક્ટ્રમ + Split Complementary Coral વિભાજિત પૂરક કોરલ + Split Complementary Teal વિભાજિત પૂરક ટીલ + Stipple બિંદુચિત્ર + Stone પથ્થર + Sunset સૂર્યાસ્ત + Taupe ટૉપ + Teal Glow ટીલ ઝળહળાટ + Teal and Gold ટીલ અને સોનું + Teal to Azure ટીલથી આસમાની + Terracotta ટેરાકોટા + Tetrad Coral ચતુષ્ક કોરલ + Tetrad Teal ચતુષ્ક ટીલ + Tide ભરતી + Triad Coral ત્રિક કોરલ + Triad Teal ત્રિક ટીલ + Umber અંબર માટી + Vertical Stripes ઊભા પટ્ટા + Vignette વિગ્નેટ + Violet Edge વાયોલેટ કિનારી + Violet Glow વાયોલેટ ઝળહળાટ + Violet to Red વાયોલેટથી લાલ + Vivid તેજસ્વી + Vivid Amber તેજસ્વી એમ્બર + Vivid Azure તેજસ્વી આસમાની + Vivid Blue તેજસ્વી વાદળી + Vivid Cyan તેજસ્વી સાયન + Vivid Green તેજસ્વી લીલો + Vivid Lime તેજસ્વી લાઇમ + Vivid Magenta તેજસ્વી મેજેન્ટા + Vivid Orange તેજસ્વી નારંગી + Vivid Red તેજસ્વી લાલ + Vivid Teal તેજસ્વી ટીલ + Vivid Violet તેજસ્વી વાયોલેટ + Vivid Yellow તેજસ્વી પીળો + Warm Gray હૂંફાળો ગ્રે + Warm Grays હૂંફાળા ગ્રે + Warped Checks વળેલાં ચેક + White Fade સફેદ ઝાંખપ + White to Black સફેદથી કાળો + Yellow Glow પીળો ઝળહળાટ + Yellow to Green પીળાથી લીલો + Arrow તીર + Bar પટ્ટી + Burst વિસ્ફોટ + Button બટન + Checkpoint ચેકપોઇન્ટ + Crosshair ક્રોસહેર + Flag ધ્વજ + Gem રત્ન + Hexagon ષટ્કોણ + Key ચાવી + Panel પેનલ + Pin પિન + Potion ઔષધ + Rounded Square ગોળ ખૂણાવાળો ચોરસ + Shield ઢાલ + Sword તલવાર + Triangle ત્રિકોણ From 7292350010aeb0c297af3efd07da648f40b981e3 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 07:45:12 -0800 Subject: [PATCH 026/247] Color Wheel: Show Color Vision Preview shows the color through four color vision simulations The Color Wheel panel's menu gains Show Color Vision Preview, which adds a row of four chips under the wheel or the box: the current color through the protanopia, deuteranopia and tritanopia simulations that View > Proof Setup uses (Cms::proof_srgb), and an achromatopsia chip that shows the gray with the color's CIE L*, a rule of VectorCraft's own. Each chip takes the keyboard focus, reports its name and its hex value to screen readers and shows both in its tooltip. A click or a key on a chip does not apply its color. With no solid color the chips are empty and keep their names. ui.colorWheel takes a vision key next to view and channel and returns all three. A value that is not true, false or null is an error and changes nothing. The setting is kept with the preferences, and a saved value the build does not read falls back to the default without losing the other settings. New strings have rows in the complete catalogs. Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/i18n/bg.tsv | 5 + crates/ui-egui/src/i18n/bs.tsv | 5 + crates/ui-egui/src/i18n/ca.tsv | 5 + crates/ui-egui/src/i18n/cs.tsv | 5 + crates/ui-egui/src/i18n/da.tsv | 5 + crates/ui-egui/src/i18n/de.tsv | 5 + crates/ui-egui/src/i18n/el.tsv | 5 + crates/ui-egui/src/i18n/es.tsv | 5 + crates/ui-egui/src/i18n/fi.tsv | 5 + crates/ui-egui/src/i18n/fr.tsv | 5 + crates/ui-egui/src/i18n/gu.tsv | 5 + crates/ui-egui/src/i18n/hi.tsv | 5 + crates/ui-egui/src/i18n/hu.tsv | 5 + crates/ui-egui/src/i18n/id.tsv | 5 + crates/ui-egui/src/i18n/it.tsv | 5 + crates/ui-egui/src/i18n/ja.tsv | 5 + crates/ui-egui/src/i18n/ka.tsv | 5 + crates/ui-egui/src/i18n/ko.tsv | 5 + crates/ui-egui/src/i18n/nl.tsv | 5 + crates/ui-egui/src/i18n/pl.tsv | 5 + crates/ui-egui/src/i18n/pt-br.tsv | 5 + crates/ui-egui/src/i18n/ru.tsv | 5 + crates/ui-egui/src/i18n/sv.tsv | 5 + crates/ui-egui/src/i18n/tr.tsv | 5 + crates/ui-egui/src/i18n/uk.tsv | 5 + crates/ui-egui/src/i18n/vi.tsv | 5 + crates/ui-egui/src/i18n/zh-hans.tsv | 5 + crates/ui-egui/src/i18n/zh-hant.tsv | 5 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels.rs | 2 + crates/ui-egui/src/panels/color_wheel.rs | 97 ++++++- .../src/panels/tests_color_wheel_box.rs | 26 +- .../src/panels/tests_color_wheel_vision.rs | 258 ++++++++++++++++++ crates/ui-egui/src/state.rs | 3 +- docs/control-protocol.md | 6 +- docs/mcp.md | 6 + docs/target-app-parity.md | 1 + 38 files changed, 519 insertions(+), 24 deletions(-) create mode 100644 crates/ui-egui/src/panels/tests_color_wheel_vision.rs diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 943faa4782..0af5289bd9 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1324,7 +1324,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, vision}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 348ac7b881..7017ac7bd3 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -5810,6 +5810,11 @@ theme Appearance Външен вид The active document changed while the screen color sampler was open Активният документ се промени, докато взимането на цвят от екрана беше отворено This system has no screen color sampler Тази система няма инструмент за взимане на цвят от екрана Color blindness – Tritanopia-type Цветна слепота – тип тританопия + Show Color Vision Preview Показване на преглед на цветовото зрение + Protanopia Протанопия + Deuteranopia Девтеранопия + Tritanopia Тританопия + Achromatopsia Ахроматопсия Panels Except Tools and Control Панели без инструменти и контрол # Type › Reset Tracking and Kerning diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3b1a9e001c..a1af907e0c 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -592,6 +592,11 @@ Color blindness – Protanopia-type Daltonizam – tip protanopije Color blindness – Deuteranopia-type Daltonizam – tip deuteranopije Color blindness – Tritanopia-type Daltonizam – tip tritanopije + Show Color Vision Preview Prikaži pregled vida boja + Protanopia Protanopija + Deuteranopia Deuteranopija + Tritanopia Tritanopija + Achromatopsia Ahromatopsija Customize… Prilagodi… Proof Colors Probne boje Zoom In Uvećaj diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 488b46c4f5..de7451339b 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -779,6 +779,11 @@ antiAlias Sharp Nítid Color blindness – Deuteranopia-type Daltonisme – tipus deuteranòpsia Color blindness – Protanopia-type Daltonisme – tipus protanòpsia Color blindness – Tritanopia-type Daltonisme – tipus tritanòpsia + Show Color Vision Preview Mostra la previsualització de la visió del color + Protanopia Protanòpsia + Deuteranopia Deuteranòpsia + Tritanopia Tritanòpsia + Achromatopsia Acromatòpsia Color Burn Subexposa el color Color conversion: Conversió de color: Color Dodge Sobreexposició de color diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 6a57e90e37..32402c3583 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -605,6 +605,11 @@ Color blindness – Protanopia-type Barvoslepost – protanopie Color blindness – Deuteranopia-type Barvoslepost – deuteranopie Color blindness – Tritanopia-type Barvoslepost – tritanopie + Show Color Vision Preview Zobrazit náhled barevného vidění + Protanopia Protanopie + Deuteranopia Deuteranopie + Tritanopia Tritanopie + Achromatopsia Achromatopsie Customize… Vlastní… Proof Colors Barvy nátisku Zoom In Zvětšit diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 54a79e38e5..bc5550c8d5 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -5565,6 +5565,11 @@ mark-style Japanese Japansk The active document changed while the screen color sampler was open Det aktive dokument ændrede sig, mens skærmfarvesampleren var åben This system has no screen color sampler Dette system har ingen skærmfarvesampler Color blindness – Tritanopia-type Farveblindhed – tritanopitype + Show Color Vision Preview Vis eksempel på farvesyn + Protanopia Protanopi + Deuteranopia Deuteranopi + Tritanopia Tritanopi + Achromatopsia Akromatopsi Panels Except Tools and Control Paneler undtagen værktøjer og kontrol Reset Tracking and Kerning Nulstil sporing og kerning Reset Horizontal Scale Nulstil vandret skalering diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index ab77cb0dd7..aa1d9e9534 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -514,6 +514,11 @@ font-technology Variable Variabel Color blindness – Deuteranopia-type Farbenblindheit – Deuteranopie Color blindness – Protanopia-type Farbenblindheit – Protanopie Color blindness – Tritanopia-type Farbenblindheit – Tritanopie + Show Color Vision Preview Farbsehvorschau einblenden + Protanopia Protanopie + Deuteranopia Deuteranopie + Tritanopia Tritanopie + Achromatopsia Achromatopsie Color Burn Farbig nachbelichten Color conversion: Farbkonvertierung: Color Dodge Farbig abwedeln diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a1a203a257..fee3b3b5f4 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5998,6 +5998,11 @@ effect Points Σημεία Close the circular ends of open profiles. Partial sweeps keep their cut sides open. Κλείσιμο των κυκλικών άκρων των ανοιχτών προφίλ. Οι μερικές περιστροφές κρατούν ανοιχτές τις πλευρές τομής τους. Color Panel Options Επιλογές πίνακα χρώματος Color blindness – Tritanopia-type Αχρωματοψία – τύπου τριτανοπίας + Show Color Vision Preview Εμφάνιση προεπισκόπησης χρωματικής όρασης + Protanopia Πρωτανοπία + Deuteranopia Δευτερανοπία + Tritanopia Τριτανοπία + Achromatopsia Ολική αχρωματοψία Create Dimension Δημιουργία διάστασης Darkness Σκουρότητα Destination Folder: Φάκελος προορισμού: diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 45fd0d8235..60511775ec 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -536,6 +536,11 @@ font-technology Variable Variables Color blindness – Deuteranopia-type Daltonismo – tipo deuteranopía Color blindness – Protanopia-type Daltonismo – tipo protanopía Color blindness – Tritanopia-type Daltonismo – tipo tritanopía + Show Color Vision Preview Mostrar vista previa de visión del color + Protanopia Protanopía + Deuteranopia Deuteranopía + Tritanopia Tritanopía + Achromatopsia Acromatopsia Color Burn Subexponer color Color conversion: Conversión de color: Color Dodge Sobreexponer color diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f6db5b8ee1..83e137334a 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6009,6 +6009,11 @@ mark-style Japanese Japanilainen Close the circular ends of open profiles. Partial sweeps keep their cut sides open. Sulje avointen profiilien pyöreät päät. Osittaiset pyöräytykset jättävät leikkauspintansa auki. Color Panel Options Väri-paneelin asetukset Color blindness – Tritanopia-type Värisokeus – tritanopia + Show Color Vision Preview Näytä värinäön esikatselu + Protanopia Protanopia + Deuteranopia Deuteranopia + Tritanopia Tritanopia + Achromatopsia Akromatopsia Create Dimension Luo mitta Darkness Tummuus Destination Folder: Kohdekansio: diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index ae0bf3b436..88a8ae8af6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -537,6 +537,11 @@ font-technology Variable Variables Color blindness – Deuteranopia-type Daltonisme – type deutéranopie Color blindness – Protanopia-type Daltonisme – type protanopie Color blindness – Tritanopia-type Daltonisme – type tritanopie + Show Color Vision Preview Afficher un aperçu de la vision des couleurs + Protanopia Protanopie + Deuteranopia Deutéranopie + Tritanopia Tritanopie + Achromatopsia Achromatopsie Color Burn Densité couleur + Color conversion: Conversion des couleurs : Color Dodge Densité couleur - diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index f38612601c..07dfda4cf0 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -643,6 +643,11 @@ Color blindness – Deuteranopia-type રંગ અંધત્વ – ડ્યુટેરેનોપિયા પ્રકાર Color blindness – Protanopia-type રંગ અંધત્વ – પ્રોટેનોપિયા પ્રકાર Color blindness – Tritanopia-type રંગ અંધત્વ – ટ્રિટેનોપિયા પ્રકાર + Show Color Vision Preview રંગ દ્રષ્ટિ પૂર્વાવલોકન બતાવો + Protanopia પ્રોટેનોપિયા + Deuteranopia ડ્યુટેરેનોપિયા + Tritanopia ટ્રિટેનોપિયા + Achromatopsia એક્રોમેટોપ્સિયા Color conversion: રંગ રૂપાંતર: Color field રંગ ક્ષેત્ર Color images રંગીન ઇમેજ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 624671acca..e2af7c75b6 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -901,6 +901,11 @@ antiAlias Sharp शार्प Color blindness – Deuteranopia-type कलर ब्लाइंडनेस – ड्यूटेरानोपिया प्रकार Color blindness – Protanopia-type रंग अंधापन - प्रोटानोपिया प्रकार Color blindness – Tritanopia-type कलर ब्लाइंडनेस – ट्राइटेनोपिया प्रकार + Show Color Vision Preview कलर विज़न प्रीव्यू दिखाएँ + Protanopia प्रोटानोपिया + Deuteranopia ड्यूटेरानोपिया + Tritanopia ट्राइटेनोपिया + Achromatopsia एक्रोमैटोप्सिया Color Burn कलर बर्न Color conversion: रंग रूपांतरण: Color Dodge कलर डॉज diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 3e8a200697..1a80d791b4 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -709,6 +709,11 @@ font-technology Variable Változó Color blindness – Deuteranopia-type Színvakság – deuteranópia Color blindness – Protanopia-type Színvakság – protanópia Color blindness – Tritanopia-type Színvakság – tritanópia + Show Color Vision Preview Színlátás-előnézet megjelenítése + Protanopia Protanópia + Deuteranopia Deuteranópia + Tritanopia Tritanópia + Achromatopsia Akromatopszia Color Burn Színsötétítés Color conversion: Színátalakítás: Color Dodge Színvilágosítás diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2107a23bf0..d2b04685e3 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5565,6 +5565,11 @@ mark-style Japanese Jepang The active document changed while the screen color sampler was open Dokumen aktif berubah saat pengambil warna layar terbuka This system has no screen color sampler Sistem ini tidak memiliki pengambil warna layar Color blindness – Tritanopia-type Buta warna – tipe Tritanopia + Show Color Vision Preview Tampilkan pratinjau penglihatan warna + Protanopia Protanopia + Deuteranopia Deuteranopia + Tritanopia Tritanopia + Achromatopsia Akromatopsia Panels Except Tools and Control Semua panel kecuali Alat dan Kontrol Reset Tracking and Kerning Atur ulang tracking dan kerning Reset Horizontal Scale Atur ulang skala horizontal diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index f75dc629db..53449c5606 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -536,6 +536,11 @@ font-technology Variable Variabili Color blindness – Deuteranopia-type Daltonismo – tipo deuteranopia Color blindness – Protanopia-type Daltonismo – tipo protanopia Color blindness – Tritanopia-type Daltonismo – tipo tritanopia + Show Color Vision Preview Mostra anteprima della visione dei colori + Protanopia Protanopia + Deuteranopia Deuteranopia + Tritanopia Tritanopia + Achromatopsia Acromatopsia Color Burn Brucia colore Color conversion: Conversione colore: Color Dodge Scherma colore diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 67072cc8b3..17b0e35d0e 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -640,6 +640,11 @@ digits Malayalam マラヤーラム数字 Color blindness – Protanopia-type P 型(1 型)色覚 Color blindness – Deuteranopia-type D 型(2 型)色覚 Color blindness – Tritanopia-type T 型(3 型)色覚 + Show Color Vision Preview 色覚のプレビューを表示 + Protanopia P 型色覚 + Deuteranopia D 型色覚 + Tritanopia T 型色覚 + Achromatopsia 1 色覚 Customize… カスタマイズ… Proof Colors 色の校正 Zoom In ズームイン diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index c8513b84c3..122e501b09 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5686,6 +5686,11 @@ imageTrace Outline კონტური @plural {n} part of the file wasn't read|{n} parts of the file weren't read ფაილის წაუკითხავი ნაწილები: {n}|ფაილის წაუკითხავი ნაწილები: {n} # Upstream sync 2026-10-16: legacy .ai export, screen color sampler, Hidden Objects, Dimension tool. Color blindness – Tritanopia-type დალტონიზმი – ტრიტანოპიის ტიპი + Show Color Vision Preview ფერთა აღქმის გადახედვის ჩვენება + Protanopia პროტანოპია + Deuteranopia დეიტერანოპია + Tritanopia ტრიტანოპია + Achromatopsia აქრომატოფსია Darkness სიმუქე Sample Color from Screen ფერის აღება ეკრანიდან This system has no screen color sampler ამ სისტემას ეკრანიდან ფერის აღების საშუალება არ აქვს diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 8aa0bc41ca..91256df9eb 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -633,6 +633,11 @@ digits Malayalam 말라얄람어 Color blindness – Protanopia-type 색맹 – 적색맹 유형 Color blindness – Deuteranopia-type 색맹 – 녹색맹 유형 Color blindness – Tritanopia-type 색맹 – 청색맹 유형 + Show Color Vision Preview 색각 미리 보기 표시 + Protanopia 적색맹 + Deuteranopia 녹색맹 + Tritanopia 청색맹 + Achromatopsia 전색맹 Customize… 사용자 지정… Proof Colors 교정 색상 Zoom In 확대 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index de5b7a3cf6..7ac537614a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -6146,6 +6146,11 @@ mark-style Japanese Japans The active document changed while the screen color sampler was open Het actieve document is gewijzigd terwijl de schermkleurkiezer open was This system has no screen color sampler Dit systeem heeft geen schermkleurkiezer Color blindness – Tritanopia-type Kleurenblindheid – type tritanopie + Show Color Vision Preview Voorvertoning van kleurwaarneming tonen + Protanopia Protanopie + Deuteranopia Deuteranopie + Tritanopia Tritanopie + Achromatopsia Achromatopsie Panels Except Tools and Control Alle panelen behalve Gereedschap en Bediening Reset Tracking and Kerning Tracking en kerning herstellen Reset Horizontal Scale Horizontale schaal herstellen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f9bdc664f1..b7748b9579 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -561,6 +561,11 @@ Color blindness – Protanopia-type Daltonizm – typu protanopia Color blindness – Deuteranopia-type Daltonizm – typu deuteranopia Color blindness – Tritanopia-type Daltonizm – typu tritanopia + Show Color Vision Preview Pokaż podgląd widzenia barw + Protanopia Protanopia + Deuteranopia Deuteranopia + Tritanopia Tritanopia + Achromatopsia Achromatopsja Customize… Dostosuj… Proof Colors Próba kolorów Zoom In Powiększ diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 07cd9c6fd6..29551e9855 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -526,6 +526,11 @@ antiAlias Sharp Nítido Color blindness – Deuteranopia-type Daltonismo – tipo deuteranopia Color blindness – Protanopia-type Daltonismo – tipo protanopia Color blindness – Tritanopia-type Daltonismo – tipo tritanopia + Show Color Vision Preview Mostrar Visualização da Visão de Cores + Protanopia Protanopia + Deuteranopia Deuteranopia + Tritanopia Tritanopia + Achromatopsia Acromatopsia Color conversion: Conversão de cor: Color images Imagens coloridas Color: Cor: diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index fcf44192cd..d5fc09295a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -534,6 +534,11 @@ font-technology Variable Вариативные Color blindness – Deuteranopia-type Дальтонизм — дейтеранопия Color blindness – Protanopia-type Дальтонизм — протанопия Color blindness – Tritanopia-type Дальтонизм — тританопия + Show Color Vision Preview Показать имитацию цветового зрения + Protanopia Протанопия + Deuteranopia Дейтеранопия + Tritanopia Тританопия + Achromatopsia Ахроматопсия Color Burn Затемнение основы Color conversion: Преобразование цвета: Color Dodge Осветление основы diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index d68878734e..0f0bb4a01a 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5999,6 +5999,11 @@ theme Appearance Utseende Close the circular ends of open profiles. Partial sweeps keep their cut sides open. Stäng de cirkulära ändarna på öppna profiler. Partiella svep behåller sina snittsidor öppna. Color Panel Options Alternativ för panelen Färg Color blindness – Tritanopia-type Färgblindhet – tritanopi + Show Color Vision Preview Visa förhandsvisning av färgseende + Protanopia Protanopi + Deuteranopia Deuteranopi + Tritanopia Tritanopi + Achromatopsia Akromatopsi Create Dimension Skapa mått Darkness Mörkhet Destination Folder: Målmapp: diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b3c88cc563..ca333d6ac5 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -518,6 +518,11 @@ font-technology Variable Değişken Color blindness – Deuteranopia-type Renk körlüğü – Döteranopi tipi Color blindness – Protanopia-type Renk körlüğü – Protanopi tipi Color blindness – Tritanopia-type Renk körlüğü – Tritanopia tipi + Show Color Vision Preview Renk Görme Önizlemesini Göster + Protanopia Protanopi + Deuteranopia Döteranopi + Tritanopia Tritanopi + Achromatopsia Akromatopsi Color Burn Renkli Yanık Color conversion: Renk dönüşümü: Color Dodge Renk Soldurma diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 0ab6257df4..1f906688ae 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -530,6 +530,11 @@ font-technology Variable Варіативні Color blindness – Deuteranopia-type Дальтонізм - дейтеранопія Color blindness – Protanopia-type Дальтонізм - протанопія Color blindness – Tritanopia-type Дальтонізм - тританопія + Show Color Vision Preview Показати імітацію колірного зору + Protanopia Протанопія + Deuteranopia Дейтеранопія + Tritanopia Тританопія + Achromatopsia Ахроматопсія Color Burn Затемнення основи Color conversion: Перетворення кольору: Color Dodge Освітлення основи diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 80cc4951cf..695e003eae 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -621,6 +621,11 @@ font-technology Variable Biến thiên Color blindness – Deuteranopia-type Mù màu – loại Deuteranopia Color blindness – Protanopia-type Mù màu – loại Protanopia Color blindness – Tritanopia-type Mù màu – loại Tritanopia + Show Color Vision Preview Hiện xem trước thị giác màu + Protanopia Mù màu đỏ + Deuteranopia Mù màu lục + Tritanopia Mù màu lam + Achromatopsia Mù màu toàn phần Color Burn Đốt màu Color conversion: Chuyển đổi màu: Color Dodge Tránh màu diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9561a51baf..0526f6e6dd 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -482,6 +482,11 @@ antiAlias Sharp 锐利 Color blindness – Deuteranopia-type 色盲 – 绿色盲型 Color blindness – Protanopia-type 色盲 – 红色盲型 Color blindness – Tritanopia-type 色盲 – 蓝色盲型 + Show Color Vision Preview 显示色觉预览 + Protanopia 红色盲 + Deuteranopia 绿色盲 + Tritanopia 蓝色盲 + Achromatopsia 全色盲 Color Burn 颜色加深 Color conversion: 色彩转换: Color Dodge 颜色减淡 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 7489e3d4d9..77ee5a9c9f 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -499,6 +499,11 @@ font-technology Variable 可變 Color blindness – Deuteranopia-type 色盲 – 綠色盲型 Color blindness – Protanopia-type 色盲 – 紅色盲型 Color blindness – Tritanopia-type 色盲 – 藍色盲型 + Show Color Vision Preview 顯示色覺預覽 + Protanopia 紅色盲 + Deuteranopia 綠色盲 + Tritanopia 藍色盲 + Achromatopsia 全色盲 Color Burn 加深顏色 Color conversion: 色彩轉換: Color Dodge 加亮顏色 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d36ecae60f..d13a83c1f3 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1325,7 +1325,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, vision}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index d12c89d2af..34a1ad2748 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -698,6 +698,8 @@ mod tests_color_wheel; #[cfg(test)] mod tests_color_wheel_box; #[cfg(test)] +mod tests_color_wheel_vision; +#[cfg(test)] mod tests_constrain; #[cfg(test)] mod tests_css_properties; diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 31522578e5..b66f9c8e38 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -11,11 +11,16 @@ //! channel strip at its right, for the channel picked under Box Channel (Hue, Saturation, //! Brightness, Red, Green or Blue). The field shows the other two components on the Color //! Picker's axes. The view and the channel are kept with the preferences (`ui.colorWheel`). +//! +//! Panel menu › Show Color Vision Preview adds a row under the wheel or the box with the color as +//! simulated for protanopia, deuteranopia and tritanopia, through the simulations View › Proof +//! Setup uses, and for achromatopsia as the gray with the color's CIE L*. The chips only show the +//! simulation. -use egui::{Ui, UiBuilder, vec2}; +use egui::{Rect, Sense, Stroke, StrokeKind, Ui, UiBuilder, vec2}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; -use vectorcraft_color::cms::{self, Cms}; +use vectorcraft_color::cms::{self, Cms, ProofSetup, ProofTarget}; use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb}; use vectorcraft_doc::{ColorMode, NodeId}; @@ -23,6 +28,7 @@ use super::color::{Target, apply, wheel_target}; use super::{pstate, set_pstate}; use crate::VectorcraftApp; use crate::dialogs::color_picker::Channel; +use crate::theme::Tokens; use crate::widgets::{self, FieldAxis, Live, SliderValue, menu_item}; pub const ID: &str = "colorWheel"; @@ -67,6 +73,13 @@ pub struct Settings { pub view: View, #[serde(serialize_with = "serialize_channel", deserialize_with = "deserialize_channel")] pub channel: Channel, + /// Show Color Vision Preview: the row of simulated colors under the wheel or the box. + #[serde(deserialize_with = "deserialize_flag")] + pub vision: bool, +} + +fn deserialize_flag<'de, D: serde::Deserializer<'de>>(d: D) -> Result<bool, D::Error> { + Ok(<Value as Deserialize>::deserialize(d)?.as_bool().unwrap_or_default()) } fn deserialize_view<'de, D: serde::Deserializer<'de>>(d: D) -> Result<View, D::Error> { @@ -90,11 +103,11 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Se Ok(serde_json::from_value(v).unwrap_or_default()) } -/// `ui.colorWheel {view?, channel?}`: show the wheel or the box, and pick the box's channel. Keys -/// left out keep their values; params that are not an object, another key or a value off the list -/// are an error and change nothing. → the settings. +/// `ui.colorWheel {view?, channel?, vision?}`: show the wheel or the box, pick the box's channel, +/// and show or hide the color vision row. Keys left out keep their values; params that are not an +/// object, another key or a value off the list are an error and change nothing. → the settings. pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> { - const KEYS: [&str; 2] = ["view", "channel"]; + const KEYS: [&str; 3] = ["view", "channel", "vision"]; match p { Value::Null => {} Value::Object(o) => { @@ -113,11 +126,15 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri None | Some(Value::Null) => {} Some(v) => set.channel = v.as_str().and_then(Channel::parse).ok_or("`channel` must be hue, saturation, brightness, red, green or blue")?, } + if let Some(on) = crate::menus::opt_bool(p, "vision")? { + set.vision = on; + } app.ui.color_wheel = set; Ok(json!(app.ui.color_wheel)) } -/// The panel menu: Wheel View and Box View, and Box Channel while the box shows. +/// The panel menu: Wheel View and Box View, Box Channel while the box shows, and Show Color Vision +/// Preview. pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { let set = app.ui.color_wheel.clone(); for (label, view) in [(tl!("Wheel View"), View::Wheel), (tl!("Box View"), View::Box)] { @@ -134,6 +151,10 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } }); }); + ui.separator(); + if menu_item(ui, tl!("Show Color Vision Preview"), true, set.vision) { + command(app, &json!({ "vision": !set.vision })).ok(); + } } /// The display values of HSB `hsb` in `ch`'s space, from 0 to 1: hue, saturation and brightness, @@ -207,6 +228,64 @@ fn show_box(ui: &mut Ui, ch: Channel, hsb: [f32; 3], marked: bool, size: f32) -> /// Panel state: the HSB picked last, its [`Owner`] and the display sRGB of the color it stored. const MEMORY: &str = "color-wheel-hsb"; +/// The height of the color vision chips and the space between them. +const VISION_CHIP: f32 = 16.0; +const VISION_GAP: f32 = 3.0; + +/// The display sRGB of `c` as simulated for protanopia, deuteranopia and tritanopia, through +/// `cms`'s Proof Setup simulations, and for achromatopsia: the gray with `c`'s CIE L*, through the +/// same display transform. +pub(crate) fn vision_colors(cms: &Cms, c: &Color) -> [[f32; 3]; 4] { + let srgb = cms.display_rgb(c); + let proof = |target| cms.proof_srgb(srgb, &ProofSetup { target, ..Default::default() }); + let gray = cms.display_rgb(&Color::lab(cms.lab(c).l, 0.0, 0.0)); + [proof(ProofTarget::Protanopia), proof(ProofTarget::Deuteranopia), proof(ProofTarget::Tritanopia), gray] +} + +/// The names of the color vision chips, in the order of [`vision_colors`]. +fn vision_names() -> [String; 4] { + [tl!("Protanopia"), tl!("Deuteranopia"), tl!("Tritanopia"), tl!("Achromatopsia")].map(|s| s.to_string()) +} + +/// The 0 to 255 values of display sRGB `rgb`. +pub(crate) fn bytes(rgb: [f32; 3]) -> [u8; 3] { + rgb.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8) +} + +/// `#rrggbb` of 0 to 255 values. +pub(crate) fn hex([r, g, b]: [u8; 3]) -> String { + format!("#{r:02x}{g:02x}{b:02x}") +} + +/// The Show Color Vision Preview row: four chips across the panel with `color` as each color +/// vision deficiency shows it. Each chip takes the keyboard focus and reports its name and, with a +/// solid color, its hex value as its value to screen readers; its tooltip shows both. A click or a +/// key on a chip does nothing. With no solid color the chips are empty and carry only their names. +fn vision_row(ui: &mut Ui, cms: &Cms, color: Option<&Color>) { + let t = Tokens::get(ui.ctx()); + let colors = color.map(|c| vision_colors(cms, c)); + let width = ui.available_width(); + let (row, _) = ui.allocate_exact_size(vec2(width, VISION_CHIP), Sense::hover()); + let w = ((width - 3.0 * VISION_GAP) / 4.0).max(1.0); + let enabled = ui.is_enabled(); + for (i, name) in vision_names().into_iter().enumerate() { + let cell = Rect::from_min_size(row.min + vec2(i as f32 * (w + VISION_GAP), 0.0), vec2(w, VISION_CHIP)); + let resp = ui.interact(cell, ui.scope_id().with(("color-vision", i)), Sense::focusable_noninteractive()); + let value = colors.map(|cs| { + let [r, g, b] = bytes(cs[i]); + ui.painter().rect_filled(cell, 0.0, egui::Color32::from_rgb(r, g, b)); + hex([r, g, b]) + }); + let stroke = if resp.has_focus() { ui.visuals().selection.stroke } else { Stroke::new(1.0, t.border) }; + ui.painter().rect_stroke(cell, 0.0, stroke, StrokeKind::Inside); + let tip = match &value { + Some(v) => format!("{name}\n{v}"), + None => name.clone(), + }; + resp.widget_info(|| egui::WidgetInfo { current_text_value: value.clone(), ..egui::WidgetInfo::labeled(egui::Role::Image, enabled, &name) }); + resp.on_hover_text(tip); + } +} /// What the HSB picked last belongs to: the document, the selected objects or text characters, /// the appearance item, the proxy, the gradient stop or freeform point, its paint, and the color @@ -344,6 +423,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { pick = Some(([hsb[0], x, 1.0 - y], field_phase)); } }); + if app.ui.color_wheel.vision { + ui.add_space(4.0); + vision_row(ui, &cms, color.as_ref()); + } let Some((hsb, phase)) = pick else { return }; let behind = super::alt_held(ui); let cmyk_doc = app.session.active().is_some_and(|d| d.doc.color_mode == ColorMode::Cmyk); diff --git a/crates/ui-egui/src/panels/tests_color_wheel_box.rs b/crates/ui-egui/src/panels/tests_color_wheel_box.rs index d3866fd5d9..4a6144443c 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_box.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_box.rs @@ -167,16 +167,16 @@ fn the_strip_takes_the_arrow_keys_and_screen_readers_actions() { #[test] fn ui_color_wheel_sets_and_reads_the_view_and_the_channel() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); - assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue"})); - assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue"})); - assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green"})); + assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue", "vision": false})); + assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue", "vision": false})); + assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green", "vision": false})); let e = app.run("ui.colorWheel", json!({"view": "triangle"})).unwrap_err(); assert_eq!(e, "`view` must be wheel or box"); let e = app.run("ui.colorWheel", json!({"view": "wheel", "channel": 7})).unwrap_err(); assert_eq!(e, "`channel` must be hue, saturation, brightness, red, green or blue"); - assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green }, "an error changes nothing"); + assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green, vision: false }, "an error changes nothing"); let ui = crate::control::inspect(&app, &egui::Context::default()); - assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green"})); + assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green", "vision": false})); } /// The command's errors are translated in the catalogs that translate status and error messages, @@ -211,10 +211,10 @@ fn ui_color_wheel_rejects_other_params() { let e = app.run("ui.colorWheel", json!([1])).unwrap_err(); assert_eq!(e, "the params must be an object, not [1]"); let e = app.run("ui.colorWheel", json!({"veiw": "wheel"})).unwrap_err(); - assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel"); + assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, vision"); let e = app.run("ui.colorWheel", json!({"view": "wheel", "chanel": "blue"})).unwrap_err(); - assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel"); - assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red }, "an error changes nothing"); + assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, vision"); + assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red, vision: false }, "an error changes nothing"); } /// With None there is no color to edit: the strip reads 0 to screen readers, as the hue ring does, @@ -249,7 +249,11 @@ fn ui_color_wheel_answers_junk_params_without_a_panic() { /// not know reads as the key's default without losing the other preferences. #[test] fn the_settings_are_kept_and_read_leniently() { - let ui = crate::UiState { color_wheel: Settings { view: View::Box, channel: Channel::Blue }, color_rgb_percent: true, ..Default::default() }; + let ui = crate::UiState { + color_wheel: Settings { view: View::Box, channel: Channel::Blue, vision: true }, + color_rgb_percent: true, + ..Default::default() + }; let saved = serde_json::to_value(&ui).unwrap(); let back: crate::UiState = serde_json::from_value(saved.clone()).unwrap(); assert_eq!(back.color_wheel, ui.color_wheel); @@ -262,11 +266,11 @@ fn the_settings_are_kept_and_read_leniently() { let mut odd = saved.clone(); odd["color_wheel"] = json!({"view": "box", "channel": 7}); let back: crate::UiState = serde_json::from_value(odd).unwrap(); - assert_eq!(back.color_wheel, Settings { view: View::Box, channel: Channel::default() }); + assert_eq!(back.color_wheel, Settings { view: View::Box, channel: Channel::default(), vision: false }); let mut odd = saved.clone(); odd["color_wheel"] = json!({"view": "triangle", "channel": "blue"}); let back: crate::UiState = serde_json::from_value(odd).unwrap(); - assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue }); + assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue, vision: false }); let mut odd = saved; odd["color_wheel"] = json!("box"); let back: crate::UiState = serde_json::from_value(odd).unwrap(); diff --git a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs new file mode 100644 index 0000000000..818bb49650 --- /dev/null +++ b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs @@ -0,0 +1,258 @@ +//! The Color Wheel panel's Show Color Vision Preview row drawn headless: the simulated colors, their +//! names and values, the painted chips, a gray fill, no solid color, clicks and keys on the chips, +//! the keyboard focus, the panel menu and `ui.colorWheel`. + +use egui::{Color32, Key, Modifiers, Rect, Shape, vec2}; +use egui_kittest::Harness; +use egui_kittest::kittest::{NodeT, Queryable}; +use serde_json::{Value, json}; +use vectorcraft_color::Color; +use vectorcraft_color::cms::{self, ProofSetup, ProofTarget}; +use vectorcraft_engine::Session; + +use super::color_wheel::{bytes, show, vision_colors}; +use crate::VectorcraftApp; + +/// `#rrggbb` of display sRGB `rgb`, as the chips show it. +fn hex(rgb: [f32; 3]) -> String { + super::color_wheel::hex(bytes(rgb)) +} + +const NAMES: [&str; 4] = ["Protanopia", "Deuteranopia", "Tritanopia", "Achromatopsia"]; + +/// A document with a selected rectangle filled with `fill`, with Show Color Vision Preview on. +fn app(fill: Value) -> VectorcraftApp { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + app.run("paint.setFill", json!({"color": fill})).unwrap(); + app.run("ui.colorWheel", json!({"vision": true})).unwrap(); + app +} + +fn harness(app: VectorcraftApp) -> Harness<'static, VectorcraftApp> { + let mut h = Harness::builder().with_size(vec2(260.0, 360.0)).build_ui_state(|ui, app: &mut VectorcraftApp| show(app, ui), app); + h.run_steps(2); + h +} + +/// The value a chip reports to screen readers. +fn value(h: &Harness<'static, VectorcraftApp>, name: &str) -> Option<String> { + h.get_by_label(name).value() +} + +fn fill(app: &VectorcraftApp) -> Color { + super::current_paints(app).0.color().expect("a solid fill") +} + +fn undo_len(app: &VectorcraftApp) -> usize { + app.session.doc().unwrap().history.undo.len() +} + +/// The fill painted inside `cell`, if a filled rectangle covers it. +fn painted(h: &Harness<'static, VectorcraftApp>, cell: Rect) -> Option<Color32> { + h.output().shapes.iter().find_map(|c| match &c.shape { + Shape::Rect(r) + if r.fill != Color32::TRANSPARENT && r.rect.expand(0.5).contains_rect(cell.shrink(0.5)) && cell.expand(0.5).contains_rect(r.rect) => + { + Some(r.fill) + } + _ => None, + }) +} + +fn color32(hex: &str) -> Color32 { + Color32::from_hex(hex).expect("a #rrggbb value") +} + +/// The protanopia, deuteranopia and tritanopia chips show the fill as View › Proof Setup's +/// simulations show it: each reports the simulation's hex value and is painted in it. +#[test] +fn the_chips_show_the_proof_setup_simulations_of_the_fill() { + let h = harness(app(json!("#3366cc"))); + let cms = cms::active(); + let srgb = cms.display_rgb(&fill(h.state())); + for (name, target) in + [("Protanopia", ProofTarget::Protanopia), ("Deuteranopia", ProofTarget::Deuteranopia), ("Tritanopia", ProofTarget::Tritanopia)] + { + let want = hex(cms.proof_srgb(srgb, &ProofSetup { target, ..Default::default() })); + assert_eq!(value(&h, name).as_deref(), Some(want.as_str()), "{name}"); + assert_eq!(painted(&h, h.get_by_label(name).rect()), Some(color32(&want)), "{name} is painted {want}"); + } +} + +/// The achromatopsia chip of a red fill is the gray with red's CIE L* (D50, about 54.29: #828282), +/// and the simulations of a pure red differ from it and from each other. +#[test] +fn the_achromatopsia_chip_is_the_gray_of_the_colors_lightness() { + let cms = cms::active(); + let [p, d, t, a] = vision_colors(&cms, &Color::rgb(1.0, 0.0, 0.0)); + assert_eq!(hex(a), "#828282"); + assert_ne!(hex(p), hex(d)); + assert_ne!(hex(t), hex(a)); + let h = harness(app(json!("#ff0000"))); + assert_eq!(value(&h, "Achromatopsia").as_deref(), Some("#828282")); + assert_eq!(painted(&h, h.get_by_label("Achromatopsia").rect()), Some(color32("#828282"))); +} + +/// A gray fill shows as the same gray in every chip. +#[test] +fn a_gray_fill_is_the_same_gray_in_every_chip() { + let h = harness(app(json!("#808080"))); + let gray = hex(cms::active().display_rgb(&fill(h.state()))); + for name in NAMES { + assert_eq!(value(&h, name).as_deref(), Some(gray.as_str()), "{name} shows {gray}"); + } +} + +/// With the box in the wheel's place the row shows under the box, with the same values. +#[test] +fn the_row_shows_under_the_box_too() { + let mut a = app(json!("#3366cc")); + a.run("ui.colorWheel", json!({"view": "box", "channel": "red"})).unwrap(); + let h = harness(a); + let [p, ..] = vision_colors(&cms::active(), &fill(h.state())); + assert_eq!(value(&h, "Protanopia").as_deref(), Some(hex(p).as_str())); + let field = h.get_by_label("Color box").rect(); + for name in NAMES { + assert!(h.get_by_label(name).rect().top() >= field.bottom(), "{name} is under the box"); + } +} + +/// With a None fill the chips carry only their names, with no value and no color. +#[test] +fn with_a_none_fill_the_chips_have_no_color() { + let mut a = app(json!("#ff0000")); + a.run("paint.setFill", json!({"none": true})).unwrap(); + let h = harness(a); + for name in NAMES { + assert_eq!(value(&h, name), None, "{name} has no value"); + assert_eq!(painted(&h, h.get_by_label(name).rect()), None, "{name} is not painted"); + } +} + +/// Screen readers find each chip by its deficiency name, with its hex value as its value, and Tab +/// steps through the four chips in order. +#[test] +fn the_chips_take_the_focus_and_report_their_names_and_values() { + let mut h = harness(app(json!("#3366cc"))); + for name in NAMES { + let node = h.get_by_label(name); + assert_eq!(node.accesskit_node().role(), egui::accesskit::Role::Image, "{name}"); + assert!(node.value().is_some_and(|v| v.starts_with('#') && v.len() == 7), "{name}: {:?}", node.value()); + assert!(!node.accesskit_node().is_disabled(), "{name}"); + } + // Tab stops on the panel's other controls first. + for _ in 0..40 { + if h.get_by_label(NAMES[0]).accesskit_node().is_focused() { + break; + } + h.key_press(Key::Tab); + h.run_steps(1); + } + assert!(h.get_by_label(NAMES[0]).accesskit_node().is_focused(), "Tab reaches {}", NAMES[0]); + for name in &NAMES[1..] { + h.key_press(Key::Tab); + h.run_steps(1); + assert!(h.get_by_label(name).accesskit_node().is_focused(), "the next Tab reaches {name}"); + } +} + +/// A click on a chip, and Enter or Space on a focused chip, leave the fill and the undo history as +/// they were. +#[test] +fn a_click_or_a_key_on_a_chip_applies_nothing() { + let mut h = harness(app(json!("#3366cc"))); + let (before, undo) = (fill(h.state()), undo_len(h.state())); + for name in NAMES { + h.get_by_label(name).click(); + h.run_steps(2); + for key in [Key::Enter, Key::Space] { + h.key_press_modifiers(Modifiers::NONE, key); + h.run_steps(1); + } + assert_eq!(fill(h.state()), before, "{name}"); + assert_eq!(undo_len(h.state()), undo, "{name}: no undo step"); + } +} + +/// Without the setting the row is not drawn, and the panel menu's Show Color Vision Preview turns +/// it on and off. +#[test] +fn the_panel_menu_turns_the_row_on_and_off() { + let mut a = app(json!("#3366cc")); + a.run("ui.colorWheel", json!({"vision": false})).unwrap(); + let h = harness(a); + assert!(h.query_by_label_contains("Protanopia").is_none()); + let mut a = app(json!("#3366cc")); + a.run("ui.colorWheel", json!({"vision": false})).unwrap(); + let mut fonts = false; + let mut menu = Harness::builder().build_ui_state( + move |ui, app: &mut VectorcraftApp| { + // The fonts, which draw the check mark, take effect from the next frame. + if !fonts { + crate::theme::install_fonts(ui.ctx()); + fonts = true; + return; + } + super::color_wheel::menu(app, ui); + }, + a, + ); + menu.run_steps(3); + menu.get_by_label_contains("Show Color Vision Preview").click(); + menu.run_steps(2); + assert!(menu.state().ui.color_wheel.vision); + menu.get_by_label_contains("Show Color Vision Preview").click(); + menu.run_steps(2); + assert!(!menu.state().ui.color_wheel.vision); +} + +/// `ui.colorWheel` sets the keys given and reads them with `{}`, and `ui.inspect` reports them as +/// `ui.color_wheel`. A value that is not a bool, params that are not an object and another key +/// are errors that change nothing. +#[test] +fn ui_color_wheel_sets_and_reads_the_settings() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue", "vision": false})); + assert_eq!(app.run("ui.colorWheel", json!({"vision": true})).unwrap(), json!({"view": "wheel", "channel": "hue", "vision": true})); + assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_wheel"]["vision"], true); + assert_eq!(app.run("ui.colorWheel", json!({"vision": "no"})).unwrap_err(), "`vision` must be true or false"); + assert_eq!(app.run("ui.colorWheel", json!("junk")).unwrap_err(), "the params must be an object, not \"junk\""); + assert_eq!(app.run("ui.colorWheel", json!(5)).unwrap_err(), "the params must be an object, not 5"); + assert_eq!( + app.run("ui.colorWheel", json!({"visoin": false})).unwrap_err(), + "unknown parameter `visoin`; the command takes: view, channel, vision" + ); + assert!(app.ui.color_wheel.vision); + assert_eq!(app.run("ui.colorWheel", json!({"vision": null})).unwrap()["vision"], true); + assert_eq!(app.run("ui.colorWheel", Value::Null).unwrap()["vision"], true); + // Setting the view or the channel keeps the row, and setting the row keeps them. + assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap()["vision"], true); + assert_eq!(app.run("ui.colorWheel", json!({"vision": false})).unwrap(), json!({"view": "box", "channel": "hue", "vision": false})); +} + +/// `ui.colorWheel` answers every junk parameter, with and without a document, without a panic. +#[test] +fn ui_color_wheel_answers_junk_params_without_a_panic() { + let doc = crate::menus::UI_COMMANDS.iter().find(|c| c.0 == "ui.colorWheel").expect("registered").3; + let mut app = app(json!("#3366cc")); + let mut empty = VectorcraftApp::new(Session::new(), Default::default()); + for p in vectorcraft_testkit::strategies::junk_params(doc, "/nonexistent").into_iter().chain(vectorcraft_testkit::strategies::junk_values()) { + let _ = app.run("ui.colorWheel", p.clone()); + let _ = empty.run("ui.colorWheel", p); + } +} + +/// The saved settings read leniently: a value this build does not know reads as the default and +/// the other preferences are kept. +#[test] +fn saved_settings_read_leniently() { + let read = |v: Value| serde_json::from_value::<crate::UiState>(v).expect("the preferences read"); + let s = read(json!({"color_wheel": {"vision": true}, "color_rgb_percent": true})); + assert!(s.color_wheel.vision && s.color_rgb_percent); + let s = read(json!({"color_wheel": {"vision": "yes", "later": 3}, "color_rgb_percent": true})); + assert!(!s.color_wheel.vision && s.color_rgb_percent); + let s = read(json!({"color_wheel": "junk", "color_rgb_percent": true})); + assert!(!s.color_wheel.vision && s.color_rgb_percent); +} diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index d1722e8b72..959f20395f 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -734,7 +734,8 @@ pub struct UiState { /// of an RGB field, `ui.colorPanel`, [`crate::panels::color::deserialize_rgb_percent`]). #[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")] pub color_rgb_percent: bool, - /// Color Wheel panel: the wheel or the box, and the box's channel (`ui.colorWheel`, + /// Color Wheel panel: the wheel or the box, the box's channel, and the color vision row + /// (`ui.colorWheel`, /// [`crate::panels::color_wheel::deserialize_settings`]). #[serde(default, deserialize_with = "crate::panels::color_wheel::deserialize_settings")] pub color_wheel: crate::panels::color_wheel::Settings, diff --git a/docs/control-protocol.md b/docs/control-protocol.md index bb13e0d5f5..6d01fd91e2 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -265,9 +265,9 @@ My Themes tab lists the saved themes; every action runs a command (`colorTheme.s Color Wheel panel (`window.panel {panel: "colorWheel"}`): a hue ring around a saturation and brightness square. A pick runs the commands the Color panel's sliders run: `paint.setFill` or `paint.setStroke` with `keepModel`, `paint.editGradient` for a gradient's selected stop, and `paint.freeform.setPoint` for a freeform gradient's selected -point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?}` shows the wheel or the box (a -color field with a channel strip at its right) and picks the box's channel; it returns the settings, and `ui.inspect` -reports them as `ui.color_wheel`. +point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, vision?}` shows the wheel or +the box (a color field with a channel strip at its right), picks the box's channel and shows or hides the color vision +row; it returns the settings, and `ui.inspect` reports them as `ui.color_wheel`. Edit Colors dialogs: `ui.colorBalanceDialog` opens Adjust Colors (`colorBalance`: fields `mode` `gray`/`rgb`/`cmyk`/ `global`, the channels `r` `g` `b` / `c` `m` `y` `k` / `gray` / `tint` (global mode) from −100 to 100, `convert`, `fill`, `stroke`, diff --git a/docs/mcp.md b/docs/mcp.md index 12c1f38184..927d37be23 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -625,6 +625,12 @@ strip at its right) in place of the wheel, as the panel menu's Box View and Box shows the wheel again. Keys left out keep their values. Params that are not an object, another key or a value off the list return an error and change nothing. The command returns `{view, channel}`, and both settings are kept with the preferences. +`ui.colorWheel {"vision": true}` turns on the Color Wheel panel's Show Color Vision Preview, as its panel menu +does: a row of four chips under the wheel or the box shows the current color through the protanopia, deuteranopia +and tritanopia simulations of `view.proofSetup`, and for achromatopsia as the gray with the color's CIE L*. Each +chip reports its name and hex value to screen readers, and a click on a chip does not apply its color. `false` +hides the row. A value that is not a bool returns an error and changes nothing. The command returns +`{view, channel, vision}`, and the setting is kept with the preferences. In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's screen color sampler and returns `null` before a color is picked: the system's sampler on macOS, the XDG desktop diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e34f814534..e8cfd684ba 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1512,6 +1512,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A Cmd/Ctrl-click on the Color panel's spectrum applies Complement and a Cmd/Ctrl+Shift-click applies Invert to the active Fill or Stroke (`paint.complement`, `paint.invert`); with Alt also held, the click recolors the inactive one, as the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) list them. A double-click right of an RGB field switches the Color panel's R, G and B between percent and 0 to 255 ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), Color panel). In VectorCraft the color does not change, Web Safe RGB and the hex field stay in 0 to 255, and the panel keeps the choice between sessions (`ui.colorPanel {rgbPercent}`); the color mixer of the Fill and Stroke chips and the gradient stop dialog follow the same setting. Toggle RGB Percent (`ui.colorRgbPercent`) in the command palette and Keyboard Shortcuts switches the units from the keyboard. Tests: `rgb_percent_switches_the_rgb_fields_between_percent_and_0_to_255`, `rgb_percent_does_not_switch_while_the_rows_are_disabled`, `rgb_percent_comes_back_after_a_restart` and `toggle_rgb_percent_switches_the_units_from_the_keyboard` in `crates/ui-egui/src/panels/color/tests.rs`. View › Proof Setup › Color blindness – Tritanopia-type turns Proof Colors on and proofs the canvas with the tritanopia simulation of Brettel, Viénot and Mollon (1997). The Separations Preview panel's Proof Setup list offers the same target (`view.proofSetup {target: "tritanopia"}`). Grays keep their value. + In VectorCraft the Color Wheel panel menu's Show Color Vision Preview (`ui.colorWheel {vision: true}`) adds a row of four chips under the wheel or the box: the current color through the protanopia, deuteranopia and tritanopia simulations that View › Proof Setup uses, and an achromatopsia chip, which is VectorCraft's own gray with the color's CIE L*. Each chip takes the keyboard focus and gives its name and hex value in its tooltip and to screen readers, and a click on one does not apply it. The setting is kept with the preferences. Tests: `crates/ui-egui/src/panels/tests_color_wheel_vision.rs`. The Separations Preview panel's Gamut Check button reports one color outside the CMYK gamut in the singular and more in the plural, in English and in each language's plural forms (`gamut_check_status_takes_the_plural_form` in `crates/ui-egui/src/i18n/tests.rs`). - **Document Color Mode outside the layers:** File › Document Color Mode (in one undo step) and `document.open {colorMode}` also convert the colors of graph designs, graphic styles, opacity-mask art, the tile that pattern editing's Cancel puts back and the art of brushes (with a Hue Shift brush's key color); a tint of a global swatch there becomes the converted swatch's color at its tint, as in the art. - **Segments dragged onto the grid (#3835):** with View › Snap to Grid (or Snap to Pixel) on, a straight segment dragged with Direct Selection or Group Selection lands its anchors on the grid, the box round them putting an edge on a gridline on each axis as a moved object's does (Shift keeps the move on its line), instead of the point it was pressed at landing on an intersection and leaving both anchors off the grid; a dragged anchor still lands on an intersection itself, and drawn points and resize handles already snapped (`direct::tests::a_dragged_segment_lands_its_anchors_on_the_grid`). From 7cd7652add5b958a38957ea09f9c41a09928ac0b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 07:45:32 -0800 Subject: [PATCH 027/247] i18n: complete catalogs have rows for the Weather Icons library and symbol names The built-in Weather Icons symbol library adds the symbols Sun, Moon, Cloud, Rain, Thunder and Snow. Each complete catalog now has a row for each of them and for the library name, and the symbol-name test counts 32 names. --- crates/ui-egui/src/i18n/bg.tsv | 7 +++++++ crates/ui-egui/src/i18n/bs.tsv | 7 +++++++ crates/ui-egui/src/i18n/ca.tsv | 7 +++++++ crates/ui-egui/src/i18n/cs.tsv | 7 +++++++ crates/ui-egui/src/i18n/da.tsv | 7 +++++++ crates/ui-egui/src/i18n/de.tsv | 7 +++++++ crates/ui-egui/src/i18n/el.tsv | 7 +++++++ crates/ui-egui/src/i18n/es.tsv | 7 +++++++ crates/ui-egui/src/i18n/fi.tsv | 7 +++++++ crates/ui-egui/src/i18n/fr.tsv | 7 +++++++ crates/ui-egui/src/i18n/gu.tsv | 7 +++++++ crates/ui-egui/src/i18n/hi.tsv | 7 +++++++ crates/ui-egui/src/i18n/hu.tsv | 7 +++++++ crates/ui-egui/src/i18n/id.tsv | 7 +++++++ crates/ui-egui/src/i18n/it.tsv | 7 +++++++ crates/ui-egui/src/i18n/ja.tsv | 7 +++++++ crates/ui-egui/src/i18n/ka.tsv | 7 +++++++ crates/ui-egui/src/i18n/ko.tsv | 7 +++++++ crates/ui-egui/src/i18n/nl.tsv | 7 +++++++ crates/ui-egui/src/i18n/pl.tsv | 7 +++++++ crates/ui-egui/src/i18n/pt-br.tsv | 7 +++++++ crates/ui-egui/src/i18n/ru.tsv | 7 +++++++ crates/ui-egui/src/i18n/sv.tsv | 7 +++++++ crates/ui-egui/src/i18n/tests.rs | 2 +- crates/ui-egui/src/i18n/tr.tsv | 7 +++++++ crates/ui-egui/src/i18n/uk.tsv | 7 +++++++ crates/ui-egui/src/i18n/vi.tsv | 7 +++++++ crates/ui-egui/src/i18n/zh-hans.tsv | 7 +++++++ crates/ui-egui/src/i18n/zh-hant.tsv | 7 +++++++ 29 files changed, 197 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 8003d375b5..ed5af35188 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6139,6 +6139,7 @@ axis Y Axis Y ос Checkpoint Контролна точка Inventory Icons Икони на инвентара Skill Icons Икони на умения + Weather Icons Икони за времето Attack Атака Defend Защита Heal Лечение @@ -6481,6 +6482,12 @@ axis Y Axis Y ос Soft Light Wash Лавиране мека светлина Burst Взрив Rounded Square Закръглен квадрат + Sun Слънце + Moon Луна + Cloud Облак + Rain Дъжд + Thunder Гръм + Snow Сняг Save Brush Library… Запази библиотека с четки… @msg no empty artboards to delete няма празни работни области за изтриване Scale Presets Пресети за мащаб diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 360df18ce5..9744eb9871 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6186,6 +6186,7 @@ axis Y Axis Y osa Checkpoint Kontrolna tačka Inventory Icons Ikone inventara Skill Icons Ikone vještina + Weather Icons Ikone vremena Attack Napad Defend Odbrana Heal Iscjeljenje @@ -6534,6 +6535,12 @@ axis Y Axis Y osa Soft Light Wash Laviranje mekim svjetlom Burst Prasak Rounded Square Zaobljeni kvadrat + Sun Sunce + Moon Mjesec + Cloud Oblak + Rain Kiša + Thunder Grom + Snow Snijeg Save Brush Library… Sačuvaj biblioteku četkica… @msg `{_1}` has no brushes to apply `{_1}` nema četkica za primjenu @msg missing `library` (see brush.libraries) nedostaje `library` (pogledajte brush.libraries) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index f8d87afb06..465afe73b0 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -468,6 +468,7 @@ antiAlias Sharp Nítid Checkpoint Punt de control Inventory Icons Icones d’inventari Skill Icons Icones d'habilitat + Weather Icons Icones del temps Attack Atac Defend Defensa Heal Curació @@ -4213,6 +4214,12 @@ digits Malayalam Malaiàlam Soft Light Wash Aiguada llum suau Burst Esclat Rounded Square Quadrat arrodonit + Sun Sol + Moon Lluna + Cloud Núvol + Rain Pluja + Thunder Tro + Snow Neu Scatter: Dispersió: Scissors Tisores Scissors Tool Eina de tisores diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 75573082b3..46b39f10bb 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6690,6 +6690,7 @@ axis Y Axis osa Y Checkpoint Kontrolní bod Inventory Icons Ikony inventáře Skill Icons Ikony dovedností + Weather Icons Ikony počasí Attack Útok Defend Obrana Heal Léčení @@ -7038,6 +7039,12 @@ axis Y Axis osa Y Soft Light Wash Lavírka měkkého světla Burst Výbuch Rounded Square Zaoblený čtverec + Sun Slunce + Moon Měsíc + Cloud Mrak + Rain Déšť + Thunder Hrom + Snow Sníh Save Brush Library… Uložit knihovnu štětců… @msg `{_1}` has no brushes to apply `{_1}` nemá žádné štětce k použití @msg missing `library` (see brush.libraries) chybí `library` (viz brush.libraries) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 7ae1e227c7..29758aa52f 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6155,6 +6155,7 @@ axis Y Axis Y-akse Checkpoint Kontrolpunkt Inventory Icons Inventarikoner Skill Icons Færdighedsikoner + Weather Icons Vejrikoner Attack Angreb Defend Forsvar Heal Helbredelse @@ -6497,6 +6498,12 @@ axis Y Axis Y-akse Soft Light Wash Blødt lys-lavering Burst Udbrud Rounded Square Afrundet kvadrat + Sun Sol + Moon Måne + Cloud Sky + Rain Regn + Thunder Torden + Snow Sne Save Brush Library… Gem penselbibliotek… @msg no empty artboards to delete ingen tomme tegneflader at slette Scale Presets Skaleringsforudindstillinger diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index ee97a6263a..d1e0487f53 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6282,6 +6282,7 @@ axis Y Axis Y-Achse Checkpoint Kontrollpunkt Inventory Icons Inventar-Symbole Skill Icons Fähigkeitssymbole + Weather Icons Wettersymbole Attack Angriff Defend Verteidigung Heal Heilung @@ -6630,6 +6631,12 @@ axis Y Axis Y-Achse Soft Light Wash Weiches-Licht-Lavierung Burst Strahlenkranz Rounded Square Abgerundetes Quadrat + Sun Sonne + Moon Mond + Cloud Wolke + Rain Regen + Thunder Donner + Snow Schnee Bar Balken Fine Dots Feine Punkte Hexagon Sechseck diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b5990ded14..b0923fe6b7 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6642,6 +6642,7 @@ axis Y Axis Άξονας Y Checkpoint Σημείο ελέγχου Inventory Icons Εικονίδια αποθέματος Skill Icons Εικονίδια δεξιοτήτων + Weather Icons Εικονίδια καιρού Attack Επίθεση Defend Άμυνα Heal Θεραπεία @@ -6990,6 +6991,12 @@ axis Y Axis Άξονας Y Soft Light Wash Αραίωση απαλού φωτός Burst Έκρηξη Rounded Square Στρογγυλεμένο τετράγωνο + Sun Ήλιος + Moon Φεγγάρι + Cloud Σύννεφο + Rain Βροχή + Thunder Βροντή + Snow Χιόνι Save Brush Library… Αποθήκευση βιβλιοθήκης πινέλων… @msg `{_1}` has no brushes to apply Η `{_1}` δεν έχει πινέλα για εφαρμογή @msg missing `library` (see brush.libraries) λείπει το `library` (δείτε brush.libraries) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index e717946e8c..35de44d453 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6633,6 +6633,7 @@ axis Y Axis Eje Y Checkpoint Punto de control Inventory Icons Iconos de inventario Skill Icons Iconos de habilidad + Weather Icons Iconos del tiempo Attack Ataque Defend Defensa Heal Curación @@ -6981,6 +6982,12 @@ axis Y Axis Eje Y Soft Light Wash Aguada luz suave Burst Estallido Rounded Square Cuadrado redondeado + Sun Sol + Moon Luna + Cloud Nube + Rain Lluvia + Thunder Trueno + Snow Nieve Save Brush Library… Guardar biblioteca de pinceles… @msg `{_1}` has no brushes to apply `{_1}` no tiene pinceles para aplicar @msg missing `library` (see brush.libraries) falta `library` (consulte brush.libraries) diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 4c68462083..2d954ce3af 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6720,6 +6720,7 @@ axis Y Axis Y-akseli Checkpoint Tarkastuskohta Inventory Icons Inventaarioikonit Skill Icons Taitoikonit + Weather Icons Sääikonit Attack Hyökkäys Defend Puolustus Heal Parannus @@ -7068,6 +7069,12 @@ axis Y Axis Y-akseli Soft Light Wash Pehmeä valo -laveeraus Burst Purkaus Rounded Square Pyöristetty neliö + Sun Aurinko + Moon Kuu + Cloud Pilvi + Rain Sade + Thunder Ukkonen + Snow Lumi Save Brush Library… Tallenna sivellinkirjasto… @msg `{_1}` has no brushes to apply Kohteessa `{_1}` ei ole käytettäviä siveltimiä @msg missing `library` (see brush.libraries) `library` puuttuu (katso brush.libraries) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 9c08b77e84..276f0d893b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6685,6 +6685,7 @@ axis Y Axis Axe Y Checkpoint Point de contrôle Inventory Icons Icônes d’inventaire Skill Icons Icônes de compétences + Weather Icons Icônes météo Attack Attaque Defend Défense Heal Soin @@ -7033,6 +7034,12 @@ axis Y Axis Axe Y Soft Light Wash Lavis lumière tamisée Burst Éclat Rounded Square Carré arrondi + Sun Soleil + Moon Lune + Cloud Nuage + Rain Pluie + Thunder Tonnerre + Snow Neige Save Brush Library… Enregistrer la bibliothèque de formes… @msg `{_1}` has no brushes to apply `{_1}` n'a aucune forme à appliquer @msg missing `library` (see brush.libraries) `library` manquant (voir brush.libraries) diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 405fdeb831..a9d910683f 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4273,6 +4273,7 @@ antiAlias Sharp શાર્પ Charge Wave ચાર્જ તરંગ Spark Trail તણખાનો પથ Skill Icons કૌશલ્ય આઇકન + Weather Icons હવામાન આઇકન Attack હુમલો Defend બચાવ Heal ઉપચાર @@ -4946,6 +4947,12 @@ swatch [Registration] [રજિસ્ટ્રેશન] Pin પિન Potion ઔષધ Rounded Square ગોળ ખૂણાવાળો ચોરસ + Sun સૂર્ય + Moon ચંદ્ર + Cloud વાદળ + Rain વરસાદ + Thunder ગર્જના + Snow બરફ Shield ઢાલ Sword તલવાર Triangle ત્રિકોણ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index e47dc7b652..1f12a94b1d 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -694,6 +694,12 @@ antiAlias Sharp शार्प Soft Light Wash सॉफ़्ट लाइट वॉश Burst विस्फोट Rounded Square गोल कोनों वाला वर्ग + Sun सूरज + Moon चाँद + Cloud बादल + Rain बारिश + Thunder गरज + Snow बर्फ़ Art using a deleted global swatch keeps its colour. हटाए गए ग्लोबल स्वॉच वाला आर्टवर्क अपना रंग बनाए रखता है। Artboard आर्टबोर्ड Artboard {n} of {total} {total} में से आर्टबोर्ड {n} @@ -795,6 +801,7 @@ antiAlias Sharp शार्प Checkpoint चेकपॉइंट Inventory Icons इन्वेंटरी आइकन Skill Icons कौशल आइकन + Weather Icons मौसम आइकन Attack आक्रमण Defend रक्षा Heal उपचार diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 8ba74eefcd..36d74468da 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6673,6 +6673,7 @@ axis Y Axis Y tengely Checkpoint Ellenőrzőpont Inventory Icons Leltári ikonok Skill Icons Képességikonok + Weather Icons Időjárás-ikonok Attack Támadás Defend Védelem Heal Gyógyítás @@ -7021,6 +7022,12 @@ axis Y Axis Y tengely Soft Light Wash Lágy fény lavírozás Burst Robbanás Rounded Square Lekerekített négyzet + Sun Nap + Moon Hold + Cloud Felhő + Rain Eső + Thunder Mennydörgés + Snow Hó Save Brush Library… Ecsetkönyvtár mentése… @msg `{_1}` has no brushes to apply A(z) `{_1}` nem tartalmaz alkalmazható ecsetet @msg missing `library` (see brush.libraries) hiányzik a `library` (lásd: brush.libraries) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index dc6d104d52..dc11f81e52 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6155,6 +6155,7 @@ axis Y Axis Sumbu Y Checkpoint Pos pemeriksaan Inventory Icons Ikon Inventaris Skill Icons Ikon Keahlian + Weather Icons Ikon Cuaca Attack Serang Defend Bertahan Heal Pulihkan @@ -6497,6 +6498,12 @@ axis Y Axis Sumbu Y Soft Light Wash Sapuan cahaya lembut Burst Ledakan Rounded Square Persegi bulat + Sun Matahari + Moon Bulan + Cloud Awan + Rain Hujan + Thunder Guntur + Snow Salju Save Brush Library… Simpan pustaka kuas… @msg no empty artboards to delete tidak ada artboard kosong untuk dihapus Scale Presets Preset skala diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 85e33a28c4..beaa9072f1 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6316,6 +6316,7 @@ axis Y Axis Asse Y Checkpoint Punto di controllo Inventory Icons Icone inventario Skill Icons Icone abilità + Weather Icons Icone meteo Attack Attacco Defend Difesa Heal Cura @@ -6664,6 +6665,12 @@ axis Y Axis Asse Y Soft Light Wash Acquerello luce soffusa Burst Esplosione Rounded Square Quadrato arrotondato + Sun Sole + Moon Luna + Cloud Nuvola + Rain Pioggia + Thunder Tuono + Snow Neve Bar Barra Hexagon Esagono Spectrum Spettro diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ab74989426..790ac6809f 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -6382,6 +6382,7 @@ axis Y Axis Y 軸 Checkpoint チェックポイント Inventory Icons インベントリアイコン Skill Icons スキルアイコン + Weather Icons 天気アイコン Attack 攻撃 Defend 防御 Heal 回復 @@ -6730,6 +6731,12 @@ axis Y Axis Y 軸 Soft Light Wash ソフトライトのにじみ Burst バースト Rounded Square 角丸の正方形 + Sun 太陽 + Moon 月 + Cloud 雲 + Rain 雨 + Thunder 雷 + Snow 雪 Bar バー Hexagon 六角形 Spectrum スペクトル diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 3300e81a99..df6766fb5b 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6641,6 +6641,7 @@ axis Y Axis Y ღერძი Checkpoint საკონტროლო წერტილი Inventory Icons ინვენტარის ხატულები Skill Icons უნარების ხატულები + Weather Icons ამინდის ხატულები Attack შეტევა Defend თავდაცვა Heal განკურნება @@ -6989,6 +6990,12 @@ axis Y Axis Y ღერძი Soft Light Wash რბილი სინათლის რეცხვა Burst აფეთქება Rounded Square მომრგვალებული კვადრატი + Sun მზე + Moon მთვარე + Cloud ღრუბელი + Rain წვიმა + Thunder ქუხილი + Snow თოვლი Save Brush Library… ფუნჯების ბიბლიოთეკის შენახვა… @msg `{_1}` has no brushes to apply `{_1}`-ში გამოსაყენებელი ფუნჯები არ არის @msg missing `library` (see brush.libraries) `library` აკლია (იხ. brush.libraries) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6661f1bda4..390b471275 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6277,6 +6277,7 @@ axis Y Axis Y축 Checkpoint 체크포인트 Inventory Icons 인벤토리 아이콘 Skill Icons 스킬 아이콘 + Weather Icons 날씨 아이콘 Attack 공격 Defend 방어 Heal 치유 @@ -6625,6 +6626,12 @@ axis Y Axis Y축 Soft Light Wash 소프트 라이트 번짐 Burst 폭발 Rounded Square 둥근 사각형 + Sun 해 + Moon 달 + Cloud 구름 + Rain 비 + Thunder 천둥 + Snow 눈 Bar 막대 Hexagon 육각형 Spectrum 스펙트럼 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f230e49b98..750faba3ee 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8598,6 +8598,7 @@ axis Y Axis Y-as Checkpoint Controlepunt Inventory Icons Inventarisiconen Skill Icons Vaardigheidsiconen + Weather Icons Weericonen Attack Aanval Defend Verdediging Heal Genezen @@ -8940,6 +8941,12 @@ axis Y Axis Y-as Soft Light Wash Zacht-licht-wassing Burst Uitbarsting Rounded Square Afgerond vierkant + Sun Zon + Moon Maan + Cloud Wolk + Rain Regen + Thunder Donder + Snow Sneeuw Save Brush Library… Penseelbibliotheek opslaan… @msg no empty artboards to delete geen lege tekengebieden om te verwijderen Scale Presets Schaalvoorinstellingen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index e53e3631ff..a23cd854fb 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6545,6 +6545,7 @@ axis Y Axis Oś Y Checkpoint Punkt kontrolny Inventory Icons Ikony ekwipunku Skill Icons Ikony umiejętności + Weather Icons Ikony pogody Attack Atak Defend Obrona Heal Leczenie @@ -6893,6 +6894,12 @@ axis Y Axis Oś Y Soft Light Wash Lawowanie łagodnym światłem Burst Wybuch Rounded Square Zaokrąglony kwadrat + Sun Słońce + Moon Księżyc + Cloud Chmura + Rain Deszcz + Thunder Grzmot + Snow Śnieg Spectrum Spektrum Vivid Żywe Save Brush Library… Zapisz bibliotekę pędzli… diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 3060141f27..451ba40f4c 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6605,6 +6605,7 @@ axis Y Axis Eixo Y Checkpoint Ponto de verificação Inventory Icons Ícones de inventário Skill Icons Ícones de habilidade + Weather Icons Ícones de clima Attack Ataque Defend Defesa Heal Cura @@ -6953,6 +6954,12 @@ axis Y Axis Eixo Y Soft Light Wash Aguada Luz Suave Burst Explosão Rounded Square Quadrado Arredondado + Sun Sol + Moon Lua + Cloud Nuvem + Rain Chuva + Thunder Trovão + Snow Neve Save Brush Library… Salvar Biblioteca de Pincéis… @msg `{_1}` has no brushes to apply `{_1}` não tem pincéis para aplicar @msg missing `library` (see brush.libraries) falta `library` (consulte brush.libraries) diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 6b70ef3427..0d1b09b8eb 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6301,6 +6301,7 @@ axis Y Axis Ось Y Checkpoint Контрольная точка Inventory Icons Иконки инвентаря Skill Icons Иконки навыков + Weather Icons Иконки погоды Attack Атака Defend Защита Heal Лечение @@ -6649,6 +6650,12 @@ axis Y Axis Ось Y Soft Light Wash Размывка мягким светом Burst Вспышка Rounded Square Скруглённый квадрат + Sun Солнце + Moon Луна + Cloud Облако + Rain Дождь + Thunder Гром + Snow Снег Save Brush Library… Сохранить библиотеку кистей… @msg `{_1}` has no brushes to apply В `{_1}` нет кистей для применения @msg missing `library` (see brush.libraries) не указан `library` (см. brush.libraries) diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 6734afa3f4..ec8c2b7071 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6670,6 +6670,7 @@ axis Y Axis Y-axel Checkpoint Kontrollpunkt Inventory Icons Inventarieikoner Skill Icons Färdighetsikoner + Weather Icons Väderikoner Attack Attack Defend Försvar Heal Retuschering @@ -7018,6 +7019,12 @@ axis Y Axis Y-axel Soft Light Wash Mjukt ljus-lavering Burst Utbrott Rounded Square Rundad kvadrat + Sun Sol + Moon Måne + Cloud Moln + Rain Regn + Thunder Åska + Snow Snö Save Brush Library… Spara penselbibliotek… @msg `{_1}` has no brushes to apply `{_1}` har inga penslar att använda @msg missing `library` (see brush.libraries) `library` saknas (se brush.libraries) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index e565721539..b78fb6a0c8 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -451,7 +451,7 @@ fn built_in_library_symbol_names_are_in_complete_catalogs() { .flat_map(|(_, lib)| lib.doc.symbols.iter().map(|s| s.name.clone()).collect::<Vec<_>>()) .collect(), ); - assert_eq!(names.len(), 26, "{names:?}"); + assert_eq!(names.len(), 32, "{names:?}"); let bad = lacking(&names, |c, n| c.plain(n).is_some()); assert!(bad.is_empty(), "{}", bad.join("\n")); } diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 709df200cd..2844bb1ace 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6763,6 +6763,7 @@ axis Y Axis Y ekseni Checkpoint Kontrol noktası Inventory Icons Envanter Simgeleri Skill Icons Yetenek Simgeleri + Weather Icons Hava Durumu Simgeleri Attack Saldırı Defend Savunma Heal İyileştirme @@ -7111,6 +7112,12 @@ axis Y Axis Y ekseni Soft Light Wash Yumuşak Işık Lavisi Burst Patlama Rounded Square Yuvarlatılmış Kare + Sun Güneş + Moon Ay + Cloud Bulut + Rain Yağmur + Thunder Gök Gürültüsü + Snow Kar Save Brush Library… Fırça Kitaplığını Kaydet… @msg `{_1}` has no brushes to apply `{_1}` içinde uygulanacak fırça yok @msg missing `library` (see brush.libraries) `library` eksik (bkz. brush.libraries) diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 19eeaedf1d..2e712b578a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6296,6 +6296,7 @@ axis Y Axis Вісь Y Checkpoint Контрольна точка Inventory Icons Піктограми інвентарю Skill Icons Іконки навичок + Weather Icons Іконки погоди Attack Атака Defend Захист Heal Лікування @@ -6644,6 +6645,12 @@ axis Y Axis Вісь Y Soft Light Wash Розмивка м’яким світлом Burst Спалах Rounded Square Округлений квадрат + Sun Сонце + Moon Місяць + Cloud Хмара + Rain Дощ + Thunder Грім + Snow Сніг Bar Панель Hexagon Шестикутник Spectrum Спектр diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 80fd45d546..d60d1f0f5d 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6297,6 +6297,7 @@ axis Y Axis Trục Y Checkpoint Điểm kiểm tra Inventory Icons Biểu tượng túi đồ Skill Icons Biểu tượng kỹ năng + Weather Icons Biểu tượng thời tiết Attack Tấn công Defend Phòng thủ Heal Hồi máu @@ -6645,6 +6646,12 @@ axis Y Axis Trục Y Soft Light Wash Loang ánh sáng mềm Burst Bùng nổ Rounded Square Hình vuông bo góc + Sun Mặt trời + Moon Mặt trăng + Cloud Mây + Rain Mưa + Thunder Sấm + Snow Tuyết Bar Thanh Hexagon Lục giác Spectrum Quang phổ diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 0e9f3a85d4..5b99b377bf 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6529,6 +6529,7 @@ axis Y Axis Y 轴 Checkpoint 检查点 Inventory Icons 物品栏图标 Skill Icons 技能图标 + Weather Icons 天气图标 Attack 攻击 Defend 防御 Heal 治疗 @@ -6877,6 +6878,12 @@ axis Y Axis Y 轴 Soft Light Wash 柔光晕染 Burst 爆发 Rounded Square 圆角正方形 + Sun 太阳 + Moon 月亮 + Cloud 云 + Rain 雨 + Thunder 雷 + Snow 雪 Bar 条形 Hexagon 六边形 Triangle 三角 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 84b6ea8d74..765a0c53ef 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6336,6 +6336,7 @@ axis Y Axis Y 軸 Checkpoint 檢查點 Inventory Icons 物品欄圖示 Skill Icons 技能圖示 + Weather Icons 天氣圖示 Attack 攻擊 Defend 防禦 Heal 治療 @@ -6684,6 +6685,12 @@ axis Y Axis Y 軸 Soft Light Wash 柔光暈染 Burst 爆發 Rounded Square 圓角正方形 + Sun 太陽 + Moon 月亮 + Cloud 雲 + Rain 雨 + Thunder 雷 + Snow 雪 Bar 長條 Hexagon 六邊形 Spectrum 光譜 From 4a7acfe0eec6d31aeb09d81c1b4327f4e813f1a8 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 08:25:58 -0800 Subject: [PATCH 028/247] Color Wheel: color vision chips show hex as the Color panel does - The chips report and show their hex value as the Color panel's hex field writes it (828282), not as #828282. - The saved Show Color Vision Preview setting reads through the Color panel's existing reader (`deserialize_rgb_percent`) instead of a copy. - The key test moves the keyboard focus to each chip with Tab before it presses Enter and Space. - A test checks that `{"view": "box", "channel": "red", "vision": 1}` returns an error and leaves the view and the channel unchanged. - docs/mcp.md says the command returns `{view, channel, vision}` in one place, and that `null` keeps the setting. - The module doc says the vision setting is kept with the preferences. --- crates/ui-egui/src/panels/color_wheel.rs | 26 +++++----- .../src/panels/tests_color_wheel_vision.rs | 47 ++++++++++++------- crates/ui-egui/src/state.rs | 3 +- docs/mcp.md | 7 ++- 4 files changed, 48 insertions(+), 35 deletions(-) diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index b66f9c8e38..bbc2b588c5 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -10,12 +10,15 @@ //! The panel menu's Box View puts a box in the wheel's place: a color field with a vertical //! channel strip at its right, for the channel picked under Box Channel (Hue, Saturation, //! Brightness, Red, Green or Blue). The field shows the other two components on the Color -//! Picker's axes. The view and the channel are kept with the preferences (`ui.colorWheel`). +//! Picker's axes. //! //! Panel menu › Show Color Vision Preview adds a row under the wheel or the box with the color as //! simulated for protanopia, deuteranopia and tritanopia, through the simulations View › Proof //! Setup uses, and for achromatopsia as the gray with the color's CIE L*. The chips only show the //! simulation. +//! +//! The view, the channel and Show Color Vision Preview are kept with the preferences +//! (`ui.colorWheel`). use egui::{Rect, Sense, Stroke, StrokeKind, Ui, UiBuilder, vec2}; use serde::{Deserialize, Serialize}; @@ -73,15 +76,12 @@ pub struct Settings { pub view: View, #[serde(serialize_with = "serialize_channel", deserialize_with = "deserialize_channel")] pub channel: Channel, - /// Show Color Vision Preview: the row of simulated colors under the wheel or the box. - #[serde(deserialize_with = "deserialize_flag")] + /// Show Color Vision Preview: the row of simulated colors under the wheel or the box. A saved + /// `true` shows the row and any other value hides it. + #[serde(deserialize_with = "crate::panels::color::deserialize_rgb_percent")] pub vision: bool, } -fn deserialize_flag<'de, D: serde::Deserializer<'de>>(d: D) -> Result<bool, D::Error> { - Ok(<Value as Deserialize>::deserialize(d)?.as_bool().unwrap_or_default()) -} - fn deserialize_view<'de, D: serde::Deserializer<'de>>(d: D) -> Result<View, D::Error> { let v = <Value as Deserialize>::deserialize(d)?; Ok(v.as_str().and_then(View::parse).unwrap_or_default()) @@ -104,8 +104,9 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Se } /// `ui.colorWheel {view?, channel?, vision?}`: show the wheel or the box, pick the box's channel, -/// and show or hide the color vision row. Keys left out keep their values; params that are not an -/// object, another key or a value off the list are an error and change nothing. → the settings. +/// and show or hide the color vision row. Keys left out or null keep their values; params that are +/// not an object, another key or a value off the list are an error and change nothing. → the +/// settings. pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> { const KEYS: [&str; 3] = ["view", "channel", "vision"]; match p { @@ -252,15 +253,16 @@ pub(crate) fn bytes(rgb: [f32; 3]) -> [u8; 3] { rgb.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8) } -/// `#rrggbb` of 0 to 255 values. +/// The hex text of 0 to 255 values, in the form of the Color panel's hex field (`E67828`). pub(crate) fn hex([r, g, b]: [u8; 3]) -> String { - format!("#{r:02x}{g:02x}{b:02x}") + format!("{r:02X}{g:02X}{b:02X}") } /// The Show Color Vision Preview row: four chips across the panel with `color` as each color /// vision deficiency shows it. Each chip takes the keyboard focus and reports its name and, with a /// solid color, its hex value as its value to screen readers; its tooltip shows both. A click or a -/// key on a chip does nothing. With no solid color the chips are empty and carry only their names. +/// key on a chip does nothing. With no solid color the chips are empty and keep their names in the tooltip and for screen +/// readers. fn vision_row(ui: &mut Ui, cms: &Cms, color: Option<&Color>) { let t = Tokens::get(ui.ctx()); let colors = color.map(|c| vision_colors(cms, c)); diff --git a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs index 818bb49650..5c73496642 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs @@ -62,7 +62,7 @@ fn painted(h: &Harness<'static, VectorcraftApp>, cell: Rect) -> Option<Color32> } fn color32(hex: &str) -> Color32 { - Color32::from_hex(hex).expect("a #rrggbb value") + Color32::from_hex(&format!("#{hex}")).expect("an RRGGBB value") } /// The protanopia, deuteranopia and tritanopia chips show the fill as View › Proof Setup's @@ -81,18 +81,18 @@ fn the_chips_show_the_proof_setup_simulations_of_the_fill() { } } -/// The achromatopsia chip of a red fill is the gray with red's CIE L* (D50, about 54.29: #828282), +/// The achromatopsia chip of a red fill is the gray with red's CIE L* (D50, about 54.29: 828282), /// and the simulations of a pure red differ from it and from each other. #[test] fn the_achromatopsia_chip_is_the_gray_of_the_colors_lightness() { let cms = cms::active(); let [p, d, t, a] = vision_colors(&cms, &Color::rgb(1.0, 0.0, 0.0)); - assert_eq!(hex(a), "#828282"); + assert_eq!(hex(a), "828282"); assert_ne!(hex(p), hex(d)); assert_ne!(hex(t), hex(a)); let h = harness(app(json!("#ff0000"))); - assert_eq!(value(&h, "Achromatopsia").as_deref(), Some("#828282")); - assert_eq!(painted(&h, h.get_by_label("Achromatopsia").rect()), Some(color32("#828282"))); + assert_eq!(value(&h, "Achromatopsia").as_deref(), Some("828282")); + assert_eq!(painted(&h, h.get_by_label("Achromatopsia").rect()), Some(color32("828282"))); } /// A gray fill shows as the same gray in every chip. @@ -139,18 +139,14 @@ fn the_chips_take_the_focus_and_report_their_names_and_values() { for name in NAMES { let node = h.get_by_label(name); assert_eq!(node.accesskit_node().role(), egui::accesskit::Role::Image, "{name}"); - assert!(node.value().is_some_and(|v| v.starts_with('#') && v.len() == 7), "{name}: {:?}", node.value()); + assert!( + node.value().is_some_and(|v| v.len() == 6 && v.bytes().all(|b| b.is_ascii_digit() || b.is_ascii_uppercase())), + "{name}: {:?}", + node.value() + ); assert!(!node.accesskit_node().is_disabled(), "{name}"); } - // Tab stops on the panel's other controls first. - for _ in 0..40 { - if h.get_by_label(NAMES[0]).accesskit_node().is_focused() { - break; - } - h.key_press(Key::Tab); - h.run_steps(1); - } - assert!(h.get_by_label(NAMES[0]).accesskit_node().is_focused(), "Tab reaches {}", NAMES[0]); + tab_to(&mut h, NAMES[0]); for name in &NAMES[1..] { h.key_press(Key::Tab); h.run_steps(1); @@ -158,6 +154,19 @@ fn the_chips_take_the_focus_and_report_their_names_and_values() { } } +/// Press Tab until the chip `name` has the keyboard focus. Tab stops on the panel's other controls +/// first. +fn tab_to(h: &mut Harness<'static, VectorcraftApp>, name: &str) { + for _ in 0..40 { + if h.get_by_label(name).accesskit_node().is_focused() { + break; + } + h.key_press(Key::Tab); + h.run_steps(1); + } + assert!(h.get_by_label(name).accesskit_node().is_focused(), "Tab reaches {name}"); +} + /// A click on a chip, and Enter or Space on a focused chip, leave the fill and the undo history as /// they were. #[test] @@ -167,6 +176,7 @@ fn a_click_or_a_key_on_a_chip_applies_nothing() { for name in NAMES { h.get_by_label(name).click(); h.run_steps(2); + tab_to(&mut h, name); for key in [Key::Enter, Key::Space] { h.key_press_modifiers(Modifiers::NONE, key); h.run_steps(1); @@ -209,8 +219,9 @@ fn the_panel_menu_turns_the_row_on_and_off() { } /// `ui.colorWheel` sets the keys given and reads them with `{}`, and `ui.inspect` reports them as -/// `ui.color_wheel`. A value that is not a bool, params that are not an object and another key -/// are errors that change nothing. +/// `ui.color_wheel`. A `vision` value other than true, false or null, params that are not an object +/// and another key are errors that change nothing, the view and the channel given with them +/// included. #[test] fn ui_color_wheel_sets_and_reads_the_settings() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); @@ -218,6 +229,8 @@ fn ui_color_wheel_sets_and_reads_the_settings() { assert_eq!(app.run("ui.colorWheel", json!({"vision": true})).unwrap(), json!({"view": "wheel", "channel": "hue", "vision": true})); assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_wheel"]["vision"], true); assert_eq!(app.run("ui.colorWheel", json!({"vision": "no"})).unwrap_err(), "`vision` must be true or false"); + assert_eq!(app.run("ui.colorWheel", json!({"view": "box", "channel": "red", "vision": 1})).unwrap_err(), "`vision` must be true or false"); + assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue", "vision": true})); assert_eq!(app.run("ui.colorWheel", json!("junk")).unwrap_err(), "the params must be an object, not \"junk\""); assert_eq!(app.run("ui.colorWheel", json!(5)).unwrap_err(), "the params must be an object, not 5"); assert_eq!( diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 959f20395f..4705876ece 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -735,8 +735,7 @@ pub struct UiState { #[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")] pub color_rgb_percent: bool, /// Color Wheel panel: the wheel or the box, the box's channel, and the color vision row - /// (`ui.colorWheel`, - /// [`crate::panels::color_wheel::deserialize_settings`]). + /// (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]). #[serde(default, deserialize_with = "crate::panels::color_wheel::deserialize_settings")] pub color_wheel: crate::panels::color_wheel::Settings, /// Swatches panel: Show Recent Colors in its panel menu, which draws the panel's Recent Colors diff --git a/docs/mcp.md b/docs/mcp.md index 927d37be23..89a10d0a07 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -623,14 +623,13 @@ and answers true when the fields show in percent. `ui.colorWheel {"view": "box", "channel": "red"}` shows the Color Wheel panel's box (a color field with the channel's strip at its right) in place of the wheel, as the panel menu's Box View and Box Channel do, and `"view": "wheel"` shows the wheel again. Keys left out keep their values. Params that are not an object, another key or a value off -the list return an error and change nothing. The command returns `{view, channel}`, and both settings are kept with -the preferences. +the list return an error and change nothing. The command returns `{view, channel, vision}`, and the settings are +kept with the preferences. `ui.colorWheel {"vision": true}` turns on the Color Wheel panel's Show Color Vision Preview, as its panel menu does: a row of four chips under the wheel or the box shows the current color through the protanopia, deuteranopia and tritanopia simulations of `view.proofSetup`, and for achromatopsia as the gray with the color's CIE L*. Each chip reports its name and hex value to screen readers, and a click on a chip does not apply its color. `false` -hides the row. A value that is not a bool returns an error and changes nothing. The command returns -`{view, channel, vision}`, and the setting is kept with the preferences. +hides the row, and `null` keeps the setting. Any other value returns an error and changes nothing. In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's screen color sampler and returns `null` before a color is picked: the system's sampler on macOS, the XDG desktop From fb1c4ec562d752b93e91b8f99ecd90a530f0b683 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 11:25:55 -0800 Subject: [PATCH 029/247] Edit: Find and Replace steps through matches in a dialog that stays open Edit > Find and Replace... opens a dialog of its own with Find and Replace With fields, Match Case, Find Whole Word, Search Backwards, Check Hidden Layers and Check Locked Layers, and Find, Replace, Replace & Find, Replace All and Done. Find shows the match in its line of text with its place among the matches and selects its type object. edit.findNext returns the match (id, start, end, index, count, selected) and takes backwards, hiddenLayers, lockedLayers and from. The new edit.replaceMatch replaces one match as one undo step. edit.findReplace takes the two layer switches and reports how many matches it replaced. Ruby after a replaced match moves with the text. Edit > Find Next goes on from the dialog's last search in the same document, and is no longer offered as an action step. --- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/typemenu.rs | 262 +++++++++--- .../engine/src/tests/ids_without_selection.rs | 2 +- crates/engine/src/tests/menucmds.rs | 183 ++++++++- crates/mcp/src/ui_catalog.rs | 7 +- crates/ui-egui/src/dialogs.rs | 2 + crates/ui-egui/src/dialogs/find_replace.rs | 358 +++++++++++++++++ .../ui-egui/src/dialogs/find_replace/tests.rs | 377 ++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 10 + crates/ui-egui/src/i18n/bs.tsv | 10 + crates/ui-egui/src/i18n/ca.tsv | 13 + crates/ui-egui/src/i18n/cs.tsv | 13 + crates/ui-egui/src/i18n/da.tsv | 10 + crates/ui-egui/src/i18n/de.tsv | 13 + crates/ui-egui/src/i18n/el.tsv | 13 + crates/ui-egui/src/i18n/es.tsv | 13 + crates/ui-egui/src/i18n/fi.tsv | 13 + crates/ui-egui/src/i18n/fr.tsv | 13 + crates/ui-egui/src/i18n/hi.tsv | 13 + crates/ui-egui/src/i18n/hu.tsv | 13 + crates/ui-egui/src/i18n/id.tsv | 10 + crates/ui-egui/src/i18n/it.tsv | 13 + crates/ui-egui/src/i18n/ja.tsv | 13 + crates/ui-egui/src/i18n/ka.tsv | 13 + crates/ui-egui/src/i18n/ko.tsv | 13 + crates/ui-egui/src/i18n/nl.tsv | 13 + crates/ui-egui/src/i18n/pl.tsv | 13 + crates/ui-egui/src/i18n/pt-br.tsv | 13 + crates/ui-egui/src/i18n/ru.tsv | 13 + crates/ui-egui/src/i18n/sv.tsv | 13 + crates/ui-egui/src/i18n/tr.tsv | 13 + crates/ui-egui/src/i18n/uk.tsv | 13 + crates/ui-egui/src/i18n/vi.tsv | 13 + crates/ui-egui/src/i18n/zh-hans.tsv | 13 + crates/ui-egui/src/i18n/zh-hant.tsv | 13 + crates/ui-egui/src/menus/entries.rs | 7 +- crates/ui-egui/src/menus/invoke.rs | 12 + crates/ui-egui/src/menus/run.rs | 4 + crates/ui-egui/src/menus/tree.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 7 +- crates/ui-egui/src/palette.rs | 2 +- crates/ui-egui/src/state.rs | 6 + docs/mcp.md | 46 +++ docs/target-app-parity.md | 1 + 44 files changed, 1542 insertions(+), 76 deletions(-) create mode 100644 crates/ui-egui/src/dialogs/find_replace.rs create mode 100644 crates/ui-egui/src/dialogs/find_replace/tests.rs diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 5329f23331..f11724dc1e 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -165,6 +165,7 @@ pub(super) const ALLOWED: &[&str] = &[ "edit.duplicate", "edit.findNext", "edit.findReplace", + "edit.replaceMatch", "effect.apply", "effect.deferredStatus", "effect.duplicate", diff --git a/crates/engine/src/cmd/typemenu.rs b/crates/engine/src/cmd/typemenu.rs index c140ba6572..0797991bf2 100644 --- a/crates/engine/src/cmd/typemenu.rs +++ b/crates/engine/src/cmd/typemenu.rs @@ -10,8 +10,8 @@ use super::object::choice; use super::threads::ThreadIndex; use super::typecmd::{area_text, block_gaps, needed_room, refresh_bounds}; use super::{ - CommandSpec, EngineError, Result, Session, bad, checked_ids_param, cmd, find_command, has_clipboard, has_doc, has_selection, number_or, - switch_or, targets, text_param, + CommandSpec, EngineError, Result, Session, bad, checked_ids_param, cmd, find_command, has_clipboard, has_doc, has_selection, index_opt, + number_or, object_param, switch_or, targets, text_param, }; pub fn specs() -> Vec<CommandSpec> { @@ -120,7 +120,7 @@ pub fn specs() -> Vec<CommandSpec> { "Find and Replace…", ["Edit"], None, - "{find, replace?: \"\", matchCase?: false, wholeWord?: false, ids?} replace in every text object (or ids) → {count}. Matches never span style runs.", + "{find, replace?: \"\", matchCase?: false, wholeWord?: false, hiddenLayers?: false, lockedLayers?: false, ids?} replace every match in the type the search reaches (or in ids, whatever their layers), as one undo step → {count (every match), replaced (the matches that did not already read as `replace`)}. The search reaches visible, unlocked type on visible, unlocked layers, off locked artboards; hiddenLayers adds the type of hidden layers and sublayers and lockedLayers that of locked ones, while a hidden or locked object or group keeps its type out. Matches never span style runs. When nothing matches, or every match already reads as `replace`, nothing changes and no undo step is recorded.", has_doc, find_replace ), @@ -129,10 +129,19 @@ pub fn specs() -> Vec<CommandSpec> { "Find Next", ["Edit"], None, - "{find, matchCase?, wholeWord?} select the next text object (after the selected one, wrapping) containing `find` → {id|null}", + "{find, matchCase?: false, wholeWord?: false, backwards?: false, hiddenLayers?: false, lockedLayers?: false, from?: {id, start, end} (a match this command returned, or the range edit.replaceMatch returned)} find the next match of `find` in the type edit.findReplace reaches and select its type object → {id, start, end (the match's bytes in the object's plain text), index (its place among all the matches, from 1), count, selected} or {id: null, count: 0}. The search visits type objects from the top of the stacking order down and each object's matches in reading order; backwards visits the objects from the bottom up and each object's matches from the last. It goes on after `from` and, past the last match, starts again at the first. Without `from` it goes on after the first selected type object, and with no type selected it starts at the first match. A match on a hidden or locked layer is returned with selected false and the selection stays as it is. Nothing is recorded for undo.", has_doc, find_next ), + cmd!( + "edit.replaceMatch", + "Replace", + [], + None, + "{find, replace?: \"\", matchCase?: false, wholeWord?: false, id, start, end} replace one match of `find`, the bytes start..end of type object id as edit.findNext returns them, with `replace`, as one undo step → {id, start, end (the replacement's bytes; pass them to edit.findNext as `from` to go on), replaced}. Bytes that are no match of `find` are refused. When the match already reads as `replace`, nothing changes, no undo step is recorded and replaced is false.", + has_doc, + replace_one + ), cmd!( "edit.pasteWithoutFormatting", "Paste without Formatting", @@ -1305,14 +1314,9 @@ fn is_word(c: char) -> bool { c.is_alphanumeric() || c == '_' } -/// Byte ranges of `needle` in `hay`. -pub(crate) fn find_all(hay: &str, needle: &str, match_case: bool, whole_word: bool) -> Vec<(usize, usize)> { - find_all_between(hay, needle, match_case, whole_word, None, None) -} - -/// [`find_all`] in run `i` of `runs`: a whole word looks past the run's ends at the characters -/// next to it, so a change of style inside a word is not a word boundary (#5901). Matches stay -/// inside the run. +/// Byte ranges of `needle` in run `i` of `runs`: a whole word looks past the run's ends at the +/// characters next to it, so a change of style inside a word is not a word boundary (#5901). +/// Matches stay inside the run. fn find_in_run(runs: &[TextRun], i: usize, needle: &str, match_case: bool, whole_word: bool) -> Vec<(usize, usize)> { let Some(run) = runs.get(i) else { return vec![] }; let before = runs.get(..i).and_then(|r| r.iter().rev().find_map(|r| r.text.chars().next_back())); @@ -1320,8 +1324,8 @@ fn find_in_run(runs: &[TextRun], i: usize, needle: &str, match_case: bool, whole find_all_between(&run.text, needle, match_case, whole_word, before, after) } -/// [`find_all`], with `before` and `after` the characters on either side of `hay` (none at the -/// text's ends), which a whole word must not touch either. +/// Byte ranges of `needle` in `hay`, with `before` and `after` the characters on either side of +/// `hay` (none at the text's ends), which a whole word must not touch either. fn find_all_between(hay: &str, needle: &str, match_case: bool, whole_word: bool, before: Option<char>, after: Option<char>) -> Vec<(usize, usize)> { let nc: Vec<char> = needle.chars().collect(); if nc.is_empty() { @@ -1353,102 +1357,232 @@ fn find_all_between(hay: &str, needle: &str, match_case: bool, whole_word: bool, /// The visible, unlocked type objects of visible, unlocked layers, off locked artboards, in paint /// order: the text Find and Replace and Check Spelling go through. pub(crate) fn all_texts(d: &Document) -> Vec<NodeId> { - fn visit(n: &Node, locks: &LockedArtboards<'_>, v: &mut Vec<NodeId>) { - if !n.visible || n.locked { + searched_texts(d, false, false) +} + +/// [`all_texts`], with the type of hidden layers (`hidden_layers`) and of locked layers +/// (`locked_layers`) as well, as Check Hidden Layers and Check Locked Layers of Find and Replace +/// ask. The switches are about layers and sublayers: a hidden or locked object or group keeps its +/// type out, and so does a locked artboard. +fn searched_texts(d: &Document, hidden_layers: bool, locked_layers: bool) -> Vec<NodeId> { + fn visit(n: &Node, locks: &LockedArtboards<'_>, layers: (bool, bool), v: &mut Vec<NodeId>) { + let layer = matches!(n.kind, NodeKind::Layer { .. }); + if (!n.visible && !(layer && layers.0)) || (n.locked && !(layer && layers.1)) { return; } if matches!(n.kind, NodeKind::Text(_)) && !locks.holds_id(n.id) { v.push(n.id); } for c in n.children().into_iter().flatten() { - visit(c, locks, v); + visit(c, locks, layers, v); } } let mut v = vec![]; let locks = d.locked_artboards(); for l in &d.layers { - visit(l, &locks, &mut v); + visit(l, &locks, (hidden_layers, locked_layers), &mut v); } v } +/// What Find and Replace looks for: the text, Match Case and Find Whole Word. +struct Query { + find: String, + match_case: bool, + whole_word: bool, +} + +impl Query { + /// The `find`, `matchCase` and `wholeWord` params of command `c`. An empty or missing `find` + /// is an error. + fn of(p: &Value, c: &str) -> Result<Self> { + let find = text_param(p, "find", c)?.filter(|f| !f.is_empty()).ok_or_else(|| bad(c, "missing `find`"))?.to_string(); + Ok(Self { find, match_case: switch_or(p, "matchCase", false, c)?, whole_word: switch_or(p, "wholeWord", false, c)? }) + } + + /// The matches in `t`, in reading order, each as (run, start, end) with `start..end` the bytes + /// of the match in the object's plain text. A match stays inside one style run, and an inline + /// graphic is art, not characters to find. + fn matches(&self, t: &TextObject) -> Vec<(usize, usize, usize)> { + let mut hits = vec![]; + let mut base = 0; + for (ri, r) in t.runs.iter().enumerate() { + if r.inline.is_none() { + hits.extend( + find_in_run(&t.runs, ri, &self.find, self.match_case, self.whole_word).into_iter().map(|(a, b)| (ri, base + a, base + b)), + ); + } + base += r.text.len(); + } + hits + } +} + +/// Replace bytes `start..end` of the plain text of `t`, which lie inside run `run`, with `rep`. +/// The paragraph styles and the ruby follow the edit, as `text.editRange` moves them. The caller +/// refreshes the bounds. +fn replace_match(t: &mut TextObject, run: usize, start: usize, end: usize, rep: &str) { + let base: usize = t.runs.iter().take(run).map(|r| r.text.len()).sum(); + let (Some(a), Some(b)) = (start.checked_sub(base), end.checked_sub(base)) else { return }; + if !t.runs.get(run).is_some_and(|r| a <= b && r.text.is_char_boundary(a) && r.text.is_char_boundary(b)) { + return; + } + t.splice_paras(start, end, rep); + if let Some(r) = t.runs.get_mut(run) { + r.text.replace_range(a..b, rep); + } + t.ruby_after_replace(start, end, rep.len()); +} + fn find_replace(s: &mut Session, p: &Value) -> Result<Value> { const C: &str = "edit.findReplace"; - let find = text_param(p, "find", C)?.filter(|f| !f.is_empty()).ok_or_else(|| bad(C, "missing `find`"))?.to_string(); + let q = Query::of(p, C)?; let rep = text_param(p, "replace", C)?.unwrap_or("").to_string(); - let (mc, ww) = (switch_or(p, "matchCase", false, C)?, switch_or(p, "wholeWord", false, C)?); + let (hidden, locked) = (switch_or(p, "hiddenLayers", false, C)?, switch_or(p, "lockedLayers", false, C)?); let ids = match p.get("ids").filter(|v| !v.is_null()) { Some(_) => text_ids(&s.doc()?.doc, &checked_ids_param(s, p, "ids", C)?), - None => all_texts(&s.doc()?.doc), + None => searched_texts(&s.doc()?.doc, hidden, locked), }; let st = s.doc()?; - let total: usize = ids + // Every match, and the matches that do not already read as the replacement. + let (total, replaced) = ids .iter() .filter_map(|id| match &st.doc.node(*id)?.kind { - NodeKind::Text(t) => Some((0..t.runs.len()).map(|i| find_in_run(&t.runs, i, &find, mc, ww).len()).sum::<usize>()), + NodeKind::Text(t) => { + let plain = t.plain_text(); + let hits = q.matches(t); + Some((hits.len(), hits.iter().filter(|(_, a, b)| plain.get(*a..*b) != Some(rep.as_str())).count())) + } _ => None, }) - .sum(); - if total == 0 { - return Ok(json!({ "count": 0 })); + .fold((0, 0), |(n, r), (hn, hr)| (n + hn, r + hr)); + if replaced == 0 { + return Ok(json!({ "count": total, "replaced": 0 })); } super::overprint::edit_counted(s, "Replace", |d| { let mut changed = 0; for id in &ids { let Some(NodeKind::Text(t)) = d.node_mut(*id).map(|n| &mut n.kind) else { continue }; - // Matches as (run, start, end) with offsets inside the run. Inline graphics are art, not - // characters to rewrite. - let mut hits = vec![]; - let mut base = 0; - for (ri, r) in t.runs.iter().enumerate() { - if r.inline.is_none() { - for (a, b) in find_in_run(&t.runs, ri, &find, mc, ww) { - if r.text.get(a..b) != Some(rep.as_str()) { - hits.push((ri, base + a, base + b, a, b)); - } - } - } - base += r.text.len(); - } + let plain = t.plain_text(); + let hits: Vec<_> = q.matches(t).into_iter().filter(|(_, a, b)| plain.get(*a..*b) != Some(rep.as_str())).collect(); if hits.is_empty() { continue; } - // Last match first, so the offsets of earlier ones stay valid. The paragraph styles follow - // each edit, as `text.editRange` does. - for (ri, ta, tb, a, b) in hits.into_iter().rev() { - t.splice_paras(ta, tb, &rep); - if let Some(r) = t.runs.get_mut(ri) { - r.text.replace_range(a..b, &rep); - } + // Last match first, so the offsets of earlier ones stay valid. + for (ri, a, b) in hits.into_iter().rev() { + replace_match(t, ri, a, b, &rep); } changed += 1; refresh_bounds(t); } Ok(changed) })?; - Ok(json!({ "count": total })) + Ok(json!({ "count": total, "replaced": replaced })) +} + +/// A match of Find and Replace: bytes `start..end` of the plain text of type object `id`. +#[derive(Clone, Copy)] +struct Match { + id: NodeId, + start: usize, + end: usize, +} + +impl Match { + /// The `id`, `start` and `end` that `p` gives for a match, under command `c`: an object id and + /// two byte offsets, put in order as `text.editRange` orders its own. + fn of(p: &Value, c: &str) -> Result<Self> { + let whole = |key: &str| index_opt(p, key, c)?.ok_or_else(|| bad(c, format!("missing `{key}`"))); + let id = object_param(p, "id", c)?.ok_or_else(|| bad(c, "missing `id`"))?; + let (start, end) = (whole("start")?, whole("end")?); + Ok(Self { id, start: start.min(end), end: start.max(end) }) + } } fn find_next(s: &mut Session, p: &Value) -> Result<Value> { const C: &str = "edit.findNext"; - let find = text_param(p, "find", C)?.filter(|f| !f.is_empty()).ok_or_else(|| bad(C, "missing `find`"))?.to_string(); - let (mc, ww) = (switch_or(p, "matchCase", false, C)?, switch_or(p, "wholeWord", false, C)?); + let q = Query::of(p, C)?; + let backwards = switch_or(p, "backwards", false, C)?; + let (hidden, locked) = (switch_or(p, "hiddenLayers", false, C)?, switch_or(p, "lockedLayers", false, C)?); + // A `from` that is no object gives no `id`, and is refused as one without it. + let from = match p.get("from") { + None | Some(Value::Null) => None, + Some(v) => Some(Match::of(v, C)?), + }; let st = s.doc()?; - let all = all_texts(&st.doc); - let cur = st.selection.objects.first().and_then(|id| all.iter().position(|x| x == id)); - let n = all.len(); - let start = cur.map(|c| c + 1).unwrap_or(0); - let hit = (0..n).map(|k| all[(start + k) % n.max(1)]).find(|id| match st.doc.node(*id).map(|n| &n.kind) { - Some(NodeKind::Text(t)) => !find_all(&t.plain_text(), &find, mc, ww).is_empty(), - _ => false, - }); - match hit { - Some(id) => { - s.select(|_, sel| sel.set([id]))?; - Ok(json!({ "id": id.0 })) - } - None => Ok(json!({ "id": null })), + // The objects in the order the search visits them: from the top of the stacking order down, + // or with Search Backwards from the bottom up. + let mut order = searched_texts(&st.doc, hidden, locked); + if !backwards { + order.reverse(); } + // Every match in that order as (object's place, match): inside an object in reading order, or + // with Search Backwards from its end. + let mut all: Vec<(usize, Match)> = vec![]; + for (place, id) in order.iter().enumerate() { + let Some(NodeKind::Text(t)) = st.doc.node(*id).map(|n| &n.kind) else { continue }; + let mut hits = q.matches(t); + if backwards { + hits.reverse(); + } + all.extend(hits.into_iter().map(|(_, start, end)| (place, Match { id: *id, start, end }))); + } + if all.is_empty() { + return Ok(json!({ "id": null, "count": 0 })); + } + // The search goes on from `from`, or from the whole of the first selected type object it + // visits, so that the same call again reaches the next object. From anywhere else it starts + // at the first match. + let from = from.or_else(|| { + st.selection.objects.iter().filter(|id| order.contains(id)).find_map(|id| match &st.doc.node(*id)?.kind { + NodeKind::Text(t) => Some(Match { id: *id, start: 0, end: t.runs.iter().map(|r| r.text.len()).sum() }), + _ => None, + }) + }); + let after = |(place, m): &(usize, Match), at: usize, f: &Match| { + *place > at || (*place == at && if backwards { m.end <= f.start } else { m.start >= f.end }) + }; + let k = from + .and_then(|f| order.iter().position(|id| *id == f.id).map(|at| (at, f))) + .and_then(|(at, f)| all.iter().position(|hit| after(hit, at, &f))) + .unwrap_or(0); + let Some((_, m)) = all.get(k).copied() else { return Ok(json!({ "id": null, "count": 0 })) }; + let count = all.len(); + // Type that a selection tool can't reach (on a hidden or locked layer) is found without being + // selected. + let selected = all_texts(&st.doc).contains(&m.id); + if selected && st.selection.objects != [m.id] { + s.select(|_, sel| sel.set([m.id]))?; + } + let index = if backwards { count - k } else { k + 1 }; + Ok(json!({ "id": m.id.0, "start": m.start, "end": m.end, "index": index, "count": count, "selected": selected })) +} + +fn replace_one(s: &mut Session, p: &Value) -> Result<Value> { + const C: &str = "edit.replaceMatch"; + let q = Query::of(p, C)?; + let rep = text_param(p, "replace", C)?.unwrap_or("").to_string(); + let m = Match::of(p, C)?; + let st = s.doc()?; + let t = match st.doc.node(m.id).map(|n| &n.kind) { + Some(NodeKind::Text(t)) => t, + Some(_) => return Err(bad(C, format!("node {} is not text", m.id.0))), + None => return Err(EngineError::NoNode(m.id)), + }; + let Some((run, ..)) = q.matches(t).into_iter().find(|(_, a, b)| (*a, *b) == (m.start, m.end)) else { + return Err(bad(C, format!("no match of `find` at bytes {}..{} of object {}", m.start, m.end, m.id.0))); + }; + let end = m.start + rep.len(); + if t.plain_text().get(m.start..m.end) == Some(rep.as_str()) { + return Ok(json!({ "id": m.id.0, "start": m.start, "end": end, "replaced": false })); + } + s.edit("Replace", |d, _| { + let Some(NodeKind::Text(t)) = d.node_mut(m.id).map(|n| &mut n.kind) else { return Err(EngineError::NoNode(m.id)) }; + replace_match(t, run, m.start, m.end, &rep); + refresh_bounds(t); + Ok(()) + })?; + Ok(json!({ "id": m.id.0, "start": m.start, "end": end, "replaced": true })) } // ---------- Paste without Formatting ---------- diff --git a/crates/engine/src/tests/ids_without_selection.rs b/crates/engine/src/tests/ids_without_selection.rs index b274e7956f..9a48655468 100644 --- a/crates/engine/src/tests/ids_without_selection.rs +++ b/crates/engine/src/tests/ids_without_selection.rs @@ -377,7 +377,7 @@ fn ids_cases(d: u64) -> Vec<(&'static str, &'static str, serde_json::Value, Unse ("addon.color.filter", "ids", json!({"effect": "addon.color.invert"}), Selected), ("addon.color.applyNearestSwatch", "ids", json!({}), Selected), ("edit.colors.overprintBlack", "ids", json!({}), Selected), - ("edit.findReplace", "ids", json!({"find": "A", "replace": "B"}), Gives(json!({"count": 1}))), + ("edit.findReplace", "ids", json!({"find": "A", "replace": "B"}), Gives(json!({"count": 1, "replaced": 1}))), ("layer.highlight", "ids", json!({}), Fails("missing ids")), ("layer.move", "ids", json!({ "target": d }), Fails("missing ids")), ("library.add", "ids", json!({"kind": "graphic"}), Selected), diff --git a/crates/engine/src/tests/menucmds.rs b/crates/engine/src/tests/menucmds.rs index abb0bf31eb..939f36269c 100644 --- a/crates/engine/src/tests/menucmds.rs +++ b/crates/engine/src/tests/menucmds.rs @@ -2140,7 +2140,8 @@ fn find_and_replace_leaves_type_on_a_locked_artboard() { /// Find and Replace that replaces each match with the text it is (`CAT` found in `cat`, ignoring /// case, and replaced by `cat`) records no undo step: the step to redo stays and the document stays -/// unmodified. It still replies with the count. A replacement that changes the text is one undo step. +/// unmodified. It still replies with the count, and with no match replaced. A replacement that +/// changes the text is one undo step. #[test] fn find_and_replace_that_changes_nothing_records_no_undo_step() { let mut s = session(); @@ -2148,9 +2149,9 @@ fn find_and_replace_that_changes_nothing_records_no_undo_step() { select_with_a_step_to_redo(&mut s, &[a]); let before = history(&s); assert_eq!((before.1, before.2), (1, false), "a step to redo, and nothing unsaved"); - assert_eq!(s.execute("edit.findReplace", &json!({"find": "CAT", "replace": "cat"})).unwrap(), json!({"count": 2})); + assert_eq!(s.execute("edit.findReplace", &json!({"find": "CAT", "replace": "cat"})).unwrap(), json!({"count": 2, "replaced": 0})); assert_eq!((history(&s), plain(&s, a)), (before, "cat cat".to_string())); - assert_eq!(s.execute("edit.findReplace", &json!({"find": "cat", "replace": "dog"})).unwrap(), json!({"count": 2})); + assert_eq!(s.execute("edit.findReplace", &json!({"find": "cat", "replace": "dog"})).unwrap(), json!({"count": 2, "replaced": 2})); assert_eq!((history(&s), plain(&s, a)), ((before.0 + 1, 0, true), "dog dog".to_string())); } @@ -2187,12 +2188,186 @@ fn find_next_cycles_through_text_objects() { let _ = text(&mut s, "banana"); let c = text(&mut s, "pineapple"); s.execute("select.none", &json!({})).unwrap(); - assert_eq!(id_of(&s.execute("edit.findNext", &json!({"find": "APPLE"})).unwrap()), a); + // From the top of the stacking order down, then round again. + assert_eq!(id_of(&s.execute("edit.findNext", &json!({"find": "APPLE"})).unwrap()), c); + assert_eq!(id_of(&s.execute("edit.findNext", &json!({"find": "apple"})).unwrap()), a); assert_eq!(id_of(&s.execute("edit.findNext", &json!({"find": "apple"})).unwrap()), c); + // A selection that starts with a shape goes on after its first type object. + let shape = rect(&mut s, 300.0, 300.0, 20.0, 20.0); + sel(&mut s, &[shape, c]); assert_eq!(id_of(&s.execute("edit.findNext", &json!({"find": "apple"})).unwrap()), a); assert!(s.execute("edit.findNext", &json!({"find": "zzz"})).unwrap()["id"].is_null()); } +/// The match `r` (an `edit.findNext` result) as (object, start, end, index, count). +fn found(r: &Value) -> (u64, u64, u64, u64, u64) { + let n = |k: &str| r[k].as_u64().unwrap_or_else(|| panic!("no `{k}` in {r}")); + (n("id"), n("start"), n("end"), n("index"), n("count")) +} + +/// Find Next steps through the matches one by one when each call is given the match before it: +/// the objects from the top of the stacking order down, each object's matches in reading order, +/// and round again after the last. Search Backwards visits them the other way. Each match is +/// returned with its bytes and its object is selected; nothing is recorded for undo. +#[test] +fn find_next_steps_through_the_matches_in_both_directions() { + let mut s = session(); + let bottom = text(&mut s, "cat éa cat"); + let _ = text(&mut s, "dog"); + let top = text(&mut s, "a cat"); + s.execute("select.none", &json!({})).unwrap(); + let before = history(&s); + let step = |s: &mut Session, from: &Value, backwards: bool| { + let from = if from.is_null() { Value::Null } else { json!({"id": from["id"], "start": from["start"], "end": from["end"]}) }; + s.execute("edit.findNext", &json!({"find": "cat", "from": from, "backwards": backwards})).unwrap() + }; + // "é" is two bytes, so the second match of the bottom object is at bytes 8..11. + let forward = [(top.0, 2, 5, 1, 3), (bottom.0, 0, 3, 2, 3), (bottom.0, 8, 11, 3, 3), (top.0, 2, 5, 1, 3)]; + let mut at = Value::Null; + for want in forward { + at = step(&mut s, &at, false); + assert_eq!((found(&at), selected(&s), at["selected"].clone()), (want, vec![NodeId(want.0)], json!(true))); + } + let backward = [(bottom.0, 8, 11, 3, 3), (bottom.0, 0, 3, 2, 3), (top.0, 2, 5, 1, 3), (bottom.0, 8, 11, 3, 3)]; + s.execute("select.none", &json!({})).unwrap(); + let mut at = Value::Null; + for want in backward { + at = step(&mut s, &at, true); + assert_eq!((found(&at), selected(&s)), (want, vec![NodeId(want.0)])); + } + assert_eq!(history(&s), before, "finding is no undo step"); + // A `from` in an object the search does not visit starts at the first match. + let r = s.execute("edit.findNext", &json!({"find": "cat", "from": {"id": 999_999, "start": 0, "end": 0}})).unwrap(); + assert_eq!(found(&r), (top.0, 2, 5, 1, 3)); + // Nothing found: no match, and the selection stays. + let r = s.execute("edit.findNext", &json!({"find": "zebra"})).unwrap(); + assert_eq!((r, selected(&s)), (json!({"id": null, "count": 0}), vec![top])); +} + +/// Check Hidden Layers and Check Locked Layers: Find Next and Find and Replace leave the type of +/// a hidden layer and of a locked layer alone unless the switch for it is on. A match on such a +/// layer is returned without being selected. A hidden or locked object keeps its type out with +/// the switches on. +#[test] +fn find_and_replace_reach_hidden_and_locked_layers_only_when_asked() { + for (prop, switch, other) in [("visible", "hiddenLayers", "lockedLayers"), ("locked", "lockedLayers", "hiddenLayers")] { + let mut s = session(); + let open = text(&mut s, "cat one"); + let layer = id_of(&s.execute("layer.new", &json!({})).unwrap()); + let closed = text(&mut s, "cat two"); + let object = text(&mut s, "cat three"); + let off = |id: NodeId| if prop == "visible" { json!({"id": id.0, "visible": false}) } else { json!({"id": id.0, "locked": true}) }; + s.execute("object.setProps", &off(object)).unwrap(); + s.execute("layer.setProps", &off(layer)).unwrap(); + sel(&mut s, &[open]); + // Without the switch, and with only the other one, the one reachable match is found. + for p in [json!({"find": "cat"}), json!({"find": "cat", other: true})] { + let r = s.execute("edit.findNext", &p).unwrap(); + assert_eq!(found(&r), (open.0, 0, 3, 1, 1), "{prop} {p}"); + } + // With it, the layer's type is searched (it is above, so it comes first) and not selected. + s.execute("select.none", &json!({})).unwrap(); + let r = s.execute("edit.findNext", &json!({"find": "cat", switch: true})).unwrap(); + assert_eq!((found(&r), r["selected"].clone(), selected(&s)), ((closed.0, 0, 3, 1, 2), json!(false), vec![]), "{prop}"); + let r = s.execute("edit.findNext", &json!({"find": "cat", switch: true, "from": {"id": closed.0, "start": 0, "end": 3}})).unwrap(); + assert_eq!((found(&r), r["selected"].clone(), selected(&s)), ((open.0, 0, 3, 2, 2), json!(true), vec![open]), "{prop}"); + // Replace All: the same reach. + let n = undo_len(&s); + assert_eq!( + s.execute("edit.findReplace", &json!({"find": "cat", "replace": "dog", other: true})).unwrap(), + json!({"count": 1, "replaced": 1}), + "{prop}" + ); + assert_eq!((plain(&s, open), plain(&s, closed), plain(&s, object)), ("dog one".into(), "cat two".into(), "cat three".into()), "{prop}"); + assert_eq!( + s.execute("edit.findReplace", &json!({"find": "cat", "replace": "dog", switch: true})).unwrap(), + json!({"count": 1, "replaced": 1}), + "{prop}" + ); + assert_eq!((plain(&s, closed), plain(&s, object), undo_len(&s)), ("dog two".into(), "cat three".into(), n + 2), "{prop}"); + } +} + +/// Replace changes one match, the bytes Find Next returned, as one undo step, and returns the +/// replacement's bytes to go on from. Bytes that are no match are refused, and a match that +/// already reads as the replacement is left with no undo step. +#[test] +fn replace_match_replaces_the_one_match_found() { + let mut s = session(); + let t = text(&mut s, "cat cat Cat"); + s.execute("select.none", &json!({})).unwrap(); + let first = s.execute("edit.findNext", &json!({"find": "cat"})).unwrap(); + assert_eq!(found(&first), (t.0, 0, 3, 1, 3)); + let n = undo_len(&s); + let r = s.execute("edit.replaceMatch", &json!({"find": "cat", "replace": "horse", "id": t.0, "start": 0, "end": 3})).unwrap(); + assert_eq!(r, json!({"id": t.0, "start": 0, "end": 5, "replaced": true})); + assert_eq!((plain(&s, t), undo_len(&s)), ("horse cat Cat".to_string(), n + 1)); + // Replace & Find: on from the replacement, so text put in is not searched again. + let r = s.execute("edit.replaceMatch", &json!({"find": "cat", "replace": "a cat", "id": t.0, "start": 6, "end": 9})).unwrap(); + let next = s.execute("edit.findNext", &json!({"find": "cat", "from": {"id": r["id"], "start": r["start"], "end": r["end"]}})).unwrap(); + assert_eq!((plain(&s, t), found(&next)), ("horse a cat Cat".to_string(), (t.0, 12, 15, 2, 2))); + // Match Case decides what a match is. + let shape = rect(&mut s, 300.0, 300.0, 20.0, 20.0); + s.execute("select.none", &json!({})).unwrap(); + let before = (history(&s), plain(&s, t)); + for (p, want) in [ + (json!({"find": "cat", "replace": "x", "matchCase": true, "id": t.0, "start": 12, "end": 15}), "at bytes 12..15 of object"), + (json!({"find": "cat", "replace": "x", "id": t.0, "start": 1, "end": 4}), "at bytes 1..4 of object"), + (json!({"find": "cat", "replace": "x", "id": t.0, "start": 4, "end": 1}), "at bytes 1..4 of object"), + (json!({"find": "cat", "replace": "x", "id": t.0, "start": 0}), "missing `end`"), + (json!({"find": "cat", "replace": "x", "start": 0, "end": 3}), "missing `id`"), + (json!({"find": "cat", "replace": "x", "id": t.0, "start": "0", "end": 3}), "`start` must be a whole number"), + (json!({"find": "", "replace": "x", "id": t.0, "start": 0, "end": 3}), "missing `find`"), + (json!({"find": "cat", "replace": 5, "id": t.0, "start": 8, "end": 11}), "`replace` must be a string"), + (json!({"find": "cat", "replace": "x", "id": shape.0, "start": 0, "end": 3}), "is not text"), + ] { + let r = s.execute("edit.replaceMatch", &p); + assert!(matches!(&r, Err(EngineError::BadParams { msg, .. }) if msg.contains(want)), "{p}: {r:?}"); + assert_eq!((history(&s), plain(&s, t)), before, "{p}"); + } + let r = s.execute("edit.replaceMatch", &json!({"find": "cat", "replace": "x", "id": 999_999, "start": 0, "end": 3})); + assert!(matches!(r, Err(EngineError::NoNode(NodeId(999_999)))), "{r:?}"); + // A match that already reads as the replacement: nothing to undo. + let r = s.execute("edit.replaceMatch", &json!({"find": "CAT", "replace": "Cat", "id": t.0, "start": 12, "end": 15})).unwrap(); + assert_eq!((r, history(&s)), (json!({"id": t.0, "start": 12, "end": 15, "replaced": false}), before.0)); + // Find Next refuses a `from` that is not a match. + for (from, want) in [ + (json!(5), "missing `id`"), + (json!({"id": t.0, "start": 2}), "missing `end`"), + (json!({"id": "x", "start": 0, "end": 1}), "`id` must be a whole number"), + ] { + let r = s.execute("edit.findNext", &json!({"find": "cat", "from": from})); + assert!(matches!(&r, Err(EngineError::BadParams { msg, .. }) if msg.contains(want)), "{from}: {r:?}"); + } + for key in ["backwards", "hiddenLayers", "lockedLayers"] { + let r = s.execute("edit.findNext", &json!({"find": "cat", key: "yes"})); + assert!(matches!(&r, Err(EngineError::BadParams { msg, .. }) if *msg == format!("`{key}` must be true or false")), "{key}: {r:?}"); + } + for key in ["hiddenLayers", "lockedLayers"] { + let r = s.execute("edit.findReplace", &json!({"find": "cat", key: 1})); + assert!(matches!(&r, Err(EngineError::BadParams { msg, .. }) if *msg == format!("`{key}` must be true or false")), "{key}: {r:?}"); + } +} + +/// Ruby over text after a replaced match moves with the text, for Replace and for Replace All, as +/// it does when the text is typed. +#[test] +fn find_and_replace_moves_the_ruby_after_a_match() { + for all in [false, true] { + let mut s = session(); + let t = text(&mut s, "ab 漢字"); + sel(&mut s, &[t]); + s.execute("type.ruby", &json!({"text": "かんじ", "start": 3, "end": 9})).unwrap(); + if all { + s.execute("edit.findReplace", &json!({"find": "ab", "replace": "abcd"})).unwrap(); + } else { + s.execute("edit.replaceMatch", &json!({"find": "ab", "replace": "abcd", "id": t.0, "start": 0, "end": 2})).unwrap(); + } + let NodeKind::Text(tt) = &node(&s, t).kind else { panic!() }; + assert_eq!((tt.plain_text().as_str(), tt.ruby.first().map(|r| (r.start, r.end))), ("abcd 漢字", Some((5, 11))), "all: {all}"); + } +} + /// The Type menu's commands and Find and Replace and Find Next refuse a param of the wrong type, or /// `ids` that name no object, with an error naming the param, and leave the text, the selection and /// the undo history as they were, even when Insert Character is also given a source it would use diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 616a11498d..8bc2cf9d36 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -801,7 +801,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{effect: id, index?: int (edit that applied effect in place, prefilled; OK runs effect.setParams), item?: appearance item index|null (the fill/stroke whose effects, null the object's; default: the Appearance panel's active item), aligned?: bool (index and item are rows of the first selected object's stack, which OK edits in each object where it has them, as effect.setParams does)} open the effect's dialog with live preview; without `index`, an effect already in that list first opens `effectExists` (confirm edits it, discard adds another) → {pending: \"effectExists\"}", ), - ("ui.paramDialog", "Command Dialog", "", "{command, label?, params} open a parameter dialog for any command"), + ( + "ui.paramDialog", + "Command Dialog", + "", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place, and Edit › Find Next goes on from it in the same document while the dialog is closed", + ), ( "ui.recolorDialog", "Recolor Artwork…", diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 5afad21b0d..5a0b3da355 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -47,6 +47,7 @@ mod export_for_screens; pub mod eyedropper; pub mod file_info; pub mod find_links; +pub mod find_replace; pub mod flare_options; pub mod flatten; pub mod flattener_presets; @@ -387,6 +388,7 @@ registry! { MissingLinks: [missing_links::KIND] => missing_links::SPEC, MissingFonts: [missing_fonts::KIND] => missing_fonts::SPEC, FindLinks: [find_links::KIND] => find_links::SPEC, + FindReplace: [find_replace::KIND] => find_replace::SPEC, TextImport: [text_import::KIND] => text_import::SPEC, PdfPresets: [pdf_presets::KIND] => pdf_presets::SPEC, PdfPreset: [save_pdf::PRESET_KIND] => save_pdf::PRESET_SPEC, diff --git a/crates/ui-egui/src/dialogs/find_replace.rs b/crates/ui-egui/src/dialogs/find_replace.rs new file mode 100644 index 0000000000..a43e737e18 --- /dev/null +++ b/crates/ui-egui/src/dialogs/find_replace.rs @@ -0,0 +1,358 @@ +//! Edit › Find and Replace…: the Find and Replace With fields, Match Case, Find Whole Word, Search +//! Backwards, Check Hidden Layers and Check Locked Layers, and the Find, Replace, Replace & Find, +//! Replace All and Done buttons, as "Find and replace text" in the public +//! [reference](https://helpx.adobe.com/pdf/illustrator_reference.pdf) describes them. The dialog +//! stays open: Find goes to the next match (`edit.findNext`), Replace changes that match +//! (`edit.replaceMatch`), Replace & Find changes it and goes to the next, and Replace All changes +//! every match (`edit.findReplace`). Each Replace is one undo step, and so is Replace All. +//! +//! These rules are VectorCraft's own. A match is shown in the dialog in its line of text with its +//! place among the matches, and its type object is selected, unless it is on a hidden or locked +//! layer. Enter runs Find. Replace and Replace & Find wait for a match that Find reached with the +//! Find text and the options as they are now. Edit › Find Next goes on from the last search while +//! the dialog is closed, and opens the dialog when there has been none. +//! +//! Fields: `find`, `replace`, `matchCase`, `wholeWord`, `backwards`, `hiddenLayers`, +//! `lockedLayers` and `action` (what `ui.dialog.confirm` does: `find`, `replace`, `replaceFind`, +//! `replaceAll` or `done`; a button sets it and confirms). The dialog keeps the place the search +//! reached in `__at`, the `uid` of its document in `__doc` and the Find text and switches it was +//! reached with in `__atQuery`, the match found in `__found` and the line under the fields in +//! `__note`. A place in a document other than the active one, or reached with other Find text or +//! switches, is not used: the search starts again. + +use serde_json::{Map, Value, json}; +use vectorcraft_doc::{NodeId, NodeKind}; + +use super::{DialogAction, DialogSpec, form}; +use crate::state::Dialog; +use crate::{VectorcraftApp, widgets}; + +/// The dialog kind of Find and Replace. +pub const KIND: &str = "findReplace"; + +/// The command of its menu item, which Replace All runs. +pub const COMMAND: &str = "edit.findReplace"; + +/// The command Find runs, and Edit › Find Next. +pub const NEXT: &str = "edit.findNext"; + +/// The command Replace runs. +const REPLACE: &str = "edit.replaceMatch"; + +/// The switches that decide what a match is and which type is searched. +const SWITCHES: [&str; 4] = ["matchCase", "wholeWord", "hiddenLayers", "lockedLayers"]; + +/// The place the search reached: `{id, start, end}`, a match or the text that replaced one. +const AT: &str = "__at"; +/// The match Find reached, which Replace changes: `{index, count, query}`, with `query` the Find +/// text and the switches it was found with. +const FOUND: &str = "__found"; +/// The line under the fields, in English: no matches, or how many Replace All replaced. +const NOTE: &str = "__note"; + +/// The characters of a match's line shown on either side of it. +const CONTEXT: usize = 24; + +pub(super) const SPEC: DialogSpec = DialogSpec { + heading: |_| tl!("Find and Replace").into(), + body_with_actions: Some(body), + confirm, + ok: None, + min_width: 480.0, + ..DialogSpec::FORM +}; + +/// The document a place in [`AT`] or the last search's `from` belongs to: its `uid`. +const DOC: &str = "__doc"; +/// The Find text and switches the place in [`AT`] was reached with ([`query`]). +const AT_QUERY: &str = "__atQuery"; + +/// The params of the Edit menu's Find and Replace… item: a `find` of null, which gives the dialog +/// no field, so that it opens on the last search. +pub fn menu_params() -> Value { + json!({"find": null}) +} + +/// The `uid` of the active document. +fn active_uid(app: &VectorcraftApp) -> Option<u64> { + app.session.active().map(|d| d.uid) +} + +/// Open Find and Replace on the last search when there has been one, with the fields that +/// `params` gives in its place. A value of another type than the field's, such as the menu item's +/// null `find` ([`menu_params`]), gives none. +pub fn open(app: &mut VectorcraftApp, params: &Map<String, Value>) -> Result<Value, String> { + let mut fields = Map::new(); + fields.insert("find".into(), json!("")); + fields.insert("replace".into(), json!("")); + for key in SWITCHES.into_iter().chain(["backwards"]) { + fields.insert(key.into(), json!(false)); + } + let last = app.ui.last_find.as_ref().and_then(Value::as_object).cloned().unwrap_or_default(); + for (k, v) in last.iter().chain(params) { + // Only the dialog's own fields, each of its own type. + if fields.get(k).is_some_and(|f| f.is_string() == v.is_string() && f.is_boolean() == v.is_boolean()) { + fields.insert(k.clone(), v.clone()); + } + } + // The place the last search reached, while its document is the active one. + let uid = active_uid(app); + if let Some(at) = last.get("from").filter(|v| v.is_object() && uid.is_some() && last.get("doc").and_then(Value::as_u64) == uid) { + fields.insert(AT.into(), at.clone()); + fields.insert(DOC.into(), json!(uid)); + fields.insert(AT_QUERY.into(), query_in(&last)); + } + fields.insert("action".into(), json!("find")); + fields.insert("__command".into(), json!(COMMAND)); + app.ui.dialog = Some(Dialog { kind: KIND.into(), fields }); + Ok(Value::Null) +} + +/// Edit › Find Next with no text to find: the next match of the last search, from the place it +/// reached, with the options the dialog had. With no search yet, it opens the dialog. +pub fn find_next(app: &mut VectorcraftApp) -> Result<Value, String> { + let Some(mut last) = app.ui.last_find.clone().filter(|l| l.get("find").and_then(Value::as_str).is_some_and(|f| !f.is_empty())) else { + return open(app, &Map::new()); + }; + let uid = active_uid(app); + if let Some(o) = last.as_object_mut() { + o.remove("replace"); + // A place in another document is no place in this one. + if uid.is_none() || o.remove("doc").and_then(|d| d.as_u64()) != uid { + o.remove("from"); + } + } + let r = app.run(NEXT, last)?; + if r["id"].is_null() { + app.status("No matches found"); + return Ok(r); + } + if let Some(l) = app.ui.last_find.as_mut() { + l["from"] = json!({ "id": r["id"], "start": r["start"], "end": r["end"] }); + l["doc"] = json!(uid); + } + Ok(r) +} + +/// The Find text and the switches of [`SWITCHES`]: what a match is, as params. +fn query(d: &Dialog) -> Value { + query_in(&d.fields) +} + +/// [`query`] of the dialog fields, or of the last search, in `fields`. +fn query_in(fields: &Map<String, Value>) -> Value { + let mut q = json!({ "find": fields.get("find").and_then(Value::as_str).unwrap_or_default() }); + for key in SWITCHES { + q[key] = json!(fields.get(key).and_then(Value::as_bool).unwrap_or(false)); + } + q +} + +/// The place the search reached, `{id, start, end}`, while its document is the active one and +/// the Find text and the switches are those it was reached with. +fn place<'a>(app: &VectorcraftApp, d: &'a Dialog) -> Option<&'a Value> { + let uid = active_uid(app)?; + let same = d.fields.get(DOC).and_then(Value::as_u64) == Some(uid) && d.fields.get(AT_QUERY) == Some(&query(d)); + same.then(|| d.fields.get(AT)).flatten().filter(|at| at.is_object()) +} + +/// Keep `at`, a place in the active document, as the place the search reached. +fn set_place(app: &VectorcraftApp, d: &mut Dialog, at: Value) { + d.fields.insert(AT.into(), at); + d.fields.insert(DOC.into(), json!(active_uid(app))); + d.fields.insert(AT_QUERY.into(), query(d)); +} + +/// The match Replace changes, as `{id, start, end}`: the one Find reached in the active document, +/// while the Find text and the switches are as they were when it was found. +fn current_match<'a>(app: &VectorcraftApp, d: &'a Dialog) -> Option<&'a Value> { + let found = d.fields.get(FOUND)?; + (found.get("query") == Some(&query(d))).then(|| place(app, d)).flatten() +} + +/// Keep what the dialog searched for and the place it reached, for Edit › Find Next and for the +/// next time the dialog opens. +fn remember(app: &mut VectorcraftApp, d: &Dialog) { + let mut last = query(d); + last["replace"] = json!(d.str("replace")); + last["backwards"] = json!(d.bool("backwards")); + if let Some(at) = place(app, d) { + last["from"] = at.clone(); + last["doc"] = json!(active_uid(app)); + } + app.ui.last_find = Some(last); +} + +/// Find: the next match after the place the search reached, kept as that place and as the match +/// Replace changes. With no match, the note says so. +fn find(app: &mut VectorcraftApp, d: &mut Dialog) -> Result<Value, String> { + let mut p = query(d); + p["backwards"] = json!(d.bool("backwards")); + if let Some(at) = place(app, d) { + p["from"] = at.clone(); + } + d.fields.remove(FOUND); + d.fields.remove(NOTE); + let r = app.run(NEXT, p)?; + if r["id"].is_null() { + app.status("No matches found"); + d.fields.insert(NOTE.into(), json!(app.ui.status)); + return Ok(r); + } + set_place(app, d, json!({ "id": r["id"], "start": r["start"], "end": r["end"] })); + d.fields.insert(FOUND.into(), json!({ "index": r["index"], "count": r["count"], "query": query(d) })); + Ok(r) +} + +/// Replace: the match Find reached becomes the Replace With text, and the search goes on from +/// it. With no such match, it finds one. +fn replace(app: &mut VectorcraftApp, d: &mut Dialog) -> Result<Value, String> { + let Some(at) = current_match(app, d).cloned() else { return find(app, d) }; + let mut p = query(d); + for key in ["hiddenLayers", "lockedLayers"] { + if let Some(o) = p.as_object_mut() { + o.remove(key); + } + } + p["replace"] = json!(d.str("replace")); + for key in ["id", "start", "end"] { + p[key] = at[key].clone(); + } + d.fields.remove(FOUND); + d.fields.remove(NOTE); + let r = app.run(REPLACE, p)?; + set_place(app, d, json!({ "id": r["id"], "start": r["start"], "end": r["end"] })); + Ok(r) +} + +/// Replace All: every match becomes the Replace With text, and the note says how many. +fn replace_all(app: &mut VectorcraftApp, d: &mut Dialog) -> Result<Value, String> { + let mut p = query(d); + p["replace"] = json!(d.str("replace")); + d.fields.remove(FOUND); + d.fields.remove(NOTE); + let r = app.run(COMMAND, p)?; + // The matches that changed: those that already read as the Replace With text do not count. + match (r["count"].as_u64().unwrap_or(0), r["replaced"].as_u64().unwrap_or(0)) { + (0, _) => app.status("No matches found"), + (_, n) => app.status(format!("Matches replaced: {n}")), + } + d.fields.insert(NOTE.into(), json!(app.ui.status)); + Ok(r) +} + +/// A button or `ui.dialog.confirm`: run the `action` and keep the dialog open, or close it for +/// `done`. What a command refuses is the note, and the dialog stays open. +fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { + let mut d = d.clone(); + let action = d.fields.insert("action".into(), json!("find")).and_then(|a| a.as_str().map(str::to_string)).unwrap_or_default(); + let r = match action.as_str() { + "done" => { + remember(app, &d); + app.ui.dialog = None; + return Ok(Value::Null); + } + "" | "find" => find(app, &mut d), + "replace" => replace(app, &mut d), + "replaceFind" => match current_match(app, &d) { + Some(_) => replace(app, &mut d).and_then(|_| find(app, &mut d)), + None => find(app, &mut d), + }, + "replaceAll" => replace_all(app, &mut d), + _ => Err("no such action".to_string()), + }; + if let Err(e) = &r { + d.fields.insert(NOTE.into(), json!(e)); + } + remember(app, &d); + app.ui.dialog = Some(d); + r +} + +/// The match Find reached as it reads in its text: (the text before it on its line, the match, +/// the text after it), each at most [`CONTEXT`] characters, and its place among the matches. +fn shown_match(app: &VectorcraftApp, d: &Dialog) -> Option<([String; 3], String)> { + let at = current_match(app, d)?; + let found = d.fields.get(FOUND)?; + let whole = |v: &Value| v.as_u64().and_then(|n| usize::try_from(n).ok()); + let (id, start, end) = (at["id"].as_u64()?, whole(&at["start"])?, whole(&at["end"])?); + let NodeKind::Text(t) = &app.session.active()?.doc.node(NodeId(id))?.kind else { return None }; + let text = t.plain_text(); + let (before, hit, after) = (text.get(..start)?, text.get(start..end)?, text.get(end..)?); + let before = before.rsplit(['\n', '\r']).next().unwrap_or_default(); + let after = after.split(['\n', '\r']).next().unwrap_or_default(); + let skip = before.chars().count().saturating_sub(CONTEXT); + let lead = if skip > 0 { "…" } else { "" }; + let tail = if after.chars().count() > CONTEXT { "…" } else { "" }; + let before = format!("{lead}{}", before.chars().skip(skip).collect::<String>()); + let after = format!("{}{tail}", after.chars().take(CONTEXT).collect::<String>()); + Some(([before, hit.to_string(), after], format!("{} / {}", found["index"], found["count"]))) +} + +fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> DialogAction { + let can_find = !d.str("find").is_empty(); + let found = current_match(app, d).is_some(); + let mut action = None; + ui.horizontal_top(|ui| { + ui.vertical(|ui| { + widgets::dim_label(ui, tl!("Find:")); + form::text(ui, d, "find", 320.0); + ui.add_space(6.0); + widgets::dim_label(ui, tl!("Replace With:")); + form::text(ui, d, "replace", 320.0); + ui.add_space(10.0); + ui.horizontal_top(|ui| { + ui.vertical(|ui| { + form::check(ui, d, "matchCase", "Match Case"); + form::check(ui, d, "wholeWord", "Find Whole Word"); + form::check(ui, d, "backwards", "Search Backwards"); + }); + ui.add_space(16.0); + ui.vertical(|ui| { + form::check(ui, d, "hiddenLayers", "Check Hidden Layers"); + form::check(ui, d, "lockedLayers", "Check Locked Layers"); + }); + }); + }); + ui.add_space(16.0); + ui.vertical(|ui| { + let mut button = |ui: &mut egui::Ui, label: &str, enabled: bool, name: &'static str| { + if ui.add_enabled_ui(enabled, |ui| widgets::flat_button(ui, label, 130.0).clicked()).inner { + action = Some(name); + } + ui.add_space(6.0); + }; + button(ui, if found { tl!("Find Next") } else { tl!("Find") }, can_find, "find"); + button(ui, tl!("Replace"), can_find && found, "replace"); + button(ui, tl!("Replace & Find"), can_find && found, "replaceFind"); + button(ui, tl!("Replace All"), can_find, "replaceAll"); + button(ui, tl!("Done"), true, "done"); + }); + }); + ui.add_space(8.0); + if let Some(([before, hit, after], place)) = shown_match(app, d) { + let t = crate::theme::Tokens::get(ui.ctx()); + ui.horizontal_wrapped(|ui| { + ui.spacing_mut().item_spacing.x = 0.0; + widgets::dim_name(ui, &format!("{place} {before}")); + ui.colored_label(t.text_strong, egui::RichText::new(hit).strong().underline()); + widgets::dim_name(ui, &after); + }); + } else if let Some(note) = d.fields.get(NOTE).and_then(Value::as_str) { + widgets::dim_name(ui, &crate::i18n::message(crate::i18n::current(), note)); + } + // Enter finds, as the Find button does. + if action.is_none() && can_find && crate::shortcuts::pressed_anew(ui.ctx(), egui::Key::Enter) { + action = Some("find"); + } + match action { + Some(name) => { + d.fields.insert("action".into(), json!(name)); + DialogAction::Confirm + } + None => DialogAction::None, + } +} + +#[cfg(test)] +mod tests; diff --git a/crates/ui-egui/src/dialogs/find_replace/tests.rs b/crates/ui-egui/src/dialogs/find_replace/tests.rs new file mode 100644 index 0000000000..a55e1c0085 --- /dev/null +++ b/crates/ui-egui/src/dialogs/find_replace/tests.rs @@ -0,0 +1,377 @@ +use egui::{Event, PointerButton, Pos2, Rect, vec2}; +use serde_json::{Value, json}; +use vectorcraft_doc::{NodeId, NodeKind}; + +use crate::VectorcraftApp; + +/// An app on a document holding point type `texts`, bottom first, with nothing selected → the +/// app and the type objects' ids. +fn app_with(texts: &[&str]) -> (VectorcraftApp, Vec<u64>) { + let mut s = vectorcraft_engine::Session::new(); + s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + let ids = texts.iter().map(|t| s.execute("text.create", &json!({"x": 50, "y": 50, "text": t})).unwrap()["id"].as_u64().unwrap()).collect(); + s.execute("select.none", &json!({})).unwrap(); + (VectorcraftApp::new(s, crate::Services::default()), ids) +} + +/// Choose Edit › Find and Replace…, as a click on the menu item does. +fn choose(app: &mut VectorcraftApp) { + let (id, p) = crate::shortcut_editor::menu_target(super::COMMAND).expect("the menu item gives params"); + crate::menus::invoke(app, &id, p); +} + +/// Choose Edit › Find Next, as a click on the menu item does. +fn choose_find_next(app: &mut VectorcraftApp) { + let e = crate::menus::menu_entries(app).into_iter().find(|e| e.label == "Find Next").expect("in the Edit menu"); + assert_eq!((e.command.as_deref(), e.enabled), (Some(super::NEXT), true)); + crate::menus::invoke(app, super::NEXT, json!({"find": ""})); +} + +fn set(app: &mut VectorcraftApp, k: &str, v: Value) { + app.ui.dialog.as_mut().unwrap().fields.insert(k.into(), v); +} + +fn field(app: &VectorcraftApp, k: &str) -> Value { + app.ui.dialog.as_ref().expect("the dialog is open").fields.get(k).cloned().unwrap_or(Value::Null) +} + +/// The match Replace would change, as (object, start, end). +fn matched(app: &VectorcraftApp) -> Option<(u64, u64, u64)> { + let at = super::current_match(app, app.ui.dialog.as_ref()?)?; + Some((at["id"].as_u64()?, at["start"].as_u64()?, at["end"].as_u64()?)) +} + +fn plain(app: &VectorcraftApp, id: u64) -> String { + match &app.session.active().unwrap().doc.node(NodeId(id)).unwrap().kind { + NodeKind::Text(t) => t.plain_text(), + _ => panic!("not type"), + } +} + +fn undo_steps(app: &VectorcraftApp) -> usize { + app.session.active().unwrap().history.undo.len() +} + +fn selected(app: &VectorcraftApp) -> Vec<u64> { + app.session.active().unwrap().selection.objects.iter().map(|id| id.0).collect() +} + +/// One frame of the dialog on an 800 × 600 window → the text painted, with its rect. +fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<Event>) -> Vec<(String, Rect)> { + // A window takes a sizing frame and fades in: each frame is a quarter second on. + let time = ctx.input(|i| i.time) + 0.25; + let screen_rect = Some(Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))); + let raw = egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() }; + let mut out = ctx.run_ui(raw, |ui| crate::dialogs::show(app, ui.ctx())); + out.textures_delta.clear(); + fn walk(s: &egui::Shape, v: &mut Vec<(String, Rect)>) { + match s { + egui::Shape::Text(t) => v.push((t.galley.text().to_string(), Rect::from_min_size(t.pos, t.galley.size()))), + egui::Shape::Vec(s) => s.iter().for_each(|s| walk(s, v)), + _ => {} + } + } + let mut v = vec![]; + out.shapes.iter().for_each(|c| walk(&c.shape, &mut v)); + v +} + +fn context() -> egui::Context { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + ctx +} + +fn click(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str) -> Vec<(String, Rect)> { + frame(app, ctx, vec![]); + let texts = frame(app, ctx, vec![]); + let at = texts.iter().find(|(t, _)| t == label).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{label}` in {texts:?}")); + let press = |pressed| Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(app, ctx, vec![Event::PointerMoved(at)]); + frame(app, ctx, vec![press(true)]); + frame(app, ctx, vec![press(false)]); + frame(app, ctx, vec![]) +} + +/// Edit › Find and Replace… opens the dialog of its own, with the fields and options of the +/// public reference's "Find and replace text", instead of the generic parameter dialog. +#[test] +fn the_edit_menu_opens_the_find_and_replace_dialog() { + let (mut app, _) = app_with(&["cat"]); + let e = crate::menus::menu_entries(&app).into_iter().find(|e| e.label == "Find and Replace…").expect("in the Edit menu"); + assert_eq!((e.path.as_slice(), e.command.as_deref(), e.enabled), (&["Edit".to_string()][..], Some(super::COMMAND), true)); + choose(&mut app); + let d = app.ui.dialog.as_ref().expect("Find and Replace opens"); + assert_eq!((d.kind.as_str(), d.fields["__command"].clone()), (super::KIND, json!(super::COMMAND))); + for (key, want) in [("find", json!("")), ("replace", json!("")), ("action", json!("find"))] { + assert_eq!(d.fields[key], want, "{key}"); + } + for key in ["matchCase", "wholeWord", "backwards", "hiddenLayers", "lockedLayers"] { + assert_eq!(d.fields[key], json!(false), "{key}"); + } + let ctx = context(); + frame(&mut app, &ctx, vec![]); + let texts: Vec<String> = frame(&mut app, &ctx, vec![]).into_iter().map(|(t, _)| t).collect(); + for label in [ + "Find and Replace", + "Find:", + "Replace With:", + "Match Case", + "Find Whole Word", + "Search Backwards", + "Check Hidden Layers", + "Check Locked Layers", + "Find", + "Replace", + "Replace & Find", + "Replace All", + "Done", + ] { + assert!(texts.iter().any(|t| t == label), "no `{label}` in {texts:?}"); + } +} + +/// The dialog stays open from match to match: Find goes to the next match and selects its +/// object, Replace changes that match, Replace & Find changes it and goes on, Replace All changes +/// the rest, and Done closes. Each Replace is one undo step, and so is Replace All; finding and a +/// Replace All with nothing to replace record none. +#[test] +fn the_buttons_step_through_the_matches() { + let (mut app, ids) = app_with(&["cat cat", "a cat"]); + let (bottom, top) = (ids[0], ids[1]); + choose(&mut app); + let ctx = context(); + set(&mut app, "find", json!("cat")); + set(&mut app, "replace", json!("dog")); + let steps = undo_steps(&app); + // Find: the first match, in the top object, shown with its place and its line of text. + let texts = click(&mut app, &ctx, "Find"); + assert_eq!((matched(&app), selected(&app), undo_steps(&app)), (Some((top, 2, 5)), vec![top], steps)); + assert!(texts.iter().any(|(t, _)| t.starts_with("1 / 3")) && texts.iter().any(|(t, _)| t == "cat"), "{texts:?}"); + assert!(texts.iter().any(|(t, _)| t == "Find Next"), "Find reads Find Next once a match is found: {texts:?}"); + // Replace: that match only, and the search stays where it was. + click(&mut app, &ctx, "Replace"); + assert_eq!((plain(&app, top), plain(&app, bottom), undo_steps(&app)), ("a dog".to_string(), "cat cat".to_string(), steps + 1)); + assert_eq!((matched(&app), field(&app, "__at")), (None, json!({"id": top, "start": 2, "end": 5}))); + // Find goes on from there, to the bottom object. + click(&mut app, &ctx, "Find"); + assert_eq!((matched(&app), selected(&app), field(&app, "__found")["count"].clone()), (Some((bottom, 0, 3)), vec![bottom], json!(2))); + // Replace & Find: one undo step, and the next match is the one left. + click(&mut app, &ctx, "Replace & Find"); + assert_eq!((plain(&app, bottom), undo_steps(&app), matched(&app)), ("dog cat".to_string(), steps + 2, Some((bottom, 4, 7)))); + // Replace All: the rest as one undo step, with the count under the fields. + let texts = click(&mut app, &ctx, "Replace All"); + assert_eq!((plain(&app, bottom), undo_steps(&app), matched(&app)), ("dog dog".to_string(), steps + 3, None)); + assert!(texts.iter().any(|(t, _)| t == "Matches replaced: 1"), "{texts:?}"); + // Nothing left: no undo step, and the dialog says so, for Replace All and for Find. + for button in ["Replace All", "Find"] { + let texts = click(&mut app, &ctx, button); + assert_eq!((undo_steps(&app), matched(&app)), (steps + 3, None), "{button}"); + assert!(texts.iter().any(|(t, _)| t == "No matches found"), "{button}: {texts:?}"); + } + assert!(app.ui.dialog.is_some(), "the dialog stays open until Done"); + click(&mut app, &ctx, "Done"); + assert!(app.ui.dialog.is_none(), "Done closes it"); + assert_eq!(undo_steps(&app), steps + 3); +} + +/// Replace and Replace & Find wait for a match found with the Find text and the options as they +/// are: before the first Find, and after the Find text changes, a click on them changes nothing. +/// With no Find text, no button but Done acts. Enter runs Find. +#[test] +fn replace_waits_for_a_match_of_the_text_as_it_is() { + let (mut app, ids) = app_with(&["cat cart"]); + choose(&mut app); + let ctx = context(); + let steps = undo_steps(&app); + set(&mut app, "replace", json!("x")); + for button in ["Find", "Replace", "Replace & Find", "Replace All"] { + click(&mut app, &ctx, button); + assert_eq!((plain(&app, ids[0]), undo_steps(&app), matched(&app)), ("cat cart".to_string(), steps, None), "{button} with no Find text"); + } + set(&mut app, "find", json!("cat")); + for button in ["Replace", "Replace & Find"] { + click(&mut app, &ctx, button); + assert_eq!((plain(&app, ids[0]), undo_steps(&app), matched(&app)), ("cat cart".to_string(), steps, None), "{button} before Find"); + } + // Enter finds. + frame(&mut app, &ctx, vec![]); + let enter = |pressed| Event::Key { key: egui::Key::Enter, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + frame(&mut app, &ctx, vec![enter(true)]); + frame(&mut app, &ctx, vec![enter(false)]); + assert_eq!(matched(&app), Some((ids[0], 0, 3))); + // The Find text changes: the match found is no longer the one to replace. + set(&mut app, "find", json!("ca")); + assert_eq!(matched(&app), None); + for button in ["Replace", "Replace & Find"] { + click(&mut app, &ctx, button); + assert_eq!((plain(&app, ids[0]), undo_steps(&app)), ("cat cart".to_string(), steps), "{button} after the Find text changed"); + } + // An option changes: the same. + set(&mut app, "find", json!("cat")); + assert_eq!(matched(&app), Some((ids[0], 0, 3))); + set(&mut app, "matchCase", json!(true)); + assert_eq!(matched(&app), None); + // Search Backwards is a direction, not what a match is. + set(&mut app, "matchCase", json!(false)); + set(&mut app, "backwards", json!(true)); + assert_eq!(matched(&app), Some((ids[0], 0, 3))); + click(&mut app, &ctx, "Replace"); + assert_eq!((plain(&app, ids[0]), undo_steps(&app)), ("x cart".to_string(), steps + 1)); +} + +/// `ui.dialog.confirm` runs the dialog's `action`, keeps it open and puts `action` back to find; +/// done closes it. An action it does not know is refused, and so is an empty Find text. +#[test] +fn confirm_runs_the_action() { + let (mut app, ids) = app_with(&["cat cat cat"]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + set(&mut app, "replace", json!("dog")); + let steps = undo_steps(&app); + let r = crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((r["start"].clone(), r["index"].clone(), r["count"].clone(), matched(&app)), (json!(0), json!(1), json!(3), Some((ids[0], 0, 3)))); + set(&mut app, "action", json!("replaceFind")); + let r = crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((plain(&app, ids[0]), r["start"].clone(), field(&app, "action")), ("dog cat cat".to_string(), json!(4), json!("find"))); + set(&mut app, "action", json!("replace")); + let r = crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((plain(&app, ids[0]), r["replaced"].clone(), matched(&app)), ("dog dog cat".to_string(), json!(true), None)); + // Replace with no match found: it finds one. + set(&mut app, "action", json!("replace")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((plain(&app, ids[0]), matched(&app), undo_steps(&app)), ("dog dog cat".to_string(), Some((ids[0], 8, 11)), steps + 2)); + set(&mut app, "action", json!("replaceAll")); + assert_eq!(crate::dialogs::confirm(&mut app).unwrap(), json!({"count": 1, "replaced": 1})); + assert_eq!((plain(&app, ids[0]), undo_steps(&app)), ("dog dog dog".to_string(), steps + 3)); + // Matches that already read as the Replace With text are found and not counted as replaced. + set(&mut app, "find", json!("DOG")); + set(&mut app, "action", json!("replaceAll")); + assert_eq!(crate::dialogs::confirm(&mut app).unwrap(), json!({"count": 3, "replaced": 0})); + assert_eq!((undo_steps(&app), field(&app, "__note")), (steps + 3, json!("Matches replaced: 0"))); + set(&mut app, "find", json!("dog")); + for (action, find) in [("erase", "dog"), ("find", ""), ("replaceAll", "")] { + set(&mut app, "action", json!(action)); + set(&mut app, "find", json!(find)); + assert!(crate::dialogs::confirm(&mut app).is_err(), "{action} {find:?}"); + assert_eq!((plain(&app, ids[0]), undo_steps(&app), field(&app, "action")), ("dog dog dog".to_string(), steps + 3, json!("find"))); + assert!(field(&app, "__note").is_string(), "{action} {find:?}: the dialog shows why"); + } + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); +} + +/// Edit › Find Next goes on from the dialog's last search while the dialog is closed, with its +/// options, and says when nothing matches. With no search yet, it opens the dialog, and the +/// dialog opens again on the last search. +#[test] +fn find_next_goes_on_from_the_last_search() { + let (mut app, ids) = app_with(&["Cat", "cat", "cat"]); + choose_find_next(&mut app); + assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(super::KIND), "no search yet: the dialog opens"); + set(&mut app, "find", json!("cat")); + set(&mut app, "replace", json!("dog")); + set(&mut app, "matchCase", json!(true)); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((ids[2], 0, 3))); + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + let steps = undo_steps(&app); + // On from the match the dialog found; Match Case still leaves out "Cat". + for want in [ids[1], ids[2], ids[1]] { + choose_find_next(&mut app); + assert_eq!((selected(&app), app.ui.dialog.is_none(), undo_steps(&app)), (vec![want], true, steps)); + } + // The dialog opens on the last search and the place it reached. + choose(&mut app); + assert_eq!((field(&app, "find"), field(&app, "replace"), field(&app, "matchCase")), (json!("cat"), json!("dog"), json!(true))); + assert_eq!(field(&app, "__at"), json!({"id": ids[1], "start": 0, "end": 3})); + set(&mut app, "find", json!("zebra")); + assert!(crate::dialogs::confirm(&mut app).unwrap()["id"].is_null()); + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + app.ui.status.clear(); + choose_find_next(&mut app); + assert_eq!((app.ui.status.as_str(), selected(&app)), ("No matches found", vec![ids[1]])); +} + +/// The place a search reached goes with the Find text and the switches it was reached with: a +/// search for other text starts again, in the dialog and when `ui.paramDialog` gives other text, +/// and the same search goes on from that place. +#[test] +fn a_changed_search_starts_again() { + let (mut app, ids) = app_with(&["cat dog cat", "dog"]); + let (bottom, top) = (ids[0], ids[1]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((bottom, 0, 3))); + set(&mut app, "find", json!("dog")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((top, 0, 3)), "not the dog after the cat found"); + set(&mut app, "find", json!("cat")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((bottom, 0, 3))); + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + crate::menus::invoke(&mut app, "ui.paramDialog", json!({"command": super::COMMAND, "params": {"find": "dog"}})); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((top, 0, 3))); + app.ui.dialog = None; + choose(&mut app); + assert_eq!(field(&app, "find"), json!("dog")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((bottom, 4, 7)), "the same search goes on"); +} + +/// The place a search reached belongs to its document: in another document, Edit › Find Next and +/// the dialog start at that document's first match, even where an object there has the same id. +/// The params of a `ui.paramDialog` call take the place of the last search's, a switch that is off +/// included, while the menu item's own params leave the last search as it was. +#[test] +fn a_search_place_stays_in_its_document_and_given_params_win() { + let (mut app, ids) = app_with(&["cat cat"]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + set(&mut app, "matchCase", json!(true)); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((ids[0], 0, 3))); + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + // A second document, whose type object has the id of the first one's. + app.run("file.new", json!({"width": 800, "height": 600})).unwrap(); + let other = app.run("text.create", json!({"x": 50, "y": 50, "text": "cat cat"})).unwrap()["id"].as_u64().unwrap(); + app.run("select.none", json!({})).unwrap(); + assert_eq!(other, ids[0]); + choose_find_next(&mut app); + assert_eq!( + (selected(&app), app.ui.last_find.as_ref().map(|l| l["from"].clone())), + (vec![other], Some(json!({"id": other, "start": 0, "end": 3}))) + ); + // The dialog opens on the last search; Find goes on in this document. + choose(&mut app); + assert_eq!(field(&app, "matchCase"), json!(true)); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((other, 4, 7))); + // Back in the first document, the dialog's place is not used: Replace finds first and changes + // nothing. + assert!(app.session.set_active(0)); + assert_eq!(matched(&app), None); + set(&mut app, "replace", json!("dog")); + set(&mut app, "action", json!("replace")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((plain(&app, ids[0]), matched(&app)), ("cat cat".to_string(), Some((ids[0], 0, 3)))); + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); + // Given params win over the last search; the menu item's own do not. + crate::menus::invoke(&mut app, "ui.paramDialog", json!({"command": super::COMMAND, "params": {"matchCase": false, "replace": "dog"}})); + assert_eq!((field(&app, "find"), field(&app, "matchCase"), field(&app, "replace")), (json!("cat"), json!(false), json!("dog"))); + app.ui.dialog = None; + let empty = json!({"find": "", "replace": "", "matchCase": false, "wholeWord": false}); + crate::menus::invoke(&mut app, "ui.paramDialog", json!({"command": super::COMMAND, "params": empty})); + assert_eq!((field(&app, "find"), field(&app, "matchCase")), (json!(""), json!(false))); + app.ui.dialog = None; + choose(&mut app); + assert_eq!((field(&app, "find"), field(&app, "matchCase")), (json!("cat"), json!(true))); +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 28944173dd..ae97c08ddb 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1202,6 +1202,16 @@ font-technology Variable Променливи Fill: click for swatches, Shift-click for the color mixer Запълване: щракнете за образци, Shift-щракване за смесителя на цветове Find Търсене Find and Replace… Търсене и замяна… + Find and Replace Търсене и замяна + Find: Търсене: + Replace With: Замяна с: + Replace & Find Замяна и търсене + Replace All Замяна на всички + Match Case Съвпадение на малки и главни букви + Find Whole Word Търсене на цяла дума + Search Backwards Търсене назад + Check Hidden Layers Проверка на скритите слоеве + Check Locked Layers Проверка на заключените слоеве Find Font Търсене на шрифт Find Font… Търсене на шрифт… Find Next Търсене на следващ diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 01b90e5148..e0f2a7791d 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -85,6 +85,16 @@ Paste without Formatting Zalijepi bez oblikovanja Clear Očisti Find and Replace… Pronađi i zamijeni… + Find and Replace Pronađi i zamijeni + Find: Pronađi: + Replace With: Zamijeni sa: + Replace & Find Zamijeni i pronađi + Replace All Zamijeni sve + Match Case Razlikuj velika i mala slova + Find Whole Word Pronađi cijelu riječ + Search Backwards Pretraži unazad + Check Hidden Layers Provjeri skrivene slojeve + Check Locked Layers Provjeri zaključane slojeve Find Next Pronađi sljedeće Spelling Pravopis Auto Spell Check Automatska provjera pravopisa diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 4ddd1d5605..1110e85c25 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1697,6 +1697,19 @@ digits Malayalam Malaiàlam Filters Filtres Find Cerca Find and Replace… Cerca i reemplaça… + Find and Replace Cerca i reemplaça + Find: Cerca: + Replace With: Reemplaça per: + Replace & Find Reemplaça i cerca + Replace All Reemplaça-ho tot + Match Case Distingeix majúscules i minúscules + Find Whole Word Cerca la paraula sencera + Search Backwards Cerca cap enrere + Check Hidden Layers Comprova les capes ocultes + Check Locked Layers Comprova les capes bloquejades +@msg No matches found No s’ha trobat cap coincidència +@msg Matches replaced: {n} Coincidències reemplaçades: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} no hi ha cap coincidència de `find` als bytes {_1}..{_2} de l’objecte {_3} Find Font Cerca un tipus de lletra Find Font Files Cerca fitxers de tipus de lletra Find Fonts Cerca tipus de lletra diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 211982f086..d8d9ff3c05 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -90,6 +90,19 @@ Paste without Formatting Vložit bez formátování Clear Smazat Find and Replace… Najít a nahradit… + Find and Replace Najít a nahradit + Find: Najít: + Replace With: Nahradit čím: + Replace & Find Nahradit a najít + Replace All Nahradit vše + Match Case Rozlišovat velká a malá písmena + Find Whole Word Najít celé slovo + Search Backwards Hledat zpět + Check Hidden Layers Prohledat skryté vrstvy + Check Locked Layers Prohledat zamknuté vrstvy +@msg No matches found Nenalezeny žádné shody +@msg Matches replaced: {n} Nahrazeno shod: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} na bajtech {_1}..{_2} objektu {_3} není žádná shoda s `find` Find Next Najít další Spelling Pravopis Auto Spell Check Automatická kontrola pravopisu diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index b3de0ae89a..d2c4bf5afa 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -78,6 +78,16 @@ Paste without Formatting Indsæt uden formatering Clear Fjern Find and Replace… Find og erstat… + Find and Replace Find og erstat + Find: Find: + Replace With: Erstat med: + Replace & Find Erstat og find + Replace All Erstat alle + Match Case Forskel på store og små bogstaver + Find Whole Word Find hele ord + Search Backwards Søg baglæns + Check Hidden Layers Kontrollér skjulte lag + Check Locked Layers Kontrollér låste lag Find Next Find næste Spelling Stavekontrol Auto Spell Check Automatisk stavekontrol diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index d0610144ef..4a1eabcece 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1230,6 +1230,19 @@ font-technology Variable Variabel Fill: click for swatches, Shift-click for the color mixer Fläche: Klicken für Farbfelder, Shift-Klick für den Farbmischer Find Suchen Find and Replace… Suchen und ersetzen… + Find and Replace Suchen und ersetzen + Find: Suchen: + Replace With: Ersetzen durch: + Replace & Find Ersetzen und suchen + Replace All Alle ersetzen + Match Case Groß-/Kleinschreibung beachten + Find Whole Word Ganzes Wort suchen + Search Backwards Rückwärts suchen + Check Hidden Layers Ausgeblendete Ebenen durchsuchen + Check Locked Layers Gesperrte Ebenen durchsuchen +@msg No matches found Keine Treffer gefunden +@msg Matches replaced: {n} Ersetzte Treffer: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} kein Treffer für `find` bei Byte {_1}..{_2} von Objekt {_3} Find Font Schrift suchen Find Font… Schrift suchen… Find Next Weitersuchen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index d03f8c6958..5f12f6ff1b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1180,6 +1180,19 @@ font-technology Variable Μεταβλητές Fill: click for swatches, Shift-click for the color mixer Γέμισμα: κλικ για δείγματα, Shift-κλικ για τον μείκτη χρωμάτων Find Εύρεση Find and Replace… Εύρεση και αντικατάσταση… + Find and Replace Εύρεση και αντικατάσταση + Find: Εύρεση: + Replace With: Αντικατάσταση με: + Replace & Find Αντικατάσταση και εύρεση + Replace All Αντικατάσταση όλων + Match Case Ταίριασμα πεζών-κεφαλαίων + Find Whole Word Εύρεση ολόκληρης λέξης + Search Backwards Αναζήτηση προς τα πίσω + Check Hidden Layers Έλεγχος κρυφών επιπέδων + Check Locked Layers Έλεγχος κλειδωμένων επιπέδων +@msg No matches found Δεν βρέθηκαν αντιστοιχίες +@msg Matches replaced: {n} Αντιστοιχίες που αντικαταστάθηκαν: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} καμία αντιστοιχία του `find` στα byte {_1}..{_2} του αντικειμένου {_3} Find Font Εύρεση γραμματοσειράς Find Font… Εύρεση γραμματοσειράς… Find Next Εύρεση επόμενου diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 3e8bd23752..654ec57749 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1251,6 +1251,19 @@ font-technology Variable Variables Fill: click for swatches, Shift-click for the color mixer Relleno: clic para muestras, Shift+clic para el mezclador de colores Find Buscar Find and Replace… Buscar y reemplazar… + Find and Replace Buscar y reemplazar + Find: Buscar: + Replace With: Reemplazar por: + Replace & Find Reemplazar y buscar + Replace All Reemplazar todo + Match Case Coincidir mayúsculas y minúsculas + Find Whole Word Buscar palabra completa + Search Backwards Buscar hacia atrás + Check Hidden Layers Comprobar capas ocultas + Check Locked Layers Comprobar capas bloqueadas +@msg No matches found No se encontraron coincidencias +@msg Matches replaced: {n} Coincidencias reemplazadas: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} no hay ninguna coincidencia de `find` en los bytes {_1}..{_2} del objeto {_3} Find Font Buscar fuente Find Font… Buscar fuente… Find Next Buscar siguiente diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index d408220f47..fd19f7246c 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -98,6 +98,19 @@ Paste without Formatting Liitä ilman muotoilua Clear Tyhjennä Find and Replace… Etsi ja korvaa… + Find and Replace Etsi ja korvaa + Find: Etsi: + Replace With: Korvaa tekstillä: + Replace & Find Korvaa ja etsi + Replace All Korvaa kaikki + Match Case Sama kirjainkoko + Find Whole Word Etsi koko sana + Search Backwards Etsi taaksepäin + Check Hidden Layers Tarkista piilotetut tasot + Check Locked Layers Tarkista lukitut tasot +@msg No matches found Osumia ei löytynyt +@msg Matches replaced: {n} Korvattuja osumia: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} objektin {_3} tavuissa {_1}..{_2} ei ole haun `find` osumaa Find Next Etsi seuraava Spelling Oikeinkirjoitus Auto Spell Check Automaattinen oikeinkirjoituksen tarkistus diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 318bbbeb44..9d79ede0b2 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1245,6 +1245,19 @@ font-technology Variable Variables Fill: click for swatches, Shift-click for the color mixer Fond : cliquez pour le nuancier, Maj+clic pour le mélangeur de couleurs Find Rechercher Find and Replace… Rechercher et remplacer… + Find and Replace Rechercher et remplacer + Find: Rechercher: + Replace With: Remplacer par: + Replace & Find Remplacer et rechercher + Replace All Tout remplacer + Match Case Respecter la casse + Find Whole Word Rechercher le mot entier + Search Backwards Rechercher vers l’arrière + Check Hidden Layers Vérifier les calques masqués + Check Locked Layers Vérifier les calques verrouillés +@msg No matches found Aucune occurrence trouvée +@msg Matches replaced: {n} Occurrences remplacées : {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} aucune occurrence de `find` aux octets {_1}..{_2} de l’objet {_3} Find Font Rechercher une police Find Font… Rechercher une police… Find Next Rechercher le suivant diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 78c0a9a7eb..a68dcbedc3 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1885,6 +1885,19 @@ antiAlias Sharp शार्प Filters फिल्टर Find खोजें Find and Replace… खोजें और बदलें… + Find and Replace खोजें और बदलें + Find: खोजें: + Replace With: इससे रिप्लेस करें: + Replace & Find रिप्लेस करें और खोजें + Replace All सभी रिप्लेस करें + Match Case केस मिलाएँ + Find Whole Word पूरा शब्द खोजें + Search Backwards पीछे की ओर खोजें + Check Hidden Layers छिपी हुई लेयर्स जाँचें + Check Locked Layers लॉक की गई लेयर्स जाँचें +@msg No matches found कोई मिलान नहीं मिला +@msg Matches replaced: {n} रिप्लेस किए गए मिलान: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} ऑब्जेक्ट {_3} के बाइट {_1}..{_2} पर `find` का कोई मिलान नहीं है Find Font फ़ॉन्ट खोजें Find Font Files फ़ॉन्ट फ़ाइल का पता लगाएं Find Font… फ़ॉन्ट खोजें… diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a1f6100b2f..1747ad1712 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1559,6 +1559,19 @@ digits Malayalam Malajálam Film & Video Film és videó Find Keresés Find and Replace… Keresés és csere… + Find and Replace Keresés és csere + Find: Keresés: + Replace With: Csere erre: + Replace & Find Csere és keresés + Replace All Az összes cseréje + Match Case Kis- és nagybetűk megkülönböztetése + Find Whole Word Teljes szó keresése + Search Backwards Keresés visszafelé + Check Hidden Layers Rejtett rétegek ellenőrzése + Check Locked Layers Zárolt rétegek ellenőrzése +@msg No matches found Nincs találat +@msg Matches replaced: {n} Cserélt találatok: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} nincs `find` találat a(z) {_3} objektum {_1}..{_2} bájtjain Find Font Betűtípus keresése Find Font Files Betűtípusfájlok keresése Find Fonts Betűtípusok keresése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c7c6b956db..0312437363 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -78,6 +78,16 @@ Paste without Formatting Tempel tanpa pemformatan Clear Hapus Find and Replace… Cari dan ganti… + Find and Replace Cari dan ganti + Find: Cari: + Replace With: Ganti dengan: + Replace & Find Ganti dan cari + Replace All Ganti semua + Match Case Cocokkan huruf besar/kecil + Find Whole Word Cari seluruh kata + Search Backwards Cari mundur + Check Hidden Layers Periksa lapisan tersembunyi + Check Locked Layers Periksa lapisan terkunci Find Next Cari berikutnya Spelling Ejaan Auto Spell Check Pemeriksaan ejaan otomatis diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 6743704785..093544fda9 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1260,6 +1260,19 @@ font-technology Variable Variabili Fill: click for swatches, Shift-click for the color mixer Riempimento: fai clic per i campioni, Shift+clic per il miscelatore colori Find Trova Find and Replace… Trova e sostituisci… + Find and Replace Trova e sostituisci + Find: Trova: + Replace With: Sostituisci con: + Replace & Find Sostituisci e trova + Replace All Sostituisci tutto + Match Case Maiuscole/minuscole + Find Whole Word Trova parola intera + Search Backwards Cerca all'indietro + Check Hidden Layers Controlla livelli nascosti + Check Locked Layers Controlla livelli bloccati +@msg No matches found Nessuna corrispondenza trovata +@msg Matches replaced: {n} Corrispondenze sostituite: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} nessuna corrispondenza di `find` ai byte {_1}..{_2} dell'oggetto {_3} Find Font Trova font Find Font… Trova font… Find Next Trova successivo diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c9cdb8fcbe..afa5bb4a68 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -163,6 +163,19 @@ digits Malayalam マラヤーラム数字 Paste without Formatting 書式なしでペースト Clear 消去 Find and Replace… 検索と置換… + Find and Replace 検索と置換 + Find: 検索: + Replace With: 置換文字列: + Replace & Find 置換して検索 + Replace All すべて置換 + Match Case 大文字と小文字を区別 + Find Whole Word 単語単位で検索 + Search Backwards 逆方向に検索 + Check Hidden Layers 非表示レイヤーを検索 + Check Locked Layers ロックされたレイヤーを検索 +@msg No matches found 一致する文字列が見つかりません +@msg Matches replaced: {n} 置換した一致: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} オブジェクト {_3} のバイト {_1}..{_2} に `find` の一致はありません Find Next 次を検索 Find Objects オブジェクトを検索 Compare with Image 画像と比較 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 55f726dc38..5c62e0615b 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -88,6 +88,19 @@ Paste without Formatting ფორმატირების გარეშე ჩასმა Clear გასუფთავება Find and Replace… ძებნა და ჩანაცვლება… + Find and Replace ძებნა და ჩანაცვლება + Find: ძებნა: + Replace With: ჩანაცვლება შემდეგით: + Replace & Find ჩანაცვლება და ძებნა + Replace All ყველას ჩანაცვლება + Match Case რეგისტრის გათვალისწინება + Find Whole Word მთელი სიტყვის ძებნა + Search Backwards უკუმიმართულებით ძებნა + Check Hidden Layers დამალული შრეების შემოწმება + Check Locked Layers ჩაკეტილი შრეების შემოწმება +@msg No matches found დამთხვევები ვერ მოიძებნა +@msg Matches replaced: {n} ჩანაცვლებული დამთხვევები: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} ობიექტ {_3}-ის {_1}..{_2} ბაიტებზე `find`-ის დამთხვევა არ არის Find Next შემდეგის ძებნა Spelling მართლწერა Auto Spell Check მართლწერის ავტომატური შემოწმება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index abe2b4bc28..a5fc870751 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -156,6 +156,19 @@ digits Malayalam 말라얄람어 Paste without Formatting 서식 없이 붙여넣기 Clear 지우기 Find and Replace… 찾기 및 바꾸기… + Find and Replace 찾기 및 바꾸기 + Find: 찾기: + Replace With: 바꿀 내용: + Replace & Find 바꾼 후 찾기 + Replace All 모두 바꾸기 + Match Case 대/소문자 구분 + Find Whole Word 단어 단위로 찾기 + Search Backwards 역방향 검색 + Check Hidden Layers 숨겨진 레이어 확인 + Check Locked Layers 잠긴 레이어 확인 +@msg No matches found 일치하는 항목이 없습니다 +@msg Matches replaced: {n} 바꾼 일치 항목: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} 개체 {_3}의 바이트 {_1}..{_2}에 `find`와 일치하는 항목이 없습니다 Find Next 다음 찾기 Find Objects 개체 찾기 Compare with Image 이미지와 비교 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ed281382a4..3b3d163817 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -582,6 +582,19 @@ Paste without Formatting Plakken zonder opmaak Clear Wissen Find and Replace… Zoeken en vervangen… + Find and Replace Zoeken en vervangen + Find: Zoeken: + Replace With: Vervangen door: + Replace & Find Vervangen en zoeken + Replace All Alles vervangen + Match Case Hoofdlettergevoelig + Find Whole Word Heel woord zoeken + Search Backwards Achterwaarts zoeken + Check Hidden Layers Verborgen lagen controleren + Check Locked Layers Vergrendelde lagen controleren +@msg No matches found Geen overeenkomsten gevonden +@msg Matches replaced: {n} Vervangen overeenkomsten: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} geen overeenkomst van `find` bij bytes {_1}..{_2} van object {_3} Find Next Volgende zoeken Spelling Spelling Auto Spell Check Automatische spellingcontrole diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 08e96e6a35..6f91958d78 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -93,6 +93,19 @@ Paste without Formatting Wklej bez formatowania Clear Wyczyść Find and Replace… Znajdź i zamień… + Find and Replace Znajdź i zamień + Find: Znajdź: + Replace With: Zastąp przez: + Replace & Find Zastąp i znajdź + Replace All Zastąp wszystko + Match Case Uwzględnij wielkość liter + Find Whole Word Znajdź całe słowo + Search Backwards Szukaj wstecz + Check Hidden Layers Sprawdź ukryte warstwy + Check Locked Layers Sprawdź zablokowane warstwy +@msg No matches found Nie znaleziono dopasowań +@msg Matches replaced: {n} Zastąpione dopasowania: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} brak dopasowania `find` w bajtach {_1}..{_2} obiektu {_3} Find Next Znajdź następny Spelling Pisownia Auto Spell Check Automatyczne sprawdzanie pisowni diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 79c4d9dc8e..2e096d6485 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1140,6 +1140,19 @@ antiAlias Sharp Nítido Find Font… Localizar Fonte… Find Next Localizar Próximo Find and Replace… Localizar e Substituir… + Find and Replace Localizar e Substituir + Find: Localizar: + Replace With: Substituir por: + Replace & Find Substituir e Localizar + Replace All Substituir Tudo + Match Case Diferenciar Maiúsculas de Minúsculas + Find Whole Word Localizar Palavra Inteira + Search Backwards Pesquisar para Trás + Check Hidden Layers Verificar Camadas Ocultas + Check Locked Layers Verificar Camadas Bloqueadas +@msg No matches found Nenhuma correspondência encontrada +@msg Matches replaced: {n} Correspondências substituídas: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} nenhuma correspondência de `find` nos bytes {_1}..{_2} do objeto {_3} First Page Primeira Página First-line Left Indent Recuo Esquerdo da Primeira Linha Fisheye… Olho de Peixe… diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 9f608618e7..b88785cf7a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1249,6 +1249,19 @@ font-technology Variable Вариативные Fill: click for swatches, Shift-click for the color mixer Заливка: щёлкните для образцов, Shift+щелчок — для смесителя цветов Find Найти Find and Replace… Найти и заменить… + Find and Replace Найти и заменить + Find: Найти: + Replace With: Заменить на: + Replace & Find Заменить и найти + Replace All Заменить все + Match Case Учитывать регистр + Find Whole Word Найти слово целиком + Search Backwards Искать назад + Check Hidden Layers Проверять скрытые слои + Check Locked Layers Проверять заблокированные слои +@msg No matches found Совпадений не найдено +@msg Matches replaced: {n} Заменено совпадений: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} в байтах {_1}..{_2} объекта {_3} нет совпадения с `find` Find Font Найти шрифт Find Font… Найти шрифт… Find Next Найти далее diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 6156ca23d5..b36244f510 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1215,6 +1215,19 @@ font-technology Variable Variabla Fill: click for swatches, Shift-click for the color mixer Fyllning: klicka för färgrutor, Shift-klicka för färgmixern Find Sök Find and Replace… Sök och ersätt… + Find and Replace Sök och ersätt + Find: Sök: + Replace With: Ersätt med: + Replace & Find Ersätt och sök + Replace All Ersätt alla + Match Case Matcha skiftläge + Find Whole Word Sök hela ord + Search Backwards Sök bakåt + Check Hidden Layers Kontrollera dolda lager + Check Locked Layers Kontrollera låsta lager +@msg No matches found Inga träffar hittades +@msg Matches replaced: {n} Ersatta träffar: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} ingen träff för `find` vid byte {_1}..{_2} i objekt {_3} Find Font Sök typsnitt Find Font… Sök typsnitt… Find Next Sök nästa diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 7120d44707..964a66274a 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1204,6 +1204,19 @@ font-technology Variable Değişken Fill: click for swatches, Shift-click for the color mixer Doldur: renk örnekleri için tıklayın, renk karıştırıcı için Shift tuşunu basılı tutarak tıklayın Find Bul Find and Replace… Bul ve Değiştir… + Find and Replace Bul ve Değiştir + Find: Bul: + Replace With: Şununla Değiştir: + Replace & Find Değiştir ve Bul + Replace All Tümünü Değiştir + Match Case Büyük/Küçük Harf Eşleştir + Find Whole Word Tam Sözcüğü Bul + Search Backwards Geriye Doğru Ara + Check Hidden Layers Gizli Katmanları Denetle + Check Locked Layers Kilitli Katmanları Denetle +@msg No matches found Eşleşme bulunamadı +@msg Matches replaced: {n} Değiştirilen eşleşmeler: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} {_3} nesnesinin {_1}..{_2} baytlarında `find` eşleşmesi yok Find Font Yazı Tipi Bul Find Font… Yazı Tipi Bul… Find Next Sonrakini Bul diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 84f296b0a6..d23d1f72ca 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1254,6 +1254,19 @@ font-technology Variable Варіативні Fill: click for swatches, Shift-click for the color mixer Заливка: клацніть для зразків, Shift+клацання — для змішувача кольорів Find Знайти Find and Replace… Знайти та замінити… + Find and Replace Знайти та замінити + Find: Знайти: + Replace With: Замінити на: + Replace & Find Замінити та знайти + Replace All Замінити все + Match Case Враховувати регістр + Find Whole Word Знайти слово цілком + Search Backwards Шукати назад + Check Hidden Layers Перевіряти приховані шари + Check Locked Layers Перевіряти заблоковані шари +@msg No matches found Збігів не знайдено +@msg Matches replaced: {n} Замінено збігів: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} у байтах {_1}..{_2} об’єкта {_3} немає збігу з `find` Find Font Знайти шрифт Find Font… Знайти шрифт… Find Next Знайти далі diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index e8b9e5758f..5bebf649d9 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1470,6 +1470,19 @@ digits Malayalam Malayalam Posterization Áp phích hóa Find Tìm Find and Replace… Tìm và thay thế… + Find and Replace Tìm và thay thế + Find: Tìm: + Replace With: Thay thế bằng: + Replace & Find Thay thế và tìm + Replace All Thay thế tất cả + Match Case Phân biệt chữ hoa chữ thường + Find Whole Word Tìm toàn bộ từ + Search Backwards Tìm ngược + Check Hidden Layers Kiểm tra lớp ẩn + Check Locked Layers Kiểm tra lớp bị khóa +@msg No matches found Không tìm thấy kết quả khớp +@msg Matches replaced: {n} Số kết quả khớp đã thay thế: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} không có kết quả khớp với `find` tại byte {_1}..{_2} của đối tượng {_3} Find Font Tìm phông Find Font Files Tìm tệp phông chữ Find Fonts Tìm phông chữ diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 719968086f..eb4d47a4dd 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1192,6 +1192,19 @@ antiAlias Sharp 锐利 Fill: click for swatches, Shift-click for the color mixer 填色:单击开启色板,按住 Shift 单击开启混色器 Find 查找 Find and Replace… 查找和替换… + Find and Replace 查找和替换 + Find: 查找: + Replace With: 替换为: + Replace & Find 替换并查找 + Replace All 全部替换 + Match Case 区分大小写 + Find Whole Word 查找全字匹配 + Search Backwards 反向搜索 + Check Hidden Layers 检查隐藏图层 + Check Locked Layers 检查锁定图层 +@msg No matches found 未找到匹配项 +@msg Matches replaced: {n} 已替换的匹配项:{n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} 对象 {_3} 的字节 {_1}..{_2} 处没有 `find` 的匹配项 Find Font 查找字体 Find Font… 查找字体… Find Next 查找下一个 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 121a8b8c02..f054cbeda5 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1226,6 +1226,19 @@ font-technology Variable 可變 Fill: click for swatches, Shift-click for the color mixer 填色:按一下開啟色票,按住 Shift 按一下開啟混色器 Find 尋找 Find and Replace… 尋找與取代… + Find and Replace 尋找與取代 + Find: 尋找: + Replace With: 取代為: + Replace & Find 取代並尋找 + Replace All 全部取代 + Match Case 大小寫須相符 + Find Whole Word 尋找全字 + Search Backwards 反向搜尋 + Check Hidden Layers 檢查隱藏圖層 + Check Locked Layers 檢查鎖定圖層 +@msg No matches found 找不到相符項目 +@msg Matches replaced: {n} 已取代的相符項目:{n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} 物件 {_3} 的位元組 {_1}..{_2} 處沒有 `find` 的相符項目 Find Font 尋找字體 Find Font… 尋找字體… Find Next 尋找下一個 diff --git a/crates/ui-egui/src/menus/entries.rs b/crates/ui-egui/src/menus/entries.rs index 953b5b58f4..ebf5707949 100644 --- a/crates/ui-egui/src/menus/entries.rs +++ b/crates/ui-egui/src/menus/entries.rs @@ -146,9 +146,10 @@ const NOT_INSERTED_MENUS: [&str; 4] = ["VectorCraft", "File", "Window", "Help"]; /// Commands whose menu items do more than run the command, which action playback does not do: /// Object › Image Trace › Make and Make and Expand trace off the UI thread with progress and Cancel -/// ([`crate::trace_runs::start`]), and Object › Pattern › Make and Edit Pattern open the Pattern -/// Options panel. -const MENU_ONLY_COMMANDS: [&str; 4] = ["imageTrace.make", "imageTrace.makeAndExpand", "object.pattern.make", "object.pattern.edit"]; +/// ([`crate::trace_runs::start`]), Object › Pattern › Make and Edit Pattern open the Pattern +/// Options panel, and Edit › Find Next goes on from the last Find and Replace search or opens its +/// dialog ([`crate::dialogs::find_replace::find_next`]). +const MENU_ONLY_COMMANDS: [&str; 5] = ["imageTrace.make", "imageTrace.makeAndExpand", "object.pattern.make", "object.pattern.edit", "edit.findNext"]; /// The View menu commands that the app runs itself, not the engine, and that can be steps of an /// action ([`plays_in_app`]): Outline, Pixel Preview, Trim View, Presentation Mode and Screen Mode, diff --git a/crates/ui-egui/src/menus/invoke.rs b/crates/ui-egui/src/menus/invoke.rs index 3aab5e1e44..475d71ed07 100644 --- a/crates/ui-egui/src/menus/invoke.rs +++ b/crates/ui-egui/src/menus/invoke.rs @@ -298,6 +298,18 @@ fn open_view_dialog(app: &mut VectorcraftApp, id: &str, p: &Value) -> bool { } return true; } + // Find Next with no text to find, as its menu item runs it: the next match of the last Find + // and Replace search, or the dialog when there has been none. + if id == crate::dialogs::find_replace::NEXT + && p.get("find").is_none_or(|f| f.as_str() == Some("")) + && p.as_object().is_none_or(|o| o.len() <= 1) + && app.session.active().is_some() + { + if let Err(e) = crate::dialogs::find_replace::find_next(app) { + app.status(e); + } + return true; + } // Edit Views…: the saved views in a list, to rename or delete. if id == "view.saved.edit" && p.as_object().is_none_or(|o| o.is_empty()) { if let Err(e) = crate::dialogs::edit_views::open(app) { diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 7b7f7a6b21..f2a0b789d1 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -705,6 +705,10 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result< "ui.paramDialog" => { let cmd = s("command").unwrap_or_default(); let mut fields = p.get("params").and_then(Value::as_object).cloned().unwrap_or_default(); + // Find and Replace has a dialog of its own, which stays open from match to match. + if cmd == crate::dialogs::find_replace::COMMAND { + return Some(crate::dialogs::find_replace::open(app, &fields)); + } fields.insert("__command".into(), json!(cmd)); fields.insert("__label".into(), json!(s("label").unwrap_or(cmd.clone()))); app.ui.dialog = Some(crate::state::Dialog { kind: "command".into(), fields }); diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index 4b86b4152d..538ffd303b 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -95,7 +95,7 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> { c("Paste without Formatting", "edit.pasteWithoutFormatting"), c("Clear", "edit.clear"), Sep, - cp("Find and Replace…", "edit.findReplace", json!({"find": "", "replace": "", "matchCase": false, "wholeWord": false})), + cp("Find and Replace…", "edit.findReplace", crate::dialogs::find_replace::menu_params()), cp("Find Next", "edit.findNext", json!({"find": ""})), sub("Spelling", vec![c("Auto Spell Check", "edit.autoSpellCheck"), todos("Check Spelling…", "Cmd+I")]), // Edit › Edit Custom Dictionary…, beside Spelling, on the public Check and correct diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 52c8c2e7bf..641268a9ab 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -802,7 +802,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{effect: id, index?: int (edit that applied effect in place, prefilled; OK runs effect.setParams), item?: appearance item index|null (the fill/stroke whose effects, null the object's; default: the Appearance panel's active item), aligned?: bool (index and item are rows of the first selected object's stack, which OK edits in each object where it has them, as effect.setParams does)} open the effect's dialog with live preview; without `index`, an effect already in that list first opens `effectExists` (confirm edits it, discard adds another) → {pending: \"effectExists\"}", ), - ("ui.paramDialog", "Command Dialog", "", "{command, label?, params} open a parameter dialog for any command"), + ( + "ui.paramDialog", + "Command Dialog", + "", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place, and Edit › Find Next goes on from it in the same document while the dialog is closed", + ), ( "ui.recolorDialog", "Recolor Artwork…", diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index ded320a5aa..796e2016db 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -387,7 +387,7 @@ mod tests { ("object.path.cleanUp", "command"), ("object.mesh.create", "command"), ("type.smartPunctuation", "command"), - ("edit.findReplace", "command"), + ("edit.findReplace", crate::dialogs::find_replace::KIND), ("object.path.smooth", crate::dialogs::smooth_slider::KIND), ]; for (id, kind) in expected { diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 80a87b4563..bfaabf7db6 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -582,6 +582,11 @@ pub struct UiState { /// The Replace Font request behind the status bar's warning ([`ReplaceFontWarning`]). Not saved. #[serde(skip)] pub replace_font_warning: Option<ReplaceFontWarning>, + /// The last Find and Replace search ([`crate::dialogs::find_replace`]): the dialog's Find and + /// Replace With text, its options and the place the search reached, which Edit › Find Next + /// goes on from while the dialog is closed. Not saved. + #[serde(skip)] + pub last_find: Option<serde_json::Value>, /// The notes of the last open that gave any, or of the last save or export, with the status /// text that names the first of them: hovering that text lists them when there are several. /// Not saved. @@ -1171,6 +1176,7 @@ impl Default for UiState { status: String::new(), status_sets: 0, replace_font_warning: None, + last_find: None, status_notes: None, palette_open: false, palette_query: String::new(), diff --git a/docs/mcp.md b/docs/mcp.md index 2e43c14d0e..7350d2f4c2 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8688,6 +8688,52 @@ for it (each a `text.editRange {id, start, end, insert}` item labelled with its All (`text.spelling.ignoreAll {word}`) and Add to Dictionary (`text.spelling.addWord {word}`); the context menu's entries list them with their params. A right-click on type also has Spelling › Auto Spell Check (`edit.autoSpellCheck`). +## Find and Replace + +`edit.findNext {find, matchCase?, wholeWord?, backwards?, hiddenLayers?, lockedLayers?, from?}` finds the next match +of `find` and selects its type object. The result is `{id, start, end, index, count, selected}`: `start` and `end` +are byte offsets in the type object's text, the ones `text.editRange` takes, `index` is the match's place among all +the matches (from 1) and `count` is how many there are. With no match it is `{id: null, count: 0}`. Nothing is +recorded for undo. + +- The search reaches visible, unlocked type on visible, unlocked layers, off locked artboards. `hiddenLayers` adds the + type of hidden layers and sublayers and `lockedLayers` that of locked ones, as Check Hidden Layers and Check Locked + Layers do in [Find and replace text](https://helpx.adobe.com/pdf/illustrator_reference.pdf). A hidden or locked + object or group keeps its type out. +- `backwards` is Search Backwards on that page: the search goes from the bottom of the stacking order to the top. + Without it, the search goes from the top down. +- These rules are VectorCraft's own. Inside a type object the matches come in reading order, or from the last with + `backwards`. `from: {id, start, end}`, a match the command returned or the range `edit.replaceMatch` returned, is + where the search goes on from; past the last match it starts again at the first. Without `from` it goes on after the + first selected type object, and with no type selected it starts at the first match. A match on a hidden or locked + layer comes back with `selected: false` and the selection stays as it is. A match stays inside one style run. + +`edit.replaceMatch {find, replace?, matchCase?, wholeWord?, id, start, end}` replaces that one match with `replace` +as one undo step and returns `{id, start, end, replaced}`, with `start` and `end` the replacement's bytes. Bytes that +are no match of `find` are refused. A match that already reads as `replace` is left as it is, with no undo step and +`replaced: false`. `edit.findReplace {find, replace?, matchCase?, wholeWord?, hiddenLayers?, lockedLayers?, ids?}` +replaces every match in the type the search reaches (or in `ids`) as one undo step and returns `{count, replaced}`, +with `count` the matches and `replaced` those that did not already read as `replace`; when +nothing changes, no undo step is recorded. An empty `find` is an error in all three. + +```json +{"name":"run_command","arguments":{"command":"edit.findNext","params":{"find":"colour","wholeWord":true}}} +{"name":"run_command","arguments":{"command":"edit.replaceMatch","params":{"find":"colour","replace":"color","wholeWord":true,"id":12,"start":4,"end":10}}} +{"name":"run_command","arguments":{"command":"edit.findNext","params":{"find":"colour","wholeWord":true,"from":{"id":12,"start":4,"end":9}}}} +``` + +In the app, Edit › Find and Replace… opens a dialog that stays open (kind `findReplace`), with Find and Replace With +fields, Match Case, Find Whole Word, Search Backwards, Check Hidden Layers and Check Locked Layers, and Find, Replace, +Replace & Find, Replace All and Done. Its fields are `find`, `replace`, `matchCase`, `wholeWord`, `backwards`, +`hiddenLayers`, `lockedLayers` and `action`; `ui.dialog.confirm` runs the `action`: `find` (the default), `replace`, +`replaceFind`, `replaceAll` or `done`, which closes the dialog. The dialog shows the match found in its line of text +with its place among the matches. Replace and Replace & Find change a match that Find reached with the Find text and +the options as they are now, and find one otherwise. Enter runs Find. Edit › Find Next goes on from the dialog's last +search while the dialog is closed, and opens the dialog when there has been none. A place the search reached in one +document is not used in another, nor once the Find text or an option that decides a match changes: the search then +starts again as it does without `from`. `ui.paramDialog` opens +the dialog on the last search, with the fields its `params` give in its place. + ## Justification options diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 8f5043993a..315f02eee1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1659,6 +1659,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur The Layers panel's New Layer (on top), Select Art and Target (Shift-click), Move Rows (the copy), Template, Paste Remembers Layers and Release to Layers (Build) refuse a value other than true, false or null, such as "true", and leave the document, the selection, the highlighted rows and the undo history as they were; New Sublayer refuses such a `top` too. Change Case, Smart Punctuation, Find and Replace, Convert To Area Type, Convert To Point Type, Type on a Path Options, the Type on a Path effects and Fill with Placeholder Text record no undo step when they change nothing. Find and Replace, Find Next, Change Case, Smart Punctuation, Insert Character and Type on a Path Options refuse a text option other than text or null, such as a replacement of 5, and a switch other than true, false or null, such as "true". Smart Punctuation also refuses a scope other than selection or document, Type on a Path Options a spacing given as text, and Find and Replace `ids` that are not a list of existing object ids. Each leaves the text, the selection and the undo history as they were. + Edit › Find and Replace… opens a dialog that stays open, with Find, Replace, Replace & Find, Replace All and Done, and Match Case, Find Whole Word, Search Backwards, Check Hidden Layers and Check Locked Layers. Find Next (`edit.findNext`) returns each match with its bytes, from the top of the stacking order down or, with Search Backwards, from the bottom up; `edit.replaceMatch` replaces one match as one undo step; Edit › Find Next goes on from the dialog's last search. The commands that take `keepModel` (fills and strokes, Appearance rows, Live Paint, Shape Builder fills, gradient stops and freeform points, gradient mesh points, type colors, the Symbol Stainer and the swatch commands) refuse a `keepModel` other than true, false or null, such as "true". Toggle Fill/Stroke Focus (`fill`), Invert, Complement, Apply Last Color and Apply Last Gradient (`stroke`), `paint.setFill` and `paint.setStroke` (`focus`, `none`), and `appearance.setItem`, `livePaint.fill`, `livePaint.strokeEdge`, a `shapeBuilder.merge` `fill`, `swatch.new` and `swatch.edit`'s `paint` (`none`) refuse such a value too. Each leaves the document, its undo history and the defaults for new art as they were. The shape tools' commands (Rectangle, Polygon, Star, Flare, Spiral, Arc, Rectangular Grid and Polar Grid), `path.create` (with `anchors` or `d`), the type commands (new type, type in a path, character formats, the byte range a text command takes, Touch Type, font size steps, `text.getRange`, Optical Margin Alignment, System Layout, Fractional Widths, Ruby and Area Type Options), the symbol commands (Place, Delete, the Symbol Sprayer and the symbolism tools), the swatch commands, the Appearance panel's commands, the gradient and freeform gradient commands, Shape Builder, Live Paint and Image Trace refuse an option other than true, false or null and a number given as text, such as "true" or "40", and leave the document and its undo history as they were. - **Fonts:** a font is found by any of its names (family and style in every language of its name table, legacy family/style pairs, PostScript name), so documents from other apps open with the font they name; Find Font and `text.fonts` say for each font whether it was found exactly, by another name, substituted or missing, and how many glyphs are missing. PDF and `.ai` import brings Japanese text back as live type: CID fonts without a ToUnicode map read through the standard CMaps, vertical columns (WMode 1) as vertical type, letter spacing as tracking; a glyph is live type only when the installed font (in the closest style of its family) draws the same glyph, and text in a font that isn't installed comes in as live type shown in the fallback font until the font is installed (exports that draw it — PDF, EPS, EMF/WMF, raster, SVG outlines or embedded fonts — warn that they wrote the fallback font, and Print and Print Preview warn about the type that prints in it; `textAs: outlines` keeps the PDF's embedded glyphs). Two installed versions of one family and style (a font library keeping an old file beside a new one) both load, the first staying the one the family and style resolve to; PDF and `.ai` import tries each version when the glyphs differ, and type set in a version other than that one names it (`CharStyle::font_version`), which layout, the substituted-glyph highlight, Find Font, Package and Document Info follow. Fonts outside the font folders are listed too: those font services such as Adobe Fonts load on Windows, through DirectWrite and, for those only GDI lists, through GDI (#1258), and those apps and font managers register with CoreText on macOS (#579). When a document opens with fonts that aren't available, fonts used only in symbols included, a Missing Fonts dialog lists them after the linked-file questions, with Find Fonts (Type › Find Font on them) and Close. Its Find in Folder… (in Find Font too) searches a folder on several threads, reads only what the font scan reads of font files and skips app packages, the Program Files and ProgramData folders, the system's folders and the app data folders in a home folder; Add Fonts copies the font files the user chooses, suitcase fonts with their resource fork, into VectorCraft's own Fonts folder, which the desktop app and `vectorcraft-cli` read (`text.missingFonts`, `text.findFontFiles`, `text.addFontFiles`). The font scan on Linux also reads the folders fontconfig's configuration lists, such as TeX fonts under `/usr/share/texmf/fonts` (#1548, fixes #1529; not verified on Linux). From b0700b1e8457d21d849f3155044b06201baeb88b Mon Sep 17 00:00:00 2001 From: yoriswind <yoriswind@yahoo.com> Date: Sat, 14 Nov 2026 14:37:18 -0800 Subject: [PATCH 030/247] 7238: add Control bar corner radius field --- crates/ui-egui/src/chrome/control_bar.rs | 44 +++ crates/ui-egui/tests/control_bar_corners.rs | 307 ++++++++++++++++++++ docs/gaps.md | 4 +- docs/roadmap.md | 5 +- docs/target-app-parity.md | 6 +- docs/ui-parity.md | 4 +- 6 files changed, 364 insertions(+), 6 deletions(-) create mode 100644 crates/ui-egui/tests/control_bar_corners.rs diff --git a/crates/ui-egui/src/chrome/control_bar.rs b/crates/ui-egui/src/chrome/control_bar.rs index fc06926247..57f5e8b644 100644 --- a/crates/ui-egui/src/chrome/control_bar.rs +++ b/crates/ui-egui/src/chrome/control_bar.rs @@ -77,6 +77,48 @@ pub fn anchor_buttons(app: &mut VectorcraftApp, ui: &mut Ui, controls: AnchorCon } } +/// The selected paths' eligible corners, as document lengths, beside the anchor controls. +/// Explicit partial selections with no corners contribute no target (unlike `picked`'s fallback). +fn corner_radius(app: &mut VectorcraftApp, ui: &mut Ui, t: &Tokens, reserve: f32) { + let Some(st) = app.session.active() else { return }; + let mut items = Vec::new(); + let mut radius: Option<f64> = None; + let mut mixed = false; + for &id in &st.selection.objects { + let Some(lc) = st.doc.node(id).and_then(vectorcraft_doc::LiveCorners::of) else { continue }; + let corners = st.selection.partial(id).map_or_else(|| lc.all(), |anchors| lc.corners_of(anchors)); + if corners.is_empty() { + continue; + } + for &k in &corners { + // Keep absolute requested radii, even when their drawing is fitted smaller. Relative + // storage is a fraction, but the field and setLiveShape both consume document lengths. + let value = if lc.radii_relative() { lc.radius(k) * lc.corner(k).map_or(0.0, |c| c.max_radius()) } else { lc.radius(k) }; + if let Some(first) = radius { + mixed |= (first - value).abs() >= 1e-9; + } else { + radius = Some(value); + } + } + items.push(json!({"id": id, "corners": corners})); + } + if items.is_empty() { + return; + } + let label = tl!("Corner Radius:"); + let text = egui::RichText::new(label).size(12.0).color(t.text); + if ui.available_width() < row_width(ui, &[widgets::text_width(ui, text.clone()), INLINE_FIELD_WIDTH]) + reserve { + return; + } + widgets::field_label(ui, text); + let shown = if mixed { None } else { radius }; + let unit = app.session.general_unit(); + if let Some(radius) = widgets::num_field_named(ui, "cb-corner-radius", Some(label), shown, unit, INLINE_FIELD_WIDTH) { + // App::run reports any command failure in the status bar, as the other inline fields do. + app.run("object.setLiveShape", json!({"items": items, "radius": radius.max(0.0)})).ok(); + } +} + /// The id of the Control bar's isolation button. pub(super) const ISOLATION_BUTTON: &str = "cb-isolation"; @@ -830,6 +872,8 @@ fn contents(app: &mut VectorcraftApp, ui: &mut Ui, t: &Tokens, bar: egui::Rect, } if anchors != AnchorControls::None && group_on(app, "anchors") { anchor_buttons(app, ui, anchors); + let reserve = transform_reserve(app, ui, !sel.is_empty()); + corner_radius(app, ui, t, reserve); } let object_options = group_on(app, "objectOptions"); if object_options { diff --git a/crates/ui-egui/tests/control_bar_corners.rs b/crates/ui-egui/tests/control_bar_corners.rs new file mode 100644 index 0000000000..7386e44a8c --- /dev/null +++ b/crates/ui-egui/tests/control_bar_corners.rs @@ -0,0 +1,307 @@ +//! Numeric selected-corner radii in the actual Control bar. +// Tests may unwrap/panic (AGENTS.md, Robustness). +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + +use std::sync::{Mutex, MutexGuard}; + +use egui::{Event, Rect, vec2}; +use serde_json::json; +use vectorcraft_doc::NodeId; +use vectorcraft_engine::Session; +use vectorcraft_ui_egui::{VectorcraftApp, chrome, i18n, panels, theme}; + +static CASE: Mutex<()> = Mutex::new(()); + +struct Language { + _lock: MutexGuard<'static, ()>, + previous: i18n::Lang, +} +impl Language { + fn english() -> Self { + let lock = CASE.lock().unwrap_or_else(|e| e.into_inner()); + let previous = i18n::current(); + i18n::set_current(i18n::Lang::EN); + Self { _lock: lock, previous } + } +} +impl Drop for Language { + fn drop(&mut self) { + i18n::set_current(self.previous); + } +} + +fn ordinary_corner() -> (VectorcraftApp, NodeId) { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 500, "height": 400, "profile": null})).unwrap(); + // A plain, original Pen-like path, not a live rectangle. + let result = app + .run( + "path.create", + json!({"anchors": [ + {"x": 100, "y": 100}, {"x": 220, "y": 100}, + {"x": 220, "y": 180}, {"x": 100, "y": 180} + ], "closed": true}), + ) + .unwrap(); + let id = NodeId(result["id"].as_u64().unwrap()); + app.select_tool("directSelection"); + app.run("select.anchors", json!({"id": id.0, "anchors": [[0, 1]], "mode": "set"})).unwrap(); + (app, id) +} + +struct Painted { + nodes: Vec<egui::accesskit::Node>, + texts: Vec<(String, Rect)>, +} +impl Painted { + fn radius_field(&self) -> Option<&egui::accesskit::Node> { + self.nodes.iter().find(|node| { + node.role() == egui::accesskit::Role::TextInput && node.label().is_some_and(|name| name.trim_end_matches(':') == "Corner Radius") + }) + } + + fn has_text(&self, name: &str) -> bool { + self.texts.iter().any(|(text, _)| text == name) + } +} + +struct Frames { + ctx: egui::Context, + time: f64, + width: f32, + properties: bool, +} +impl Frames { + fn new(width: f32, properties: bool) -> Self { + let ctx = egui::Context::default(); + ctx.enable_accesskit(); + theme::install_fonts(&ctx); + theme::apply(&ctx, theme::Brightness::MediumDark); + Self { ctx, time: 0.0, width, properties } + } + + fn frame(&mut self, app: &mut VectorcraftApp, events: Vec<Event>) -> Painted { + self.time += 0.05; + let mut output = self.ctx.run_ui( + egui::RawInput { + screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, vec2(self.width, 1100.0))), + time: Some(self.time), + focused: true, + events, + ..Default::default() + }, + |ui| { + if self.properties { + panels::properties::show(app, ui); + } else { + chrome::control_bar(app, ui); + } + }, + ); + let texts = output + .shapes + .iter() + .filter_map(|clipped| match &clipped.shape { + egui::Shape::Text(text) => Some((text.galley.text().to_owned(), Rect::from_min_size(text.pos, text.galley.size()))), + _ => None, + }) + .collect(); + let nodes = + output.platform_output.accesskit_update.take().map(|update| update.nodes.into_iter().map(|(_, node)| node).collect()).unwrap_or_default(); + output.textures_delta.clear(); + Painted { nodes, texts } + } + + fn settled(&mut self, app: &mut VectorcraftApp) -> Painted { + self.frame(app, vec![]); + self.frame(app, vec![]); + self.frame(app, vec![]) + } +} + +#[test] +fn corner_radius_existing_anchor_controls_and_properties_remain_available() { + let _language = Language::english(); + let (mut app, _) = ordinary_corner(); + let bar = Frames::new(1800.0, false).settled(&mut app); + assert!(bar.has_text("Convert:") && bar.has_text("Anchors:"), "{:?}", bar.texts); + assert!(bar.nodes.iter().any(|node| node.label() == Some("Remove Anchor Points"))); + let properties = Frames::new(360.0, true).settled(&mut app); + assert!(properties.has_text("Corner Radius:"), "{:?}", properties.texts); + assert!(properties.texts.iter().any(|(text, _)| text == "0 pt")); +} + +#[test] +fn corner_radius_selected_ordinary_corner_has_a_named_control_bar_field() { + let _language = Language::english(); + let (mut app, _) = ordinary_corner(); + let bar = Frames::new(1800.0, false).settled(&mut app); + assert!(bar.radius_field().is_some(), "no named Corner Radius input in actual Control bar: {:?}", bar.texts); +} + +fn node_path(app: &VectorcraftApp, id: NodeId) -> vectorcraft_geom::PathData { + app.session.doc().unwrap().doc.node(id).unwrap().path_data().unwrap().clone() +} + +fn corner_state(app: &VectorcraftApp, id: NodeId) -> (vectorcraft_geom::PathData, serde_json::Value, vectorcraft_doc::Selection, usize) { + let state = app.session.doc().unwrap(); + let node = state.doc.node(id).unwrap(); + (node.path_data().unwrap().clone(), serde_json::to_value(node.live_shape()).unwrap(), state.selection.clone(), state.history.undo.len()) +} + +fn picked_corner(app: &mut VectorcraftApp, id: NodeId, corner: usize, mode: &str) { + let anchors = { + let node = app.session.doc().unwrap().doc.node(id).unwrap(); + vectorcraft_doc::LiveCorners::of(node).unwrap().anchors_of(&std::collections::BTreeSet::from([corner])) + }; + app.run("select.anchors", json!({"id": id.0, "anchors": anchors, "mode": mode})).unwrap(); +} + +fn radius(app: &VectorcraftApp, id: NodeId, corner: usize) -> f64 { + let node = app.session.doc().unwrap().doc.node(id).unwrap(); + vectorcraft_doc::LiveCorners::of(node).unwrap().radius(corner) +} + +fn field_text(painted: &Painted) -> &str { + painted.radius_field().unwrap().value().unwrap_or_default() +} + +fn close(a: f64, b: f64) -> bool { + (a - b).abs() < 1e-8 +} + +impl Frames { + fn edit_radius(&mut self, app: &mut VectorcraftApp, text: &str) -> Painted { + let painted = self.settled(app); + let bounds = painted.radius_field().unwrap().bounds().unwrap(); + let at = egui::pos2(((bounds.x0 + bounds.x1) / 2.0) as f32, ((bounds.y0 + bounds.y1) / 2.0) as f32); + let button = |pressed| Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }; + self.frame(app, vec![Event::PointerMoved(at), button(true)]); + self.frame(app, vec![button(false)]); + let command = + egui::Modifiers { command: true, ctrl: !cfg!(target_os = "macos"), mac_cmd: cfg!(target_os = "macos"), ..egui::Modifiers::NONE }; + let key = |key, pressed, modifiers| Event::Key { key, physical_key: Some(key), pressed, repeat: false, modifiers }; + self.frame(app, vec![Event::ModifiersChanged(command), key(egui::Key::A, true, command)]); + self.frame(app, vec![key(egui::Key::A, false, command), Event::ModifiersChanged(egui::Modifiers::NONE), Event::Text(text.into())]); + self.frame(app, vec![key(egui::Key::Enter, true, egui::Modifiers::NONE)]); + self.frame(app, vec![key(egui::Key::Enter, false, egui::Modifiers::NONE)]); + self.settled(app) + } +} + +#[test] +fn corner_radius_typing_edits_only_the_selected_corner_and_undo_restores_it() { + let _language = Language::english(); + let (mut app, id) = ordinary_corner(); + app.run("object.setLiveShape", json!({"id": id.0, "corners": [1], "radius": 160, "kind": "chamfer"})).unwrap(); + picked_corner(&mut app, id, 1, "set"); + let before = corner_state(&app, id); + let base = { + let node = app.session.doc().unwrap().doc.node(id).unwrap(); + let corners = vectorcraft_doc::LiveCorners::of(node).unwrap(); + assert!(corners.drawn_radius(1) < corners.radius(1), "the stored request exceeds the fitted radius"); + corners.base.clone().into_owned() + }; + let mut frames = Frames::new(1800.0, false); + assert_eq!(field_text(&frames.settled(&mut app)), "160 pt", "show requested absolute radius, not fitted size"); + frames.edit_radius(&mut app, "6 pt"); + let state = app.session.doc().unwrap(); + let node = state.doc.node(id).unwrap(); + let corners = vectorcraft_doc::LiveCorners::of(node).unwrap(); + assert_eq!(&*corners.base, &base, "the uncut outline does not move"); + assert!(close(corners.radius(1), 6.0)); + assert_eq!(corners.kind(1), vectorcraft_geom::shapes::CornerKind::Chamfer); + for corner in [0, 2, 3] { + assert_eq!(corners.radius(corner), 0.0); + assert_eq!(corners.kind(corner), vectorcraft_geom::shapes::CornerKind::Round); + } + let logical = std::collections::BTreeSet::from([1]); + assert_eq!(state.selection.objects, vec![id]); + assert_eq!(corners.corners_of(state.selection.partial(id).unwrap()), logical); + assert_eq!(state.selection.partial(id).unwrap(), &corners.anchors_of(&logical)); + assert_eq!(state.history.undo.len(), before.3 + 1); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(corner_state(&app, id), before); +} + +#[test] +fn corner_radius_mixed_targets_resolve_relative_units_and_skip_noncorner_partials() { + let _language = Language::english(); + let (mut app, ordinary) = ordinary_corner(); + app.run("object.setLiveShape", json!({"id": ordinary.0, "corners": [1], "radius": 6})).unwrap(); + let result = app.run("shape.rectangle", json!({"x": 300, "y": 100, "width": 100, "height": 100})).unwrap(); + let live = NodeId(result["id"].as_u64().unwrap()); + app.run("object.setLiveShape", json!({"id": live.0, "relativeRadii": true, "radius": 10})).unwrap(); + let result = app + .run( + "path.create", + json!({"anchors": [ + {"x": 300, "y": 250}, {"x": 400, "y": 250}, + {"x": 400, "y": 350, "in": [400, 330], "out": [400, 370]}, + {"x": 450, "y": 400} + ]}), + ) + .unwrap(); + let excluded = NodeId(result["id"].as_u64().unwrap()); + let excluded_before = node_path(&app, excluded); + let noncorners = std::collections::BTreeSet::from([(0, 0), (0, 2)]); + { + let node = app.session.doc().unwrap().doc.node(excluded).unwrap(); + let corners = vectorcraft_doc::LiveCorners::of(node).unwrap(); + assert!(!corners.all().is_empty(), "this path has another corner that fallback must not edit"); + assert!(corners.corners_of(&noncorners).is_empty(), "an endpoint and a smooth anchor are selected"); + } + picked_corner(&mut app, ordinary, 1, "set"); + picked_corner(&mut app, live, 1, "add"); + app.run("select.anchors", json!({"id": excluded.0, "anchors": noncorners, "mode": "add"})).unwrap(); + app.run("document.setUnits", json!({"units": "Millimeters"})).unwrap(); + let mut frames = Frames::new(1800.0, false); + assert!(field_text(&frames.settled(&mut app)).is_empty(), "6 pt and 10 pt are mixed"); + let depth = app.session.doc().unwrap().history.undo.len(); + let shown = frames.edit_radius(&mut app, "2 mm"); + let expected = 2.0 * 72.0 / 25.4; + assert!(close(radius(&app, ordinary, 1), expected)); + assert_eq!(field_text(&shown), app.session.general_unit().format(expected)); + let node = app.session.doc().unwrap().doc.node(live).unwrap(); + let corners = vectorcraft_doc::LiveCorners::of(node).unwrap(); + assert!(corners.radii_relative()); + let maximum = corners.corner(1).unwrap().max_radius(); + assert!(close(corners.radius(1), expected / maximum)); + for corner in [0, 2, 3] { + assert!(close(corners.radius(corner), 0.2)); + assert_eq!(radius(&app, ordinary, corner), 0.0); + } + assert_eq!(node_path(&app, excluded), excluded_before); + assert!(app.session.doc().unwrap().doc.node(excluded).unwrap().live_shape().is_none()); + assert_eq!(app.session.doc().unwrap().history.undo.len(), depth + 1, "all targets in one edit"); + // With only the non-corner partial left, there is no eligible field. + app.run("select.anchors", json!({"id": excluded.0, "anchors": noncorners, "mode": "set"})).unwrap(); + assert!(frames.settled(&mut app).radius_field().is_none()); +} + +#[test] +fn corner_radius_respects_anchor_group_and_narrow_control_bar_space() { + let _language = Language::english(); + let (mut app, id) = ordinary_corner(); + let mut wide = Frames::new(1800.0, false); + assert!(wide.settled(&mut app).radius_field().is_some()); + app.run("window.control.options", json!({"group": "anchors", "visible": false})).unwrap(); + let hidden = wide.settled(&mut app); + assert!(hidden.radius_field().is_none()); + assert!(!hidden.has_text("Corner Radius:")); + app.run("window.control.options", json!({"group": "anchors", "visible": true})).unwrap(); + let narrow = Frames::new(400.0, false).settled(&mut app); + assert!(narrow.radius_field().is_none()); + assert!(!narrow.has_text("Corner Radius:"), "the complete label and field are omitted together"); + let menu = narrow.nodes.iter().find(|node| node.label() == Some("Panel menu")).unwrap().bounds().unwrap(); + for node in narrow.nodes.iter().filter(|node| node.role() == egui::accesskit::Role::TextInput) { + if let Some(bounds) = node.bounds() { + assert!(bounds.x0 >= -0.5 && bounds.x1 <= menu.x0 + 0.5, "numeric control reaches past the panel menu: {bounds:?}"); + } + } + app.run("select.set", json!({"ids": [id.0]})).unwrap(); + app.select_tool("selection"); + assert!(wide.settled(&mut app).radius_field().is_none(), "ordinary whole-path Selection has no anchor controls"); + app.select_tool("pen"); + assert!(wide.settled(&mut app).radius_field().is_some(), "whole-path anchor-editing tools use all eligible corners"); +} diff --git a/docs/gaps.md b/docs/gaps.md index 5e31ddee13..d7b4900bd8 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Control bar: numeric selected-corner radius (part of #7238, request 3 only); scores and estimates unchanged; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -466,6 +466,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi ## G12 Preferences and panels that don't act yet +- **Done (2026-11-14, part of #7238 request 3):** The Control bar's Anchor Points group offers numeric Corner Radius for eligible selected ordinary and live corners. It shows a common requested radius or a mixed value, uses general document units, and edits eligible corners across selected objects in one Undo through `object.setLiveShape`. Existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Estimate unchanged. - **Done (2026-11-14):** Symbols panel context menu: right-click on a symbol in thumbnail or list view displays a context menu with Place Symbol Instance, Edit Symbol, Duplicate Symbol, Delete Symbol, Break Link to Symbol (enabled when canvas selection includes instances of the symbol), and Select All Instances, selecting the symbol if unselected. Estimate unchanged. - **Done (2026-10-29, #4522):** the Pathfinder panel menu's Make, Release and Expand Compound Shape, which were dimmed placeholders, and the panel's Expand button act on live compound shapes ([Create compound shapes with Pathfinder](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/create-compound-shapes-with-pathfinder.html)): Alt-clicking a Shape Mode makes one in that mode, a Shape Mode sets the mode of the members selected, and the compound shape draws, exports and saves as the area its members' modes make (`object.compoundShape.*`, `crates/engine/src/tests/compound_shape.rs`). Left: blends, envelopes and warps as members, question marks on the buttons for mixed member modes, clicks that hit the area rather than the members. Estimate unchanged. - **Done (2026-10-25, #3426):** Pathfinder panel › Pathfinder Options… ([Pathfinder panel overview](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/pathfinder-panel-overview.html)): Precision (0.001–10 pt; results are refit to within it and pieces thinner than it are dropped), Remove Redundant Points and Divide and Outline Will Remove Unpainted Artwork (pieces of objects with no fill), kept in the preferences (`object.pathfinder.options`, group `pathfinder`) and used by every Shape Mode and Pathfinder button and Repeat; the page gives no defaults, so ours (0.01 pt, both off) keep the earlier results byte for byte. Trap is left as it was. Estimate unchanged. @@ -886,6 +887,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| +| 2026-11-14 | minor | Control bar: Corner Radius edits eligible selected ordinary and live corners in document units, with mixed values and multi-object edits in one Undo (part of #7238, request 3 only). Existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Scores and estimates unchanged. | | 2026-11-12 | minor | 3D: The seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins (the seams of Revolve and of colored lights, and 3D (Classic) Wireframe edges, were already round): no thorns on edge-on facets, and facets with no neighbour now have rounded convex corners ([three-d.md](three-d.md#seams)). Scores and estimates unchanged. | | 2026-11-12 | minor | Explicit editing-data import keeps a single artboard beyond a capped 14,400 pt PDF page (#6865), with a warning; automatic mode stays unchanged. Scores and estimates unchanged. | | 2026-11-09 | minor | G4 review (#6084): positional variants no supported feature draws can be applied as glyph choices in both Glyphs views; unlisted glyphs still respect name ownership. OpenType style options keep only a valid last on-value when enabling a set. Existing contextual/ligature lookup and unsupported-feature gaps remain; estimate unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 1cf18c3ce3..99b567b841 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-13 · **Change:** minor (Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Control bar: numeric selected-corner radius (part of #7238, request 3 only); scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -169,7 +169,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View, middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color, Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | | M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; the script document model and batch work remain | 18–27 | -| M14 | 1.0 polish (preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset <name>, UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307) | 18–28 | +| M14 | 1.0 polish (preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | Control bar Corner Radius for eligible selected corners, including mixed/multi-object values and document units (part of #7238 request 3; requests 1/2 and existing widget-selection behavior unchanged); 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset <name>, UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307) | 18–28 | | — | Interaction fidelity pass (every tool's modifiers, Properties panel per context, isolation, nuance; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed) | ⬜ (new ruler-guide Alt orientation implemented; existing-guide Escape cancellation regression-tested; broader pass remains) | 60–90 | | — | Hardening at scale (big-file corpus, fuzzing, cross-platform + browser QA) | 🟡 PngSuite integrity and bounded fetching verified (#1729); real-world corpus/manual QA remain | 50–80 | | M14 follow-up | Color Picker layout (#2008) | ✅ Compact controls, centered header, stacked actions, aligned fields and screen sampling; narrow windows scroll vertically | Included above | @@ -207,6 +207,7 @@ separate. Scores and hours unchanged. [Behavior and command details](development | Date | Change | Summary | |---|---|---| +| 2026-11-14 | minor | Control bar: Corner Radius edits eligible selected ordinary and live corners in document units, with mixed values and multi-object edits in one Undo (part of #7238, request 3 only). Existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Scores and estimates unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | | 2026-11-12 | minor | Gujarati (`gu`): 4,286-row machine-assisted catalog reviewed by a native speaker, zero/one singular plurals, desktop font fallback and optional Gujarati craft-fonts fallback; all 72 translation tests pass; a web font and about 2,600 untranslated messages remain; scores and estimates unchanged | | 2026-11-12 | minor | Explicit editing-data import keeps a single artboard beyond a capped 14,400 pt PDF page (#6865), with a warning; automatic mode stays unchanged. Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 871ec2e5a6..5eb6cd34e9 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Control bar: numeric selected-corner radius (part of #7238, request 3 only); scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -265,7 +265,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | anti-aliasing ghost borders (#983); TIFF choices and settings are implemented | 2–4 | estimated | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity | 2–4 | estimated | | Automation (Actions, Variables, scripting, batch) | 3 | 60% | a scripting surface (Illustrator: JavaScript/ExtendScript), Batch, image and graph variables, dataset import/export | 8–14 | estimated; MCP `add_text` exposes existing vertical type; score and hours unchanged | -| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the panels that have none, accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged | +| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the panels that have none, accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; numeric Control bar radius for eligible selected corners (part of #7238, request 3 only) | | Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated | | Generative AI (Text to Vector, Generative Recolor, Shape Fill, Concept to Vector, Prompt to Edit, Rewrite Text) | 2 | 0% | a pluggable provider and the panels; needs an owner decision on models | 30–60 | measured (absent) | | **Feature depth** | **105** | **~75%** | | **~250–420** | | @@ -571,6 +571,7 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **Control bar selected-corner radius (part of #7238, request 3):** When the Anchor Points controls are active, eligible ordinary and live path corners expose Corner Radius in general document units. The field shows their common requested radius or a mixed/blank value and edits eligible corners across objects in one Undo through `object.setLiveShape` with explicit corner targets. A partial selection with no eligible corners contributes no target; it does not fall back to all corners. Relative radii are read as lengths, absolute radii keep their requested value, and corner kind, relative mode and unrelated geometry are retained. Existing corner-widget selection and rendering, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Scores and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. @@ -2455,6 +2456,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| +| 2026-11-14 | minor | Control bar: Corner Radius edits eligible selected ordinary and live corners in document units, with mixed values and multi-object edits in one Undo (part of #7238, request 3 only). Existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Scores and estimates unchanged. | | 2026-11-14 | minor | G5: Weather Icons joins Basic Shapes, UI Frames, Map Markers, Inventory Icons and Skill Icons as a sixth built-in symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow; original procedural vector symbols generated in code, no default 9-slice); area score and estimate unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | | 2026-11-12 | minor | Gujarati (`gu`): 4,286-row machine-assisted catalog reviewed by a native speaker, zero/one singular plurals, desktop font fallback and optional Gujarati craft-fonts fallback; all 72 translation tests pass; a web font and about 2,600 untranslated messages remain; scores and estimates unchanged | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 5f26e4377e..8b59b19262 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-13 · **Change:** minor (Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-14 · **Change:** minor (Control bar: numeric selected-corner radius (part of #7238, request 3 only); scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Vector Halftone preview update (2026-11-10): temporary dot selection marks are hidden, and the bounding box stays available (#6369). > @@ -422,6 +422,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Select › Start Global Edit / Stop Global Edit; Properties › Quick Actions with the Global Edit Options popover (Match: Appearance, Size; On Artboards: All Artboards or a range, Include Objects On Canvas; Result(s)); Escape stops it; the matched objects are highlighted in their layer colour while it runs; a Shift-click on a highlighted match leaves it out | partial | #3521, `select.globalEdit` / `select.globalEditOptions` / `select.globalEditExclude`, `crates/engine/src/tests/globaledit.rs`; paths, compound paths, symbol instances and groups of them (similar groups, #4939: edits inside one group reach the same object in the others; [public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/edit-objects/edit-groups-with-similar-objects.html)); a group holding type or an image is not taken, as Global Edit does not take images or text; Shift-click to leave a match out ([public source](https://helpx.adobe.com/ph_fil/illustrator/how-to/global-editing-sensei.html)); the Control bar's Global Edit Options dropdown opens the same options; the matches are highlighted before the start (`selecting_one_object_highlights_the_similar_objects_before_global_edit_starts`); rotated copies are matched and take an edit turned by their angle ([public source](https://helpx.adobe.com/vn_vi/illustrator/how-to/modern-logo-design.html); `start_global_edit_takes_rotated_copies_and_an_edit_reaches_each_turned_by_its_angle`); reflected copies are not matched (VectorCraft's own rule) | | Contextual task bar | done | | | Control bar with Transform and Stroke popovers | done | | +| Control bar: numeric Corner Radius for eligible selected ordinary and live corners (part of #7238, request 3 only) | done | Anchor Points visibility group; common/mixed values, general document units and multi-object edits through `object.setLiveShape`, one Undo. A partial selection containing no eligible corners contributes no target. Corner kind and relative mode are retained; existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged. Requests 1/2 remain open. | | Stroke panel: custom arrowheads after the built-in ones in both arrowhead menus, from the arrowheads file that the panel menu's Edit Arrowheads… opens; saving the file reloads the menus, and a stroke keeps a copy of its custom head's art | done | [Apply stroke on an object](https://helpx.adobe.com/illustrator/using/stroke-object.html) (Customize arrowheads); the file's layout (one symbol per head, pointing right, tip at the registration point, height drawn as wide as the built-in heads) is VectorCraft's own; `stroke.arrowheads.edit`, `stroke.arrowheads.list`, `stroke.arrowheads.reload`, `stroke.set` `{custom: name}`; engine `tests::arrowheads`, `stroke::tests_arrows::custom_heads_draw_their_own_art_at_the_tip` | | Control bar: Paragraph: link and Align left/center/right while type is selected (#5372) | done | After the Character controls, as the public documentation has the Control panel format paragraphs ([Paragraph panel overview](https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html), [Align text](https://helpx.adobe.com/illustrator/using/align-text.html)); the link opens the Paragraph panel in a popover, as Character: does with the Character panel. The bar trims from its right end: X/Y/W/H, Distribute, Align, area type vertical alignment, then these buttons, then the link. The three-button set is our choice for room; all seven alignments are in the popover. `panels/paragraph/tests.rs` headless tests (`the_control_bar_shows_the_paragraph_alignment_of_the_selected_type`, `the_control_bar_trims_its_paragraph_section_after_the_controls_to_its_right`) | | Pathfinder shape results keep their source names and SVG IDs | done | #1293; Minus Front keeps the back name, Minus Back the front name; Unite/Intersect/Exclude use the backmost named input; compound output carries it once; geometry and paint unchanged | @@ -539,6 +540,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra | Date | Change | Summary | |---|---|---| +| 2026-11-14 | minor | Control bar: Corner Radius edits eligible selected ordinary and live corners in document units, with mixed values and multi-object edits in one Undo (part of #7238, request 3 only). Existing corner-widget selection, widget visibility and maximum-radius behavior are unchanged; requests 1/2 remain open. Scores and estimates unchanged. | | 2026-11-12 | minor | Numeric fields: a focus click released more than 1 pt from its press keeps the caret; a tap within 1 pt still selects the whole value (#6659, follow-up to #1326). Scores and estimates unchanged. | | 2026-11-12 | minor | Remove Background for a selected image in the Contextual Task Bar, Properties › Quick Actions and the Control bar, which runs at once with its defaults. Scores and estimates unchanged. | | 2026-11-12 | minor | Live Paint Bucket fills faces crossed in one drag (#6373). Scores and estimates unchanged. | From a7c8d287772aadbfe0282ad5196ef32eb584115b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 15:25:01 -0800 Subject: [PATCH 031/247] Object Mosaic: Create Object Mosaic opens a dialog with its size, ratio and percentage options Object > Create Object Mosaic... opens its own dialog on the selected image: Current Size, New Size, Tile Spacing, Number of Tiles, Constrain Ratio (Width or Height), Result (Color or Grayscale), Resize Using Percentages, Delete Raster and Use Ratio. It replaces the generic parameter dialog, which showed only the counts, the spacing and the two switches. object.createObjectMosaic takes percentages, constrain and useRatio. Use Ratio keeps the count on the kept side and picks the other count whose tiles, spacing taken off, come closest to square, measured along the image's own sides. A new width or height outside 0.1 to 1000000 is refused, and the result gives the columns and rows used. Docs: docs/mcp.md, docs/target-app-parity.md. --- crates/engine/src/cmd.rs | 3 + crates/engine/src/cmd/menucmds.rs | 137 +++++- crates/engine/src/tests.rs | 108 +++++ crates/ui-egui/src/dialogs.rs | 7 + crates/ui-egui/src/dialogs/object_mosaic.rs | 468 ++++++++++++++++++++ crates/ui-egui/src/dialogs/tests.rs | 8 +- crates/ui-egui/src/i18n/bg.tsv | 10 + crates/ui-egui/src/i18n/bs.tsv | 10 + crates/ui-egui/src/i18n/ca.tsv | 10 + crates/ui-egui/src/i18n/cs.tsv | 10 + crates/ui-egui/src/i18n/da.tsv | 10 + crates/ui-egui/src/i18n/de.tsv | 10 + crates/ui-egui/src/i18n/el.tsv | 10 + crates/ui-egui/src/i18n/es.tsv | 10 + crates/ui-egui/src/i18n/fi.tsv | 10 + crates/ui-egui/src/i18n/fr.tsv | 10 + crates/ui-egui/src/i18n/gu.tsv | 9 + crates/ui-egui/src/i18n/hi.tsv | 9 + crates/ui-egui/src/i18n/hu.tsv | 10 + crates/ui-egui/src/i18n/id.tsv | 10 + crates/ui-egui/src/i18n/it.tsv | 10 + crates/ui-egui/src/i18n/ja.tsv | 10 + crates/ui-egui/src/i18n/ka.tsv | 10 + crates/ui-egui/src/i18n/ko.tsv | 10 + crates/ui-egui/src/i18n/nl.tsv | 10 + crates/ui-egui/src/i18n/pl.tsv | 10 + crates/ui-egui/src/i18n/pt-br.tsv | 10 + crates/ui-egui/src/i18n/ru.tsv | 10 + crates/ui-egui/src/i18n/sv.tsv | 10 + crates/ui-egui/src/i18n/tr.tsv | 10 + crates/ui-egui/src/i18n/uk.tsv | 10 + crates/ui-egui/src/i18n/vi.tsv | 10 + crates/ui-egui/src/i18n/zh-hans.tsv | 10 + crates/ui-egui/src/i18n/zh-hant.tsv | 10 + crates/ui-egui/src/menus/run.rs | 4 + docs/mcp.md | 30 +- docs/target-app-parity.md | 1 + 37 files changed, 1022 insertions(+), 22 deletions(-) create mode 100644 crates/ui-egui/src/dialogs/object_mosaic.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index a2d0316913..4abdbf1556 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -885,6 +885,9 @@ pub(crate) use buildcmds::TracePresetChanges; /// The shapes a group selected alone gives the Pathfinder panel. pub use pathops::shape_count; +/// The tile counts Create Object Mosaic would use (the dialog's Use Ratio button sets them). +pub use menucmds::mosaic_counts; + /// The gaps View › Show Live Paint Gaps shows on a Live Paint group. pub use buildcmds::live_paint_gaps; diff --git a/crates/engine/src/cmd/menucmds.rs b/crates/engine/src/cmd/menucmds.rs index 1ab0e0b670..41fc1cf2fe 100644 --- a/crates/engine/src/cmd/menucmds.rs +++ b/crates/engine/src/cmd/menucmds.rs @@ -124,7 +124,7 @@ pub fn specs() -> Vec<CommandSpec> { "Create Object Mosaic…", ["Object"], None, - "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt; default the image's), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles coloured by the selected image's average tile colours → {id, tiles}", + "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt, 0.1..1000000; default the image's), percentages?: bool (width and height are percentages of the image's size, default 100), constrain?: \"width\"|\"height\"|null (Constrain Ratio: the mosaic keeps the image's proportions, the named side's size leads and the other side's is worked out from it), useRatio?: bool|\"width\"|\"height\" (square tiles as drawn, spacing taken off: the count on the side named, or with true on the constrained side, columns by default, stays and the other is the count, 1..1000, whose tiles come closest to square), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles coloured by the selected image's average tile colours → {id, tiles, columns, rows}", has_image, object_mosaic ), @@ -891,7 +891,23 @@ pub(crate) fn has_image(s: &Session) -> std::result::Result<(), String> { } } -fn object_mosaic(s: &mut Session, p: &Value) -> Result<Value> { +/// What `object.createObjectMosaic` makes from its params: the image, the tile counts, the tiles' +/// placement, their size and spacing in image pixels, and the options. +struct MosaicPlan { + id: NodeId, + im: ImageObject, + cols: u32, + rows: u32, + xf: Affine, + tile: (f64, f64), + gap: (f64, f64), + gray: bool, + delete: bool, +} + +/// The mosaic `object.createObjectMosaic` would make from `p`, worked out without decoding the +/// image or changing the document. +fn mosaic_plan(s: &Session, p: &Value) -> Result<MosaicPlan> { const C: &str = "object.createObjectMosaic"; let st = s.doc()?; let id = st @@ -901,28 +917,92 @@ fn object_mosaic(s: &mut Session, p: &Value) -> Result<Value> { .copied() .find(|id| matches!(st.doc.node(*id).map(|n| &n.kind), Some(NodeKind::Image(_)))) .ok_or_else(|| bad(C, "select an image"))?; - let node = st.doc.node(id).cloned().ok_or(EngineError::NoNode(id))?; + let node = st.doc.node(id).ok_or(EngineError::NoNode(id))?; let NodeKind::Image(im) = &node.kind else { return Err(bad(C, "select an image")) }; - let blob = st.doc.images.get(&im.key).filter(|b| !b.bytes.is_empty()).ok_or_else(|| bad(C, "the image has no embedded pixels"))?; - let raster = vectorcraft_trace::Raster::decode(&blob.bytes).map_err(|e| bad(C, e.to_string()))?; - let cols = whole_or(p, "columns", 10, C)?.clamp(1, 1000) as u32; - let rows = whole_or(p, "rows", 10, C)?.clamp(1, 1000) as u32; + if !st.doc.images.get(&im.key).is_some_and(|b| !b.bytes.is_empty()) { + return Err(bad(C, "the image has no embedded pixels")); + } + let mut cols = whole_or(p, "columns", 10, C)?.clamp(1, 1000) as u32; + let mut rows = whole_or(p, "rows", 10, C)?.clamp(1, 1000) as u32; let gray = switch_or(p, "gray", false, C)?; - let colors = vectorcraft_trace::mosaic(&raster, cols, rows); + let percentages = switch_or(p, "percentages", false, C)?; + // A side named "width" (true) or "height" (false), as `constrain` and `useRatio` take it. + let side = |key: &str, v: &Value, also: &str| match v.as_str() { + Some("width") => Ok(true), + Some("height") => Ok(false), + _ => Err(bad(C, format!("`{key}` must be one of {}", format_args!("\"width\", \"height\"{also} or null")))), + }; + let constrain = match p.get("constrain") { + None | Some(Value::Null) => None, + Some(v) => Some(side("constrain", v, "")?), + }; + // Use Ratio's kept side: true keeps Constrain Ratio's side (the width when it is left out). + let use_ratio = match p.get("useRatio") { + None | Some(Value::Null | Value::Bool(false)) => None, + Some(Value::Bool(true)) => Some(constrain.unwrap_or(true)), + Some(v) => Some(side("useRatio", v, ", true, false")?), + }; // Tiles in image space, placed by the image transform (scaled to a new size if asked). let b = node.geometric_bounds().ok_or_else(|| bad(C, "image has no bounds"))?; check_numbers(p, &["width", "height", "spacingX", "spacingY"], C)?; - let (nw, nh) = (f64_or(p, "width", b.width()).max(0.1), f64_or(p, "height", b.height()).max(0.1)); - let resize = Affine::translate(b.origin().to_vec2()) - * Affine::scale_non_uniform(nw / b.width().max(1e-9), nh / b.height().max(1e-9)) - * Affine::translate(-b.origin().to_vec2()); + let (bw, bh) = (b.width().max(1e-9), b.height().max(1e-9)); + // A size given (pt, or % of the image's) is from 0.1 to 1,000,000; one left out is the image's. + let size = |key: &str, base: f64| -> Result<f64> { + let Some(x) = p.get(key).and_then(Value::as_f64) else { return Ok(base) }; + let (min, max) = (0.1, 1_000_000.0); + if !(min..=max).contains(&x) { + return Err(bad(C, format!("`{key}` must be between {min} and {max} (got {x})"))); + } + Ok(if percentages { base * x / 100.0 } else { x }) + }; + let (mut nw, mut nh) = (size("width", bw)?, size("height", bh)?); + // Constrain Ratio keeps the image's proportions: the named side leads and the other follows. + match constrain { + Some(true) => nh = nw * bh / bw, + Some(false) => nw = nh * bw / bh, + None => {} + } + // A size under 0.1 pt grows to 0.1 pt, in proportion while Constrain Ratio keeps it. + let (nw, nh) = match constrain { + Some(_) => { + let k = (0.1 / nw.min(nh)).max(1.0); + (nw * k, nh * k) + } + None => (nw.max(0.1), nh.max(0.1)), + }; + let resize = Affine::translate(b.origin().to_vec2()) * Affine::scale_non_uniform(nw / bw, nh / bh) * Affine::translate(-b.origin().to_vec2()); let xf = resize * im.xf; - let (tw, th) = (im.width as f64 / cols as f64, im.height as f64 / rows as f64); - // Spacing is in points; convert to image pixels along each axis. + // Points per image pixel along each of the image's axes (the image may be turned). let ppx = (xf * Point::new(1.0, 0.0) - xf * Point::ZERO).hypot().max(1e-9); let ppy = (xf * Point::new(0.0, 1.0) - xf * Point::ZERO).hypot().max(1e-9); - let (gx, gy) = ((f64_or(p, "spacingX", 0.0).max(0.0) / ppx).min(tw * 0.9), (f64_or(p, "spacingY", 0.0).max(0.0) / ppy).min(th * 0.9)); + let (sx, sy) = (f64_or(p, "spacingX", 0.0).max(0.0), f64_or(p, "spacingY", 0.0).max(0.0)); + let (iw, ih) = (im.width as f64, im.height as f64); + // Use Ratio: square tiles as drawn, spacing taken off, from the count on the kept side, + // measured along the image's axes. + match use_ratio { + Some(true) => rows = mosaic_square_count(cols, iw * ppx, ih * ppy, sx, sy), + Some(false) => cols = mosaic_square_count(rows, ih * ppy, iw * ppx, sy, sx), + None => {} + } + let (tw, th) = (iw / cols as f64, ih / rows as f64); + // Spacing is in points; convert to image pixels along each axis. + let gap = ((sx / ppx).min(tw * 0.9), (sy / ppy).min(th * 0.9)); let delete = switch_or(p, "deleteRaster", false, C)?; + Ok(MosaicPlan { id, im: im.as_ref().clone(), cols, rows, xf, tile: (tw, th), gap, gray, delete }) +} + +/// The tile counts (columns, rows) `object.createObjectMosaic` would use with `p`, Use Ratio +/// included, without making the mosaic (the dialog's Use Ratio button shows them). +pub fn mosaic_counts(s: &Session, p: &Value) -> Result<(u32, u32)> { + mosaic_plan(s, p).map(|m| (m.cols, m.rows)) +} + +fn object_mosaic(s: &mut Session, p: &Value) -> Result<Value> { + const C: &str = "object.createObjectMosaic"; + let MosaicPlan { id, im, cols, rows, xf, tile: (tw, th), gap: (gx, gy), gray, delete } = mosaic_plan(s, p)?; + let blob = s.doc()?.doc.images.get(&im.key).ok_or_else(|| bad(C, "the image has no embedded pixels"))?; + let raster = vectorcraft_trace::Raster::decode(&blob.bytes).map_err(|e| bad(C, e.to_string()))?; + let colors = vectorcraft_trace::mosaic(&raster, cols, rows); let (gid, n) = s.edit("Create Object Mosaic", |d, sel| { let mut tiles = vec![]; for r in 0..rows { @@ -960,7 +1040,32 @@ fn object_mosaic(s: &mut Session, p: &Value) -> Result<Value> { sel.set([gid]); Ok((gid, n)) })?; - Ok(json!({ "id": gid.0, "tiles": n })) + Ok(json!({ "id": gid.0, "tiles": n, "columns": cols, "rows": rows })) +} + +/// The tile count along one side of an Object Mosaic whose tiles, as drawn, come closest to square +/// (Use Ratio): `kept` tiles span `kept_len` on the other side, and this side is `other_len` long. +/// Each tile is its cell less the gap on its side (`kept_gap`, `other_gap`), and a gap takes at +/// most 90% of a cell, as the tiles are drawn. Within 1..1000, the smaller count on a tie; all +/// lengths in points. +pub(crate) fn mosaic_square_count(kept: u32, kept_len: f64, other_len: f64, kept_gap: f64, other_gap: f64) -> u32 { + let drawn = |len: f64, n: u32, gap: f64| { + let cell = len / n.max(1) as f64; + cell - gap.max(0.0).min(cell * 0.9) + }; + let side = drawn(kept_len, kept, kept_gap); + if !(side.is_finite() && side > 0.0 && other_len.is_finite() && other_len > 0.0) { + return 1; + } + // A tile on this side shrinks as the count grows: find the first count whose tile is no wider + // than `side`, then take it or the count before it, whichever is closer. + let (mut lo, mut hi) = (1u32, 1000u32); + while lo < hi { + let mid = (lo + hi) / 2; + if drawn(other_len, mid, other_gap) > side { lo = mid + 1 } else { hi = mid } + } + let off = |n: u32| (drawn(other_len, n, other_gap) - side).abs(); + if lo > 1 && off(lo - 1) <= off(lo) { lo - 1 } else { lo } } fn polygon_path(pts: &[Point]) -> PathData { diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 57445a36be..8f7cf46950 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -4035,6 +4035,114 @@ fn object_mosaic_refuses_a_boolean_given_as_text() { assert_eq!((r["tiles"].clone(), images(&s)), (json!(2), 1)); } +/// The size of the mosaic a call makes from the 100 × 50 pt image selected in `s`, with its column and row counts. +fn mosaic_size(s: &mut Session, p: serde_json::Value) -> (f64, f64, serde_json::Value, serde_json::Value) { + let image = s.doc().unwrap().selection.objects.clone(); + let r = s.execute("object.createObjectMosaic", &p).unwrap(); + let b = s.doc().unwrap().doc.node(NodeId(r["id"].as_u64().unwrap())).unwrap().geometric_bounds().unwrap(); + s.execute("select.set", &json!({ "ids": image })).unwrap(); + ((b.width() * 1e6).round() / 1e6, (b.height() * 1e6).round() / 1e6, r["columns"].clone(), r["rows"].clone()) +} + +/// Resize Using Percentages reads the new width and height as percentages of the image's size; Constrain Ratio keeps +/// the image's proportions, the named side leading; Use Ratio makes the tiles square from the count on the +/// constrained side (columns by default), and the call answers the counts it used. +#[test] +fn object_mosaic_resizes_by_percentages_constrains_the_ratio_and_squares_the_tiles() { + let mut s = session(); + rect(&mut s, 0.0, 0.0, 100.0, 50.0); + s.execute("paint.setStroke", &json!({"none": true})).unwrap(); + s.execute("object.rasterize", &json!({"ppi": 72})).unwrap(); + assert_eq!(mosaic_size(&mut s, json!({"columns": 2, "rows": 1})), (100.0, 50.0, json!(2), json!(1))); + assert_eq!(mosaic_size(&mut s, json!({"width": 50, "height": 200, "percentages": true})), (50.0, 100.0, json!(10), json!(10))); + // A side left out is 100% of the image's. + assert_eq!(mosaic_size(&mut s, json!({"width": 150, "percentages": true})).0, 150.0); + assert_eq!(mosaic_size(&mut s, json!({"width": 200, "height": 10, "constrain": "width"})), (200.0, 100.0, json!(10), json!(10))); + assert_eq!(mosaic_size(&mut s, json!({"width": 10, "height": 25, "constrain": "height"})), (50.0, 25.0, json!(10), json!(10))); + assert_eq!(mosaic_size(&mut s, json!({"width": 50, "constrain": "width", "percentages": true})), (50.0, 25.0, json!(10), json!(10))); + // Square tiles: 10 columns of 10 pt over 50 pt are 5 rows; 4 rows of 12.5 pt over 100 pt are 8 columns. + assert_eq!(mosaic_size(&mut s, json!({"columns": 10, "rows": 3, "useRatio": true})), (100.0, 50.0, json!(10), json!(5))); + assert_eq!(mosaic_size(&mut s, json!({"columns": 3, "rows": 4, "useRatio": true, "constrain": "height"})), (100.0, 50.0, json!(8), json!(4))); + // A side named for Use Ratio is kept without Constrain Ratio: the size stays as given. + assert_eq!(mosaic_size(&mut s, json!({"rows": 4, "height": 100, "useRatio": "height"})), (100.0, 100.0, json!(4), json!(4))); + // On a new size: 30 columns over 300 × 50 pt are 5 rows. + assert_eq!(mosaic_size(&mut s, json!({"columns": 30, "width": 300, "useRatio": true})), (300.0, 50.0, json!(30), json!(5))); + // The count is kept within 1..1000. + assert_eq!(mosaic_size(&mut s, json!({"columns": 1, "width": 1, "height": 5000, "useRatio": true})).3, json!(1000)); + assert_eq!(mosaic_size(&mut s, json!({"columns": 1, "width": 5000, "height": 1, "useRatio": true})).3, json!(1)); + // A size under 0.1 pt grows in proportion while Constrain Ratio keeps it. + let (w, h, ..) = mosaic_size(&mut s, json!({"width": 0.1, "constrain": "width"})); + assert!((w - 0.2).abs() < 1e-6 && (h - 0.1).abs() < 1e-6, "{w} × {h}"); +} + +/// Use Ratio squares the tiles as drawn: with 4 pt between columns, 10 columns of 10 pt cells draw 6 pt wide, so the +/// rows are 6 pt plus their own 4 pt apart (5 rows down 50 pt); on an image turned 90°, the tiles are measured along +/// its own axes. +#[test] +fn object_mosaic_use_ratio_takes_spacing_and_turned_images_into_account() { + let mut s = session(); + rect(&mut s, 0.0, 0.0, 100.0, 50.0); + s.execute("paint.setStroke", &json!({"none": true})).unwrap(); + s.execute("object.rasterize", &json!({"ppi": 72})).unwrap(); + let image = s.doc().unwrap().selection.objects.clone(); + let counts = |s: &Session, p: serde_json::Value| crate::cmd::mosaic_counts(s, &p).unwrap(); + assert_eq!(counts(&s, json!({"columns": 10, "useRatio": true, "spacingX": 4, "spacingY": 4})), (10, 5)); + assert_eq!(counts(&s, json!({"columns": 10, "useRatio": true, "spacingX": 4})), (10, 8)); + assert_eq!(counts(&s, json!({"columns": 10, "rows": 7})), (10, 7), "without Use Ratio the counts are kept"); + let r = s.execute("object.createObjectMosaic", &json!({"columns": 10, "useRatio": true, "spacingX": 4})).unwrap(); + let g = s.doc().unwrap().doc.node(NodeId(r["id"].as_u64().unwrap())).unwrap().clone(); + let t = g.children().unwrap()[0].geometric_bounds().unwrap(); + assert!((t.width() - 6.0).abs() < 1e-6 && (t.height() - 6.25).abs() < 1e-6, "{t:?}"); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("select.set", &json!({ "ids": image })).unwrap(); + // Turned 90°, the image's 100 pt side runs down the page; 10 columns along it are still 5 rows across its 50. + s.execute("object.rotate", &json!({"angle": 90})).unwrap(); + assert_eq!(counts(&s, json!({"columns": 10, "useRatio": true})), (10, 5)); +} + +#[test] +fn object_mosaic_square_count_is_the_nearest_whole_count() { + use crate::cmd::menucmds::mosaic_square_count; + assert_eq!(mosaic_square_count(10, 100.0, 50.0, 0.0, 0.0), 5); + assert_eq!(mosaic_square_count(3, 100.0, 50.0, 0.0, 0.0), 2); + assert_eq!(mosaic_square_count(0, 100.0, 50.0, 0.0, 0.0), 1); + assert_eq!(mosaic_square_count(10, 0.0, 50.0, 0.0, 0.0), 1); + assert_eq!(mosaic_square_count(1000, 1.0, 1000.0, 0.0, 0.0), 1000); + // Spacing wider than a cell leaves 10% of it, on either side. + assert_eq!(mosaic_square_count(10, 100.0, 50.0, 50.0, 0.0), 50); + // 10 columns of 1 pt tiles (9 pt gaps) over 100 pt; rows 100 pt apart are capped too, so 10 rows draw 1 pt. + assert_eq!(mosaic_square_count(10, 100.0, 100.0, 9.0, 100.0), 10); + // 15 pt tiles over 50 pt: 3 rows draw 16.7 pt and 4 rows 12.5 pt, so 3. + assert_eq!(mosaic_square_count(1, 15.0, 50.0, 0.0, 0.0), 3); +} + +/// A Constrain Ratio side that is not "width" or "height", a new size of 0 or less, and Use Ratio or Resize Using +/// Percentages given as text are errors naming the key; no mosaic is made. +#[test] +fn object_mosaic_refuses_a_bad_ratio_side_size_or_switch() { + let mut s = session(); + rect(&mut s, 0.0, 0.0, 100.0, 50.0); + s.execute("object.rasterize", &json!({"ppi": 72})).unwrap(); + let undo = |s: &Session| s.doc().unwrap().history.undo.len(); + let before = undo(&s); + for (p, msg) in [ + (json!({"constrain": "both"}), "`constrain` must be one of \"width\", \"height\" or null"), + (json!({"constrain": 1}), "`constrain` must be one of \"width\", \"height\" or null"), + (json!({"width": 0}), "`width` must be between 0.1 and 1000000 (got 0)"), + (json!({"height": -5, "percentages": true}), "`height` must be between 0.1 and 1000000 (got -5)"), + (json!({"width": 2e6, "percentages": true}), "`width` must be between 0.1 and 1000000 (got 2000000)"), + (json!({"useRatio": "true"}), "`useRatio` must be one of \"width\", \"height\", true, false or null"), + (json!({"useRatio": 1}), "`useRatio` must be one of \"width\", \"height\", true, false or null"), + (json!({"percentages": 1}), "`percentages` must be true or false"), + ] { + let r = s.execute("object.createObjectMosaic", &p); + assert!(matches!(&r, Err(EngineError::BadParams { msg: m, .. }) if m == msg), "{p}: {r:?}"); + assert_eq!(undo(&s), before, "{p}"); + } + let r = s.execute("object.createObjectMosaic", &json!({"constrain": null, "useRatio": null, "percentages": null})).unwrap(); + assert_eq!(r["tiles"], json!(100)); +} + #[test] fn snap_to_pixel_rounds_drawing_and_moves() { let mut s = session(); diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 5afad21b0d..e05da0a333 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -78,6 +78,7 @@ pub mod new_color_group; mod new_document; pub mod new_swatch; pub mod new_text_style; +pub mod object_mosaic; pub mod objects_on_path_options; pub mod office_export; pub mod package; @@ -428,6 +429,7 @@ registry! { ScriptClose: [script_run::CLOSE_KIND] => script_run::CLOSE_SPEC, ScriptNotice: [script_run::NOTICE_KIND] => script_run::NOTICE_SPEC, VectorHalftone: [halftone::KIND] => halftone::SPEC, + ObjectMosaic: [object_mosaic::KIND] => object_mosaic::SPEC, SimplifySlider: [simplify_slider::KIND] => simplify_slider::SPEC, SmoothSlider: [smooth_slider::KIND] => smooth_slider::SPEC, PerspectiveGrid: [perspective_grid::KIND] => perspective_grid::SPEC, @@ -593,6 +595,11 @@ pub fn set_field(d: &mut Dialog, field: String, value: Value) { if d.kind == "preferences" { crate::prefs_dialog::note_set(d, &field, &value); } + // Create Object Mosaic's Resize Using Percentages shows the new size the other way, as its checkbox does. + if d.kind == object_mosaic::KIND && field == "percentages" { + object_mosaic::set_percentages(d, &value); + return; + } let dxf = (d.kind == dxf_options::KIND).then(|| field.clone()); d.fields.insert(field, value); if let Some(field) = dxf { diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs new file mode 100644 index 0000000000..ed8b060a92 --- /dev/null +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -0,0 +1,468 @@ +//! Object → Create Object Mosaic: the selected image's Current Size, the mosaic's New Size, Tile +//! Spacing and Number of Tiles, Constrain Ratio (Width or Height), Result (Color or Grayscale), +//! Resize Using Percentages, Delete Raster and Use Ratio. OK runs `object.createObjectMosaic` as one +//! undo step. +//! +//! Fields: `width`, `height` (pt, or percentages of the image's size with `percentages`), +//! `spacingX`, `spacingY` (pt), `columns`, `rows`, `lock` (Constrain Ratio on), `constrain` +//! (`width` | `height`: the side Constrain Ratio and Use Ratio keep), `gray`, `percentages` and +//! `deleteRaster`. `__imageW` and `__imageH` hold the image's size (pt). + +use serde_json::{Value, json}; +use vectorcraft_doc::NodeKind; + +use super::{DialogSpec, form, run_and_close}; +use crate::state::Dialog; +use crate::{VectorcraftApp, widgets}; + +/// The dialog kind of Create Object Mosaic. +pub const KIND: &str = "objectMosaic"; + +/// The command the dialog runs. +pub const COMMAND: &str = "object.createObjectMosaic"; + +/// Width of the label column. +const LABEL_W: f32 = 112.0; + +/// Width of a size or count field. +const FIELD_W: f32 = 76.0; + +pub(super) const SPEC: DialogSpec = + DialogSpec { heading: |_| tl!("Create Object Mosaic").into(), body, confirm, min_width: 360.0, ..DialogSpec::FORM }; + +/// The size (pt) of the first selected image, which the mosaic is made from. +fn image_size(app: &VectorcraftApp) -> Option<(f64, f64)> { + let st = app.session.active()?; + let node = st.selection.objects.iter().filter_map(|id| st.doc.node(*id)).find(|n| matches!(n.kind, NodeKind::Image(_)))?; + let b = node.geometric_bounds()?; + Some((b.width(), b.height())) +} + +/// Open the dialog on the selected image, with the values `given` holds (the menu item's params, or +/// a caller's `object.createObjectMosaic` params, its Use Ratio applied to the counts) and the +/// command's defaults for the rest. With no image selected, or with params the command refuses, +/// nothing opens and the error says why. +pub fn open(app: &mut VectorcraftApp, given: &Value) -> Result<Value, String> { + let Some((w, h)) = image_size(app) else { return Err("select an image".into()) }; + let none = json!({}); + let given = if given.is_null() { &none } else { given }; + app.session.check_params(COMMAND, given).map_err(|e| e.to_string())?; + let (cols, rows) = vectorcraft_engine::cmd::mosaic_counts(&app.session, given).map_err(|e| e.to_string())?; + let n = |key: &str, d: f64| given.get(key).and_then(Value::as_f64).unwrap_or(d); + let b = |key: &str| given.get(key).and_then(Value::as_bool).unwrap_or(false); + let pct = b("percentages"); + // The new size starts at the image's, within the sizes the command takes (0.1 to 1,000,000 pt). + let (base_w, base_h) = if pct { (100.0, 100.0) } else { (w.clamp(0.1, 1.0e6), h.clamp(0.1, 1.0e6)) }; + let named = |key: &str| given.get(key).and_then(Value::as_str).filter(|s| matches!(*s, "width" | "height")); + let constrain = named("constrain"); + // The side the dialog keeps: Constrain Ratio's, else the one Use Ratio names. + let side = constrain.or(named("useRatio")).unwrap_or("width"); + let fields = json!({ + "width": n("width", base_w), "height": n("height", base_h), "spacingX": n("spacingX", 0.0), "spacingY": n("spacingY", 0.0), + "columns": cols, "rows": rows, + "lock": constrain.is_some(), "constrain": side, "gray": b("gray"), "percentages": pct, + "deleteRaster": b("deleteRaster"), "__imageW": w, "__imageH": h, + }); + app.ui.dialog = Some(Dialog::new(KIND, fields)); + Ok(json!({ "dialog": KIND })) +} + +/// The image's size (pt) the dialog holds. +fn image(d: &Dialog) -> (f64, f64) { + (d.f64("__imageW", 1.0).max(1e-9), d.f64("__imageH", 1.0).max(1e-9)) +} + +/// Whether Constrain Ratio and Use Ratio keep the width (else the height). +fn keeps_width(d: &Dialog) -> bool { + d.str("constrain") != "height" +} + +/// With Constrain Ratio on, the side that follows set from the side that leads, in the image's +/// proportions. +fn follow_ratio(d: &mut Dialog) { + if !d.bool("lock") { + return; + } + let (iw, ih) = image(d); + let pct = d.bool("percentages"); + if keeps_width(d) { + let w = d.f64("width", 0.0); + d.fields.insert("height".into(), json!(if pct { w } else { w * ih / iw })); + } else { + let h = d.f64("height", 0.0); + d.fields.insert("width".into(), json!(if pct { h } else { h * iw / ih })); + } +} + +/// Resize Using Percentages turned on or off: the new size shown the other way, so it stays the +/// same size. +fn switch_percentages(d: &mut Dialog, on: bool) { + let (iw, ih) = image(d); + let (w, h) = (d.f64("width", iw), d.f64("height", ih)); + let (w, h) = if on { (w / iw * 100.0, h / ih * 100.0) } else { (iw * w / 100.0, ih * h / 100.0) }; + d.fields.insert("width".into(), json!(w)); + d.fields.insert("height".into(), json!(h)); + d.fields.insert("percentages".into(), json!(on)); +} + +/// `ui.dialog.set` of `percentages`: true or false switches the new size as the checkbox does; +/// another value is kept as it is, and the command refuses it on OK. +pub(super) fn set_percentages(d: &mut Dialog, value: &Value) { + match value.as_bool() { + Some(on) if on != d.bool("percentages") => switch_percentages(d, on), + Some(_) => {} + None => { + d.fields.insert("percentages".into(), value.clone()); + } + } +} + +/// Use Ratio: the count on the kept side stays and the other makes the tiles square, as the +/// command counts them for the fields as they are (Constrain Ratio's side, the new size and the +/// spacing). +fn use_ratio(app: &VectorcraftApp, d: &mut Dialog) { + let mut p = params(d); + p["useRatio"] = json!(if keeps_width(d) { "width" } else { "height" }); + match vectorcraft_engine::cmd::mosaic_counts(&app.session, &p) { + Ok((cols, rows)) => { + d.fields.insert("columns".into(), json!(cols)); + d.fields.insert("rows".into(), json!(rows)); + } + Err(e) => form::note_refusal(d, &e), + } +} + +/// Field `key` as `object.createObjectMosaic` takes it: a number (text with a unit, as +/// `ui.dialog.set` may give it, read in points), `default` when the field is missing, and any other +/// value as it is, for the command to refuse. +fn number(d: &Dialog, key: &str, default: f64) -> Value { + match d.fields.get(key) { + None => json!(default), + Some(Value::String(s)) => vectorcraft_doc::Unit::Points.parse(s).map_or_else(|| json!(s), |v| json!(v)), + Some(v) => v.clone(), + } +} + +/// Field `key` as the command takes an on/off value: false when the field is missing, and any +/// other value as it is, for the command to refuse one that is not true or false. +fn switch(d: &Dialog, key: &str) -> Value { + d.fields.get(key).cloned().unwrap_or(json!(false)) +} + +/// `object.createObjectMosaic` parameters from the fields. +fn params(d: &Dialog) -> Value { + json!({ + "columns": number(d, "columns", 10.0), "rows": number(d, "rows", 10.0), + "width": number(d, "width", 100.0), "height": number(d, "height", 100.0), "percentages": switch(d, "percentages"), + "constrain": if d.bool("lock") { json!(if keeps_width(d) { "width" } else { "height" }) } else { Value::Null }, + "spacingX": number(d, "spacingX", 0.0), "spacingY": number(d, "spacingY", 0.0), + "gray": switch(d, "gray"), "deleteRaster": switch(d, "deleteRaster"), + }) +} + +/// A Width and a Height field for `keys`: lengths in `unit` of at least `least` points, or +/// percentages with `pct`. With `follows`, the field of that key is grayed (Constrain Ratio sets it). +fn pair(ui: &mut egui::Ui, d: &mut Dialog, keys: [&str; 2], unit: vectorcraft_doc::Unit, (pct, least): (bool, f64), follows: Option<&str>) { + for (key, label) in keys.into_iter().zip([tl!("Width:"), tl!("Height:")]) { + widgets::dim_label(ui, label); + ui.add_enabled_ui(follows != Some(key), |ui| { + if pct { + if let Some(v) = widgets::spin_plain(ui, ("mosaic", key), d.f64(key, 100.0), "%", 2, FIELD_W, 1.0, 0.1, &[]) { + d.fields.insert(key.into(), json!(v)); + } + } else { + form::length_within(ui, d, key, unit, FIELD_W, Some(least..=1.0e6)); + } + }); + } +} + +fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { + let unit = app.session.general_unit(); + let (iw, ih) = image(d); + widgets::label_row(ui, tl!("Current Size:"), LABEL_W, |ui| { + widgets::dim_label(ui, tl!("Width:")); + widgets::dim_name(ui, &unit.format(iw)); + widgets::dim_label(ui, tl!("Height:")); + widgets::dim_name(ui, &unit.format(ih)); + }); + ui.add_space(4.0); + let follows = d.bool("lock").then(|| if keeps_width(d) { "height" } else { "width" }); + let pct = d.bool("percentages"); + widgets::label_row(ui, tl!("New Size:"), LABEL_W, |ui| pair(ui, d, ["width", "height"], unit, (pct, 0.1), follows)); + follow_ratio(d); + ui.add_space(4.0); + widgets::label_row(ui, tl!("Tile Spacing:"), LABEL_W, |ui| pair(ui, d, ["spacingX", "spacingY"], unit, (false, 0.0), None)); + ui.add_space(4.0); + widgets::label_row(ui, tl!("Number of Tiles:"), LABEL_W, |ui| { + for (key, label) in [("columns", tl!("Width:")), ("rows", tl!("Height:"))] { + widgets::dim_label(ui, label); + if let Some(v) = widgets::spin_plain(ui, ("mosaic", key), d.f64(key, 10.0), "", 0, FIELD_W, 1.0, 1.0, &[]) { + d.fields.insert(key.into(), json!(v.round().clamp(1.0, 1000.0))); + } + } + }); + ui.add_space(4.0); + widgets::label_row(ui, tl!("Constrain Ratio:"), LABEL_W, |ui| { + form::check(ui, d, "lock", tl!("Constrain Width and Height Proportions")); + let width = keeps_width(d); + if widgets::radio(ui, tl!("Width"), width, true) { + d.fields.insert("constrain".into(), json!("width")); + } + if widgets::radio(ui, tl!("Height"), !width, true) { + d.fields.insert("constrain".into(), json!("height")); + } + }); + follow_ratio(d); + ui.add_space(4.0); + widgets::label_row(ui, tl!("Result:"), LABEL_W, |ui| { + let gray = d.bool("gray"); + if widgets::radio(ui, tl!("Color"), !gray, true) { + d.fields.insert("gray".into(), json!(false)); + } + if widgets::radio(ui, tl!("Grayscale"), gray, true) { + d.fields.insert("gray".into(), json!(true)); + } + }); + ui.add_space(4.0); + widgets::label_row(ui, tl!("Options:"), LABEL_W, |ui| { + ui.vertical(|ui| { + if widgets::check(ui, tl!("Resize Using Percentages"), pct, true) { + switch_percentages(d, !pct); + } + form::check(ui, d, "deleteRaster", tl!("Delete Raster")); + }); + }); + ui.add_space(6.0); + if widgets::flat_button(ui, tl!("Use Ratio"), 96.0).clicked() { + use_ratio(app, d); + } + false +} + +fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { + run_and_close(app, COMMAND, params(d)) +} + +#[cfg(test)] +mod tests { + use super::*; + use vectorcraft_engine::Session; + + /// A frame of the open dialog → the texts painted. The dialog measures itself on its first + /// frame, so a fresh context needs two. + fn frame(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<String> { + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| super::super::show(app, ui.ctx())); + out.textures_delta.clear(); + out.shapes.iter().filter_map(|s| if let egui::epaint::Shape::Text(t) = &s.shape { Some(t.galley.text().to_string()) } else { None }).collect() + } + + fn context() -> egui::Context { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + ctx + } + + /// A tile count the dialog holds. + fn count(d: &Dialog, key: &str) -> u32 { + d.f64(key, 0.0) as u32 + } + + /// An app with a 100 × 50 pt embedded image selected. + fn app_with_image() -> VectorcraftApp { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 400})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 100, "height": 50})).unwrap(); + app.run("paint.setStroke", json!({"none": true})).unwrap(); + app.run("object.rasterize", json!({"ppi": 72})).unwrap(); + app + } + + /// The mosaic group's size and tile count. + fn mosaic(app: &VectorcraftApp) -> Option<(f64, f64, usize)> { + let mut found = None; + app.session.active()?.doc.walk(|n| { + if n.name.as_deref() == Some("Object Mosaic") { + let b = n.geometric_bounds().unwrap(); + found = Some(((b.width() * 1e6).round() / 1e6, (b.height() * 1e6).round() / 1e6, n.children().map_or(0, |c| c.len()))); + } + }); + found + } + + fn open_from_menu(app: &mut VectorcraftApp) { + let entry = crate::menus::menu_entries(app).into_iter().find(|e| e.label == "Create Object Mosaic…").expect("menu item"); + let (cmd, params) = crate::menus::click_target(&entry.label, entry.command.as_deref().unwrap(), &entry.params); + crate::menus::invoke(app, &cmd, params); + } + + /// The menu item opens this dialog, not the generic one, on the image's size, with every documented row; OK + /// makes the mosaic as one undo step. + #[test] + fn the_menu_item_opens_the_dialog_with_its_rows() { + let mut app = app_with_image(); + open_from_menu(&mut app); + let d = app.ui.dialog.as_ref().expect("a dialog"); + assert_eq!(d.kind, KIND); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0), d.f64("columns", 0.0), d.f64("rows", 0.0)), (100.0, 50.0, 10.0, 10.0)); + let ctx = context(); + frame(&mut app, &ctx); + let texts = frame(&mut app, &ctx); + for want in [ + "Create Object Mosaic", + "Current Size:", + "New Size:", + "Tile Spacing:", + "Number of Tiles:", + "Constrain Ratio:", + "Constrain Width and Height Proportions", + "Result:", + "Color", + "Grayscale", + "Resize Using Percentages", + "Delete Raster", + "Use Ratio", + "100 pt", + "50 pt", + ] { + assert!(texts.iter().any(|t| t == want), "{want:?} in {texts:?}"); + } + let undo = app.session.doc().unwrap().history.undo.len(); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); + assert_eq!(mosaic(&app), Some((100.0, 50.0, 100))); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1); + } + + /// An image narrower than 0.1 pt opens with a new width of 0.1 pt, which OK makes. + #[test] + fn a_tiny_image_opens_with_a_size_the_command_takes() { + let mut app = app_with_image(); + app.run("object.scale", json!({"sx": 0.05, "sy": 100})).unwrap(); + open(&mut app, &json!({})).unwrap(); + assert_eq!(app.ui.dialog.as_ref().unwrap().f64("width", 0.0), 0.1); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| m.0), Some(0.1)); + } + + /// With no image selected the dialog does not open and the error says why. + #[test] + fn without_an_image_nothing_opens() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 400})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 100, "height": 50})).unwrap(); + let e = open(&mut app, &json!({})).unwrap_err(); + assert!(app.ui.dialog.is_none()); + assert!(e.contains("select an image"), "{e}"); + } + + /// Constrain Ratio keeps the new size in the image's proportions from the side it names; Resize Using + /// Percentages shows the same size as percentages; Use Ratio makes the tiles square from the kept side's count. + #[test] + fn constrain_ratio_percentages_and_use_ratio_set_the_fields() { + let mut app = app_with_image(); + open(&mut app, &json!({"columns": 10, "rows": 10})).unwrap(); + let ctx = context(); + frame(&mut app, &ctx); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("lock".into(), json!(true)); + d.fields.insert("width".into(), json!(300)); + frame(&mut app, &ctx); + let mut d = app.ui.dialog.take().unwrap(); + assert_eq!(d.f64("height", 0.0), 150.0, "height follows the width"); + // Percentages: 300 × 150 pt of a 100 × 50 pt image is 300%. + switch_percentages(&mut d, true); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0)), (300.0, 300.0)); + // Use Ratio: 10 columns across 300 pt are 30 pt tiles, so 5 rows down 150 pt. + use_ratio(&app, &mut d); + assert_eq!((count(&d, "columns"), count(&d, "rows")), (10, 5)); + // Kept by height: 4 rows of 37.5 pt over 300 pt are 8 columns. + d.fields.insert("constrain".into(), json!("height")); + d.fields.insert("rows".into(), json!(4)); + use_ratio(&app, &mut d); + assert_eq!((count(&d, "columns"), count(&d, "rows")), (8, 4)); + switch_percentages(&mut d, false); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0)), (300.0, 150.0)); + d.fields.insert("gray".into(), json!(true)); + app.ui.dialog = Some(d); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app), Some((300.0, 150.0, 32))); + } + + /// A caller's params open the dialog with their values, and OK makes the mosaic they ask for. + #[test] + fn a_callers_params_open_the_dialog_with_their_values() { + let mut app = app_with_image(); + let params = json!({"columns": 4, "rows": 2, "width": 200, "percentages": true, "constrain": "width", "gray": true}); + app.run("ui.paramDialog", json!({"command": COMMAND, "label": "Create Object Mosaic", "params": params})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!(d.kind, KIND); + assert_eq!( + (d.f64("width", 0.0), d.bool("percentages"), d.bool("lock"), d.str("constrain"), d.bool("gray")), + (200.0, true, true, "width".into(), true) + ); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app), Some((200.0, 100.0, 8))); + // Use Ratio given applies to the counts shown: 10 columns over 100 × 50 pt are 5 rows. + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + let params = json!({"columns": 10, "rows": 3, "useRatio": true}); + app.run("ui.paramDialog", json!({"command": COMMAND, "params": params})).unwrap(); + assert_eq!(count(app.ui.dialog.as_ref().unwrap(), "rows"), 5); + // A side Use Ratio names is the side the dialog keeps: 4 rows over 100 × 50 pt are 8 columns. + let params = json!({"columns": 3, "rows": 4, "useRatio": "height"}); + app.run("ui.paramDialog", json!({"command": COMMAND, "params": params})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((count(d, "columns"), count(d, "rows"), d.str("constrain"), d.bool("lock")), (8, 4, "height".into(), false)); + app.ui.dialog = None; + // Params the command refuses open nothing and say why. + for (bad, key) in [(json!({"width": "abc"}), "width"), (json!({"constrain": "both"}), "constrain"), (json!({"widht": 200}), "widht")] { + let e = app.run("ui.paramDialog", json!({"command": COMMAND, "params": bad})).unwrap_err(); + assert!(app.ui.dialog.is_none(), "{e}"); + assert!(e.contains(key), "{e}"); + } + } + + /// `ui.dialog.set` of Resize Using Percentages shows the new size the other way, as the checkbox + /// does, so OK makes the same mosaic. Values the command refuses, set that way, are refused on OK + /// and make no mosaic. + #[test] + fn setting_fields_from_outside_keeps_the_size_or_is_refused() { + let mut app = app_with_image(); + open(&mut app, &json!({"width": 200, "height": 100})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + crate::dialogs::set_field(d, "percentages".into(), json!(true)); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0), d.bool("percentages")), (200.0, 200.0, true)); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((200.0, 100.0))); + app.run("edit.undo", json!({})).unwrap(); + for (field, value) in [("percentages", json!("yes")), ("width", json!("abc")), ("gray", json!(1))] { + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + open(&mut app, &json!({})).unwrap(); + crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), field.into(), value); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains(field), "{field}: {e}"); + assert_eq!(mosaic(&app), None, "{field}"); + } + } + + /// The id of the image in the document. + fn image_id(app: &VectorcraftApp) -> u64 { + let mut id = None; + app.session.active().unwrap().doc.walk(|n| { + if matches!(n.kind, NodeKind::Image(_)) { + id = Some(n.id.0); + } + }); + id.unwrap() + } + + /// #1000: the count the dialog holds reaches the command, so a count of 3.0 makes three columns. + #[test] + fn a_count_reaches_the_command() { + let mut app = app_with_image(); + open_from_menu(&mut app); + app.ui.dialog.as_mut().unwrap().fields.insert("columns".into(), json!(3.0)); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| m.2), Some(30)); + } +} diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index 3ce5455437..d50b08f97f 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -1128,8 +1128,8 @@ fn a_hex_code_pasted_into_the_hex_field_replaces_its_digits() { } } -/// #1000: a count typed in Object › Create Object Mosaic… reaches the command (a whole number typed -/// in a command's dialog is an integer), so the mosaic has that many columns, not the 10 × 10 grid. +/// #1000: a count set in Object › Create Object Mosaic… reaches the command, so the mosaic has that +/// many columns, not the 10 × 10 grid; Enter confirms the dialog. #[test] fn object_mosaic_makes_the_grid_typed_in_its_dialog() { let mut app = app(); @@ -1145,9 +1145,9 @@ fn object_mosaic_makes_the_grid_typed_in_its_dialog() { let entry = crate::menus::menu_entries(&app).into_iter().find(|e| e.label == "Create Object Mosaic…").expect("menu item"); let (cmd, params) = crate::menus::click_target(&entry.label, entry.command.as_deref().unwrap(), &entry.params); crate::menus::invoke(&mut app, &cmd, params); - // Its first field, Columns, is focused: type 3 over it and press Enter. frame(&mut app, vec![]); - frame(&mut app, vec![egui::Event::Text("3".into())]); + app.ui.dialog.as_mut().expect("the mosaic dialog").fields.insert("columns".into(), json!(3.0)); + frame(&mut app, vec![]); let enter = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; frame(&mut app, vec![enter]); assert!(app.ui.dialog.is_none()); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 28944173dd..da7fdcc70a 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -668,6 +668,16 @@ font-technology Variable Променливи Create New Swatch… Създаване на нов образец… Create New {kind} Style Създаване на нов стил за {kind} Create Object Mosaic… Създаване на обектова мозайка… + Create Object Mosaic Създаване на обектова мозайка + Current Size: Текущ размер: + New Size: Нов размер: + Tile Spacing: Разстояние между плочките: + Number of Tiles: Брой плочки: + Constrain Ratio: Ограничаване на съотношението: + Result: Резултат: + Resize Using Percentages Преоразмеряване с проценти + Delete Raster Изтриване на растерното изображение + Use Ratio Използване на съотношението Create Outlines Създаване на контур Create Path Създаване на път Create PDF layers from layers and sublayers Създаване на PDF слоеве от слоеве и подслоеве diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 01b90e5148..88530380fb 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -219,6 +219,16 @@ Rasterize… Rasteriziraj… Create Gradient Mesh… Kreiraj gradijentnu mrežu… Create Object Mosaic… Kreiraj mozaik objekata… + Create Object Mosaic Kreiraj mozaik objekata + Current Size: Trenutna veličina: + New Size: Nova veličina: + Tile Spacing: Razmak između pločica: + Number of Tiles: Broj pločica: + Constrain Ratio: Ograniči omjer: + Result: Rezultat: + Resize Using Percentages Promijeni veličinu u postocima + Delete Raster Izbriši rastersku sliku + Use Ratio Koristi omjer Vector Halftone… Vektorski polutonovi… Create Trim Marks Kreiraj oznake za obrezivanje Flatten Transparency… Spljošti prozirnost… diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 4ddd1d5605..120a525639 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -979,6 +979,16 @@ antiAlias Sharp Nítid Create New Swatch… Crea una mostra nova… Create New {kind} Style Crea un estil de {kind} nou Create Object Mosaic… Crea un mosaic d’objectes… + Create Object Mosaic Crea un mosaic d’objectes + Current Size: Mida actual: + New Size: Mida nova: + Tile Spacing: Espaiat de les tessel·les: + Number of Tiles: Nombre de tessel·les: + Constrain Ratio: Restringeix la proporció: + Result: Resultat: + Resize Using Percentages Canvia la mida amb percentatges + Delete Raster Suprimeix la imatge ràster + Use Ratio Usa la proporció Create Outlines Crea contorns Create Path Crea un traçat Create PDF layers from layers and sublayers Crea capes de PDF a partir de capes i subcapes diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 211982f086..328b60a247 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -225,6 +225,16 @@ Rasterize… Rastrovat… Create Gradient Mesh… Vytvořit přechodovou síť… Create Object Mosaic… Vytvořit mozaiku objektů… + Create Object Mosaic Vytvořit mozaiku objektů + Current Size: Aktuální velikost: + New Size: Nová velikost: + Tile Spacing: Rozestupy dlaždic: + Number of Tiles: Počet dlaždic: + Constrain Ratio: Zachovat poměr: + Result: Výsledek: + Resize Using Percentages Změnit velikost v procentech + Delete Raster Odstranit rastrový obraz + Use Ratio Použít poměr Vector Halftone… Vektorový polotón… Create Trim Marks Vytvořit značky ořezu Flatten Transparency… Sloučit průhlednost… diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index b3de0ae89a..65d141c988 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -212,6 +212,16 @@ Rasterize… Rasterisér… Create Gradient Mesh… Opret gradientnet… Create Object Mosaic… Opret objektmosaik… + Create Object Mosaic Opret objektmosaik + Current Size: Aktuel størrelse: + New Size: Ny størrelse: + Tile Spacing: Mellemrum mellem fliser: + Number of Tiles: Antal fliser: + Constrain Ratio: Begræns forhold: + Result: Resultat: + Resize Using Percentages Tilpas størrelse med procenter + Delete Raster Slet rasterbillede + Use Ratio Brug forhold Vector Halftone… Vektorhalvtone… Create Trim Marks Opret beskæringsmærker Flatten Transparency… Udjævn gennemsigtighed… diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index d0610144ef..d64a3ec160 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -661,6 +661,16 @@ font-technology Variable Variabel Create New Swatch… Neues Farbfeld erstellen… Create New {kind} Style Neues {kind}format erstellen Create Object Mosaic… Objektmosaik erstellen… + Create Object Mosaic Objektmosaik erstellen + Current Size: Aktuelle Größe: + New Size: Neue Größe: + Tile Spacing: Kachelabstand: + Number of Tiles: Anzahl der Kacheln: + Constrain Ratio: Proportionen beschränken: + Result: Ergebnis: + Resize Using Percentages Größe in Prozent ändern + Delete Raster Pixelbild löschen + Use Ratio Verhältnis verwenden Create Outlines In Pfade umwandeln Create Path Pfad erstellen Create PDF layers from layers and sublayers PDF-Ebenen aus Ebenen und Unterebenen erstellen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index d03f8c6958..b2b525911b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -642,6 +642,16 @@ font-technology Variable Μεταβλητές Create New Swatch… Δημιουργία νέου δείγματος χρώματος… Create New {kind} Style Δημιουργία νέου στυλ {kind} Create Object Mosaic… Δημιουργία μωσαϊκού αντικειμένων… + Create Object Mosaic Δημιουργία μωσαϊκού αντικειμένων + Current Size: Τρέχον μέγεθος: + New Size: Νέο μέγεθος: + Tile Spacing: Απόσταση πλακιδίων: + Number of Tiles: Αριθμός πλακιδίων: + Constrain Ratio: Περιορισμός αναλογίας: + Result: Αποτέλεσμα: + Resize Using Percentages Αλλαγή μεγέθους με ποσοστά + Delete Raster Διαγραφή εικόνας εικονοστοιχείων + Use Ratio Χρήση αναλογίας Create Outlines Δημιουργία περιγραμμάτων Create Path Δημιουργία διαδρομής Create PDF layers from layers and sublayers Δημιουργία επιπέδων PDF από επίπεδα και υποεπίπεδα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 3e8bd23752..df7bf676a7 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -683,6 +683,16 @@ font-technology Variable Variables Create New Swatch… Crear muestra nueva… Create New {kind} Style Crear estilo de {kind} nuevo Create Object Mosaic… Crear mosaico de objetos… + Create Object Mosaic Crear mosaico de objetos + Current Size: Tamaño actual: + New Size: Tamaño nuevo: + Tile Spacing: Espaciado de teselas: + Number of Tiles: Número de teselas: + Constrain Ratio: Limitar proporción: + Result: Resultado: + Resize Using Percentages Cambiar tamaño con porcentajes + Delete Raster Eliminar imagen rasterizada + Use Ratio Usar proporción Create Outlines Crear contornos Create Path Crear trazado Create PDF layers from layers and sublayers Crear capas PDF a partir de las capas y subcapas diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index d408220f47..97cb15c00e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -232,6 +232,16 @@ Rasterize… Rasteroi… Create Gradient Mesh… Luo liukuväriverkko… Create Object Mosaic… Luo objektimosaiikki… + Create Object Mosaic Luo objektimosaiikki + Current Size: Nykyinen koko: + New Size: Uusi koko: + Tile Spacing: Laattojen välistys: + Number of Tiles: Laattojen määrä: + Constrain Ratio: Rajoita suhdetta: + Result: Tulos: + Resize Using Percentages Muuta kokoa prosentteina + Delete Raster Poista rasterikuva + Use Ratio Käytä suhdetta Vector Halftone… Vektorirasterointi… Create Trim Marks Luo leikkuumerkit Flatten Transparency… Litistä läpinäkyvyys… diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 318bbbeb44..0c88b39ea4 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -684,6 +684,16 @@ font-technology Variable Variables Create New Swatch… Créer une nuance… Create New {kind} Style Créer un style de {kind} Create Object Mosaic… Créer une mosaïque d’objets… + Create Object Mosaic Créer une mosaïque d’objets + Current Size: Taille actuelle : + New Size: Nouvelle taille : + Tile Spacing: Espacement des carreaux : + Number of Tiles: Nombre de carreaux : + Constrain Ratio: Conserver les proportions : + Result: Résultat : + Resize Using Percentages Redimensionner en pourcentage + Delete Raster Supprimer l’image pixellisée + Use Ratio Utiliser le rapport Create Outlines Vectoriser Create Path Créer un tracé Create PDF layers from layers and sublayers Créer des calques PDF à partir des calques et sous-calques diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 716d851655..672077c95d 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -783,6 +783,15 @@ Create New Swatch… નવો સ્વેચ બનાવો… Create Object Mosaic ઑબ્જેક્ટ મોઝેઇક બનાવો Create Object Mosaic… ઑબ્જેક્ટ મોઝેઇક બનાવો… + Current Size: વર્તમાન કદ: + New Size: નવું કદ: + Tile Spacing: ટાઇલ વચ્ચે અંતર: + Number of Tiles: ટાઇલની સંખ્યા: + Constrain Ratio: ગુણોત્તર જાળવો: + Result: પરિણામ: + Resize Using Percentages ટકાવારીથી કદ બદલો + Delete Raster રાસ્ટર છબી કાઢી નાખો + Use Ratio ગુણોત્તર વાપરો Create Outlines આઉટલાઇન બનાવો Create PDF layers from layers and sublayers લેયર અને સબલેયરમાંથી PDF લેયર બનાવો Create PDF-Compatible File PDF-સુસંગત ફાઇલ બનાવો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 78c0a9a7eb..26eebd7628 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1117,6 +1117,15 @@ antiAlias Sharp शार्प Create New Swatch… नया स्वॉच बनाएँ… Create Object Mosaic ऑब्जेक्ट मोज़ेक बनाएँ Create Object Mosaic… ऑब्जेक्ट मोज़ेक बनाएँ… + Current Size: वर्तमान साइज़: + New Size: नया साइज़: + Tile Spacing: टाइल स्पेसिंग: + Number of Tiles: टाइलों की संख्या: + Constrain Ratio: अनुपात सीमित करें: + Result: परिणाम: + Resize Using Percentages प्रतिशत से साइज़ बदलें + Delete Raster रास्टर इमेज हटाएँ + Use Ratio अनुपात इस्तेमाल करें Create Outlines आउटलाइन बनाएँ Create Path पाथ बनाएँ Create PDF layers from layers and sublayers लेयर्स और सबलेयरों से PDF लेयरें बनाएं diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a1f6100b2f..8ae9f8db91 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -881,6 +881,16 @@ font-technology Variable Változó Create New Swatch… Új színminta létrehozása… Create New {kind} Style Új stílus létrehozása: {kind} Create Object Mosaic… Objektummozaik létrehozása… + Create Object Mosaic Objektummozaik létrehozása + Current Size: Jelenlegi méret: + New Size: Új méret: + Tile Spacing: Csempék térköze: + Number of Tiles: Csempék száma: + Constrain Ratio: Arány rögzítése: + Result: Eredmény: + Resize Using Percentages Átméretezés százalékban + Delete Raster Raszterkép törlése + Use Ratio Arány használata Create Outlines Átalakítás útvonallá Create Path Útvonal létrehozása Create PDF layers from layers and sublayers PDF-rétegek létrehozása a rétegekből és alrétegekből diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c7c6b956db..af0cdf56d3 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -212,6 +212,16 @@ Rasterize… Rasterisasi… Create Gradient Mesh… Buat mesh gradien… Create Object Mosaic… Buat mozaik objek… + Create Object Mosaic Buat mozaik objek + Current Size: Ukuran saat ini: + New Size: Ukuran baru: + Tile Spacing: Spasi ubin: + Number of Tiles: Jumlah ubin: + Constrain Ratio: Batasi rasio: + Result: Hasil: + Resize Using Percentages Ubah ukuran dengan persentase + Delete Raster Hapus gambar raster + Use Ratio Gunakan rasio Vector Halftone… Halftone vektor… Create Trim Marks Buat tanda potong Flatten Transparency… Ratakan transparansi… diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 6743704785..3a0c6aba8b 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -683,6 +683,16 @@ font-technology Variable Variabili Create New Swatch… Crea nuovo campione… Create New {kind} Style Crea nuovo stile {kind} Create Object Mosaic… Crea mosaico di oggetti… + Create Object Mosaic Crea mosaico di oggetti + Current Size: Dimensione attuale: + New Size: Nuova dimensione: + Tile Spacing: Spaziatura tessere: + Number of Tiles: Numero di tessere: + Constrain Ratio: Vincola proporzioni: + Result: Risultato: + Resize Using Percentages Ridimensiona in percentuale + Delete Raster Elimina immagine raster + Use Ratio Usa proporzioni Create Outlines Crea contorni Create Path Crea tracciato Create PDF layers from layers and sublayers Crea livelli PDF dai livelli e sottolivelli diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c9cdb8fcbe..6ea5212bf5 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -261,6 +261,16 @@ digits Malayalam マラヤーラム数字 Rasterize… ラスタライズ… Create Gradient Mesh… グラデーションメッシュを作成… Create Object Mosaic… モザイクオブジェクトを作成… + Create Object Mosaic モザイクオブジェクトを作成 + Current Size: 現在のサイズ: + New Size: 新しいサイズ: + Tile Spacing: タイルの間隔: + Number of Tiles: タイル数: + Constrain Ratio: 比率を固定: + Result: 結果: + Resize Using Percentages パーセントでサイズを変更 + Delete Raster ラスター画像を削除 + Use Ratio 比率を使用 Vector Halftone… ベクターハーフトーン… Create Trim Marks トリムマークを作成 Flatten Transparency… 透明部分を分割・統合… diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 55f726dc38..dd799eccd4 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -183,6 +183,16 @@ Rasterize… რასტრირება… Create Gradient Mesh… გრადიენტული ბადის შექმნა… Create Object Mosaic… ობიექტების მოზაიკის შექმნა… + Create Object Mosaic ობიექტების მოზაიკის შექმნა + Current Size: მიმდინარე ზომა: + New Size: ახალი ზომა: + Tile Spacing: ფილებს შორის ინტერვალი: + Number of Tiles: ფილების რაოდენობა: + Constrain Ratio: პროპორციის შეზღუდვა: + Result: შედეგი: + Resize Using Percentages ზომის შეცვლა პროცენტებით + Delete Raster რასტრული გამოსახულების წაშლა + Use Ratio პროპორციის გამოყენება Vector Halftone… ვექტორული ნახევარტონი… Create Trim Marks ჭრის ნიშნების შექმნა Flatten Transparency… გამჭვირვალობის გაბრტყელება… diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index abe2b4bc28..d7aff86dba 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -254,6 +254,16 @@ digits Malayalam 말라얄람어 Rasterize… 래스터화… Create Gradient Mesh… 그레이디언트 메시 만들기… Create Object Mosaic… 개체 모자이크 만들기… + Create Object Mosaic 개체 모자이크 만들기 + Current Size: 현재 크기: + New Size: 새 크기: + Tile Spacing: 타일 간격: + Number of Tiles: 타일 수: + Constrain Ratio: 비율 제한: + Result: 결과: + Resize Using Percentages 백분율로 크기 조정 + Delete Raster 래스터 이미지 삭제 + Use Ratio 비율 사용 Vector Halftone… 벡터 하프톤… Create Trim Marks 트림 마크 만들기 Flatten Transparency… 투명도 병합… diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ed281382a4..8737dbfb32 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -730,6 +730,16 @@ Rasterize… Rasteriseren… Create Gradient Mesh… Verloopmesh maken… Create Object Mosaic… Objectmozaïek maken… + Create Object Mosaic Objectmozaïek maken + Current Size: Huidige grootte: + New Size: Nieuwe grootte: + Tile Spacing: Tussenruimte tegels: + Number of Tiles: Aantal tegels: + Constrain Ratio: Verhouding beperken: + Result: Resultaat: + Resize Using Percentages Grootte wijzigen met percentages + Delete Raster Rasterafbeelding verwijderen + Use Ratio Verhouding gebruiken Vector Halftone… Vectorhalftoon… Create Trim Marks Afsnijtekens maken Flatten Transparency… Transparantie afvlakken… diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 08e96e6a35..736f3931fe 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -189,6 +189,16 @@ Rasterize… Rasteryzuj… Create Gradient Mesh… Utwórz siatkę gradientową… Create Object Mosaic… Utwórz mozaikę obiektów… + Create Object Mosaic Utwórz mozaikę obiektów + Current Size: Bieżący rozmiar: + New Size: Nowy rozmiar: + Tile Spacing: Odstęp między kafelkami: + Number of Tiles: Liczba kafelków: + Constrain Ratio: Ogranicz proporcje: + Result: Wynik: + Resize Using Percentages Zmień rozmiar w procentach + Delete Raster Usuń obraz rastrowy + Use Ratio Użyj proporcji Vector Halftone… Półton wektorowy… Create Trim Marks Utwórz znaczniki przycięcia Flatten Transparency… Spłaszcz przezroczystość… diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 79c4d9dc8e..ef6b2ffd91 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -608,6 +608,16 @@ antiAlias Sharp Nítido Create New Swatch… Criar Nova Amostra… Create New {kind} Style Criar Novo Estilo de {kind} Create Object Mosaic… Criar Mosaico de Objetos… + Create Object Mosaic Criar Mosaico de Objetos + Current Size: Tamanho atual: + New Size: Novo tamanho: + Tile Spacing: Espaçamento dos ladrilhos: + Number of Tiles: Número de ladrilhos: + Constrain Ratio: Restringir proporção: + Result: Resultado: + Resize Using Percentages Redimensionar usando porcentagens + Delete Raster Excluir imagem rasterizada + Use Ratio Usar proporção Create Outlines Criar Contornos Create PDF layers from layers and sublayers Criar camadas de PDF a partir das camadas e subcamadas Create PDF-Compatible File Criar Arquivo Compatível com PDF diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 9f608618e7..00ba36c68f 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -681,6 +681,16 @@ font-technology Variable Вариативные Create New Swatch… Создать новый образец… Create New {kind} Style Создать новый стиль {kind} Create Object Mosaic… Создать мозаику объектов… + Create Object Mosaic Создать мозаику объектов + Current Size: Текущий размер: + New Size: Новый размер: + Tile Spacing: Интервал между плитками: + Number of Tiles: Количество плиток: + Constrain Ratio: Сохранять пропорции: + Result: Результат: + Resize Using Percentages Изменить размер в процентах + Delete Raster Удалить растровое изображение + Use Ratio Использовать пропорции Create Outlines Создать контуры Create Path Создать контур Create PDF layers from layers and sublayers Создавать слои PDF из слоёв и подслоёв diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 6156ca23d5..64f32f05d7 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -670,6 +670,16 @@ font-technology Variable Variabla Create New Swatch… Skapa ny färgruta… Create New {kind} Style Skapa ny stil ({kind}) Create Object Mosaic… Skapa objektmosaik… + Create Object Mosaic Skapa objektmosaik + Current Size: Aktuell storlek: + New Size: Ny storlek: + Tile Spacing: Avstånd mellan plattor: + Number of Tiles: Antal plattor: + Constrain Ratio: Begränsa förhållande: + Result: Resultat: + Resize Using Percentages Ändra storlek med procent + Delete Raster Ta bort rasterbild + Use Ratio Använd förhållande Create Outlines Skapa konturbanor Create Path Skapa bana Create PDF layers from layers and sublayers Skapa PDF-lager från lager och underlager diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 7120d44707..089c4caa82 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -662,6 +662,16 @@ font-technology Variable Değişken Create New Swatch… Yeni Renk Örneği Oluştur… Create New {kind} Style Yeni {kind} Stili Oluşturun Create Object Mosaic… Nesne Mozaiği Oluştur… + Create Object Mosaic Nesne Mozaiği Oluştur + Current Size: Geçerli Boyut: + New Size: Yeni Boyut: + Tile Spacing: Döşeme Aralığı: + Number of Tiles: Döşeme Sayısı: + Constrain Ratio: Oranı Sınırla: + Result: Sonuç: + Resize Using Percentages Yüzdelerle Yeniden Boyutlandır + Delete Raster Raster Görüntüyü Sil + Use Ratio Oranı Kullan Create Outlines Anahatlar Oluştur Create Path Yol Oluştur Create PDF layers from layers and sublayers Katmanlardan ve alt katmanlardan PDF katmanları oluşturun diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 84f296b0a6..a50cb47980 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -677,6 +677,16 @@ font-technology Variable Варіативні Create New Swatch… Створити новий зразок… Create New {kind} Style Створити новий стиль {kind} Create Object Mosaic… Створити мозаїку об’єктів… + Create Object Mosaic Створити мозаїку об’єктів + Current Size: Поточний розмір: + New Size: Новий розмір: + Tile Spacing: Інтервал між плитками: + Number of Tiles: Кількість плиток: + Constrain Ratio: Зберігати пропорції: + Result: Результат: + Resize Using Percentages Змінити розмір у відсотках + Delete Raster Видалити растрове зображення + Use Ratio Використати пропорції Create Outlines Створити контури Create Path Створити контур Create PDF layers from layers and sublayers Створювати шари PDF із шарів та підшарів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index e8b9e5758f..eabdc31ae6 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -782,6 +782,16 @@ font-technology Variable Biến thiên Create New Swatch… Tạo mẫu màu mới… Create New {kind} Style Tạo kiểu {kind} mới Create Object Mosaic… Tạo khảm đối tượng… + Create Object Mosaic Tạo khảm đối tượng + Current Size: Kích thước hiện tại: + New Size: Kích thước mới: + Tile Spacing: Khoảng cách ô: + Number of Tiles: Số ô: + Constrain Ratio: Ràng buộc tỷ lệ: + Result: Kết quả: + Resize Using Percentages Đổi kích thước theo phần trăm + Delete Raster Xóa ảnh raster + Use Ratio Dùng tỷ lệ Create Outlines Tạo đường bao Create Path Tạo đường dẫn Create PDF layers from layers and sublayers Tạo lớp PDF từ các lớp và lớp con diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 719968086f..b5f17c7d9d 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -628,6 +628,16 @@ antiAlias Sharp 锐利 Create New Swatch… 新建色板… Create New {kind} Style 创建新的{kind}样式 Create Object Mosaic… 创建对象马赛克… + Create Object Mosaic 创建对象马赛克 + Current Size: 当前尺寸: + New Size: 新尺寸: + Tile Spacing: 拼贴间距: + Number of Tiles: 拼贴数量: + Constrain Ratio: 约束比例: + Result: 结果: + Resize Using Percentages 使用百分比调整大小 + Delete Raster 删除栅格图像 + Use Ratio 使用比例 Create Outlines 创建轮廓 Create Path 创建路径 Create PDF layers from layers and sublayers 从图层和子图层创建 PDF 图层 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 121a8b8c02..3f1dd675b0 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -646,6 +646,16 @@ font-technology Variable 可變 Create New Swatch… 建立新色票… Create New {kind} Style 建立新的{kind}樣式 Create Object Mosaic… 建立物件馬賽克… + Create Object Mosaic 建立物件馬賽克 + Current Size: 目前大小: + New Size: 新大小: + Tile Spacing: 拼貼間距: + Number of Tiles: 拼貼數量: + Constrain Ratio: 限制比例: + Result: 結果: + Resize Using Percentages 使用百分比調整大小 + Delete Raster 刪除點陣圖 + Use Ratio 使用比例 Create Outlines 建立外框 Create Path 建立路徑 Create PDF layers from layers and sublayers 從圖層和子圖層建立 PDF 圖層 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 7b7f7a6b21..ed5c94fbba 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -702,6 +702,10 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result< app.select_tool(vectorcraft_tools::cropimage::ID); Ok(json!({"tool": app.session.tool_id()})) } + // Create Object Mosaic… has a dialog of its own, opened on the selected image. + "ui.paramDialog" if s("command").as_deref() == Some(crate::dialogs::object_mosaic::COMMAND) => { + crate::dialogs::object_mosaic::open(app, p.get("params").unwrap_or(&Value::Null)) + } "ui.paramDialog" => { let cmd = s("command").unwrap_or_default(); let mut fields = p.get("params").and_then(Value::as_object).cloned().unwrap_or_default(); diff --git a/docs/mcp.md b/docs/mcp.md index 2e43c14d0e..d760baa267 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -1815,12 +1815,38 @@ nothing. These Object menu commands refuse a string, a number or another value that is not true or false with `` `copy` must be true or false ``, naming the key, and change nothing: `reflectX`, `reflectY`, `random`, `copy`, -`relative`, `strokes`, `corners`, `objects` and `patterns` in `object.transformEach`; `gray` and `deleteRaster` in -`object.createObjectMosaic`; `trim` in `object.cropImage`; `allArtboards` in `object.createTrimMarks`; and `byColumn`, +`relative`, `strokes`, `corners`, `objects` and `patterns` in `object.transformEach`; `gray`, `deleteRaster` +and `percentages` in `object.createObjectMosaic`; `trim` in `object.cropImage`; `allArtboards` in `object.createTrimMarks`; and `byColumn`, `moveArtwork`, `patterns` and `lockedAndHidden` in `artboard.rearrange`. A null is read as a key left out. `object.createTrimMarks` refuses a `style` that is not a string, such as `5`, with `` `style` must be roman or japanese ``, the message it gives for a string that names no style. +Object › Create Object Mosaic… opens a dialog on the selected image +([Create a mosaic from a bitmap image](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/create-mosaic-from-bitmap-image.html)): +Current Size, New Size, Tile Spacing, Number of Tiles, Constrain Ratio (Width or Height), Result (Color or +Grayscale), Resize Using Percentages, Delete Raster and Use Ratio. With no image selected it does not open. OK runs +`object.createObjectMosaic` as one undo step. The command takes: + +- `percentages: true`: `width` and `height` are percentages of the image's size (a side left out is 100). +- `constrain: "width"` or `"height"`: the mosaic keeps the image's proportions. The named side's size is used and the + other side's is worked out from it, so a `height` given with `constrain: "width"` is not used. +- `useRatio: "width"` or `"height"`: the tiles are square as drawn, with the spacing taken off. The count on the named + side (`columns` for `"width"`) stays, and the other count, within 1 to 1000, is the one whose tiles come closest to + square, measured along the image's own sides when it is turned. `useRatio: true` keeps the `constrain` side, or the + width when `constrain` is left out. This rounding is VectorCraft's own rule. The dialog's Use Ratio button sets the + counts the same way. + +A `width` or `height` outside 0.1 to 1000000 (points, or percent with `percentages`) is refused with +`` `width` must be between 0.1 and 1000000 (got 0) ``. A `constrain` other than `"width"`, `"height"` or null is +refused with `` `constrain` must be one of "width", "height" or null ``, and a `useRatio` other than those, true or +false with `` `useRatio` must be one of "width", "height", true, false or null ``; the command then changes nothing. A +side that `constrain` works out as under 0.1 pt grows to 0.1 pt, and the other side grows with it. The result also gives the `columns` and `rows` the mosaic was made with, here for a 100 × 50 pt image: + +```json +{"columns": 10, "rows": 3, "useRatio": true} +→ {"id": 42, "tiles": 50, "columns": 10, "rows": 5} +``` + A whole number that is larger than the build's `usize` can hold (4294967295 on a 32-bit build, such as the `wasm32-unknown-unknown` web build) counts as larger than any index, place, byte offset or count. An index, such as a `subpath`, `anchor`, `segment`, document `index`, `artboard`, appearance `item` or `index`, gradient `stop` or diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c6375f3aa3..eb5428f4e2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1319,6 +1319,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Initial live Revolve (#605, #846): a portable geometry and shading crate (`three-d`), editable path and compound profiles, compact options with artboard rotation and light gizmos, SVG/PDF vector output and Expand Appearance that can trim covered faces. Cap is on by default with continuous curved vector rims; shading uses vector gradients automatically, with sharp profile corners, uniform caps and round seam joins. The Lights list, Add Light and Delete Light manage one to ten independent colored lights; ambient is shared and visibility remains approximate ([revolve.md](revolve.md)). - Live effects with previewing dialogs: Distort & Transform, Path, Convert to Shape, 15 Warp styles, Round Corners, Scribble, Effect → Pathfinder (all 10 operations, live on groups; several loose objects are grouped first, in one undo step), Color Adjustments (Brightness/Contrast, Curves, Levels, Hue/Saturation, Shift to Color, Temperature/Tint, on vectors, live type and embedded images), and raster drop shadow, glows and feather. SVG and PDF export keep live effects (geometry baked; SVG raster effects as filters). Zig Zag spaces its ridges evenly along each segment, so lines and curves get a regular wave in Corner and Smooth (#1558). Warp › Arc (the effect and Envelope › Make with Warp) bends in the object's real proportions: a circular arc with concentric edges and no fold-over at 100%, so Arc on art that isn't square draws differently from before (#1581, fixes #1578). `effect.apply` and `effect.setParams` give an error for a misspelt or wrongly typed effect parameter instead of running the effect with its default (#1623, #1592). Roughen with Smooth keeps turn-backs smooth instead of making cusps that draw as spikes (#1646, #1643). Scribble draws one zig-zag per region, with no lines across holes and notches; convex shapes are unchanged (#1651, #1648). - Scribble (Effect › Stylize › Scribble…) has a Variation for each of Path Overlap, Curviness and Spacing ([Scribble options](https://helpx.adobe.com/illustrator/using/creating-sketches-mosaics.html)) (`overlapVariation`, `curvinessVariation`, `spacingVariation`), shown in its dialog and in the Appearance panel. A Scribble saved with the earlier single `variation` reads it as the Path Overlap and Spacing variations and draws as before. The angle is stored above -180° and up to 180°, so 270° is stored as -90°. + - Object › Create Object Mosaic… opens its own dialog on the selected image ([Create a mosaic from a bitmap image](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/create-mosaic-from-bitmap-image.html)): Current Size, New Size, Tile Spacing, Number of Tiles, Constrain Ratio (Width or Height), Result (Color or Grayscale), Resize Using Percentages, Delete Raster and Use Ratio. `object.createObjectMosaic` takes `percentages`, `constrain` and `useRatio`; Use Ratio keeps the constrained side's count and picks the other count whose tiles, spacing taken off, come closest to square, VectorCraft's own rule (`dialogs::object_mosaic::tests`, `tests::object_mosaic_resizes_by_percentages_constrains_the_ratio_and_squares_the_tiles`). - **Simplify feedback and component selection (#1272):** the existing tolerance dialog previews from the original interaction snapshot and shows original/new anchor counts. Preview off and Cancel restore the document and selection; OK is one Undo. A refit or Add Anchor Points clears component indexes only on paths whose geometry changes, keeping their objects selected whole and unchanged paths' components intact. Engine and real-egui frame regressions cover document/selection restoration and grouped paths. Public references: [Simplify benefits](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/simplify-path-benefits.html) and [advanced options](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/simplify-paths-advanced-options-overview.html). Nearly unchanged appearance is expected when reducing points. The checklist is partial, without raising scores. From 21edd7f6d85708b67c333eddcb5606416b35e215 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 15:42:57 -0800 Subject: [PATCH 032/247] i18n: Danish rows for Find and Replace messages --- crates/ui-egui/src/i18n/da.tsv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 19171ddcc0..e0b922564b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -697,6 +697,9 @@ Search Backwards Søg baglæns Check Hidden Layers Kontrollér skjulte lag Check Locked Layers Kontrollér låste lag +@msg No matches found Ingen forekomster fundet +@msg Matches replaced: {n} Erstattede forekomster: {n} +@msg no match of `find` at bytes {_1}..{_2} of object {_3} ingen forekomst af `find` ved byte {_1}..{_2} i objekt {_3} Find Next Find næste Spelling Stavekontrol Auto Spell Check Automatisk stavekontrol From 95a237e57599f0b9aefa200553822c1955826933 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 17:14:51 -0800 Subject: [PATCH 033/247] Object Mosaic: a constrained size under the minimum grows in proportion With Constrain Ratio on, OK leaves out the side it sets while that side holds the size Constrain Ratio gave it, so the command works it out from the kept side and grows both in proportion to its 0.1 pt minimum. A kept width of 0.1 pt over a 100 x 50 pt image now makes a 0.2 x 0.1 pt mosaic instead of refusing the 0.05 pt height. Another value set on that side is still passed on for the command to check. Resize Using Percentages keeps the fields and the mode as they are when the size would fall outside 0.1 to 1000000 the other way, and the dialog shows the limit. The dialog also shows why Use Ratio was refused. Docs: docs/target-app-parity.md (image tools row). --- crates/ui-egui/src/dialogs/object_mosaic.rs | 112 +++++++++++++++++--- docs/target-app-parity.md | 2 +- 2 files changed, 97 insertions(+), 17 deletions(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index ed8b060a92..ca699569be 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -13,6 +13,7 @@ use vectorcraft_doc::NodeKind; use super::{DialogSpec, form, run_and_close}; use crate::state::Dialog; +use crate::theme::Tokens; use crate::{VectorcraftApp, widgets}; /// The dialog kind of Create Object Mosaic. @@ -77,29 +78,51 @@ fn keeps_width(d: &Dialog) -> bool { d.str("constrain") != "height" } +/// With Constrain Ratio on, the size field that follows the kept side. +fn follower(d: &Dialog) -> Option<&'static str> { + d.bool("lock").then(|| if keeps_width(d) { "height" } else { "width" }) +} + +/// The new sizes the command takes, in points or percentages (`object.createObjectMosaic`). +const SIZE_RANGE: std::ops::RangeInclusive<f64> = 0.1..=1.0e6; + /// With Constrain Ratio on, the side that follows set from the side that leads, in the image's /// proportions. fn follow_ratio(d: &mut Dialog) { - if !d.bool("lock") { - return; - } - let (iw, ih) = image(d); - let pct = d.bool("percentages"); - if keeps_width(d) { - let w = d.f64("width", 0.0); - d.fields.insert("height".into(), json!(if pct { w } else { w * ih / iw })); - } else { - let h = d.f64("height", 0.0); - d.fields.insert("width".into(), json!(if pct { h } else { h * iw / ih })); + if let Some((key, v)) = derived(d) { + d.fields.insert(key.into(), json!(v)); } } +/// With Constrain Ratio on, the side that follows and the size it gets from the side that leads. +fn derived(d: &Dialog) -> Option<(&'static str, f64)> { + let key = follower(d)?; + let (iw, ih) = image(d); + let pct = d.bool("percentages"); + Some(if key == "height" { + let w = d.f64("width", 0.0); + (key, if pct { w } else { w * ih / iw }) + } else { + let h = d.f64("height", 0.0); + (key, if pct { h } else { h * iw / ih }) + }) +} + /// Resize Using Percentages turned on or off: the new size shown the other way, so it stays the -/// same size. +/// same size. When a size the command takes (all but the side Constrain Ratio sets) falls outside +/// what the command accepts the other way, the fields and the mode stay as they are and the dialog +/// shows the limit. fn switch_percentages(d: &mut Dialog, on: bool) { let (iw, ih) = image(d); let (w, h) = (d.f64("width", iw), d.f64("height", ih)); let (w, h) = if on { (w / iw * 100.0, h / ih * 100.0) } else { (iw * w / 100.0, ih * h / 100.0) }; + let skip = follower(d); + if let Some((key, v)) = [("width", w), ("height", h)].into_iter().find(|(k, v)| skip != Some(*k) && !SIZE_RANGE.contains(v)) { + let why = format!("`{key}` must be between {} and {} (got {v})", SIZE_RANGE.start(), SIZE_RANGE.end()); + d.fields.insert(form::REFUSED.into(), json!(why)); + return; + } + d.fields.remove(form::REFUSED); d.fields.insert("width".into(), json!(w)); d.fields.insert("height".into(), json!(h)); d.fields.insert("percentages".into(), json!(on)); @@ -125,6 +148,7 @@ fn use_ratio(app: &VectorcraftApp, d: &mut Dialog) { p["useRatio"] = json!(if keeps_width(d) { "width" } else { "height" }); match vectorcraft_engine::cmd::mosaic_counts(&app.session, &p) { Ok((cols, rows)) => { + d.fields.remove(form::REFUSED); d.fields.insert("columns".into(), json!(cols)); d.fields.insert("rows".into(), json!(rows)); } @@ -149,15 +173,24 @@ fn switch(d: &Dialog, key: &str) -> Value { d.fields.get(key).cloned().unwrap_or(json!(false)) } -/// `object.createObjectMosaic` parameters from the fields. +/// `object.createObjectMosaic` parameters from the fields. With Constrain Ratio on, the side it +/// sets is left out while it holds the size Constrain Ratio gives it: the command works it out from +/// the kept side and grows both in proportion to its 0.1 pt minimum. Any other value set on that +/// side is passed on for the command to check. fn params(d: &Dialog) -> Value { - json!({ + let mut p = json!({ "columns": number(d, "columns", 10.0), "rows": number(d, "rows", 10.0), "width": number(d, "width", 100.0), "height": number(d, "height", 100.0), "percentages": switch(d, "percentages"), "constrain": if d.bool("lock") { json!(if keeps_width(d) { "width" } else { "height" }) } else { Value::Null }, "spacingX": number(d, "spacingX", 0.0), "spacingY": number(d, "spacingY", 0.0), "gray": switch(d, "gray"), "deleteRaster": switch(d, "deleteRaster"), - }) + }); + if let (Some((key, v)), Some(o)) = (derived(d), p.as_object_mut()) + && o.get(key).and_then(Value::as_f64).is_some_and(|x| x == v) + { + o.remove(key); + } + p } /// A Width and a Height field for `keys`: lengths in `unit` of at least `least` points, or @@ -187,7 +220,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { widgets::dim_name(ui, &unit.format(ih)); }); ui.add_space(4.0); - let follows = d.bool("lock").then(|| if keeps_width(d) { "height" } else { "width" }); + let follows = follower(d); let pct = d.bool("percentages"); widgets::label_row(ui, tl!("New Size:"), LABEL_W, |ui| pair(ui, d, ["width", "height"], unit, (pct, 0.1), follows)); follow_ratio(d); @@ -233,6 +266,10 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { form::check(ui, d, "deleteRaster", tl!("Delete Raster")); }); }); + if let Some(why) = d.fields.get(form::REFUSED).and_then(Value::as_str) { + ui.add_space(4.0); + ui.add(egui::Label::new(egui::RichText::new(why).color(Tokens::get(ui.ctx()).warning)).wrap()); + } ui.add_space(6.0); if widgets::flat_button(ui, tl!("Use Ratio"), 96.0).clicked() { use_ratio(app, d); @@ -389,6 +426,23 @@ mod tests { assert_eq!(mosaic(&app), Some((300.0, 150.0, 32))); } + /// With Constrain Ratio on, a kept width of 0.1 pt over a 100 × 50 pt image sets a height of + /// 0.05 pt, under the command's minimum: OK makes the 0.2 × 0.1 pt mosaic the command grows it to. + #[test] + fn a_constrained_size_under_the_minimum_grows_in_proportion() { + let mut app = app_with_image(); + open(&mut app, &json!({})).unwrap(); + let ctx = context(); + frame(&mut app, &ctx); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("lock".into(), json!(true)); + d.fields.insert("width".into(), json!(0.1)); + frame(&mut app, &ctx); + assert_eq!(app.ui.dialog.as_ref().unwrap().f64("height", 0.0), 0.05, "height follows the width"); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((0.2, 0.1))); + } + /// A caller's params open the dialog with their values, and OK makes the mosaic they ask for. #[test] fn a_callers_params_open_the_dialog_with_their_values() { @@ -435,6 +489,23 @@ mod tests { crate::dialogs::confirm(&mut app).unwrap(); assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((200.0, 100.0))); app.run("edit.undo", json!({})).unwrap(); + // 0.1 × 0.1 pt of a 1000 × 500 pt image are 0.01% × 0.02%, under the command's 0.1%: the + // points stay, with the limit shown, and OK makes that size. + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + app.run("object.scale", json!({"sx": 1000, "sy": 1000})).unwrap(); + open(&mut app, &json!({"width": 0.1, "height": 0.1})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + crate::dialogs::set_field(d, "percentages".into(), json!(true)); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0), d.bool("percentages")), (0.1, 0.1, false)); + assert!(d.str(form::REFUSED).contains("`width` must be between 0.1"), "{}", d.str(form::REFUSED)); + let ctx = context(); + frame(&mut app, &ctx); + let texts = frame(&mut app, &ctx); + assert!(texts.iter().any(|t| t.contains("must be between")), "the limit is shown: {texts:?}"); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((0.1, 0.1))); + app.run("edit.undo", json!({})).unwrap(); + app.run("edit.undo", json!({})).unwrap(); for (field, value) in [("percentages", json!("yes")), ("width", json!("abc")), ("gray", json!(1))] { app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); open(&mut app, &json!({})).unwrap(); @@ -443,6 +514,15 @@ mod tests { assert!(e.contains(field), "{field}: {e}"); assert_eq!(mosaic(&app), None, "{field}"); } + // With Constrain Ratio on, a value the command refuses, set on the side it sets, is refused too. + for value in [json!("abc"), json!(0)] { + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + open(&mut app, &json!({"constrain": "width"})).unwrap(); + crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), "height".into(), value.clone()); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("height"), "{value}: {e}"); + assert_eq!(mosaic(&app), None, "{value}"); + } } /// The id of the image in the document. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index eb5428f4e2..60ea6baab7 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -246,7 +246,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | | Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), tab leaders, spell check (engine, custom dictionary and Auto Spell Check with its right-click suggestions and Spelling › Auto Spell Check, and the Edit Custom Dictionary dialog done, #4936; the Check Spelling dialog remains), Touch Type, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | -| Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; simpler contour walk, identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments, so Paths is monotone on the code-drawn sweep) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them; Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views (scores/hours unchanged) | +| Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; simpler contour walk, identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments, so Paths is monotone on the code-drawn sweep) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them; Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views (scores/hours unchanged); Create Object Mosaic's dialog with New Size, Constrain Ratio, Resize Using Percentages and Use Ratio is covered by `dialogs::object_mosaic::tests` (score, gaps and hours unchanged) | | Live vector effects | 5 | 85% | Outline Object, SVG Filters | 4–8 | measured count 49/50 (Pathfinder 13/13 with Trap), depth estimated; Warp Options controls verified by focused checks and original-image review | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, original lighting presets, painter visibility), Revolve (Classic) with Angle, Cap, Offset and the Plastic, Diffuse, No Shading and Wireframe surfaces, the Quick Actions › Expand as Wireframes command (#6354); materials, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); Revolve (Classic) is covered by the `revolve::classic` tests and `dialogs::revolve::tests::classic_revolve_shows_its_options_and_applies_as_one_step`; Expand as Wireframes is covered by `crates/effects/src/solids/wireframe/tests.rs` and `crates/engine/src/cmd/wireframe/tests.rs` (score, gaps and hours unchanged); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | | Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), variable font axes, tab leaders, spell check (engine, custom dictionary and Auto Spell Check with its right-click suggestions and Spelling › Auto Spell Check, and the Edit Custom Dictionary dialog done, #4936; the Check Spelling dialog remains), Touch Type, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | From 3183d77489a619e4ececebe32c5768267fbe88a7 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 18:12:06 -0800 Subject: [PATCH 034/247] Object Mosaic: a refused size set on the constrained side stays for OK to report A new width or height that ui.dialog.set gives and the command refuses (not a number, or outside 0.1 to 1000000) now stays in its field, also on the side Constrain Ratio sets, until a size the command takes replaces it. Before, the next frame replaced it with the size worked out from the kept side, so OK made a mosaic instead of reporting it. --- crates/ui-egui/src/dialogs.rs | 4 ++ crates/ui-egui/src/dialogs/object_mosaic.rs | 59 +++++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index e05da0a333..ee57b8010a 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -601,10 +601,14 @@ pub fn set_field(d: &mut Dialog, field: String, value: Value) { return; } let dxf = (d.kind == dxf_options::KIND).then(|| field.clone()); + let mosaic = (d.kind == object_mosaic::KIND).then(|| field.clone()); d.fields.insert(field, value); if let Some(field) = dxf { dxf_options::note_set(d, &field); } + if let Some(field) = mosaic { + object_mosaic::note_set(d, &field); + } } /// The fields `ui.dialog.set` can set on `d`, sorted: those it holds other than its `__` ones, the diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index ca699569be..1ab1262952 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -87,10 +87,41 @@ fn follower(d: &Dialog) -> Option<&'static str> { const SIZE_RANGE: std::ops::RangeInclusive<f64> = 0.1..=1.0e6; /// With Constrain Ratio on, the side that follows set from the side that leads, in the image's -/// proportions. +/// proportions. A size `ui.dialog.set` gave the following side that the command refuses stays, +/// for OK to report. fn follow_ratio(d: &mut Dialog) { - if let Some((key, v)) = derived(d) { - d.fields.insert(key.into(), json!(v)); + let Some((key, v)) = derived(d) else { return }; + if d.bool(&kept(key)) { + if !takes(d, key) { + return; + } + d.fields.remove(&kept(key)); + } + d.fields.insert(key.into(), json!(v)); +} + +/// The field that is true while size field `key` holds a value `ui.dialog.set` gave and the +/// command refuses. +fn kept(key: &str) -> String { + format!("__kept.{key}") +} + +/// Whether the command takes size field `key` as it is: a number from 0.1 to 1,000,000. +fn takes(d: &Dialog, key: &str) -> bool { + number(d, key, 0.0).as_f64().is_some_and(|x| SIZE_RANGE.contains(&x)) +} + +/// `ui.dialog.set` of `field`: a new size the command refuses (not a number, or outside 0.1 to +/// 1,000,000) stays in its field while it is refused, also on the side Constrain Ratio sets, instead +/// of being replaced by the size worked out from the kept side. +pub(super) fn note_set(d: &mut Dialog, field: &str) { + if !matches!(field, "width" | "height") { + return; + } + if takes(d, field) { + d.fields.remove(&kept(field)); + } else { + d.fields.insert(kept(field), json!(true)); } } @@ -514,15 +545,35 @@ mod tests { assert!(e.contains(field), "{field}: {e}"); assert_eq!(mosaic(&app), None, "{field}"); } - // With Constrain Ratio on, a value the command refuses, set on the side it sets, is refused too. + // With Constrain Ratio on, a value the command refuses, set on the side it sets, is refused + // too, also after a frame. for value in [json!("abc"), json!(0)] { app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); open(&mut app, &json!({"constrain": "width"})).unwrap(); crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), "height".into(), value.clone()); + frame(&mut app, &ctx); let e = crate::dialogs::confirm(&mut app).unwrap_err(); assert!(e.contains("height"), "{value}: {e}"); assert_eq!(mosaic(&app), None, "{value}"); } + // Once that side holds a size the command takes, Constrain Ratio sets it again. + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + open(&mut app, &json!({"constrain": "width"})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + for (field, value) in [("height", json!(0)), ("lock", json!(false)), ("height", json!(80)), ("lock", json!(true))] { + crate::dialogs::set_field(d, field.into(), value); + } + frame(&mut app, &ctx); + assert_eq!(app.ui.dialog.as_ref().unwrap().f64("height", 0.0), 50.0); + // A refused height stays while a refused width is set and then corrected. + let d = app.ui.dialog.as_mut().unwrap(); + for (field, value) in [("height", json!(0)), ("width", json!(0)), ("width", json!(100))] { + crate::dialogs::set_field(d, field.into(), value); + } + frame(&mut app, &ctx); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("height"), "{e}"); + assert_eq!(mosaic(&app), None); } /// The id of the image in the document. From 2242af85f7a8f40e01578f24c028e046f0e5f73f Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 18:57:19 -0800 Subject: [PATCH 035/247] Object Mosaic: a size that is not a number, or a refused height, stays for OK to report Resize Using Percentages no longer replaces a width or height that is not a number with one converted from the image's size: the fields and the mode stay and the dialog shows why. With Constrain Ratio on, a refused size set on the constrained side is passed to the command even when it equals the size worked out from the kept side, so OK reports it. --- crates/ui-egui/src/dialogs/object_mosaic.rs | 49 ++++++++++++++++++--- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index 1ab1262952..680ebd4d95 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -140,12 +140,19 @@ fn derived(d: &Dialog) -> Option<(&'static str, f64)> { } /// Resize Using Percentages turned on or off: the new size shown the other way, so it stays the -/// same size. When a size the command takes (all but the side Constrain Ratio sets) falls outside -/// what the command accepts the other way, the fields and the mode stay as they are and the dialog -/// shows the limit. +/// same size. When a size field does not hold a number, or a size the command takes (all but the +/// side Constrain Ratio sets) falls outside what the command accepts the other way, the fields and +/// the mode stay as they are and the dialog shows why. fn switch_percentages(d: &mut Dialog, on: bool) { let (iw, ih) = image(d); - let (w, h) = (d.f64("width", iw), d.f64("height", ih)); + let size = |key: &str| number(d, key, 100.0).as_f64().ok_or_else(|| format!("`{key}` must be a number (got {})", d.str(key))); + let (w, h) = match (size("width"), size("height")) { + (Ok(w), Ok(h)) => (w, h), + (Err(why), _) | (_, Err(why)) => { + d.fields.insert(form::REFUSED.into(), json!(why)); + return; + } + }; let (w, h) = if on { (w / iw * 100.0, h / ih * 100.0) } else { (iw * w / 100.0, ih * h / 100.0) }; let skip = follower(d); if let Some((key, v)) = [("width", w), ("height", h)].into_iter().find(|(k, v)| skip != Some(*k) && !SIZE_RANGE.contains(v)) { @@ -207,7 +214,8 @@ fn switch(d: &Dialog, key: &str) -> Value { /// `object.createObjectMosaic` parameters from the fields. With Constrain Ratio on, the side it /// sets is left out while it holds the size Constrain Ratio gives it: the command works it out from /// the kept side and grows both in proportion to its 0.1 pt minimum. Any other value set on that -/// side is passed on for the command to check. +/// side, and a refused value `ui.dialog.set` gave it even when it equals that size, is passed on for +/// the command to check. fn params(d: &Dialog) -> Value { let mut p = json!({ "columns": number(d, "columns", 10.0), "rows": number(d, "rows", 10.0), @@ -217,6 +225,7 @@ fn params(d: &Dialog) -> Value { "gray": switch(d, "gray"), "deleteRaster": switch(d, "deleteRaster"), }); if let (Some((key, v)), Some(o)) = (derived(d), p.as_object_mut()) + && !d.bool(&kept(key)) && o.get(key).and_then(Value::as_f64).is_some_and(|x| x == v) { o.remove(key); @@ -576,6 +585,36 @@ mod tests { assert_eq!(mosaic(&app), None); } + /// A width `ui.dialog.set` gave that is not a number stays when Resize Using Percentages is set, + /// with the mode unchanged and the reason shown, and OK refuses it. + #[test] + fn a_size_that_is_not_a_number_stays_when_percentages_switch() { + let mut app = app_with_image(); + open(&mut app, &json!({})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + crate::dialogs::set_field(d, "width".into(), json!("abc")); + crate::dialogs::set_field(d, "percentages".into(), json!(true)); + assert_eq!((d.str("width"), d.bool("percentages")), ("abc".into(), false)); + assert!(d.str(form::REFUSED).contains("`width` must be a number"), "{}", d.str(form::REFUSED)); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("width"), "{e}"); + assert_eq!(mosaic(&app), None); + } + + /// With Constrain Ratio on, a refused height `ui.dialog.set` gave is refused on OK even when it + /// equals the size Constrain Ratio works out from the width (0.05 pt from 0.1 pt over 100 × 50 pt). + #[test] + fn a_refused_height_equal_to_the_constrained_size_is_refused() { + let mut app = app_with_image(); + open(&mut app, &json!({"constrain": "width"})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + crate::dialogs::set_field(d, "width".into(), json!(0.1)); + crate::dialogs::set_field(d, "height".into(), json!(0.05)); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("height"), "{e}"); + assert_eq!(mosaic(&app), None); + } + /// The id of the image in the document. fn image_id(app: &VectorcraftApp) -> u64 { let mut id = None; From 09a8d3d6d28a07d990b806fc3bb7f46e303f0ed8 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 19:49:33 -0800 Subject: [PATCH 036/247] Docs: one Spanish row in the localization table, with its current counts --- docs/localization-parity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 5f97c9d57f..5f5d448256 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -30,8 +30,7 @@ Chinese by `imachus`). Georgian and the original Gujarati catalog are recorded a |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all (3,554 `@msg` and 48 `@msgplural` rows, counted 2026-11-13: the untranslated report lists 55 missing messages for it, which open #7116, #7211, #7330, #7378 and #7405 translate) | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,430 `@msg` and 48 `@msgplural` rows, counted 2026-11-13; the untranslated report lists 50 missing messages for it) | Latin | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (604 messages) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,556 `@msg` and 49 `@msgplural` rows, counted 2026-11-14: the untranslated report lists 145 messages without a Spanish row, 33 in its own section and 112 that every checked language lacks) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; the untranslated report on main `f793044f83` (2026-11-14) lists 676 missing rows for it: 608 in its own section and 68 that every checked language lacks | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, and a word-sense pass on short labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | reported missing rows, native review, layout and web font | | Gujarati | `gu` | 4,673 rows (2026-11-14): original 4,286 unchanged; all 387 additions contributor-reviewed and approved | menus and dialogs; status/error messages partial | installed Gujarati fonts on desktop; optional `Gujr` craft-fonts fallback; no Gujarati face in the pinned CI/release fonts or web startup list | original catalog reviewed by a native speaker; all 387 later additions approved by the contributor, with 11 wording corrections | contributor-reviewed catalog | remaining messages and a bundled Gujarati web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | From 16d1ed57acfdb04f78f2b0e8d650c1701a9b35c4 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sat, 14 Nov 2026 20:42:01 -0800 Subject: [PATCH 037/247] Scripts: the status bar shows text a script throws as it is A failed run's status translated a script's own thrown text whenever it matched one of the app's messages, so `throw new Error('invalid array length')` read as the app's translated error. Run errors now say whether their message is the script's own text: errors the interpreter or a host function throws are marked when they are made, stay the app's own when a script catches and rethrows them unchanged, and become the script's text when it changes their name or message. The status bar translates the words around such a message and shows the script's text unchanged. - `script.run`'s failed report adds `messageOrigin` (`script` or `built-in`); `message`, `kind` and the console line are unchanged. - The advice about other applications' objects follows only the app's own reference errors, not the same text thrown by a script. --- crates/engine/src/script/mod.rs | 46 ++++++++++++++------ crates/engine/src/tests/script_include.rs | 25 +++++++++++ crates/engine/src/tests/script_run.rs | 52 ++++++++++++++++++++++ crates/js/src/builtins.rs | 2 +- crates/js/src/heap.rs | 6 ++- crates/js/src/interp.rs | 48 ++++++++++++++++++-- crates/js/src/interp_tests.rs | 38 ++++++++++++++++ crates/js/src/realm.rs | 39 ++++++++++++----- crates/ui-egui/src/chrome/status_bar.rs | 15 ++++++- crates/ui-egui/src/chrome/tests.rs | 53 +++++++++++++++++++++++ crates/ui-egui/src/i18n.rs | 29 +++++++++++++ crates/ui-egui/src/i18n/tests.rs | 15 +++++++ docs/mcp.md | 6 ++- docs/target-app-parity.md | 1 + 14 files changed, 342 insertions(+), 33 deletions(-) diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 1b95b5fe2a..bb80023017 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -1476,12 +1476,14 @@ fn kind_id(kind: &RunErrorKind) -> &'static str { } } -/// `message`, with what to do about a failure that comes from a script written for another program. -fn explained(kind: &RunErrorKind, message: &str) -> String { +/// `e`'s message, with what to do about a failure that comes from a script written for another +/// program. A message the script supplied itself ([`RunError::authored`]) is given as it is. +fn explained(e: &RunError) -> String { const HOST_OBJECTS: &[&str] = &["app", "Window", "BridgeTalk", "activeDocument", "documents"]; + let message = &e.message; let names_host_object = message.strip_prefix("ReferenceError: ").is_some_and(|m| HOST_OBJECTS.iter().any(|o| m.split_whitespace().next() == Some(o))); - if *kind == RunErrorKind::Thrown && names_host_object { + if e.kind == RunErrorKind::Thrown && !e.authored && names_host_object { format!("{message} (scripts here use the `vc` object; objects other applications give their scripts are not available)") } else { message.to_string() @@ -1499,7 +1501,7 @@ fn preprocessor_error(f: include::Failure) -> (RunError, Option<Arc<str>>) { include::FailKind::Limit => (RunErrorKind::Limit(LimitKind::Host), f.message), }; let file = (f.index > 0).then_some(f.file); - (RunError { kind, message, line: f.line, column: f.column }, file) + (RunError { kind, message, line: f.line, column: f.column, authored: false }, file) } /// `e`, the error `realm` raised in the run of `host`, at the line and column of the file it is in, @@ -1508,20 +1510,20 @@ fn located(host: &Host, realm: &Realm, e: &RunError) -> (RunError, Option<Arc<st let map = |m: &include::SourceMap| { let (index, file, line, column) = m.locate(e.line, e.column); let message = if e.kind == RunErrorKind::Syntax { relocated(&e.message, e.line, e.column, line, column) } else { e.message.clone() }; - (RunError { kind: e.kind.clone(), message, line, column }, index, file) + (RunError { kind: e.kind.clone(), message, line, column, authored: e.authored }, index, file) }; // An error `$.evalFile` raised for a file it could not run, and no script caught, is at that // file's place. if let Some((file, line, column)) = realm.error_mark().and_then(|m| host.eval_failures.borrow().get(m as usize).cloned()) { let message = if e.kind == RunErrorKind::Syntax { relocated(&e.message, e.line, e.column, line, column) } else { e.message.clone() }; - return (RunError { kind: e.kind.clone(), message, line, column }, Some(file)); + return (RunError { kind: e.kind.clone(), message, line, column, authored: e.authored }, Some(file)); } if e.line == 0 { return (e.clone(), None); } // An error in code from a source whose map is not at hand, such as code that `eval` compiled, // is given without a place. - let unplaced = || (RunError { kind: e.kind.clone(), message: e.message.clone(), line: 0, column: 0 }, None); + let unplaced = || (RunError { line: 0, column: 0, ..e.clone() }, None); match realm.error_source() { 0 => { let (e, index, file) = map(&host.script_map.borrow()); @@ -1694,6 +1696,15 @@ impl Session { self.script_report.as_ref().filter(|r| r["ok"] == false).map(failure_text) } + /// [`Self::script_failure_text`] split around the message when that message is text the script + /// supplied itself (`messageOrigin` `script`): the text before it, the message and the text after + /// it. `None` when the last run did not fail, or failed with one of the app's own errors. + pub fn script_authored_failure(&self) -> Option<(String, &str, String)> { + let r = self.script_report.as_ref().filter(|r| r["ok"] == false && r["messageOrigin"] == "script")?; + let (before, after) = failure_frame(r); + Some((before, r["message"].as_str().unwrap_or_default(), after)) + } + /// Has the running script used up its growth allowance, so a person must answer? A run asked /// to stop no longer waits: the next [`Session::script_pump`] ends it. pub fn script_waiting(&self) -> bool { @@ -1764,7 +1775,7 @@ impl Session { }; drop(key); let kind = LimitKind::Interrupted; - let e = RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0 }; + let e = RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0, authored: false }; let _ = self.script_failed(job, &e); true } @@ -1986,14 +1997,14 @@ impl Session { // A stop while a dialog waits ends the run there; the interpreter cannot go on from the call. if job.realm.waits() { let kind = LimitKind::Interrupted; - let e = RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0 }; + let e = RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line: 0, column: 0, authored: false }; return Some(self.script_failed(job, &e)); } job.host.calls_this_slice.set(0); let outcome = run_slice(self, &mut job); match outcome { Err(panic) => { - let e = RunError { kind: RunErrorKind::Internal, message: panic, line: 0, column: 0 }; + let e = RunError { kind: RunErrorKind::Internal, message: panic, line: 0, column: 0, authored: false }; Some(self.script_failed(job, &e)) } Ok(Err(e)) => Some(self.script_failed(job, &e)), @@ -2006,7 +2017,7 @@ impl Session { let n = job.host.dialogs.unused(); let kind = LimitKind::Host; let message = format!("`answers` has {n} answer{} the script did not use", if n == 1 { "" } else { "s" }); - Some(self.script_failed(job, &RunError { kind: RunErrorKind::Limit(kind), message, line: 0, column: 0 })) + Some(self.script_failed(job, &RunError { kind: RunErrorKind::Limit(kind), message, line: 0, column: 0, authored: false })) } Ok(Ok(Progress::Done(_))) => { let r = self.script_commit(job); @@ -2050,7 +2061,7 @@ impl Session { if changed && (!crate::sanity::doc_sane(&st.doc, &st.selection) || st.doc.too_deep(None)) { job.world.docs = start; job.world.swap(self); - let e = RunError { kind: RunErrorKind::Internal, message: INVALID_RESULT.to_string(), line: 0, column: 0 }; + let e = RunError { kind: RunErrorKind::Internal, message: INVALID_RESULT.to_string(), line: 0, column: 0, authored: false }; return self.script_failed(job, &e); } } @@ -2153,7 +2164,8 @@ fn failure_report(name: &str, e: &RunError, file: Option<&str>, host: &Host, fue let mut report = json!({ "ok": false, "kind": kind_id(&e.kind), - "message": explained(&e.kind, &e.message), + "message": explained(e), + "messageOrigin": if e.authored { "script" } else { "built-in" }, "name": name, "line": e.line, "column": e.column, @@ -2245,6 +2257,12 @@ fn close_run(s: &mut Session, host: &Host, report: &mut Value, ending: console:: /// The text of a failed run's error. fn failure_text(report: &Value) -> String { + let (before, after) = failure_frame(report); + format!("{before}{}{after}", report["message"].as_str().unwrap_or_default()) +} + +/// The text of a failed run's error before its message and after it. +fn failure_frame(report: &Value) -> (String, String) { let s = |k: &str| report[k].as_str().unwrap_or_default(); let (line, column) = (report["line"].as_u64().unwrap_or(0), report["column"].as_u64().unwrap_or(0)); let at = match report["file"].as_str() { @@ -2259,7 +2277,7 @@ fn failure_text(report: &Value) -> String { } else { String::new() }; - format!("{}{at}: {} ({}){kept}", s("name"), s("message"), s("kind")) + (format!("{}{at}: ", s("name")), format!(" ({}){kept}", s("kind"))) } /// A run's slice: the working copy in, the real session lent to the host functions, one measured diff --git a/crates/engine/src/tests/script_include.rs b/crates/engine/src/tests/script_include.rs index 1ad659cfdd..cc6756c332 100644 --- a/crates/engine/src/tests/script_include.rs +++ b/crates/engine/src/tests/script_include.rs @@ -77,6 +77,31 @@ fn script_missing_include_reports_origin() { assert!(report["message"].as_str().unwrap().contains("include file not found: nope.jsxinc"), "{report}"); assert_eq!(report["log"], json!([]), "nothing ran before the include was read"); assert!(report.get("file").is_none(), "the line is the script's own"); + assert_eq!(report["messageOrigin"], "built-in"); + let _ = std::fs::remove_dir_all(base); +} + +/// An error in an included file keeps where its message came from: a value the file threw is the +/// script's own text, and an error the app raised for it, or for a file `$.evalFile` could not run, is not. +#[test] +fn script_include_errors_keep_their_message_origin() { + let base = folder("origin"); + write(&base.join("main/lib.jsxinc"), "var a = 1;\n throw new RangeError('invalid array length');"); + write(&base.join("main/native.jsxinc"), "var a = 1;\n new Array(-1);"); + for (text, message, origin) in [ + ("#include \"lib.jsxinc\"", "RangeError: invalid array length", "script"), + ("#include \"native.jsxinc\"", "RangeError: invalid array length", "built-in"), + ("try {\n#include \"native.jsxinc\"\n} catch (e) { throw e; }", "RangeError: invalid array length", "built-in"), + ("try {\n#include \"native.jsxinc\"\n} catch (e) { throw e.message; }", "invalid array length", "script"), + ] { + let report = failed(&base, text); + assert_eq!((report["message"].as_str(), report["messageOrigin"].as_str()), (Some(message), Some(origin)), "{text}: {report}"); + } + let report = failed(&base, "#include \"lib.jsxinc\""); + let file = report["file"].as_str().map(|f| Path::new(f).ends_with("lib.jsxinc")); + assert_eq!((file, report["line"].as_u64(), report["column"].as_u64()), (Some(true), Some(2), Some(3)), "{report}"); + let report = failed(&base, "$.evalFile('nope.jsx');"); + assert_eq!(report["messageOrigin"], "built-in", "{report}"); let _ = std::fs::remove_dir_all(base); } diff --git a/crates/engine/src/tests/script_run.rs b/crates/engine/src/tests/script_run.rs index d272fea167..ac91ea4a7d 100644 --- a/crates/engine/src/tests/script_run.rs +++ b/crates/engine/src/tests/script_run.rs @@ -170,6 +170,58 @@ fn an_error_names_the_script_its_place_and_kind() { assert_eq!(s.script_report().unwrap()["line"], 1); } +/// A failed run's report keeps its message and kind and says where the message came from: text the +/// script supplied, or one of the app's own errors. The status text and the console line read the +/// same either way, and only the app's own errors get advice about other applications' objects. +#[test] +fn failed_script_report_keeps_message_and_adds_origin() { + let mut s = two_docs(); + for (source, kind, message, origin) in [ + ("throw new Error('invalid array length');", "thrown", "Error: invalid array length", "script"), + ("throw new RangeError('invalid array length');", "thrown", "RangeError: invalid array length", "script"), + ("throw 'invalid array length';", "thrown", "invalid array length", "script"), + ("throw 'ReferenceError: app is not defined';", "thrown", "ReferenceError: app is not defined", "script"), + ("try { new Array(-1); } catch (e) { throw new Error(e.message); }", "thrown", "Error: invalid array length", "script"), + ("new Array(-1);", "thrown", "RangeError: invalid array length", "built-in"), + ("try { new Array(-1); } catch (e) { throw e; }", "thrown", "RangeError: invalid array length", "built-in"), + ("vc.run();", "thrown", "TypeError: vc.run: give a command id, as a string", "built-in"), + ] { + let e = run(&mut s, source).unwrap_err().to_string(); + let report = s.script_report().unwrap().clone(); + assert_eq!( + (report["kind"].as_str(), report["message"].as_str(), report["messageOrigin"].as_str()), + (Some(kind), Some(message), Some(origin)), + "{source}" + ); + let (line, column) = (&report["line"], &report["column"]); + let before = format!("t.js: line {line}, column {column}: "); + assert_eq!(e, format!("{before}{message} ({kind})"), "{source}"); + assert_eq!(s.script_failure_text().as_deref(), Some(e.as_str())); + let authored = s.script_authored_failure(); + assert_eq!(authored, (origin == "script").then(|| (before.clone(), message, format!(" ({kind})"))), "{source}"); + let console = s.execute("script.console", &json!({})).unwrap(); + let error = console["lines"].as_array().unwrap().iter().rev().find(|l| l["kind"] == "error").map(|l| l["text"].clone()); + assert_eq!(error, Some(json!(format!("t.js:{line}:{column}: {message}"))), "{source}"); + } + // The app's own reference error names the `vc` object; the same text a script threw does not. + run(&mut s, "app.activeDocument;").unwrap_err(); + assert!(s.script_report().unwrap()["message"].as_str().unwrap().contains("`vc`")); + assert_eq!(s.script_report().unwrap()["messageOrigin"], "built-in"); + // An error in code `eval` compiled keeps where its message came from. + let e = run(&mut s, "eval(\"throw new Error('invalid array length')\");").unwrap_err().to_string(); + assert_eq!(e, "t.js: Error: invalid array length (thrown)"); + assert_eq!(s.script_authored_failure(), Some(("t.js: ".to_string(), "Error: invalid array length", " (thrown)".to_string()))); + // Syntax errors and limits are the app's own. + run(&mut s, "var = 1;").unwrap_err(); + assert_eq!((s.script_report().unwrap()["kind"].as_str(), s.script_authored_failure()), (Some("syntax"), None)); + s.execute("script.run", &json!({"source": "while (true) {}", "name": "t.js", "maxFuel": 100_000})).unwrap_err(); + assert_eq!((s.script_report().unwrap()["messageOrigin"].as_str(), s.script_authored_failure()), (Some("built-in"), None)); + // A run that completes has no failure to split. + run(&mut s, "throw 'x';").unwrap_err(); + run(&mut s, "1").unwrap(); + assert_eq!(s.script_authored_failure(), None); +} + /// An error raised where the run has no place for it, such as in code `eval` compiled, is named /// with the script and its kind alone, with one colon after the script's name. #[test] diff --git a/crates/js/src/builtins.rs b/crates/js/src/builtins.rs index 301b1235a4..4b9b14cfe0 100644 --- a/crates/js/src/builtins.rs +++ b/crates/js/src/builtins.rs @@ -318,7 +318,7 @@ fn install_errors(interp: &mut Interp, object_proto: ObjId) -> JsResult<()> { for (i, (name, f)) in kinds.into_iter().enumerate() { // Error.prototype and each NativeError prototype are Error objects (sections 15.11.4 and // 15.11.7.7). - let proto = alloc(interp, Class::Error, Some(if i == 0 { object_proto } else { error_proto })); + let proto = alloc(interp, Class::Error(None), Some(if i == 0 { object_proto } else { error_proto })); if i == 0 { error_proto = proto; method(interp, proto, "toString", error_to_string, 0)?; diff --git a/crates/js/src/heap.rs b/crates/js/src/heap.rs index dea53c557f..b72d00da90 100644 --- a/crates/js/src/heap.rs +++ b/crates/js/src/heap.rs @@ -213,7 +213,9 @@ pub(crate) enum Class { length_writable: bool, }, Function(Func), - Error, + /// An error object. One the interpreter threw itself holds a hash of the description it had + /// then ([`crate::interp::Interp::describe`]); one a script made holds `None`. + Error(Option<u64>), Arguments(Box<ArgMap>), /// A `Boolean` object made by ToObject, with its primitive value. Boolean(bool), @@ -311,7 +313,7 @@ impl Class { Class::Ordinary | Class::ForIn(_) => "Object", Class::Array { .. } => "Array", Class::Function(_) => "Function", - Class::Error => "Error", + Class::Error(_) => "Error", Class::Arguments(_) => "Arguments", Class::Boolean(_) => "Boolean", Class::Number(_) => "Number", diff --git a/crates/js/src/interp.rs b/crates/js/src/interp.rs index aa4a4c5c78..6b86b3765b 100644 --- a/crates/js/src/interp.rs +++ b/crates/js/src/interp.rs @@ -48,6 +48,14 @@ fn internal<T>(message: &str) -> JsResult<T> { Err(Abrupt::Internal(message.into())) } +/// The hash an error the interpreter throws keeps of its description ([`Interp::throw`]). +fn description_hash(text: &str) -> u64 { + use std::hash::{Hash, Hasher}; + let mut h = std::hash::DefaultHasher::new(); + text.hash(&mut h); + h.finish() +} + /// The kinds of error object the engine throws. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(crate) enum ErrorType { @@ -60,6 +68,21 @@ pub(crate) enum ErrorType { Uri, } +impl ErrorType { + /// The `name` the prototype of this kind of error has before a script changes it. + pub(crate) fn name(self) -> &'static str { + match self { + ErrorType::Error => "Error", + ErrorType::Eval => "EvalError", + ErrorType::Range => "RangeError", + ErrorType::Reference => "ReferenceError", + ErrorType::Syntax => "SyntaxError", + ErrorType::Type => "TypeError", + ErrorType::Uri => "URIError", + } + } +} + /// The objects the interpreter itself refers to. #[derive(Clone, Copy, Debug)] pub(crate) struct Intrinsics { @@ -498,15 +521,34 @@ impl Interp { pub(crate) fn error_object(&mut self, t: ErrorType, message: &str) -> ObjId { let proto = self.intrinsics.error_proto(t); - let mut o = Object::new(Class::Error, Some(proto)); + let mut o = Object::new(Class::Error(None), Some(proto)); if !message.is_empty() { o.props.insert(key("message"), Prop::Data { value: Value::str(message), flags: HIDDEN }); } self.heap.alloc_object(o) } + /// An error of the interpreter's or a host function's own, marked as such with a hash of the + /// description it has with its kind's own name ([`Self::thrown_by_script`]), so a name a script + /// gave the kind's prototype before the error was made counts as the script's text. pub(crate) fn throw(&mut self, t: ErrorType, message: &str) -> Abrupt { - Abrupt::Throw(Value::Object(self.error_object(t, message))) + let o = self.error_object(t, message); + let own = if message.is_empty() { t.name().to_string() } else { format!("{}: {message}", t.name()) }; + if let Some(object) = self.heap.object_mut(o) { + object.class = Class::Error(Some(description_hash(&own))); + } + Abrupt::Throw(Value::Object(o)) + } + + /// Is the text [`Self::describe`] gives for the thrown value `v` the script's own? It is unless + /// `v` is an error the interpreter or a host function threw, with its name and message as they + /// were then: a value the script threw, an error it made, and an error whose name or message it + /// changed all hold its own text. + pub(crate) fn thrown_by_script(&mut self, v: &Value) -> bool { + let Value::Object(o) = v else { return true }; + let Some(Class::Error(Some(hash))) = self.heap.object(*o).map(|o| &o.class) else { return true }; + let hash = *hash; + description_hash(&self.describe(v)) != hash } pub(crate) fn type_error(&mut self, message: &str) -> Abrupt { @@ -770,7 +812,7 @@ impl Interp { let passed = matches!((&v, std::mem::replace(&mut self.passing, Value::Undefined)), (Value::Object(a), Value::Object(b)) if *a == b); if !passed && let Value::Object(o) = v - && self.heap.object(o).is_some_and(|o| matches!(o.class, Class::Error)) + && self.heap.object(o).is_some_and(|o| matches!(o.class, Class::Error(_))) { self.last_error = v.clone(); } diff --git a/crates/js/src/interp_tests.rs b/crates/js/src/interp_tests.rs index 93c487b378..c73195b085 100644 --- a/crates/js/src/interp_tests.rs +++ b/crates/js/src/interp_tests.rs @@ -239,6 +239,44 @@ fn errors_carry_line_and_column() { assert_eq!(e.message, "42"); } +/// A run error says whether its message is the script's own text, whatever that text reads: an +/// error the interpreter or a host function threw is not, even when a script caught it and threw +/// it again, and a value or error the script made, or an error whose name or message it changed, +/// is. +#[test] +fn script_error_origin_distinguishes_native_and_authored_values() { + let native = "RangeError: invalid array length"; + for (src, message, authored) in [ + ("new Array(-1)", native, false), + ("try { new Array(-1); } catch (e) { throw e; }", native, false), + ("try { new Array(-1); } catch (e) { e.message = 'invalid array length'; throw e; }", native, false), + ("nope()", "ReferenceError: nope is not defined", false), + ("throw new RangeError('invalid array length')", native, true), + ("throw new Error('invalid array length')", "Error: invalid array length", true), + ("throw 'invalid array length'", "invalid array length", true), + ("throw 17", "17", true), + ("throw {}", "[object Object]", true), + ("throw new Error()", "Error", true), + ("try { new Array(-1); } catch (e) { throw e.message; }", "invalid array length", true), + ("try { new Array(-1); } catch (e) { throw new RangeError(e.message); }", native, true), + ("try { new Array(-1); } catch (e) { e.message = 'mine'; throw e; }", "RangeError: mine", true), + ("try { nope(); } catch (e) { e.name = 'TypeError'; throw e; }", "TypeError: nope is not defined", true), + ("try { new Array(-1); } catch (e) { RangeError.prototype.name = 'Mine'; throw e; }", "Mine: invalid array length", true), + ("RangeError.prototype.name = 'Mine'; new Array(-1)", "Mine: invalid array length", true), + ("RangeError.prototype.name = 'RangeError'; new Array(-1)", native, false), + ] { + let e = fail(src); + assert_eq!((e.kind, e.message.as_str(), e.authored), (RunErrorKind::Thrown, message, authored), "{src}"); + } + assert!(!fail("var x = ;").authored, "a syntax error"); + let mut realm = Realm::new(); + realm.define_function("add", |_| Err("add takes two numbers".into())); + let e = realm.run("add()").unwrap_err(); + assert_eq!((e.message.as_str(), e.authored), ("Error: add takes two numbers", false), "a host function's error"); + let e = realm.run("throw new Error('add takes two numbers')").unwrap_err(); + assert_eq!((e.message.as_str(), e.authored), ("Error: add takes two numbers", true)); +} + #[test] fn host_functions_receive_arguments_and_return_values() { let mut realm = Realm::new(); diff --git a/crates/js/src/realm.rs b/crates/js/src/realm.rs index 4146ae891b..1570a9e70d 100644 --- a/crates/js/src/realm.rs +++ b/crates/js/src/realm.rs @@ -139,6 +139,10 @@ pub struct RunError { pub message: String, pub line: u32, pub column: u32, + /// `message` is text the script supplied: a value it threw, or an error object it made or whose + /// name or message it changed. False for the interpreter's and host functions' own errors, + /// syntax errors and limits, even when a script caught one and threw it again. + pub authored: bool, } impl std::fmt::Display for RunError { @@ -151,7 +155,7 @@ impl std::error::Error for RunError {} impl From<SyntaxError> for RunError { fn from(e: SyntaxError) -> Self { - RunError { kind: RunErrorKind::Syntax, message: e.to_string(), line: e.line, column: e.column } + RunError { kind: RunErrorKind::Syntax, message: e.to_string(), line: e.line, column: e.column, authored: false } } } @@ -241,7 +245,7 @@ impl Realm { self.script_tag = UNKNOWN_SOURCE; let interp = &mut self.interp; if let Some(message) = &interp.install_error { - return Err(RunError { kind: RunErrorKind::Internal, message: message.clone(), line: 0, column: 0 }); + return Err(RunError { kind: RunErrorKind::Internal, message: message.clone(), line: 0, column: 0, authored: false }); } interp.fuel = interp.limits.fuel; interp.flattened_fuel.set(0); @@ -268,7 +272,7 @@ impl Realm { interp.error_tag = self.script_tag; Err(e.into()) } - Err(CompileError::Internal(m)) => Err(RunError { kind: RunErrorKind::Internal, message: m, line: 0, column: 0 }), + Err(CompileError::Internal(m)) => Err(RunError { kind: RunErrorKind::Internal, message: m, line: 0, column: 0, authored: false }), } } @@ -291,15 +295,18 @@ impl Realm { Ok(v) => Ok(interp.to_js_value(&v)), Err(Abrupt::Throw(v)) => { let message = interp.describe(&v); + let authored = interp.thrown_by_script(&v); interp.last_thrown = v; - Err(RunError { kind: RunErrorKind::Thrown, message, line, column }) + Err(RunError { kind: RunErrorKind::Thrown, message, line, column, authored }) } Err(Abrupt::Limit(LimitKind::Host)) => { let message = interp.host_abort.take().unwrap_or_else(|| format!("limit reached: {:?}", LimitKind::Host)); - Err(RunError { kind: RunErrorKind::Limit(LimitKind::Host), message, line, column }) + Err(RunError { kind: RunErrorKind::Limit(LimitKind::Host), message, line, column, authored: false }) } - Err(Abrupt::Limit(kind)) => Err(RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line, column }), - Err(Abrupt::Internal(message)) => Err(RunError { kind: RunErrorKind::Internal, message, line, column }), + Err(Abrupt::Limit(kind)) => { + Err(RunError { kind: RunErrorKind::Limit(kind), message: format!("limit reached: {kind:?}"), line, column, authored: false }) + } + Err(Abrupt::Internal(message)) => Err(RunError { kind: RunErrorKind::Internal, message, line, column, authored: false }), } } @@ -321,10 +328,16 @@ impl Realm { pub fn advance(&mut self, slice: u64) -> Result<Progress, RunError> { let interp = &mut self.interp; if interp.frames.is_empty() { - return Err(RunError { kind: RunErrorKind::Internal, message: "no run to advance".into(), line: 0, column: 0 }); + return Err(RunError { kind: RunErrorKind::Internal, message: "no run to advance".into(), line: 0, column: 0, authored: false }); } if interp.waiting { - return Err(RunError { kind: RunErrorKind::Internal, message: "the run waits for a host function's result".into(), line: 0, column: 0 }); + return Err(RunError { + kind: RunErrorKind::Internal, + message: "the run waits for a host function's result".into(), + line: 0, + column: 0, + authored: false, + }); } let total = interp.fuel; let cap = slice.saturating_add(self.unbroken_fuel).min(total); @@ -380,7 +393,13 @@ impl Realm { pub fn answer(&mut self, d: crate::Data) -> Result<(), RunError> { let interp = &mut self.interp; if !interp.waiting { - return Err(RunError { kind: RunErrorKind::Internal, message: "no host function waits for a result".into(), line: 0, column: 0 }); + return Err(RunError { + kind: RunErrorKind::Internal, + message: "no host function waits for a result".into(), + line: 0, + column: 0, + authored: false, + }); } interp.waiting = false; // The value on top of the stack stood in for the result. diff --git a/crates/ui-egui/src/chrome/status_bar.rs b/crates/ui-egui/src/chrome/status_bar.rs index 1e946b56da..8e9f26b929 100644 --- a/crates/ui-egui/src/chrome/status_bar.rs +++ b/crates/ui-egui/src/chrome/status_bar.rs @@ -237,7 +237,7 @@ pub(super) fn status_readouts(app: &VectorcraftApp, ui: &mut Ui, t: &Tokens) { let more = busy.len() - 1; (if more > 0 { format!("{label}… (+{more})") } else { format!("{label}…") }, &[][..]) } else { - (crate::i18n::msg(&app.ui.status), status_notes(&app.ui)) + (status_message(app), status_notes(&app.ui)) }; if !message.is_empty() { let rect = egui::Rect::from_min_max(egui::pos2((area.left() + 18.0).min(right), area.top()), egui::pos2(right, area.bottom())); @@ -245,6 +245,19 @@ pub(super) fn status_readouts(app: &VectorcraftApp, ui: &mut Ui, t: &Tokens) { } } +/// The status message in the interface language. While it is the error of the last script run +/// and that error's message is text the script supplied, that text is shown as it is and only the +/// words around it are translated. +pub(crate) fn status_message(app: &VectorcraftApp) -> String { + let status = app.ui.status.as_str(); + if let Some((before, kept, after)) = app.session.script_authored_failure() + && status.strip_prefix(before.as_str()).and_then(|rest| rest.strip_suffix(after.as_str())) == Some(kept) + { + return crate::i18n::msg_keeping(&before, kept, &after); + } + crate::i18n::msg(status) +} + /// Most notes the status message's hover and access information list. const MAX_LISTED_NOTES: usize = 30; diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index be37f10a29..23af31a827 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -491,6 +491,59 @@ fn the_message_of_an_open_with_several_notes_lists_them_on_hover() { assert_eq!(hovered.iter().filter(|t| t.text.starts_with("Opened")).count(), 1, "no tooltip: {hovered:?}"); } +/// The status message of a failed script run shows text the script threw as it is, even when it +/// reads like one of the app's own errors, and translates the words around it; the app's own error +/// is translated. Both a run that ends in one call and a run the frames take to its end show it. +#[test] +fn german_script_status_preserves_authored_error_and_translates_native_error() { + crate::i18n::set_current(crate::i18n::Lang::from_code("de").expect("de registered")); + let mut app = crate::VectorcraftApp::new(Session::new(), Default::default()); + let failed = |app: &mut crate::VectorcraftApp, source: &str, frames: bool| { + app.session.script_frames = frames; + let r = app.run("script.run", json!({"source": source, "name": "t.js"})); + if frames { + assert_eq!(r.map(|v| v["running"].clone()), Ok(json!(true)), "{source}"); + for _ in 0..1_000 { + if !app.session.script_running() { + break; + } + crate::script_runs::poll(app); + } + } else { + assert!(r.is_err(), "{source}"); + } + assert!(!app.session.script_running()); + super::status_bar::status_message(app) + }; + let long = "invalid array length ".repeat(120); + for frames in [false, true] { + let shown = failed(&mut app, "throw new Error('invalid array length')", frames); + assert_eq!(shown, "t.js: Zeile 1, Spalte 1: Error: invalid array length (ausgelöst)"); + let shown = failed(&mut app, "throw 'invalid array length'", frames); + assert_eq!(shown, "t.js: Zeile 1, Spalte 1: invalid array length (ausgelöst)"); + let shown = failed(&mut app, "new Array(-1)", frames); + assert!(shown.starts_with("t.js: Zeile 1, Spalte 1: ") && shown.contains("ungültige Array-Länge"), "{shown}"); + for text in ["", "invalid array length\nsecond line", "{name}: {e}", "t.js: line 1, column 1: invalid array length (thrown)", long.as_str()] { + let source = format!("throw {}", serde_json::to_string(text).unwrap()); + assert_eq!(failed(&mut app, &source, frames), format!("t.js: Zeile 1, Spalte 1: {text} (ausgelöst)"), "{text}"); + } + } + // Another message, even one spelled like the script's text, is translated as before. + failed(&mut app, "throw 'invalid array length'", false); + app.ui.status = "invalid array length".to_string(); + assert_eq!(super::status_bar::status_message(&app), "ungültige Array-Länge"); + // A change of language while the message stays keeps the script's text. + failed(&mut app, "throw new Error('invalid array length')", false); + crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); + assert_eq!(super::status_bar::status_message(&app), "t.js : ligne 1, colonne 1 : Error: invalid array length (levée)"); + crate::i18n::set_current(crate::i18n::Lang::EN); + assert_eq!(super::status_bar::status_message(&app), app.ui.status); + // After a run that completes, the message is an ordinary one. + app.session.script_frames = false; + app.run("script.run", json!({"source": "1", "name": "t.js"})).unwrap(); + assert_eq!(app.session.script_authored_failure(), None); +} + /// The message of an open that starts with a line about its linked files lists the open's notes on /// hover and for screen readers, in a wide and in a narrow window. A later message leaves the list /// out. diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 377df81a72..75f3067730 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -765,6 +765,35 @@ pub fn msg(s: &str) -> String { out } +/// Stands in for the value [`message_keeping`] shows as it is while the text around it is +/// translated. +const KEPT_VALUE: char = '\u{FFFC}'; + +/// The message `before`, `kept` and `after` make, with `before` and `after` translated as +/// [`message`] translates a message and `kept` (such as text a script threw) shown as it is, even +/// when it reads like a message that has a translation. When the translation does not hold the +/// place of `kept` exactly once, the message is shown in English. +pub fn message_keeping(lang: Lang, before: &str, kept: &str, after: &str) -> String { + keeping(|s| message(lang, s), before, kept, after) +} + +/// [`message_keeping`] in the current language, remembering the last translation as [`msg`] does. +pub fn msg_keeping(before: &str, kept: &str, after: &str) -> String { + keeping(msg, before, kept, after) +} + +fn keeping(translate: impl Fn(&str) -> String, before: &str, kept: &str, after: &str) -> String { + let english = || format!("{before}{kept}{after}"); + if before.contains(KEPT_VALUE) || after.contains(KEPT_VALUE) { + return english(); + } + let shown = translate(&format!("{before}{KEPT_VALUE}{after}")); + match shown.split_once(KEPT_VALUE) { + Some((head, tail)) if !tail.contains(KEPT_VALUE) => format!("{head}{kept}{tail}"), + _ => english(), + } +} + /// [`trn`] in the current language. pub fn tn(n: u64, one: &str, other: &str) -> String { trn(current(), n, one, other) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 55295f011a..6a4c1c407e 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -3252,6 +3252,21 @@ fn script_errors_are_translated() { } } +/// A message with a value kept as it is translates the words around the value and shows the value +/// unchanged, whatever it reads like; when the words around it cannot hold its place once, the +/// message stays English. +#[test] +fn a_kept_value_is_shown_as_it_is_in_a_translated_message() { + let de = Lang::from_code("de").expect("registered"); + let (before, after) = ("t.js: line 1, column 1: ", " (thrown)"); + for kept in ["invalid array length", "", "{e}", "\u{FFFC}", "a\nb", "t.js: line 1, column 1: x (thrown)"] { + assert_eq!(message_keeping(de, before, kept, after), format!("t.js: Zeile 1, Spalte 1: {kept} (ausgelöst)"), "{kept:?}"); + } + assert_eq!(message_keeping(de, "t.js\u{FFFC}: line 1, column 1: ", "x", after), "t.js\u{FFFC}: line 1, column 1: x (thrown)"); + assert_eq!(message_keeping(de, "no such message ", "x", ""), "no such message x"); + assert_eq!(message_keeping(Lang::EN, before, "invalid array length", after), "t.js: line 1, column 1: invalid array length (thrown)"); +} + /// The errors a script's `$` object, its `alert`, `confirm` and `prompt` dialogs, `vc.document`, /// `vc.log`, the methods of its `File` and `Folder` objects and a run's limits give, and the errors /// of the script engine commands, are translated in every language of [`COMPLETE_MESSAGES`], on diff --git a/docs/mcp.md b/docs/mcp.md index 9336ea35ca..a58c47a64a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2374,8 +2374,10 @@ In the app, a script past the growth limit stops at a question to continue or to with an error at that limit. The headless reply is `{ok: true, name, changed, written, log, fuelUsed, hostCalls, runTimeMs, timingAvailable, hostCallCounts, slowestCommands, console, dialogs, dialogCount, dialogsTruncated}`. In the app the reply is `{running: true, name}`, and the report appears later as `scriptReport` in `ui.inspect`. The -report of a failed run has the same fields after `kind`, `message`, `line`, `column`, `file` (when the error is in -another file than the script) and `fuelLeft`. +report of a failed run has the same fields after `kind`, `message`, `messageOrigin`, `line`, `column`, `file` (when +the error is in another file than the script) and `fuelLeft`. `messageOrigin` is `script` when `message` is text the +script supplied (a value it threw, or an error it made or whose name or message it changed) and `built-in` for the +app's own errors, syntax errors and limits. The status bar shows a `script` message as it is, untranslated. - `runTimeMs` is the time the script ran, its commands included. Waits between frames and for a person's answer are left out. `timingAvailable` is false on the web, where `runTimeMs` is 0. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 90d82894db..2a912fee9a 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -827,6 +827,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. + - Scripts: the status bar translates its own words around a failed run's error and the app's own error messages, and shows text the script threw itself (a value, an error it made, or an error whose name or message it changed) as it is, even when that text reads like one of the app's messages. `script.run`'s report gives `messageOrigin` (`script` or `built-in`), and the advice about objects other applications give their scripts follows only the app's own reference errors. VectorCraft's own rule. `crates/js/src/interp_tests.rs`, `crates/engine/src/tests/script_run.rs`, `crates/ui-egui/src/chrome/tests.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. - Scripts: `toSource` throws a `TypeError` for a property that is not writable or not configurable, a sealed, frozen or non-extensible object or array, and an array with a read-only `length` (VectorCraft's own rule). `crates/js/src/extension_tests.rs`. - Scripts: a canceled request stops a run that sleeps in `$.sleep`, waits at a dialog or waits for approval to grow at the run's next slice, before its wake time or an answer, and every document goes back to its state before the run. VectorCraft's own rule. `crates/engine/src/tests/script_dollar.rs`, `crates/engine/src/tests/script_dialogs.rs`, `crates/engine/src/tests/script_run.rs`. From 578072babbb168162f88870d1ccdbf4ca0f91bfa Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 06:37:03 -0800 Subject: [PATCH 038/247] Flare: a flare keeps its settings and can be edited after it is drawn A flare drawn with the Flare tool or shape.flare now keeps the settings it was drawn with and the transform it has had since. With flares selected, double-clicking the Flare tool opens Flare Tool Options filled from the first one, and OK draws the selected flares again in their place as one undo step (none when nothing changed). With one flare selected, the Flare tool shows its center and end handles, and dragging either changes the flare's length or direction. Object > Expand turns a flare into a plain group of its parts. - shape.editFlare draws flares again with the settings it is given. - A flare whose parts were edited, or that is locked or hidden, is not edited as a flare. - shape.flare returns an error for a fractional or negative count. - Native files save a flare's settings. --- crates/doc/src/flare.rs | 326 ++++++++++++++++++++ crates/doc/src/lib.rs | 1 + crates/doc/src/mem.rs | 1 + crates/doc/src/node/extras.rs | 4 + crates/doc/src/node/ops.rs | 6 + crates/doc/src/node/wire.rs | 5 + crates/engine/src/cmd.rs | 1 + crates/engine/src/cmd/create.rs | 132 +------- crates/engine/src/cmd/expand.rs | 6 +- crates/engine/src/cmd/flare.rs | 220 +++++++++++++ crates/engine/src/lib.rs | 1 + crates/engine/src/tests.rs | 122 ++++++++ crates/tools/src/extra.rs | 142 ++++++++- crates/ui-egui/src/dialogs/flare_options.rs | 130 +++++++- crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/toolbar.rs | 3 +- docs/mcp.md | 18 ++ docs/ui-parity.md | 2 + 46 files changed, 1043 insertions(+), 134 deletions(-) create mode 100644 crates/doc/src/flare.rs create mode 100644 crates/engine/src/cmd/flare.rs diff --git a/crates/doc/src/flare.rs b/crates/doc/src/flare.rs new file mode 100644 index 0000000000..f8e79a64ae --- /dev/null +++ b/crates/doc/src/flare.rs @@ -0,0 +1,326 @@ +//! Flare objects: the settings a flare group was drawn with (the Flare tool, `shape.flare`). Its +//! children are ordinary paths for every renderer and exporter; the settings let it be drawn again. +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use vectorcraft_color::{BlendMode, Color, Gradient, GradientGeom, GradientKind, GradientPaint, GradientStop, Paint}; +use vectorcraft_geom::{Affine, BezPath, PathData, Point, Rect, Vec2, shapes}; + +use crate::Appearance; +use crate::node::{Node, NodeId, NodeKind}; + +/// The seed of the sizes a flare's rays and rings take when its settings give none. +pub const DEFAULT_SEED: u64 = 0x2545_f491_4f6c_dd1d; + +/// One part of a flare: its name, outline, fill and opacity. +pub type Part = (&'static str, PathData, Paint, f32); + +/// The number `key` of the settings `v`, or `default`. +fn number(v: &Value, key: &str, default: f64) -> f64 { + v.get(key).and_then(Value::as_f64).unwrap_or(default) +} + +/// The parts of a flare with the settings `v` (`shape.flare`'s params, each one given): a bright +/// center, a halo ring, rays of varying length and rings along the path to the end point. +pub fn parts(v: &Value) -> Vec<Part> { + let c = Point::new(number(v, "cx", 0.0), number(v, "cy", 0.0)); + let end = Point::new(number(v, "x2", c.x), number(v, "y2", c.y)); + let pct = |k: &str| (number(v, k, 0.0) / 100.0).clamp(0.0, 10.0); + let r = (number(v, "diameter", 100.0) / 2.0).max(0.5); + let opacity = pct("opacity").min(1.0) as f32; + let brightness = pct("brightness").min(1.0) as f32; + let growth = pct("growth"); + let fuzz = pct("fuzziness").min(1.0); + let rays = v.get("rays").and_then(Value::as_u64).unwrap_or(0).min(50) as usize; + let longest = pct("longest"); + let ray_fuzz = pct("rayFuzziness").min(1.0); + let ray_turn = number(v, "rotation", 0.0).to_radians(); + let rings = v.get("rings").and_then(Value::as_u64).unwrap_or(0).min(50) as usize; + let largest = pct("largest"); + // Deterministic pseudo-random sizes (same parameters → same flare). + let mut seed = v.get("seed").and_then(Value::as_u64).unwrap_or(DEFAULT_SEED) | 1; + let mut rnd = move || { + seed ^= seed << 13; + seed ^= seed >> 7; + seed ^= seed << 17; + (seed >> 11) as f64 / (1u64 << 53) as f64 + }; + let stop = |offset: f32, opacity: f32| GradientStop { opacity, ..GradientStop::new(offset, Color::WHITE) }; + let radial = |centre: Point, radius: f64, stops: Vec<GradientStop>| { + let mut g = GradientPaint::new(Gradient::new(GradientKind::Radial, stops)); + g.geom = Some(GradientGeom { start: centre, end: centre + Vec2::new(radius, 0.0), aspect: 1.0, focal: None }); + Paint::Gradient(Box::new(g)) + }; + let circle = |centre: Point, radius: f64| shapes::ellipse(Rect::from_center_size(centre, (radius * 2.0, radius * 2.0))); + let mut parts: Vec<Part> = vec![]; + // Halo: a soft ring just outside the centre. + let halo_r = r * (1.0 + growth) * 1.6; + let inner = (1.0 - fuzz as f32 * 0.6).clamp(0.05, 0.95); + parts.push(("Halo", circle(c, halo_r), radial(c, halo_r, vec![stop(0.0, 0.0), stop(inner * 0.75, 0.0), stop(inner, 0.5), stop(1.0, 0.0)]), 1.0)); + // Rays: thin spikes of random length (Longest = % of the centre radius), fading outwards. + // `rotation` turns them clockwise about the center. + if rays > 0 { + let mut bp = BezPath::new(); + let mut reach: f64 = 0.0; + for i in 0..rays { + let a = std::f64::consts::TAU * (i as f64 + rnd() * 0.6) / rays as f64 + ray_turn; + let len = r * longest * (1.0 - ray_fuzz * 0.75 * rnd()).max(0.1); + reach = reach.max(len); + let w = r * 0.035; + let dir = Vec2::new(a.cos(), a.sin()); + let n = Vec2::new(-dir.y, dir.x) * w; + bp.move_to(c + n); + bp.line_to(c + dir * len); + bp.line_to(c - n); + bp.line_to(c - dir * (w * 4.0)); + bp.close_path(); + } + parts.push(("Rays", PathData::from_bezpath(&bp), radial(c, reach, vec![stop(0.0, 0.9), stop(0.25, 0.35), stop(1.0, 0.0)]), 1.0)); + } + // Centre: bright core fading to transparent. + parts.push(("Center", circle(c, r), radial(c, r, vec![stop(0.0, 1.0), stop(0.25 + brightness * 0.5, 0.6), stop(1.0, 0.0)]), opacity)); + // Rings along the path to the end point (Largest = % of the average ring size). + for _ in 0..rings { + let t = rnd(); + let at = c + (end - c) * t; + let rr = (r * largest * (0.25 + rnd() * 0.75)).max(0.5); + let solid = rnd() < 0.5; + let stops = if solid { + vec![stop(0.0, 0.25), stop(0.8, 0.2), stop(1.0, 0.0)] + } else { + vec![stop(0.0, 0.0), stop(0.7, 0.05), stop(0.92, 0.35), stop(1.0, 0.0)] + }; + parts.push(("Ring", circle(at, rr), radial(at, rr, stops), 1.0)); + } + parts +} + +/// Part `part` of a flare as the object `id`, transformed by `xf` (the transform its flare has had +/// since it was drawn), with the pixel-aligned property when `aligned`. +pub fn part_node(id: NodeId, part: Part, xf: Affine, aligned: bool) -> Node { + let (name, pd, paint, op) = part; + let mut n = Node::path(id, pd, Appearance::basic(paint, Paint::None, 0.0)); + n.name = Some(name.into()); + n.blend = BlendMode::Screen; + n.opacity = op; + if aligned { + n.extras_mut().pixel_aligned = true; + } + if xf != Affine::IDENTITY { + n.transform(xf, false); + } + n +} + +/// The ellipse of a radial gradient's placement `geom` as the symmetric matrix `[xx, xy, yy]` that +/// maps it to the unit circle's: the same for every end point and aspect that give that ellipse +/// (transforms applied one by one and all at once can put the end on different axes of it). +fn ellipse(geom: &GradientGeom) -> [f64; 3] { + let u = geom.end - geom.start; + let w = Vec2::new(-u.y, u.x) * geom.aspect; + [u.x * u.x + w.x * w.x, u.x * u.y + w.x * w.y, u.y * u.y + w.y * w.y] +} + +/// `n` as JSON without what depends on how its transforms were applied: its id, the angle of its +/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays). +fn comparable(n: &Node) -> Value { + fn strip(v: &mut Value) { + match v { + Value::Object(m) => { + for key in ["id", "bbox_angle"] { + m.remove(key); + } + if let Some(geom) = m.get_mut("geom") + && let Ok(g) = serde_json::from_value::<GradientGeom>(geom.clone()) + && let Value::Object(geom) = geom + { + geom.remove("end"); + geom.remove("aspect"); + geom.insert("ellipse".into(), serde_json::json!(ellipse(&g))); + } + m.values_mut().for_each(strip); + } + Value::Array(a) => a.iter_mut().for_each(strip), + _ => {} + } + } + let mut v = serde_json::to_value(n).unwrap_or(Value::Null); + strip(&mut v); + v +} + +/// How close, relative to its size, a number in an outline or a gradient's placement must be to the +/// one its transforms give: a few thousandths of a point near the edge of the canvas. +const GEOMETRY_TOL: f64 = 1e-9; + +/// Whether `a` and `b` are the same JSON, with each number within `tol` relative to its size; each +/// number in an outline (`path`) or a gradient's placement (`geom`) is within [`GEOMETRY_TOL`] +/// relative to its size (or `tol`, when smaller), and `snap` points as well. +fn close(a: &Value, b: &Value, tol: f64, snap: f64, geometry: bool) -> bool { + match (a, b) { + (Value::Number(x), Value::Number(y)) => match (x.as_f64(), y.as_f64()) { + (Some(x), Some(y)) => { + let (snap, tol) = if geometry { (snap, tol.min(GEOMETRY_TOL)) } else { (0.0, tol) }; + (x - y).abs() <= snap + tol * (1.0 + x.abs().max(y.abs())) + } + _ => x == y, + }, + (Value::Array(x), Value::Array(y)) => x.len() == y.len() && x.iter().zip(y).all(|(x, y)| close(x, y, tol, snap, geometry)), + (Value::Object(x), Value::Object(y)) => { + x.len() == y.len() && x.iter().all(|(k, v)| y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom"))) + } + _ => a == b, + } +} + +/// Whether `a` and `b` are the same JSON, with each number within `tol` relative to its size. +pub fn json_close(a: &Value, b: &Value, tol: f64) -> bool { + close(a, b, tol, 0.0, false) +} + +/// How far a pixel-aligned object's points may be from where its transforms put them: snapping to +/// the pixel grid moves each by up to a pixel. +const PIXEL_SNAP: f64 = 1.0; + +/// The settings of a flare group ([`crate::NodeExtras::flare`]). +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlareSpec { + /// `shape.flare`'s params the flare was drawn with, each one given: the center (`cx`, `cy`) and + /// the rings' end point (`x2`, `y2`) are in the coordinates it was drawn in. + pub params: serde_json::Value, + /// The transform its art has had since it was drawn (moves, scales, rotations, reflections and + /// shears). + #[serde(default = "identity", skip_serializing_if = "is_identity")] + pub transform: Affine, +} + +fn identity() -> Affine { + Affine::IDENTITY +} + +fn is_identity(a: &Affine) -> bool { + *a == Affine::IDENTITY +} + +impl FlareSpec { + /// The settings of a flare drawn with `params`, not transformed since. + pub fn new(params: serde_json::Value) -> Self { + Self { params, transform: Affine::IDENTITY } + } + + /// The point `key_x`, `key_y` of the params, where it is in the document now. + fn point(&self, key_x: &str, key_y: &str) -> Option<Point> { + let x = self.params.get(key_x)?.as_f64()?; + let y = self.params.get(key_y)?.as_f64()?; + Some(self.transform * Point::new(x, y)).filter(|p| p.x.is_finite() && p.y.is_finite()) + } + + /// The flare's center, where it is in the document now. + pub fn center(&self) -> Option<Point> { + self.point("cx", "cy") + } + + /// The rings' end point, where it is in the document now. + pub fn end(&self) -> Option<Point> { + self.point("x2", "y2") + } + + /// Its art transformed by `a`. + pub fn transform(&mut self, a: Affine) { + self.transform = a * self.transform; + } + + /// Whether `group`'s parts are still the ones these settings draw, in place: none was edited, + /// distorted, removed or added, and the transform can be undone. + pub fn draws(&self, group: &Node) -> bool { + let NodeKind::Group { children, .. } = &group.kind else { return false }; + if self.transform.determinant().abs() < 1e-12 || !self.transform.as_coeffs().iter().all(|c| c.is_finite()) { + return false; + } + let expected = parts(&self.params); + expected.len() == children.len() + && expected.into_iter().zip(children).all(|(part, child)| { + let aligned = child.extras().pixel_aligned; + let snap = if aligned { PIXEL_SNAP } else { 0.0 }; + close(&comparable(&part_node(child.id, part, self.transform, aligned)), &comparable(child), 1e-6, snap, false) + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + /// A flare's center and end point follow its art through a transform, and a save and reload + /// keeps its settings. + #[test] + fn a_flare_keeps_its_settings_through_a_transform_and_a_save() { + let mut g = Node::group(NodeId(1), vec![std::sync::Arc::new(Node::path(NodeId(2), PathData::default(), Default::default()))]); + g.extras_mut().flare = Some(Box::new(FlareSpec::new(json!({ "cx": 10.0, "cy": 20.0, "x2": 110.0, "y2": 20.0, "seed": 7 })))); + g.transform(Affine::translate((5.0, 0.0)) * Affine::rotate(std::f64::consts::FRAC_PI_2), false); + let spec = g.extras().flare.as_deref().cloned().unwrap_or_else(|| panic!("no flare")); + let c = spec.center().unwrap_or_else(|| panic!("no center")); + let e = spec.end().unwrap_or_else(|| panic!("no end")); + assert!((c.x - -15.0).abs() < 1e-9 && (c.y - 10.0).abs() < 1e-9, "{c:?}"); + assert!((e.x - -15.0).abs() < 1e-9 && (e.y - 110.0).abs() < 1e-9, "{e:?}"); + let text = serde_json::to_string(&g).unwrap_or_else(|e| panic!("{e}")); + let back: Node = serde_json::from_str(&text).unwrap_or_else(|e| panic!("{e}")); + assert_eq!(back.extras().flare.as_deref(), Some(&spec)); + // A flare that was not transformed writes no transform. + let plain = FlareSpec::new(json!({ "cx": 1.0 })); + assert_eq!(serde_json::to_value(&plain).unwrap_or_default(), json!({ "params": { "cx": 1.0 } })); + } + + /// A flare group draws its settings until a part's gradient, opacity or outline is edited; a + /// pixel-aligned part may sit up to a pixel from where its transforms put it, but only in its + /// outline and its gradient's placement. + #[test] + fn a_flare_with_an_edited_part_no_longer_draws_its_settings() { + let v = json!({ "cx": 50.0, "cy": 50.0, "x2": 250.0, "y2": 50.0, "rays": 5, "rings": 2, "seed": 9, "diameter": 40.0, + "opacity": 50.0, "brightness": 30.0, "growth": 20.0, "fuzziness": 50.0, "longest": 300.0, "rayFuzziness": 100.0, + "rotation": 0.0, "largest": 50.0 }); + let flare = |aligned: bool| { + let xf = Affine::rotate(0.3) * Affine::scale_non_uniform(1.5, 0.75); + let children = parts(&v).into_iter().enumerate().map(|(i, p)| std::sync::Arc::new(part_node(NodeId(10 + i as u64), p, xf, aligned))); + let mut g = Node::group(NodeId(1), children.collect()); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v.clone(), transform: xf })); + g + }; + let spec = |g: &Node| g.extras().flare.as_deref().cloned().unwrap_or_else(|| panic!("no flare")); + let edit = |g: &mut Node, f: &dyn Fn(&mut Node)| { + let NodeKind::Group { children, .. } = &mut g.kind else { panic!("not a group") }; + // The center, drawn at half opacity. + f(std::sync::Arc::make_mut(&mut children[2])); + }; + for aligned in [false, true] { + let g = flare(aligned); + assert!(spec(&g).draws(&g), "aligned {aligned}"); + let mut moved = g.clone(); + edit(&mut moved, &|n| n.transform(Affine::translate((0.4, 0.0)), false)); + assert_eq!(spec(&moved).draws(&moved), aligned, "a fraction of a pixel, aligned {aligned}"); + let mut faded = g.clone(); + edit(&mut faded, &|n| n.opacity *= 0.8); + assert!(!spec(&faded).draws(&faded), "opacity, aligned {aligned}"); + let mut shifted = g.clone(); + edit(&mut shifted, &|n| { + if let Some(crate::AppearanceItem::Fill(fill)) = n.appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + geom.start.x += 20.0; + } + }); + assert!(!spec(&shifted).draws(&shifted), "gradient placement, aligned {aligned}"); + let mut squashed = g.clone(); + edit(&mut squashed, &|n| { + if let Some(crate::AppearanceItem::Fill(fill)) = n.appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + geom.aspect *= 0.5; + } + }); + assert!(!spec(&squashed).draws(&squashed), "gradient shape, aligned {aligned}"); + } + } +} diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index b32a4485f4..fda73f40e8 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -16,6 +16,7 @@ pub mod compound_shape; pub mod corners; pub mod depth; pub mod dimension; +pub mod flare; pub mod graph; mod halftone_radii; pub mod hit; diff --git a/crates/doc/src/mem.rs b/crates/doc/src/mem.rs index 7ff6cdeea2..fef740e5a1 100644 --- a/crates/doc/src/mem.rs +++ b/crates/doc/src/mem.rs @@ -266,6 +266,7 @@ fn node_bytes(n: &Node, other: Option<&Node>, counted: &mut HashSet<usize>) -> u .as_deref() .map_or(0, |m| ALLOC + size_of::<crate::color_mask::ColorMask>() + m.key.capacity() + m.from.capacity() + m.colors.capacity() * 3); b += e.trace.as_ref().map_or(0, |t| ALLOC + size_of::<Value>() + json_bytes(t)); + b += e.flare.as_ref().map_or(0, |f| ALLOC + size_of::<crate::flare::FlareSpec>() + json_bytes(&f.params)); b += e.intertwine.as_deref().map_or(0, |a| ALLOC + size_of::<PathData>() + path_bytes(a)); if e.intertwine_tiers.capacity() > 0 { b += ALLOC + e.intertwine_tiers.capacity() * size_of::<PathData>() + e.intertwine_tiers.iter().map(path_bytes).sum::<usize>(); diff --git a/crates/doc/src/node/extras.rs b/crates/doc/src/node/extras.rs index e13750457e..5fa0c430d1 100644 --- a/crates/doc/src/node/extras.rs +++ b/crates/doc/src/node/extras.rs @@ -41,6 +41,9 @@ pub struct NodeExtras { /// Dimension object: the live measurement it draws; its ordinary group children hold its /// exportable appearance (Object › Dimensions, the Dimension tool). pub dimension: Option<Box<crate::dimension::Dimension>>, + /// Flare object: the settings its group was drawn with (the Flare tool); its ordinary group + /// children hold its art. + pub flare: Option<Box<crate::flare::FlareSpec>>, /// Object › Intertwine: as a member of an Intertwine group, the area (document coordinates, /// filled non-zero) where this object is drawn over the group's other members. pub intertwine: Option<Box<PathData>>, @@ -96,6 +99,7 @@ pub(super) static NO_EXTRAS: NodeExtras = NodeExtras { slice: None, perspective: None, dimension: None, + flare: None, intertwine: None, intertwine_tiers: Vec::new(), live_paint_gaps: None, diff --git a/crates/doc/src/node/ops.rs b/crates/doc/src/node/ops.rs index 1aad3a27cf..dffef9f44b 100644 --- a/crates/doc/src/node/ops.rs +++ b/crates/doc/src/node/ops.rs @@ -448,6 +448,12 @@ impl Node { { dimension.transform(a); } + // So does a flare's center and end point. + if let Some(e) = self.extras_if_any() + && let Some(flare) = &mut e.flare + { + flare.transform(a); + } // The path the objects are attached to, before it is transformed. let on_path_before = self.on_path_data().cloned(); if !self.is_layer() { diff --git a/crates/doc/src/node/wire.rs b/crates/doc/src/node/wire.rs index 885f9a5853..24bb4d5957 100644 --- a/crates/doc/src/node/wire.rs +++ b/crates/doc/src/node/wire.rs @@ -45,6 +45,7 @@ impl Serialize for Node { is_default(&self.bbox_angle), e.perspective.is_none(), e.dimension.is_none(), + e.flare.is_none(), e.intertwine.is_none(), e.intertwine_tiers.is_empty(), e.live_paint_gaps.is_none(), @@ -90,6 +91,7 @@ impl Serialize for Node { field!("bbox_angle", &self.bbox_angle); field!("perspective", &e.perspective); field!("dimension", &e.dimension); + field!("flare", &e.flare); field!("intertwine", &e.intertwine); field!("intertwine_tiers", &e.intertwine_tiers); field!("live_paint_gaps", &e.live_paint_gaps); @@ -226,6 +228,8 @@ pub(super) struct NodeWire { #[serde(default)] dimension: Option<Box<crate::dimension::Dimension>>, #[serde(default)] + flare: Option<Box<crate::flare::FlareSpec>>, + #[serde(default)] intertwine: Option<Box<PathData>>, #[serde(default, deserialize_with = "counted_list")] intertwine_tiers: Vec<PathData>, @@ -267,6 +271,7 @@ impl From<NodeWire> for Node { slice: w.slice, perspective: w.perspective, dimension: w.dimension, + flare: w.flare, intertwine: w.intertwine, intertwine_tiers: w.intertwine_tiers, live_paint_gaps: w.live_paint_gaps, diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 99b8e1ecdd..b5a723672a 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -32,6 +32,7 @@ pub mod expand; pub(crate) mod fileinfo; pub mod fileio; pub mod findfiles; +pub mod flare; pub mod flatten; pub mod fontfiles; mod fonts; diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index ebef729fd3..2c038c3f97 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -55,7 +55,16 @@ pub fn specs() -> Vec<CommandSpec> { None, "{cx, cy, diameter=100, opacity=50 (%), brightness=30 (%), growth=20 (%), fuzziness=50 (%), rays=15, longest=300 (%), rayFuzziness=100 (%), rotation=0 (deg, turns the rays clockwise), x2?, y2? (ring end; else pathLength at direction), pathLength=300, rings=10, largest=50 (%), direction=45 (deg counter-clockwise from 3 o'clock: where the rings run from the centre), seed?} → {id}", has_doc, - flare + super::flare::flare + ), + cmd!( + "shape.editFlare", + "Edit Flare", + [], + None, + "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation?, pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", + has_doc, + super::flare::edit_flare ), cmd!("shape.line", "Line Segment", [], None, "{x1, y1, x2, y2, fill?: bool (Fill Line: the current fill, else none)} → {id}", has_doc, line), cmd!("shape.spiral", "Spiral", [], None, "{cx, cy, radius, decay=80 (%), segments=10, clockwise?} → {id}", has_doc, spiral), @@ -407,127 +416,6 @@ fn star(s: &mut Session, p: &Value) -> Result<Value> { add_art_turned(s, "Star", path_kind(path, None), constrained_turn(s, rot)) } -/// Flare tool: a lens flare built from radial-gradient paths in Screen mode — a bright centre, a halo -/// ring, rays of varying length and rings along the path to the end point. -fn flare(s: &mut Session, p: &Value) -> Result<Value> { - use vectorcraft_color::{BlendMode, Gradient, GradientGeom, GradientKind, GradientPaint, GradientStop, Paint}; - let c = Point::new(f64_req(p, "cx", "shape.flare")?, f64_req(p, "cy", "shape.flare")?); - let numbers = [ - "diameter", - "opacity", - "brightness", - "growth", - "fuzziness", - "rays", - "longest", - "rayFuzziness", - "rotation", - "rings", - "largest", - "x2", - "y2", - "direction", - "pathLength", - "seed", - ]; - check_numbers(p, &numbers, "shape.flare")?; - let pct = |k: &str, d: f64| (f64_or(p, k, d) / 100.0).clamp(0.0, 10.0); - let r = (f64_or(p, "diameter", 100.0) / 2.0).max(0.5); - let opacity = pct("opacity", 50.0).min(1.0) as f32; - let brightness = pct("brightness", 30.0).min(1.0) as f32; - let growth = pct("growth", 20.0); - let fuzz = pct("fuzziness", 50.0).min(1.0); - let rays = p.get("rays").and_then(Value::as_u64).unwrap_or(15).min(50) as usize; - let longest = pct("longest", 300.0); - let ray_fuzz = pct("rayFuzziness", 100.0).min(1.0); - let ray_turn = f64_or(p, "rotation", 0.0).to_radians(); - let rings = p.get("rings").and_then(Value::as_u64).unwrap_or(10).min(50) as usize; - let largest = pct("largest", 50.0); - let end = match (p.get("x2").and_then(Value::as_f64), p.get("y2").and_then(Value::as_f64)) { - (Some(x), Some(y)) => Point::new(x, y), - _ => { - let a = f64_or(p, "direction", 45.0).to_radians(); - c + vectorcraft_geom::Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) - } - }; - // Deterministic pseudo-random sizes (same parameters → same flare). - let mut seed = p.get("seed").and_then(Value::as_u64).unwrap_or(0x2545_f491_4f6c_dd1d) | 1; - let mut rnd = move || { - seed ^= seed << 13; - seed ^= seed >> 7; - seed ^= seed << 17; - (seed >> 11) as f64 / (1u64 << 53) as f64 - }; - let stop = |offset: f32, opacity: f32| GradientStop { opacity, ..GradientStop::new(offset, vectorcraft_color::Color::WHITE) }; - let radial = |centre: Point, radius: f64, stops: Vec<GradientStop>| { - let mut g = GradientPaint::new(Gradient::new(GradientKind::Radial, stops)); - g.geom = Some(GradientGeom { start: centre, end: centre + vectorcraft_geom::Vec2::new(radius, 0.0), aspect: 1.0, focal: None }); - Paint::Gradient(Box::new(g)) - }; - let circle = |centre: Point, radius: f64| shapes::ellipse(Rect::from_center_size(centre, (radius * 2.0, radius * 2.0))); - let mut parts: Vec<(&str, PathData, Paint, f32)> = vec![]; - // Halo: a soft ring just outside the centre. - let halo_r = r * (1.0 + growth) * 1.6; - let inner = (1.0 - fuzz as f32 * 0.6).clamp(0.05, 0.95); - parts.push(("Halo", circle(c, halo_r), radial(c, halo_r, vec![stop(0.0, 0.0), stop(inner * 0.75, 0.0), stop(inner, 0.5), stop(1.0, 0.0)]), 1.0)); - // Rays: thin spikes of random length (Longest = % of the centre radius), fading outwards. - // `rotation` turns them clockwise about the center. - if rays > 0 { - let mut bp = vectorcraft_geom::BezPath::new(); - let mut reach: f64 = 0.0; - for i in 0..rays { - let a = std::f64::consts::TAU * (i as f64 + rnd() * 0.6) / rays as f64 + ray_turn; - let len = r * longest * (1.0 - ray_fuzz * 0.75 * rnd()).max(0.1); - reach = reach.max(len); - let w = r * 0.035; - let dir = vectorcraft_geom::Vec2::new(a.cos(), a.sin()); - let n = vectorcraft_geom::Vec2::new(-dir.y, dir.x) * w; - bp.move_to(c + n); - bp.line_to(c + dir * len); - bp.line_to(c - n); - bp.line_to(c - dir * (w * 4.0)); - bp.close_path(); - } - parts.push(("Rays", PathData::from_bezpath(&bp), radial(c, reach, vec![stop(0.0, 0.9), stop(0.25, 0.35), stop(1.0, 0.0)]), 1.0)); - } - // Centre: bright core fading to transparent. - parts.push(("Center", circle(c, r), radial(c, r, vec![stop(0.0, 1.0), stop(0.25 + brightness * 0.5, 0.6), stop(1.0, 0.0)]), opacity)); - // Rings along the path to the end point (Largest = % of the average ring size). - for _ in 0..rings { - let t = rnd(); - let at = c + (end - c) * t; - let rr = (r * largest * (0.25 + rnd() * 0.75)).max(0.5); - let solid = rnd() < 0.5; - let stops = if solid { - vec![stop(0.0, 0.25), stop(0.8, 0.2), stop(1.0, 0.0)] - } else { - vec![stop(0.0, 0.0), stop(0.7, 0.05), stop(0.92, 0.35), stop(1.0, 0.0)] - }; - parts.push(("Ring", circle(at, rr), radial(at, rr, stops), 1.0)); - } - let parent = s.doc()?.target_parent()?; - let id = s.edit("Flare", |d, sel| { - let children = parts - .into_iter() - .map(|(name, pd, paint, op)| { - let mut n = Node::path(d.alloc_id(), pd, Appearance::basic(paint, Paint::None, 0.0)); - n.name = Some(name.into()); - n.blend = BlendMode::Screen; - n.opacity = op; - super::object::align_new_object(d, &mut n); - std::sync::Arc::new(n) - }) - .collect(); - let gid = d.alloc_id(); - let mut g = Node::group(gid, children); - g.name = Some("Flare".into()); - d.insert(parent, usize::MAX, g)?; - sel.set([gid]); - Ok(gid) - })?; - Ok(json!({ "id": id.0 })) -} - fn line(s: &mut Session, p: &Value) -> Result<Value> { let a = Point::new(f64_req(p, "x1", "shape.line")?, f64_req(p, "y1", "shape.line")?); let b = Point::new(f64_req(p, "x2", "shape.line")?, f64_req(p, "y2", "shape.line")?); diff --git a/crates/engine/src/cmd/expand.rs b/crates/engine/src/cmd/expand.rs index 43975fe4e4..c39fd7012d 100644 --- a/crates/engine/src/cmd/expand.rs +++ b/crates/engine/src/cmd/expand.rs @@ -182,7 +182,7 @@ impl Expandable { n.walk(&mut |c| { let shape = matches!(c.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }); e.text |= matches!(c.kind, NodeKind::Text(_)); - e.live |= matches!(c.kind, NodeKind::Path { live: Some(_), .. }); + e.live |= matches!(c.kind, NodeKind::Path { live: Some(_), .. }) || c.extras().flare.is_some(); e.effects |= !c.appearance.effects.is_empty(); e.envelope |= matches!(c.kind, NodeKind::Envelope { .. }); e.blends |= matches!(c.kind, NodeKind::Blend { .. }); @@ -500,10 +500,14 @@ fn end_dimension_links(s: &mut Session, ended: &mut Vec<EndedLink>) -> Result<() Ok(()) } +/// Makes the live shapes in `n` plain paths, and the flares plain groups of their parts. fn drop_live(n: &mut Node) { if let NodeKind::Path { live, .. } = &mut n.kind { *live = None; } + if n.extras().flare.is_some() { + n.extras_mut().flare = None; + } if let Some(ch) = n.children_mut() { for c in ch.iter_mut() { drop_live(Arc::make_mut(c)); diff --git a/crates/engine/src/cmd/flare.rs b/crates/engine/src/cmd/flare.rs new file mode 100644 index 0000000000..f13d8ca0e2 --- /dev/null +++ b/crates/engine/src/cmd/flare.rs @@ -0,0 +1,220 @@ +//! Flares (the Flare tool): `shape.flare` draws a group of radial-gradient paths that keeps the +//! settings it was drawn with ([`FlareSpec`]), and `shape.editFlare` draws it again from them. + +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_doc::flare::{DEFAULT_SEED, FlareSpec, json_close, part_node, parts}; +use vectorcraft_doc::{Document, Node, NodeId}; +use vectorcraft_geom::{Affine, Point, Vec2}; + +use super::{EngineError, Result, Session, bad, check_numbers, f64_or, f64_req, given_objects, number_or}; + +const C: &str = "shape.editFlare"; + +/// `shape.flare`'s settings besides the center, the rings' end point, the counts and the seed: +/// (key, default). +const SETTINGS: [(&str, f64); 9] = [ + ("diameter", 100.0), + ("opacity", 50.0), + ("brightness", 30.0), + ("growth", 20.0), + ("fuzziness", 50.0), + ("longest", 300.0), + ("rayFuzziness", 100.0), + ("rotation", 0.0), + ("largest", 50.0), +]; + +/// The whole number of 0 or more `p` gives for `key`, or `default`. +fn count_or(p: &Value, key: &str, default: u64, cmd: &str) -> Result<u64> { + let n = number_or(p, key, default as f64, cmd)?; + if n.is_finite() && n >= 0.0 && n.fract() == 0.0 { + Ok(n as u64) + } else { + Err(bad(cmd, format!("`{key}` must be a whole number of at least 0, not {n}"))) + } +} + +/// `shape.flare`'s params `p` with every setting given: the defaults filled in, the counts at most +/// 50 and the rings' end point as `x2`, `y2` (from `pathLength` and `direction` when `p` gives no +/// end point). +fn settings_of(p: &Value, cmd: &str) -> Result<Value> { + let c = Point::new(f64_req(p, "cx", cmd)?, f64_req(p, "cy", cmd)?); + let mut numbers: Vec<&str> = SETTINGS.iter().map(|(key, _)| *key).collect(); + numbers.extend(["x2", "y2", "direction", "pathLength", "seed"]); + check_numbers(p, &numbers, cmd)?; + let rays = count_or(p, "rays", 15, cmd)?.min(50); + let rings = count_or(p, "rings", 10, cmd)?.min(50); + let end = match (p.get("x2").and_then(Value::as_f64), p.get("y2").and_then(Value::as_f64)) { + (Some(x), Some(y)) => Point::new(x, y), + _ => { + let a = f64_or(p, "direction", 45.0).to_radians(); + c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) + } + }; + let seed = p.get("seed").and_then(Value::as_u64).unwrap_or(DEFAULT_SEED); + let mut v = json!({ "cx": c.x, "cy": c.y, "x2": end.x, "y2": end.y, "rays": rays, "rings": rings, "seed": seed }); + for (key, default) in SETTINGS { + v[key] = json!(f64_or(p, key, default)); + } + Ok(v) +} + +/// The objects of a flare drawn with the settings `v`, transformed by `xf`. A new flare's parts +/// (`old` None) get new ids and take the document's Align New Objects to Pixel Grid. A flare drawn +/// again from its parts `old` keeps, for each part, the id and pixel-aligned property of the old +/// part it replaces (the same kind of part, counted in order: the second ring replaces the second +/// ring); a part that replaces none gets a new id and the first old part's property. +fn part_nodes(d: &mut Document, v: &Value, xf: Affine, old: Option<&[Arc<Node>]>) -> Vec<Arc<Node>> { + let mut seen: Vec<&str> = vec![]; + parts(v) + .into_iter() + .map(|part| { + let name = part.0; + let nth = seen.iter().filter(|n| **n == name).count(); + seen.push(name); + let replaced = old.and_then(|old| old.iter().filter(|c| c.name.as_deref() == Some(name)).nth(nth)); + let id = replaced.map_or_else(|| d.alloc_id(), |c| c.id); + let mut n = part_node(id, part, Affine::IDENTITY, false); + match old { + None => super::object::align_new_object(d, &mut n), + Some(old) => n.extras_mut().pixel_aligned = replaced.or(old.first()).is_some_and(|c| c.extras().pixel_aligned), + } + if xf != Affine::IDENTITY { + n.transform(xf, false); + } + Arc::new(n) + }) + .collect() +} + +/// `shape.flare`: a flare group that keeps its settings. +pub(super) fn flare(s: &mut Session, p: &Value) -> Result<Value> { + let v = settings_of(p, "shape.flare")?; + let parent = s.doc()?.target_parent()?; + let id = s.edit("Flare", |d, sel| { + let children = part_nodes(d, &v, Affine::IDENTITY, None); + let gid = d.alloc_id(); + let mut g = Node::group(gid, children); + g.name = Some("Flare".into()); + g.extras_mut().flare = Some(Box::new(FlareSpec::new(v))); + d.insert(parent, usize::MAX, g)?; + sel.set([gid]); + Ok(gid) + })?; + Ok(json!({ "id": id.0 })) +} + +/// The settings of flare `id`: a group drawn by the Flare tool whose parts are still the ones its +/// settings draw, in place ([`FlareSpec::draws`]). A flare whose parts were edited, distorted, +/// removed or added to, or whose art was flattened to a line, is no longer one. +pub fn flare_settings(d: &Document, id: NodeId) -> Option<FlareSpec> { + let n = d.node(id)?; + let spec = n.extras().flare.as_deref()?; + // Settings a file holds are read as `shape.flare` reads them. + let spec = FlareSpec { params: settings_of(&spec.params, "shape.flare").ok()?, transform: spec.transform }; + spec.draws(n).then_some(spec) +} + +/// The flares `shape.editFlare` changes: those `p` names, else the selected flares. Each must be a +/// flare that can be edited. +fn flares_to_edit(s: &Session, p: &Value) -> Result<Vec<(NodeId, FlareSpec)>> { + let given = given_objects(s, p, C)?; + let d = &s.doc()?.doc; + let flare = |id: NodeId| flare_settings(d, id).filter(|_| d.is_editable(id)).map(|spec| (id, spec)); + let flares: Vec<(NodeId, FlareSpec)> = match &given { + Some(ids) => ids.iter().map(|id| flare(*id)).collect::<Option<Vec<_>>>().unwrap_or_default(), + None => s.doc()?.selection.objects.iter().filter_map(|id| flare(*id)).collect(), + }; + if flares.is_empty() { + return Err(EngineError::Other("select a flare".into())); + } + Ok(flares) +} + +/// The settings `old` changed as `p` asks (`shape.editFlare`'s params). The center and the end +/// point `p` gives are in the document, where the flare is now drawn, which `xf` maps from where +/// it was drawn. +fn edited(old: &Value, p: &Value, xf: Affine) -> Result<Value> { + let mut v = old.clone(); + let inv = xf.inverse(); + let point = |kx: &str, ky: &str| -> Result<Option<Point>> { + if p.get(kx).is_none_or(Value::is_null) && p.get(ky).is_none_or(Value::is_null) { + return Ok(None); + } + Ok(Some(inv * Point::new(f64_req(p, kx, C)?, f64_req(p, ky, C)?))) + }; + let c = point("cx", "cy")?; + let end = point("x2", "y2")?; + if let Some(c) = c { + v["cx"] = json!(c.x); + v["cy"] = json!(c.y); + } + let centre = Point::new(f64_or(&v, "cx", 0.0), f64_or(&v, "cy", 0.0)); + let old_end = Point::new(f64_or(&v, "x2", centre.x), f64_or(&v, "y2", centre.y)); + let end = match end { + Some(e) => e, + None if p.get("pathLength").is_some_and(|l| !l.is_null()) || p.get("direction").is_some_and(|a| !a.is_null()) => { + // The path length and the direction are where the flare is drawn now; the direction is + // measured counter-clockwise from 3 o'clock, as `shape.flare` takes it. + let (c, e) = (xf * centre, xf * old_end); + let d = e - c; + let a = number_or(p, "direction", (-d.y).atan2(d.x).to_degrees(), C)?.to_radians(); + inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?) + } + // Moving the center leaves the rings' end point where it is. + None => old_end, + }; + v["x2"] = json!(end.x); + v["y2"] = json!(end.y); + for (key, _) in SETTINGS { + if p.get(key).is_some_and(|x| !x.is_null()) { + v[key] = json!(number_or(p, key, 0.0, C)?); + } + } + for key in ["rays", "rings"] { + if p.get(key).is_some_and(|x| !x.is_null()) { + v[key] = json!(count_or(p, key, 0, C)?.min(50)); + } + } + settings_of(&v, C) +} + +/// `shape.editFlare`: draw the flares again with the settings `p` changes, each in its place and +/// transformed as it has been since it was drawn, as one undo step. +pub(super) fn edit_flare(s: &mut Session, p: &Value) -> Result<Value> { + let mut numbers: Vec<&str> = SETTINGS.iter().map(|(key, _)| *key).collect(); + numbers.extend(["cx", "cy", "x2", "y2", "pathLength", "direction", "rays", "rings"]); + check_numbers(p, &numbers, C)?; + let flares = flares_to_edit(s, p)?; + let mut changed: Vec<(NodeId, FlareSpec)> = vec![]; + for (id, spec) in &flares { + let v = edited(&spec.params, p, spec.transform)?; + if !json_close(&v, &spec.params, 1e-9) { + changed.push((*id, FlareSpec { params: v, transform: spec.transform })); + } + } + let ids: Vec<u64> = flares.iter().map(|(id, _)| id.0).collect(); + // Nothing changes: no undo step. + if changed.is_empty() { + return Ok(json!({ "ids": ids })); + } + let edited_ids: Vec<NodeId> = changed.iter().map(|(id, _)| *id).collect(); + s.edit("Edit Flare", |d, _| { + for (id, spec) in changed { + let old: Vec<Arc<Node>> = d.node(id).and_then(Node::children).cloned().unwrap_or_default(); + let children = part_nodes(d, &spec.params, spec.transform, Some(&old)); + let n = d.node_mut(id).ok_or(EngineError::NoNode(id))?; + if let Some(ch) = n.children_mut() { + *ch = children; + } + n.extras_mut().flare = Some(Box::new(spec)); + } + if !crate::sanity::objects_in_range(d, &edited_ids) { + return Err(EngineError::Other("result would exceed the canvas (coordinates out of range)".into())); + } + Ok(()) + })?; + Ok(json!({ "ids": ids })) +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 4b47966463..bf19294663 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -29,6 +29,7 @@ use vectorcraft_tools::{PaintDefaults, Tool}; pub use cmd::clipboard::{Clipboard, SourceLayer}; pub use cmd::create::constrain_click; pub use cmd::distortcmds::perspective_click; +pub use cmd::flare::flare_settings; pub use cmd::params::{check_keys, check_params}; pub use cmd::pathops::auto_simplify_level; pub use cmd::rasterfx::{export_pdf, flatten_raster_effects}; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index f89cc98ff8..a8b000c9c6 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -3268,6 +3268,128 @@ fn flare_rotation_turns_only_the_rays() { } } +/// A flare keeps its settings: `shape.editFlare` draws it again with the settings changed, in its +/// place and transformed as it has been since, as one undo step (none when nothing changes). A +/// flare with a changed part, a locked one and an expanded one are not edited. +#[test] +fn edit_flare_draws_a_transformed_flare_again_in_its_place_in_one_undo_step() { + let mut s = session(); + let p = json!({"cx": 200, "cy": 200, "diameter": 60, "rays": 9, "rings": 4, "x2": 400, "y2": 200, "seed": 3}); + let id = NodeId(s.execute("shape.flare", &p).unwrap()["id"].as_u64().unwrap()); + // Reflected twice, sheared and back, turned a quarter and moved: it stays a flare. + for (c, p) in [ + ("object.reflect", json!({"axis": "vertical"})), + ("object.reflect", json!({"axis": "horizontal"})), + ("object.shear", json!({"angle": 30})), + ("object.shear", json!({"angle": -30})), + ("object.rotate", json!({"angle": 90})), + ("object.move", json!({"dx": 50, "dy": 10})), + ] { + s.execute(c, &p).unwrap(); + } + let spec = |s: &Session| flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"); + let part = |s: &Session, name: &str| { + let g = s.doc().unwrap().doc.node(id).unwrap(); + g.children().unwrap().iter().filter(|c| c.name.as_deref() == Some(name)).map(|c| c.geometric_bounds().unwrap()).collect::<Vec<_>>() + }; + let (c, e) = (spec(&s).center().unwrap(), spec(&s).end().unwrap()); + // The quarter turn made the rings run vertically, 200 points from the center. + assert!((c.distance(e) - 200.0).abs() < 1e-6 && (c.x - e.x).abs() < 1e-6, "{c:?} {e:?}"); + let undo = s.doc().unwrap().history.undo.len(); + s.execute("shape.editFlare", &json!({"diameter": 100, "rings": 6, "rays": 0})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); + assert_eq!(s.doc().unwrap().selection.objects, vec![id]); + let centre = part(&s, "Center")[0]; + assert!(centre.center().distance(c) < 1e-6 && (centre.width() - 100.0).abs() < 1e-6, "{centre:?}"); + assert_eq!((part(&s, "Ring").len(), part(&s, "Rays").len()), (6, 0)); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6, "the end point stays"); + // Each ring lies on the line from the center to the end point. + assert!(part(&s, "Ring").iter().all(|r| (r.center().x - c.x).abs() < 1e-6), "{:?}", part(&s, "Ring")); + // The center handle, where it is drawn now: the end point stays where it is. + s.execute("shape.editFlare", &json!({"ids": [id.0], "cx": c.x + 20.0, "cy": c.y})).unwrap(); + assert!(spec(&s).center().unwrap().distance(Point::new(c.x + 20.0, c.y)) < 1e-6); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6); + assert!(part(&s, "Center")[0].center().distance(Point::new(c.x + 20.0, c.y)) < 1e-6); + // The end handle, then the path length and direction. + s.execute("shape.editFlare", &json!({"x2": c.x + 20.0, "y2": c.y + 80.0})).unwrap(); + assert!(spec(&s).end().unwrap().distance(Point::new(c.x + 20.0, c.y + 80.0)) < 1e-6); + // The path length and direction are where the flare is drawn now, though it was turned. + s.execute("shape.editFlare", &json!({"direction": 0, "pathLength": 50})).unwrap(); + assert!(spec(&s).end().unwrap().distance(Point::new(c.x + 70.0, c.y)) < 1e-6, "{:?}", spec(&s).end()); + s.execute("edit.undo", &json!({})).unwrap(); + // Nothing changes: no undo step. + let undo = s.doc().unwrap().history.undo.len(); + s.execute("shape.editFlare", &json!({"diameter": 100})).unwrap(); + assert_eq!(s.doc().unwrap().history.undo.len(), undo); + // Bad values are refused. + for bad in [json!({"rings": 2.5}), json!({"diameter": "big"}), json!({"cx": 10}), json!({"diameter": 1e20})] { + assert!(s.execute("shape.editFlare", &bad).is_err(), "{bad}"); + } + assert_eq!(s.doc().unwrap().history.undo.len(), undo); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(spec(&s).end().unwrap().distance(e) < 1e-6, "undo puts the end point back"); + // A changed part: no longer a flare. + s.edit("Opacity", |d, _| { + let ring = d.node(id).unwrap().children().unwrap().iter().find(|c| c.name.as_deref() == Some("Center")).unwrap().id; + d.node_mut(ring).unwrap().opacity = 0.25; + Ok(()) + }) + .unwrap(); + assert_eq!(s.execute("shape.editFlare", &json!({"rings": 3})).unwrap_err().to_string(), "select a flare"); + s.execute("edit.undo", &json!({})).unwrap(); + // A locked flare. + s.execute("object.lock", &json!({})).unwrap(); + assert!(s.execute("shape.editFlare", &json!({"ids": [id.0], "rings": 3})).is_err()); + s.execute("object.unlockAll", &json!({})).unwrap(); + // Object › Expand: a plain group that is no longer a flare. + s.execute("object.expand", &json!({"object": true, "fill": false, "stroke": false})).unwrap(); + assert!(s.doc().unwrap().doc.node(id).unwrap().extras().flare.is_none()); + assert!(s.execute("shape.editFlare", &json!({"rings": 3})).is_err()); +} + +/// `shape.flare` reads whole-number counts written as floats, and refuses fractions. +#[test] +fn flare_counts_are_whole_numbers() { + let mut s = session(); + let id = NodeId(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 4.0, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + let g = s.doc().unwrap().doc.node(id).unwrap(); + let rays = g.children().unwrap().iter().find(|c| c.name.as_deref() == Some("Rays")).unwrap(); + assert_eq!(rays.path_data().unwrap().subpaths.len(), 4); + assert!(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 2.5})).is_err()); +} + +/// A flare drawn again keeps its parts' pixel-aligned property, whatever the document's Align New +/// Objects to Pixel Grid is now, and a pixel-aligned flare that was moved is still a flare. +#[test] +fn edit_flare_keeps_its_parts_pixel_alignment() { + let mut s = session(); + let aligned = |s: &Session, id: NodeId| -> Vec<bool> { + s.doc().unwrap().doc.node(id).unwrap().children().unwrap().iter().map(|c| c.extras().pixel_aligned).collect() + }; + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": true})).unwrap(); + let on = NodeId(s.execute("shape.flare", &json!({"cx": 100.3, "cy": 200.6, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("object.move", &json!({"dx": 10.25, "dy": 3.5})).unwrap(); + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": false})).unwrap(); + let part = |s: &Session, id: NodeId, name: &str| -> NodeId { + s.doc().unwrap().doc.node(id).unwrap().children().unwrap().iter().find(|c| c.name.as_deref() == Some(name)).unwrap().id + }; + let centre = part(&s, on, "Center"); + s.execute("shape.editFlare", &json!({"rings": 4})).unwrap(); + assert!(aligned(&s, on).len() > 4 && aligned(&s, on).iter().all(|a| *a)); + // Each part drawn again keeps its id and its own property: without the rays, the center does + // not take theirs. + assert_eq!(part(&s, on, "Center"), centre); + s.execute("object.setPixelAligned", &json!({"ids": [centre.0], "on": false})).unwrap(); + s.execute("select.set", &json!({"ids": [on.0]})).unwrap(); + s.execute("shape.editFlare", &json!({"rays": 0})).unwrap(); + let node = |s: &Session, id: NodeId| s.doc().unwrap().doc.node(id).unwrap().extras().pixel_aligned; + assert!(!node(&s, centre) && node(&s, part(&s, on, "Halo"))); + let off = NodeId(s.execute("shape.flare", &json!({"cx": 300.3, "cy": 200.6, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("document.setup", &json!({"alignNewObjectsToPixelGrid": true})).unwrap(); + s.execute("shape.editFlare", &json!({"rings": 4})).unwrap(); + assert!(aligned(&s, off).iter().all(|a| !*a)); +} + #[test] fn reshape_moves_the_grabbed_point_and_its_neighbourhood() { let mut s = session(); diff --git a/crates/tools/src/extra.rs b/crates/tools/src/extra.rs index d1a2672402..83227f3d20 100644 --- a/crates/tools/src/extra.rs +++ b/crates/tools/src/extra.rs @@ -3,7 +3,9 @@ //! Flare: drag sets the center and its size and turns the rays as the pointer moves up or down //! (Shift holds their turn; click without dragging opens the Flare Tool Options), then a click //! sets the end point of the rings; Space held during either drag moves the flare. The rest comes -//! from the tool's options (the Flare Tool Options, which last). Reshape: a click on a selected +//! from the tool's options (the Flare Tool Options, which last). With one flare selected, the tool +//! shows its center and end handles, and dragging either changes the flare's length and direction +//! (`shape.editFlare`). Reshape: a click on a selected //! path sets a focal point (adding an anchor on a segment), Shift-click adds or removes more, and //! a drag from a focal point moves them all; the engine's `path.reshape` stretches the selected //! anchors between them and the anchors that stay. @@ -66,6 +68,38 @@ pub struct FlareTool { /// Whether the flare has rays and rings (the options' Rays and Rings checkboxes). rays_on: bool, rings_on: bool, + /// A drag of the selected flare's center or end handle. + handle: Option<HandleDrag>, +} + +/// A drag of a selected flare's handle: the flare, whether it is the end handle (else the center), +/// where the handle was, where it was pressed and whether the drag has begun its undo step. +#[derive(Clone, Copy, Debug)] +struct HandleDrag { + id: vectorcraft_doc::NodeId, + end: bool, + from: Point, + at: Point, + began: bool, +} + +/// The flare whose handles the Flare tool shows: the one selected object, when it is a flare that +/// can be edited, with its center and the rings' end point. +fn selected_flare(cx: &ToolContext) -> Option<(vectorcraft_doc::NodeId, Point, Point)> { + let [id] = cx.selection.objects.as_slice() else { return None }; + if !cx.doc.is_editable(*id) { + return None; + } + let node = cx.doc.node(*id)?; + let spec = node.extras().flare.as_deref().filter(|spec| spec.draws(node))?; + Some((*id, spec.center()?, spec.end()?)) +} + +/// `shape.editFlare`'s params for handle drag `h` with the pointer at `pointer`: the handle moves +/// as far as the pointer has. +fn handle_params(h: HandleDrag, pointer: Point) -> Value { + let p = h.from + (pointer - h.at); + if h.end { json!({ "ids": [h.id.0], "x2": p.x, "y2": p.y }) } else { json!({ "ids": [h.id.0], "cx": p.x, "cy": p.y }) } } impl Default for FlareTool { @@ -81,6 +115,7 @@ impl Default for FlareTool { values: FLARE_OPTIONS.map(|(_, default, _, _)| default), rays_on: true, rings_on: true, + handle: None, } } } @@ -146,12 +181,40 @@ impl Tool for FlareTool { "flare" } fn busy(&self) -> bool { - self.drag.is_some() || self.placed.is_some() + self.drag.is_some() || self.placed.is_some() || self.handle.is_some() } fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec<Action> { self.hover = ev.pos; + if let Some(mut h) = self.handle { + return match ev.kind { + PointerKind::Drag if h.began => vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos))], + PointerKind::Drag if ev.pos.distance(h.at) < cx.tol(3.0) => vec![], + PointerKind::Drag => { + h.began = true; + self.handle = Some(h); + vec![Action::Begin("Edit Flare".into()), Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos))] + } + PointerKind::Up => { + self.handle = None; + if h.began { vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos)), Action::Commit] } else { vec![] } + } + _ => vec![], + }; + } match ev.kind { PointerKind::Down => { + // A press on the selected flare's center or end handle drags that handle. + if self.placed.is_none() + && let Some((id, c, e)) = selected_flare(cx) + { + let tol = cx.tol(4.0); + let (dc, de) = (ev.pos.distance(c), ev.pos.distance(e)); + if dc.min(de) <= tol { + let end = de < dc; + self.handle = Some(HandleDrag { id, end, from: if end { e } else { c }, at: ev.pos, began: false }); + return vec![]; + } + } if self.placed.is_none() { self.drag = Some((ev.pos, ev.pos)); self.rays = None; @@ -223,6 +286,11 @@ impl Tool for FlareTool { }; return vec![Action::Preview("shape.flare".into(), preview)]; } + if key == ToolKey::Escape + && let Some(h) = self.handle.take() + { + return if h.began { vec![Action::Cancel] } else { vec![] }; + } if key == ToolKey::Escape && self.busy() { self.rays = None; self.drag = None; @@ -235,15 +303,26 @@ impl Tool for FlareTool { fn deactivate(&mut self, _cx: &ToolContext) -> Vec<Action> { // Switching away after the centre drag keeps the flare with the rings its options give. self.drag = None; + if self.handle.take().is_some_and(|h| h.began) { + return vec![Action::Commit]; + } if self.placed.take().is_some() && std::mem::take(&mut self.began) { vec![Action::Commit] } else { vec![] } } - fn overlays(&self, _cx: &ToolContext) -> Vec<Overlay> { + fn overlays(&self, cx: &ToolContext) -> Vec<Overlay> { match (self.drag, self.placed) { (Some((c, p)), _) => { vec![Overlay::Path { path: ellipse_path(c, p.distance(c), p.distance(c), 0.0), color: BLUE, width: 1.0, dashed: false }] } (_, Some((c, _))) => vec![Overlay::Line { a: c, b: self.hover, color: BLUE, dashed: true }], - _ => vec![], + // The selected flare's center and end handles. + _ => match selected_flare(cx) { + Some((_, c, e)) => vec![ + Overlay::Line { a: c, b: e, color: BLUE, dashed: true }, + Overlay::Anchor { p: c, color: BLUE, filled: self.handle.is_some_and(|h| !h.end), size: 7.0 }, + Overlay::Anchor { p: e, color: BLUE, filled: self.handle.is_some_and(|h| h.end), size: 7.0 }, + ], + None => vec![], + }, } } fn cursor(&self, _cx: &ToolContext, _p: Point, _mods: Mods) -> Cursor { @@ -791,6 +870,61 @@ mod tests { assert_eq!(t.turn, 10.0); } + /// With one flare selected, the tool shows its center and end handles where the flare is now + /// drawn, and dragging either edits the flare (`shape.editFlare`) as one undo step; a press + /// away from them draws a new flare. + #[test] + fn dragging_a_selected_flares_handles_changes_its_length_and_direction() { + use crate::testutil::*; + use vectorcraft_doc::flare::{FlareSpec, part_node, parts}; + use vectorcraft_doc::{Node, Selection}; + let (mut d, _) = doc_with_rect(); + let gid = d.alloc_id(); + let v = json!({ "cx": 100.0, "cy": 100.0, "x2": 300.0, "y2": 100.0, "rays": 3, "rings": 2, "seed": 5, "diameter": 30.0, + "opacity": 50.0, "brightness": 30.0, "growth": 20.0, "fuzziness": 50.0, "longest": 300.0, "rayFuzziness": 100.0, + "rotation": 0.0, "largest": 50.0 }); + let xf = vectorcraft_geom::Affine::translate((10.0, 20.0)); + let children: Vec<_> = parts(&v).into_iter().map(|part| std::sync::Arc::new(part_node(d.alloc_id(), part, xf, false))).collect(); + let edited = children[0].id; + let mut g = Node::group(gid, children); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v, transform: xf })); + let layer = d.layers[0].id; + d.insert(Some(layer), usize::MAX, g).unwrap_or_else(|e| panic!("{e}")); + let s = Selection { objects: vec![gid], ..Default::default() }; + let p = paint(); + let cx = cx(&d, &s, &p); + let mut t = FlareTool::default(); + let ov = t.overlays(&cx); + let anchors: Vec<Point> = ov.iter().filter_map(|o| if let Overlay::Anchor { p, .. } = o { Some(*p) } else { None }).collect(); + assert_eq!(anchors, vec![Point::new(110.0, 120.0), Point::new(310.0, 120.0)]); + // The end handle, grabbed 2 points off: it moves as far as the pointer. + assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 312.0, 120.0)).is_empty()); + assert!(t.busy()); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 312.0, 160.0)); + assert_eq!(a.first(), Some(&Action::Begin("Edit Flare".into()))); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 302.0, 200.0)); + assert_eq!(a, vec![Action::Preview("shape.editFlare".into(), json!({ "ids": [gid.0], "x2": 300.0, "y2": 200.0 })), Action::Commit]); + // The center handle; Escape cancels its drag. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 110.0, 121.0)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 150.0, 121.0)); + assert_eq!(a.last(), Some(&Action::Preview("shape.editFlare".into(), json!({ "ids": [gid.0], "cx": 150.0, "cy": 120.0 })))); + assert_eq!(t.key(&cx, ToolKey::Escape, Mods::default()), vec![Action::Cancel]); + assert!(!t.busy()); + // A click on a handle without a drag changes nothing. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 110.0, 120.0)); + assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 110.0, 120.0)).is_empty()); + // Away from the handles a drag draws a new flare. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 200.0, 300.0)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 240.0, 300.0)); + assert_eq!(a.first(), Some(&Action::Begin("Flare".into()))); + // Without a flare selected, no handles show. + let none = Selection::default(); + assert!(FlareTool::default().overlays(&crate::testutil::cx(&d, &none, &p)).is_empty()); + // A flare with an edited part is no longer edited as a flare: no handles show. + d.node_mut(edited).unwrap_or_else(|| panic!("no part")).opacity = 0.25; + assert!(FlareTool::default().overlays(&crate::testutil::cx(&d, &s, &p)).is_empty()); + } + /// Space held while dragging out a flare moves it at its current size and turn, in the center /// drag and in the drag that places the rings' end point; let go, the drag goes on from there. #[test] diff --git a/crates/ui-egui/src/dialogs/flare_options.rs b/crates/ui-egui/src/dialogs/flare_options.rs index b94f6a7c2e..cf01d150d0 100644 --- a/crates/ui-egui/src/dialogs/flare_options.rs +++ b/crates/ui-egui/src/dialogs/flare_options.rs @@ -5,11 +5,15 @@ //! grid shows). While Alt (Option on macOS) is held, Cancel reads Reset, which puts every option //! back to the tool's default and leaves the dialog open (`ui.dialogReset`). A click-opened //! dialog previews its settings live; Reset refreshes that preview and Cancel rolls it back. +//! Opened from the toolbar with flares selected, it shows the first one's settings, and OK draws +//! the selected flares again with the settings changed in the dialog (`shape.editFlare`); the tool +//! keeps its options. //! //! Fields: the options (`vectorcraft_tools::extra::FLARE_OPTIONS`): `diameter` and `pathLength` //! (points), `opacity`, `brightness`, `growth`, `fuzziness`, `longest`, `rayFuzziness` and -//! `largest` (%), `rays` and `rings` (counts), `direction` (degrees); `raysOn` and `ringsOn`; and -//! `x`, `y` where a click opened it, with `preview` on initially for that click. +//! `largest` (%), `rays` and `rings` (counts), `direction` (degrees); `raysOn` and `ringsOn`; +//! `x`, `y` where a click opened it, with `preview` on initially for that click; and `flares` +//! (ids) with `shown` (the settings the dialog opened with) for the selected flares. use serde_json::{Map, Value, json}; use vectorcraft_geom::Point; @@ -38,7 +42,8 @@ const LABEL_W: f32 = 78.0; const FIELD_W: f32 = 90.0; /// Open the Flare Tool Options with the tool's values; `at`: where a click opened them, to draw a -/// flare there on OK. +/// flare there on OK. Opened without a click while flares are selected, they show the first one's +/// settings, to change the selected flares on OK. pub fn open(app: &mut VectorcraftApp, at: Option<Point>) -> Value { let mut fields = match app.session.tool_options_of("flare") { Value::Object(o) => o, @@ -48,11 +53,79 @@ pub fn open(app: &mut VectorcraftApp, at: Option<Point>) -> Value { fields.insert("preview".into(), json!(true)); fields.insert("x".into(), json!(p.x)); fields.insert("y".into(), json!(p.y)); + } else if let Some((ids, settings)) = selected_flares(app) { + // A flare without rays or rings shows that checkbox off, with the tool's count. + for (key, on) in [("rays", "raysOn"), ("rings", "ringsOn")] { + let n = settings.get(key).and_then(Value::as_f64).unwrap_or(0.0); + fields.insert(on.into(), json!(n > 0.0)); + if n > 0.0 { + fields.insert(key.into(), json!(n)); + } + } + for (key, ..) in FLARE_OPTIONS.iter().filter(|(k, ..)| !matches!(*k, "rays" | "rings")) { + if let Some(v) = settings.get(*key) { + fields.insert(key.to_string(), v.clone()); + } + } + fields.insert("shown".into(), Value::Object(shown(&fields))); + fields.insert("flares".into(), json!(ids)); } app.ui.dialog = Some(Dialog { kind: KIND.into(), fields }); json!({ "dialog": KIND }) } +/// The selected flares that can be edited (ids) and the first one's settings as the dialog shows +/// them: its rings' path length and direction from its center to its end point, where the flare is +/// drawn now. +fn selected_flares(app: &VectorcraftApp) -> Option<(Vec<u64>, Map<String, Value>)> { + let st = app.session.doc().ok()?; + let flares: Vec<_> = st + .selection + .objects + .iter() + .filter(|id| st.doc.is_editable(**id)) + .filter_map(|id| vectorcraft_engine::flare_settings(&st.doc, *id).map(|spec| (id.0, spec))) + .collect(); + let (_, first) = flares.first()?; + let Value::Object(mut settings) = first.params.clone() else { return None }; + let d = first.end()? - first.center()?; + settings.insert("pathLength".into(), json!(d.hypot())); + // Counter-clockwise from 3 o'clock, 0° to 360°, as `shape.flare` takes it. + settings.insert("direction".into(), json!((-d.y).atan2(d.x).to_degrees().rem_euclid(360.0))); + Some((flares.iter().map(|(id, _)| *id).collect(), settings)) +} + +/// The settings `fields` give a flare: each option, with a count of 0 when its checkbox is off. +fn shown(fields: &Map<String, Value>) -> Map<String, Value> { + let get = |key: &str, default: f64| fields.get(key).and_then(Value::as_f64).unwrap_or(default); + let on = |key: &str| fields.get(key).and_then(Value::as_bool) != Some(false); + FLARE_OPTIONS + .iter() + .map(|&(key, default, ..)| { + let v = match key { + "rays" if !on("raysOn") => 0.0, + "rings" if !on("ringsOn") => 0.0, + "rays" | "rings" => get(key, default).round(), + _ => get(key, default), + }; + (key.to_string(), json!(v)) + }) + .collect() +} + +/// `shape.editFlare`'s params for the selected flares: the settings changed since the dialog opened. +fn edit_params(d: &Dialog) -> Option<Value> { + let ids = d.fields.get("flares")?.clone(); + let start = d.fields.get("shown").and_then(Value::as_object).cloned().unwrap_or_default(); + let mut params = json!({ "ids": ids }); + for (key, v) in shown(&d.fields) { + if start.get(&key) != Some(&v) { + params[key.as_str()] = if matches!(key.as_str(), "rays" | "rings") { json!(v.as_f64().unwrap_or(0.0) as u64) } else { v }; + } + } + Some(params) +} + /// A row for option `key`, kept within its range: a distance in `unit`, else a number. fn field(ui: &mut egui::Ui, d: &mut Dialog, unit: vectorcraft_doc::Unit, (key, label): (&str, &str)) { let Some(&(_, default, lo, hi)) = FLARE_OPTIONS.iter().find(|(k, ..)| *k == key) else { return }; @@ -119,8 +192,12 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { false } -/// A click-created flare previews at that original click; toolbar options draw no artwork. +/// A click-created flare previews at that original click, and the selected flares preview with the +/// settings changed; toolbar options draw no artwork. fn preview_command(app: &VectorcraftApp, d: &Dialog) -> Option<(String, Value)> { + if let Some(params) = edit_params(d) { + return Some(("shape.editFlare".into(), params)); + } let at = Point::new(d.fields.get("x")?.as_f64().filter(|v| v.is_finite())?, d.fields.get("y")?.as_f64().filter(|v| v.is_finite())?); // Use the same clamping and whole-count conversion as accepted tool settings. let mut tool = vectorcraft_tools::create("flare"); @@ -142,8 +219,16 @@ fn reset(_: &VectorcraftApp, d: &mut Dialog) { } } -/// OK: set the tool's options; opened by a click, draw a flare there with them. +/// OK: set the tool's options; opened by a click, draw a flare there with them. Opened for the +/// selected flares, draw them again with the settings changed, leaving the tool's options. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { + if let Some(params) = edit_params(d) { + return if d.fields.contains_key(form::PREVIEWED) { + form::commit_preview(app, "shape.editFlare", params) + } else { + run_and_close(app, "shape.editFlare", params) + }; + } let command = preview_command(app, d); if command.is_none() && (d.fields.contains_key("x") || d.fields.contains_key("y") || d.fields.contains_key(form::PREVIEWED)) { return Err("Flare click coordinates must be finite numbers".into()); @@ -317,6 +402,41 @@ mod tests { assert_eq!((o["opacity"].as_f64(), o["diameter"].as_f64()), (Some(100.0), Some(0.0))); } + /// With a flare selected, the toolbar's Flare Tool Options show its settings, and OK draws it + /// again with the settings changed, as one undo step, leaving the tool's options. + #[test] + fn with_a_flare_selected_the_options_show_its_settings_and_ok_draws_it_again() { + let mut app = app(); + let flare = json!({"cx": 200, "cy": 200, "diameter": 60, "rays": 0, "rings": 4, "x2": 200, "y2": 0, "largest": 80, "seed": 5}); + app.run("shape.flare", flare).unwrap(); + app.run("object.move", json!({"dx": 30, "dy": 0})).unwrap(); + let options = app.session.tool_options_of("flare"); + app.run("tool.options", json!({"tool": "flare"})).unwrap(); + painted(&mut app); + let d = app.ui.dialog.as_mut().unwrap(); + let shown = (d.f64("diameter", 0.0), d.bool("raysOn"), d.f64("rays", 0.0), d.f64("rings", 0.0), d.f64("largest", 0.0)); + assert_eq!(shown, (60.0, false, 15.0, 4.0, 80.0)); + assert!((d.f64("pathLength", 0.0) - 200.0).abs() < 1e-9 && (d.f64("direction", 0.0) - 90.0).abs() < 1e-9); + d.fields.insert("rings".into(), json!(7)); + d.fields.insert("raysOn".into(), json!(true)); + let depth = app.session.doc().unwrap().history.undo.len(); + super::super::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); + assert_eq!(app.session.doc().unwrap().history.undo.len(), depth + 1); + let parts = flare_parts(&app); + assert_eq!((parts.iter().filter(|p| *p == "Ring").count(), parts.iter().any(|p| p == "Rays")), (7, true), "{parts:?}"); + // Still where it was moved to. + let doc = &app.session.doc().unwrap().doc; + let id = app.session.doc().unwrap().selection.objects[0]; + assert!(vectorcraft_engine::flare_settings(doc, id).unwrap().center().unwrap().distance(Point::new(230.0, 200.0)) < 1e-9); + assert_eq!(app.session.tool_options_of("flare"), options); + // With nothing selected, the dialog shows the tool's options again. + app.run("select.none", json!({})).unwrap(); + app.run("tool.options", json!({"tool": "flare"})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("diameter", 0.0), d.fields.contains_key("flares")), (100.0, false)); + } + #[test] fn ui_dialog_reset_puts_the_defaults_back_and_keeps_where_a_click_opened_it() { let mut app = app(); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 948b295e17..0dfdb5a443 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1234,6 +1234,7 @@ font-technology Variable Променливи Fit to Selected Art Побиране спрямо избраната графика Flag… Знаме… Flare Взрив + Edit Flare Редактиране на взрива Flare Tool Инструмент „Взрив“ Flare Tool Options Опции на инструмента „Взрив“ Halo Ореол @@ -4615,6 +4616,7 @@ axis Both И двете @msg select a blend изберете преход (blend) @msg select a blend or give `id` изберете преливане или задайте неговия `id` @msg select a clip group изберете група за изрязване +@msg select a flare изберете взрив @msg select a gradient mesh изберете мрежа на градиент (gradient mesh) @msg select a linked image: an embedded one has no file изберете свързано изображение: вграденото няма файл @msg select a repeat изберете повторение (repeat) diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index f8d6fa263b..358aeea968 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4049,6 +4049,7 @@ theme Appearance Izgled Set Tab Stops Postavi tabulatore Tab Stops Tabulatori Flare Odsjaj + Edit Flare Uredi odsjaj Rays Zrake Rectangle Pravougaonik Paintbrush Kist @@ -5011,6 +5012,7 @@ imageTrace Outline Obris @msg select a blend odaberite stapanje @msg select a blend or give `id` odaberite stapanje ili navedite `id` @msg select a clip group odaberite grupu isijecanja +@msg select a flare odaberite odsjaj @msg select a gradient mesh odaberite gradijentnu mrežu @msg select a linked image: an embedded one has no file odaberite povezanu sliku: ugrađena nema datoteku @msg select a repeat odaberite ponavljanje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3ed3ca8331..cf7b13b28d 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1738,6 +1738,7 @@ digits Malayalam Malaiàlam Fixed Fix Flag… Marca… Flare Resplendor + Edit Flare Edita el resplendor Flare Tool Eina de resplendor Flare Tool Options Opcions de l’eina de resplendor Flat Angle Angle pla @@ -6106,6 +6107,7 @@ digits Malayalam Malaiàlam @msg select a blend selecciona una fusió @msg select a blend or give `id` selecciona una fusió o dona `id` @msg select a clip group selecciona un grup de retall +@msg select a flare selecciona un resplendor @msg select a gradient mesh selecciona una malla de degradat @msg select a linked image: an embedded one has no file selecciona una imatge enllaçada: una d’incrustada no té fitxer @msg select a Live Paint group selecciona un grup de pintura interactiva diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 161e235c56..d1c1b9cab9 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4105,6 +4105,7 @@ theme Appearance Motiv Set Tab Stops Nastavit zarážky tabulátoru Tab Stops Zarážky tabulátoru Flare Odlesk + Edit Flare Upravit odlesk Rays Paprsky Rectangle Obdélník Paintbrush Štětec @@ -5185,6 +5186,7 @@ imageTrace Outline Obrys @msg select a blend vyberte prolnutí @msg select a blend or give `id` vyberte prolnutí, nebo zadejte `id` @msg select a clip group vyberte ořezovou skupinu +@msg select a flare vyberte odlesk @msg select a gradient mesh vyberte přechodovou síť @msg select a linked image: an embedded one has no file vyberte propojený obrázek: vložený nemá soubor @msg select a repeat vyberte opakování diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index fd0b7c042e..0073d6f1cf 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -4431,6 +4431,7 @@ theme Appearance Udseende Set Tab Stops Angiv tabulatorstop Tab Stops Tabulatorstop Flare Flare + Edit Flare Redigér flare Rays Stråler Rectangle Rektangel Paintbrush Malerpensel @@ -5323,6 +5324,7 @@ imageTrace Outline Kontur @msg select a Live Paint group markér en Live Paint-gruppe @msg select a blend markér en blanding @msg select a clip group markér en klipgruppe +@msg select a flare markér en flare @msg select a gradient mesh markér et gradientnet @msg select a linked image: an embedded one has no file markér et linket billede: et indlejret har ingen fil @msg select a repeat markér en gentagelse diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2a5f32a5d9..1197f96944 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1267,6 +1267,7 @@ font-technology Variable Variabel Fit to Selected Art An ausgewählte Grafik anpassen Flag… Flagge… Flare Blendenfleck + Edit Flare Blendenfleck bearbeiten Flare Tool Blendenfleck-Werkzeug Flare Tool Options Optionen für das Blendenfleck-Werkzeug Halo Lichtkranz @@ -4800,6 +4801,7 @@ theme Appearance Erscheinungsbild @msg select a blend wählen Sie eine Angleichung aus @msg select a blend or give `id` wählen Sie eine Angleichung aus oder geben Sie `id` an @msg select a clip group wählen Sie eine Schnittgruppe aus +@msg select a flare wählen Sie einen Blendenfleck aus @msg select a gradient mesh wählen Sie ein Verlaufsgitter aus @msg select a linked image: an embedded one has no file wählen Sie ein verknüpftes Bild aus: Ein eingebettetes hat keine Datei @msg select a repeat wählen Sie eine Wiederholung aus diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b1b7b4d039..8c4153e396 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1212,6 +1212,7 @@ font-technology Variable Μεταβλητές Fit to Selected Art Προσαρμογή στο επιλεγμένο γραφικό Flag… Σημαία… Flare Λάμψη + Edit Flare Επεξεργασία λάμψης Flare Tool Λάμψη (Flare Tool) Flare Tool Options Επιλογές εργαλείου λάμψης Halo Άλως @@ -4834,6 +4835,7 @@ digits Malayalam Μαλαγιάλαμ @msg select a blend επιλέξτε ανάμειξη @msg select a blend or give `id` επιλέξτε ανάμειξη ή δώστε το `id` @msg select a clip group επιλέξτε ομάδα αποκοπής +@msg select a flare επιλέξτε λάμψη @msg select a gradient mesh επιλέξτε πλέγμα ντεγκραντέ @msg select a linked image: an embedded one has no file επιλέξτε συνδεδεμένη εικόνα: η ενσωματωμένη δεν έχει αρχείο @msg select a repeat επιλέξτε επανάληψη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5b3c675f7b..451a5654f4 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1288,6 +1288,7 @@ font-technology Variable Variables Fit to Selected Art Encajar en la ilustración seleccionada Flag… Bandera… Flare Destello + Edit Flare Editar destello Flare Tool Herramienta Destello Flare Tool Options Opciones de la herramienta Destello Halo Halo @@ -4878,6 +4879,7 @@ axis Both Ambos @msg select a blend selecciona una fusión @msg select a blend or give `id` selecciona una fusión o indica su `id` @msg select a clip group selecciona un grupo de recorte +@msg select a flare selecciona un destello @msg select a gradient mesh selecciona una malla de degradado @msg select a linked image: an embedded one has no file selecciona una imagen vinculada: una incrustada no tiene archivo @msg select a repeat selecciona una repetición diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index e77a617c52..cb2a4d8227 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4029,6 +4029,7 @@ theme Appearance Ulkoasu Set Tab Stops Aseta sarkainkohdat Tab Stops Sarkainkohdat Flare Häikäisy + Edit Flare Muokkaa häikäisyä Rays Säteet Rectangle Suorakulmio Paintbrush Maalaussivellin @@ -5093,6 +5094,7 @@ imageTrace Outline Ääriviiva @msg select a blend valitse sulautus @msg select a blend or give `id` valitse sulautus tai anna sen `id` @msg select a clip group valitse leikkausryhmä +@msg select a flare valitse häikäisy @msg select a gradient mesh valitse liukuväriverkko @msg select a linked image: an embedded one has no file valitse linkitetty kuva: upotetulla kuvalla ei ole tiedostoa @msg select a repeat valitse toisto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 2762d2a954..7d0c1cad6d 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1282,6 +1282,7 @@ font-technology Variable Variables Fit to Selected Art Ajuster à l’illustration sélectionnée Flag… Drapeau… Flare Halo + Edit Flare Modifier le halo Flare Tool Outil Halo Flare Tool Options Options de l’outil Halo Halo Halo @@ -4865,6 +4866,7 @@ axis Both Les deux @msg select a blend sélectionnez un dégradé de formes @msg select a blend or give `id` sélectionnez un dégradé de formes ou indiquez son `id` @msg select a clip group sélectionnez un groupe d’écrêtage +@msg select a flare sélectionnez un halo @msg select a gradient mesh sélectionnez un filet de dégradé @msg select a linked image: an embedded one has no file sélectionnez une image liée : une image incorporée n’a pas de fichier @msg select a repeat sélectionnez une répétition diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 1c96900b2b..f307fad521 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1412,6 +1412,7 @@ Fix Selected પસંદ કરેલું ઠીક કરો Flag… ફ્લેગ… Flare ફ્લેર + Edit Flare ફ્લેર સંપાદિત કરો Flare Tool ફ્લેર ટૂલ Flare Tool Options ફ્લેર ટૂલ વિકલ્પો Flat Image ફ્લેટ છબી diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 548f961f51..b500fa4b21 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1939,6 +1939,7 @@ antiAlias Sharp शार्प Fixed निश्चित Flag… झंडा… Flare फ्लेयर + Edit Flare फ्लेयर संपादित करें Flare Tool फ्लेयर टूल Flare Tool Options फ़्लेयर टूल ऑप्शन्स Flat Angle फ्लैट कोण @@ -7831,6 +7832,7 @@ antiAlias Sharp शार्प @msg select a blend or give `id` एक मिश्रण सिलेक्ट करें या `id` देना @msg select a blend to set easing or color shift Easing या रंग शिफ्ट सेट करने के लिए एक मिश्रण सिलेक्ट करें @msg select a clip group एक क्लिप समूह चुनें +@msg select a flare एक फ्लेयर चुनें @msg select a compound shape एक मिश्रित आकार चुनें @msg Select a dimension first पहले आयाम सिलेक्ट करें @msg select a gradient mesh एक ग्रेडिएंट जाल सिलेक्ट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 200b45d1b1..22611fc847 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1602,6 +1602,7 @@ digits Malayalam Malajálam Fixed Rögzített Flag… Zászló… Flare Fényvillanás + Edit Flare Fényvillanás szerkesztése Flare Tool Fényvillanás Flare Tool Options Fényvillanás beállításai Flat Angle Lapos, ferde @@ -5638,6 +5639,7 @@ imageTrace Outline Körvonal @msg select a blend jelölj ki egy összemosást @msg select a blend or give `id` jelölj ki egy összemosást, vagy add meg az `id` értékét @msg select a clip group jelölj ki egy vágócsoportot +@msg select a flare jelölj ki egy fényvillanást @msg select a gradient mesh jelölj ki egy színátmenetes hálót @msg select a linked image: an embedded one has no file jelölj ki egy csatolt képet: a beágyazottnak nincs fájlja @msg select a Live Paint group jelölj ki egy élőfestés-csoportot diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f3dcca3874..c9153eecc0 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3822,6 +3822,7 @@ theme Appearance Tampilan Set Tab Stops Atur hentian tab Tab Stops Hentian tab Flare Flare + Edit Flare Edit flare Rays Sinar Rectangle Persegi panjang Paintbrush Kuas lukis @@ -4713,6 +4714,7 @@ imageTrace Outline Kontur @msg select a Live Paint group pilih grup Live Paint @msg select a blend pilih blend @msg select a clip group pilih grup klip +@msg select a flare pilih flare @msg select a gradient mesh pilih mesh gradien @msg select a linked image: an embedded one has no file pilih gambar tertaut: gambar yang tersemat tidak memiliki berkas @msg select a repeat pilih pengulangan diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 90ec79404c..0a0eff1d6c 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1297,6 +1297,7 @@ font-technology Variable Variabili Fit to Selected Art Adatta alla grafica selezionata Flag… Bandiera… Flare Riflesso + Edit Flare Modifica riflesso Flare Tool Strumento Riflesso Flare Tool Options Opzioni strumento Riflesso Halo Alone @@ -4928,6 +4929,7 @@ axis Both Entrambi @msg select a blend seleziona una fusione @msg select a blend or give `id` seleziona una fusione o specifica il suo `id` @msg select a clip group seleziona un gruppo di ritaglio +@msg select a flare seleziona un riflesso @msg select a gradient mesh seleziona una trama sfumatura @msg select a linked image: an embedded one has no file seleziona un'immagine collegata: un'immagine incorporata non ha un file @msg select a repeat seleziona una ripetizione diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d98acfa22d..0ae8b3476c 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1826,6 +1826,7 @@ antiAlias Sharp シャープ Fit in Window ウィンドウに合わせる Fit on Screen 画面にフィット Flare フレア + Edit Flare フレアを編集 Flare Tool フレアツール Flat Image 統合イメージ Flatness: フラットネス: @@ -4602,6 +4603,7 @@ swatch Bright Violet ビビッドバイオレット @msg no previous transform 前回の変形がありません @msg nothing to align 整列するものがありません @msg select a clip group クリップグループを選択してください +@msg select a flare フレアを選択してください @msg select two or more objects to distribute 分布させるオブジェクトを 2 つ以上選択してください @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis には "vertical"、"horizontal"、度単位の角度のいずれかを指定してください (`{v}` は指定できません) @msg give horizontal or vertical horizontal または vertical を指定してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 794e5454a9..ec66e9fb64 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3660,6 +3660,7 @@ theme Appearance იერსახე Set Tab Stops ტაბულაციის გაჩერებების დაყენება Tab Stops ტაბულაციის გაჩერებები Flare ბლიკი + Edit Flare ბლიკის რედაქტირება Rays სხივები Rectangle მართკუთხედი Paintbrush ფუნჯი @@ -4543,6 +4544,7 @@ font-technology Variable ცვლადი @msg select a Live Paint group მონიშნეთ ცოცხალი შეღებვის ჯგუფი @msg select a blend მონიშნეთ გადასვლა @msg select a clip group მონიშნეთ მომჭრელი ჯგუფი +@msg select a flare მონიშნეთ ბლიკი @msg select a gradient mesh მონიშნეთ გრადიენტული ბადე @msg select a linked image: an embedded one has no file მონიშნეთ მიბმული გამოსახულება: ჩაშენებულს ფაილი არ აქვს @msg select a repeat მონიშნეთ გამეორება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index bb8676df71..88a530b304 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1816,6 +1816,7 @@ antiAlias Sharp 날카롭게 Fit in Window 창에 맞추기 Fit on Screen 화면에 맞추기 Flare 플레어 + Edit Flare 플레어 편집 Flare Tool 플레어 도구 Flat Image 단일 이미지 Flatness: 평탄도: @@ -4529,6 +4530,7 @@ theme Appearance 외관 @msg no previous transform 이전 변형이 없습니다 @msg nothing to align 정렬할 항목이 없습니다 @msg select a clip group 클립 그룹을 선택하세요 +@msg select a flare 플레어를 선택하세요 @msg select two or more objects to distribute 분포할 개체를 두 개 이상 선택하세요 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis는 "vertical", "horizontal" 또는 도 단위 각도여야 합니다: `{v}` @msg give horizontal or vertical horizontal 또는 vertical을 지정하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index a597a03fd0..a2aef865b4 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4340,6 +4340,7 @@ theme Appearance Vormgeving Set Tab Stops Tabstops instellen Tab Stops Tabstops Flare Flare + Edit Flare Flare bewerken Rays Stralen Rectangle Rechthoek Paintbrush Penseel @@ -5232,6 +5233,7 @@ imageTrace Outline Contour @msg select a Live Paint group selecteer een Live Paint-groep @msg select a blend selecteer een vermenging @msg select a clip group selecteer een knipgroep +@msg select a flare selecteer een flare @msg select a gradient mesh selecteer een verloopnet @msg select a linked image: an embedded one has no file selecteer een gekoppelde afbeelding: een ingesloten afbeelding heeft geen bestand @msg select a repeat selecteer een herhaling diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 99ee2080b8..a7065b0b4f 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3964,6 +3964,7 @@ theme Appearance Wygląd Set Tab Stops Ustaw tabulatory Tab Stops Tabulatory Flare Rozbłysk + Edit Flare Edytuj rozbłysk Rays Promienie Rectangle Prostokąt Paintbrush Pędzel @@ -5011,6 +5012,7 @@ imageTrace Outline Kontur @msg select a blend zaznacz przejście @msg select a blend or give `id` zaznacz przejście lub podaj `id` @msg select a clip group zaznacz grupę przycinającą +@msg select a flare zaznacz rozbłysk @msg select a gradient mesh zaznacz siatkę gradientową @msg select a linked image: an embedded one has no file zaznacz obraz połączony: osadzony nie ma pliku @msg select a repeat zaznacz powtórzenie diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 677c8e460f..35ffb04b83 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1168,6 +1168,7 @@ antiAlias Sharp Nítido Fit to Selected Art Ajustar à Arte Selecionada Flag… Bandeira… Flare Brilho de Lente + Edit Flare Editar Brilho de Lente Flare Tool Ferramenta Brilho de Lente Flat Image Imagem Plana Flatness: Achatamento: @@ -4325,6 +4326,7 @@ axis Both Ambos @msg select a blend selecione uma mesclagem @msg select a blend or give `id` selecione uma mesclagem ou informe seu `id` @msg select a clip group selecione um grupo de recorte +@msg select a flare selecione um brilho de lente @msg select a gradient mesh selecione uma malha de gradiente @msg select a linked image: an embedded one has no file selecione uma imagem vinculada: uma incorporada não tem arquivo @msg select a repeat selecione uma repetição diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 106343cddd..3ef691ef91 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1286,6 +1286,7 @@ font-technology Variable Вариативные Fit to Selected Art Вписать в выделенный рисунок Flag… Флаг… Flare Блик + Edit Flare Редактировать блик Flare Tool Инструмент «Блик» Flare Tool Options Параметры инструмента «Блик» Halo Ореол @@ -4915,6 +4916,7 @@ axis Both Оба @msg select a blend выделите переход @msg select a blend or give `id` выделите переход или укажите `id` @msg select a clip group выделите группу обрезки +@msg select a flare выделите блик @msg select a gradient mesh выделите градиентную сетку @msg select a linked image: an embedded one has no file выделите связанное изображение: у внедрённого нет файла @msg select a repeat выделите повтор diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index cc854aa362..4f95c2fa8f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1247,6 +1247,7 @@ font-technology Variable Variabla Fit to Selected Art Anpassa till markerad grafik Flag… Flagga… Flare Ljusreflex + Edit Flare Redigera ljusreflex Flare Tool Ljusreflexverktyg Flare Tool Options Alternativ för ljusreflexverktyget Halo Halo @@ -4776,6 +4777,7 @@ axis Both Båda @msg select a blend markera en blandning @msg select a blend or give `id` markera en blandning eller ange dess `id` @msg select a clip group markera en urklippsgrupp +@msg select a flare markera en ljusreflex @msg select a gradient mesh markera ett gradientnät @msg select a linked image: an embedded one has no file markera en länkad bild: en inbäddad bild har ingen fil @msg select a repeat markera en upprepning diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index f2888a30f0..967775a659 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1241,6 +1241,7 @@ font-technology Variable Değişken Fit to Selected Art Seçilen Sanata Sığdır Flag… Bayrak… Flare parlama + Edit Flare Parlamayı Düzenle Flare Tool Mercek Parlaması Aracı Flare Tool Options Genişletme Aracı Seçenekleri Halo Hale @@ -4647,6 +4648,7 @@ axis Both Her İkisi @msg select a Live Paint group bir Canlı Boyama grubu seçin @msg select a blend bir karışım seç @msg select a clip group bir klip grubu seçin +@msg select a flare bir parlama seçin @msg select a gradient mesh bir degrade ağı seçin @msg select a linked image: an embedded one has no file bağlantılı bir görsel seçin: gömülü görselin dosyası yok @msg select a repeat bir tekrar seç diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 411b2c3baf..a63194eb5a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1291,6 +1291,7 @@ font-technology Variable Варіативні Fit to Selected Art Вписати у виділений малюнок Flag… Прапор… Flare Відблиск + Edit Flare Редагувати відблиск Flare Tool Інструмент «Відблиск» Flare Tool Options Параметри інструменту «Відблиск» Halo Ореол @@ -4912,6 +4913,7 @@ axis Both Обидві @msg select a blend виділіть перехід @msg select a blend or give `id` виділіть перехід або вкажіть `id` @msg select a clip group виділіть відсічну групу +@msg select a flare виділіть відблиск @msg select a gradient mesh виділіть градієнтну сітку @msg select a linked image: an embedded one has no file виділіть пов’язане зображення: у вбудованого немає файлу @msg select a repeat виділіть повтор diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 1460910197..4851de7575 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1513,6 +1513,7 @@ digits Malayalam Malayalam Fixed Cố định Flag… Lá cờ… Flare Hào quang + Edit Flare Chỉnh sửa hào quang Flare Tool Công cụ Hào quang Flare Tool Options Tùy chọn Công cụ Hào quang Flat Angle Góc phẳng @@ -5302,6 +5303,7 @@ theme Appearance Giao diện @msg select a blend hãy chọn một đối tượng hòa trộn @msg select a blend or give `id` hãy chọn một đối tượng hòa trộn hoặc cung cấp `id` @msg select a clip group hãy chọn nhóm cắt +@msg select a flare hãy chọn một hào quang @msg select a gradient mesh hãy chọn lưới chuyển sắc @msg select a linked image: an embedded one has no file hãy chọn ảnh liên kết: ảnh nhúng không có tệp @msg select a Live Paint group hãy chọn nhóm tô trực tiếp diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 3fe2f9e009..e03bc90802 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1228,6 +1228,7 @@ antiAlias Sharp 锐利 Fit to Selected Art 适合所选图稿 Flag… 旗形… Flare 光晕 + Edit Flare 编辑光晕 Flare Tool 光晕工具 Flare Tool Options 光晕工具选项 Halo 光晕 @@ -4301,6 +4302,7 @@ imageTrace Outline 轮廓 @msg no previous transform 没有上一次变换 @msg nothing to align 没有可对齐的内容 @msg select a clip group 请选择一个剪切组 +@msg select a flare 请选择一个光晕 @msg select two or more objects to distribute 请选择两个或更多要分布的对象 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis 必须是 "vertical"、"horizontal" 或以度为单位的角度,而不是 `{v}` @msg give horizontal or vertical 请给出 horizontal 或 vertical diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index ab7f9d9dd2..ad0a9afabb 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1262,6 +1262,7 @@ font-technology Variable 可變 Fit to Selected Art 符合選取的圖稿 Flag… 旗形… Flare 光暈 + Edit Flare 編輯光暈 Flare Tool 光暈工具 Flare Tool Options 光暈工具選項 Halo 光暈 @@ -1997,6 +1998,7 @@ file-filter Templates 範本 @msg no previous transform 沒有上一次的變形 @msg nothing to align 沒有可對齊的內容 @msg select a clip group 請選取剪裁群組 +@msg select a flare 請選取光暈 @msg select two or more objects to distribute 請選取兩個以上要均分的物件 @msg axis must be "vertical", "horizontal" or an angle in degrees, not `{v}` axis 必須是 "vertical"、"horizontal" 或以度為單位的角度,而非 `{v}` @msg give horizontal or vertical 請提供 horizontal 或 vertical diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d83f03d376..4642824545 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -956,7 +956,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph (dialog `command` running graph.setType; an error without one), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph (dialog `command` running graph.setType; an error without one), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 29d89ebf6d..d6aec770f9 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -460,7 +460,8 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result<serde_json:: // The Line Segment, Arc and grid tools: their Tool Options, the options of their next // drag and click. _ if crate::dialogs::shapes::OPTION_TOOLS.contains(&tool) => crate::dialogs::shapes::open_options(app, tool), - // The Flare tool: its options, which draw the next flare (OK draws none). + // The Flare tool: its options, which draw the next flare (OK draws none); with flares + // selected, the first one's settings, and OK draws the selected flares again. "flare" => Ok(crate::dialogs::flare_options::open(app, None)), // A double click on the Print Tiling tool puts the pages back where the placement puts them. "printTiling" => app.run("print.tiling.set", json!({ "reset": true })), diff --git a/docs/mcp.md b/docs/mcp.md index 8ca4121032..b7deac9cea 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10478,6 +10478,24 @@ A canvas-click dialog also has `preview` (initially on): tentative settings draw {"name":"run_command","arguments":{"command":"tool.setOption","params":{"tool":"flare","values":{"rays":24,"ringsOn":false}}}} ``` +A flare keeps the settings it was drawn with, and a move, scale, rotation, reflection or shear of it updates them. +With one or more flares selected, double-clicking the Flare tool opens Flare Tool Options filled from the first +selected flare, with `flares` listing the selected ones. OK runs `shape.editFlare` with the settings changed in the +dialog and leaves the tool's own options as they were. `shape.editFlare {ids?, cx?, cy?, x2?, y2?, diameter?, ...}` +draws each flare again in its place from its settings, changing only the ones given (the center, the end point, +the path length and the direction where the flare is drawn now, the other settings as in `shape.flare`), as one undo step, and adds no step when nothing +changes. With a flare selected, the Flare tool draws its center and end point as handles joined by a dashed line; +dragging the center moves it while the end point stays, and dragging the end point moves the end point; either drag +changes the flare's length and direction as one undo step, and Esc cancels the drag. A flare whose parts were edited +is no longer edited as a flare (error `select a flare`), and a locked or hidden flare is not edited either. Object › Expand turns +a flare into a plain group of its parts. The document saves a flare's settings. Sources: +[Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html), +[the CS3 help, page 67](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). + +```json +{"name":"run_command","arguments":{"command":"shape.editFlare","params":{"diameter":100,"rings":6}}} +``` + The Shape Builder tool's options are its Shape Builder Tool Options (dialog `shapeBuilderOptions`): `openFilledAsClosed` (on: a filled open path bounds a region as if an invisible edge closed it; a path counts as filled when any of its fill rows is shown, painted and above 0% opacity, whichever row is on top; off: it cuts regions diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 082e565bd2..4f5fb04450 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -14,6 +14,8 @@ Numeric fields step on wheel hover without taking keyboard focus (#5949). Arrow keys still require focus; modifiers, units, limits, mixed values and existing rounding stay in the shared stepping path. Headless regressions in `tests/numfields.rs` cover hovered unfocused fields, focused fields, trackpad accumulation and panel scroll exclusion. Scores and estimates unchanged. +A flare keeps its settings through transforms and saves. With a flare selected, double-clicking the Flare tool opens Flare Tool Options filled from it, and OK draws it again in its place as one undo step (`shape.editFlare`; none when nothing changed); the Flare tool shows the selected flare's center and end handles, and dragging either changes its length or direction; Object › Expand turns it into plain objects ([Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html)). Regressions: `edit_flare_draws_a_transformed_flare_again_in_its_place_in_one_undo_step`, `dragging_a_selected_flares_handles_changes_its_length_and_direction` and `with_a_flare_selected_the_options_show_its_settings_and_ok_draws_it_again`. Scores and estimates unchanged. + | 2026-11-06 | minor | Opening a file that takes longer than 0.4 s shows a progress window: the file name, a moving bar (reading reports no steps), how many more files wait, Cancel (Esc; the file doesn't open) and Continue in Background (`file.cancelOpen`, `file.openInBackground`); it never opens over another dialog or progress window (part of #5930); scores and estimates unchanged | Raster rendering fits and preflattens curved stroke outlines more tightly only below four times the raster tolerance, retaining thin-band coverage without changing stroke weight or vector export geometry. Current cached character/object outlines, cropped long strokes, gradient clips and effect rasters share the helper; cropped-region reuse and guarded flattening remain. The unchanged `fractional_curved_strokes_retain_coverage_between_notches` regression covers fractional weights, rotation, phase, opacity and f32-rounded endpoints. This is a quality/cost tradeoff, not a speed claim. Scores and estimates unchanged. From 2b97e0a52a19e47297e392cc0e0e26b097f2e154 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 07:17:31 -0800 Subject: [PATCH 039/247] Docs: the flare editing source link names its help section --- docs/mcp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mcp.md b/docs/mcp.md index 2745282a65..3ac0dfbef8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10885,7 +10885,7 @@ changes the flare's length and direction as one undo step, and Esc cancels the d is no longer edited as a flare (error `select a flare`), and a locked or hidden flare is not edited either. Object › Expand turns a flare into a plain group of its parts. The document saves a flare's settings. Sources: [Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html), -[the CS3 help, page 67](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). +[Edit a flare](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=67). ```json {"name":"run_command","arguments":{"command":"shape.editFlare","params":{"diameter":100,"rings":6}}} From 69410d99d7a6b1e46923029b53e40dc0c4d2727c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 07:31:45 -0800 Subject: [PATCH 040/247] Object Mosaic: a constrained size above 1000000 pt shrinks in proportion - With Constrain Ratio on, a side worked out above 1000000 pt shrinks to 1000000 pt and the other side shrinks with it, as a side under 0.1 pt grows. An image more than 10000000 times wider than tall (or taller than wide) leaves no such size, and the call is refused with an error. - A percentage typed in New Size is kept at 1000000, the most the command takes. - The #1000 test types the count into Number of Tiles again. - docs/mcp.md says a size given for the side Constrain Ratio works out is still checked, and the new lines are wrapped like the paragraph. --- crates/engine/src/cmd/menucmds.rs | 11 +++-- crates/engine/src/tests.rs | 10 +++++ crates/ui-egui/src/dialogs/object_mosaic.rs | 45 +++++++++++++++++++-- crates/ui-egui/src/dialogs/tests.rs | 26 ++++++++++-- docs/mcp.md | 15 +++++-- 5 files changed, 94 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/menucmds.rs b/crates/engine/src/cmd/menucmds.rs index 41fc1cf2fe..606cd28618 100644 --- a/crates/engine/src/cmd/menucmds.rs +++ b/crates/engine/src/cmd/menucmds.rs @@ -124,7 +124,7 @@ pub fn specs() -> Vec<CommandSpec> { "Create Object Mosaic…", ["Object"], None, - "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt, 0.1..1000000; default the image's), percentages?: bool (width and height are percentages of the image's size, default 100), constrain?: \"width\"|\"height\"|null (Constrain Ratio: the mosaic keeps the image's proportions, the named side's size leads and the other side's is worked out from it), useRatio?: bool|\"width\"|\"height\" (square tiles as drawn, spacing taken off: the count on the side named, or with true on the constrained side, columns by default, stays and the other is the count, 1..1000, whose tiles come closest to square), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles coloured by the selected image's average tile colours → {id, tiles, columns, rows}", + "{columns=10, rows=10 (whole numbers, kept within 1..1000), width?, height? (new size in pt, 0.1..1000000; default the image's), percentages?: bool (width and height are percentages of the image's size, default 100), constrain?: \"width\"|\"height\"|null (Constrain Ratio: the mosaic keeps the image's proportions, the named side's size leads and the other side's is worked out from it, both growing or shrinking in proportion to keep the sizes within 0.1..1000000), useRatio?: bool|\"width\"|\"height\" (square tiles as drawn, spacing taken off: the count on the side named, or with true on the constrained side, columns by default, stays and the other is the count, 1..1000, whose tiles come closest to square), spacingX=0, spacingY=0 (pt between tiles), gray?: bool, deleteRaster?: bool} a group of rectangles colored by the selected image's average tile colors → {id, tiles, columns, rows}", has_image, object_mosaic ), @@ -962,10 +962,15 @@ fn mosaic_plan(s: &Session, p: &Value) -> Result<MosaicPlan> { Some(false) => nw = nh * bw / bh, None => {} } - // A size under 0.1 pt grows to 0.1 pt, in proportion while Constrain Ratio keeps it. + // A size under 0.1 pt grows to 0.1 pt, in proportion while Constrain Ratio keeps it. A side + // Constrain Ratio works out above 1,000,000 pt shrinks to 1,000,000 pt, the other with it. let (nw, nh) = match constrain { Some(_) => { - let k = (0.1 / nw.min(nh)).max(1.0); + let k = (0.1 / nw.min(nh)).max(1.0).min(1_000_000.0 / nw.max(nh)); + // Proportions over 10,000,000 to 1 leave no size with both sides within the range. + if nw.min(nh) * k < 0.1 * (1.0 - 1e-9) { + return Err(bad(C, "the image's proportions leave no size with both sides between 0.1 and 1000000 pt")); + } (nw * k, nh * k) } None => (nw.max(0.1), nh.max(0.1)), diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index df9fea654d..15023df3ab 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -4079,6 +4079,14 @@ fn object_mosaic_resizes_by_percentages_constrains_the_ratio_and_squares_the_til // A size under 0.1 pt grows in proportion while Constrain Ratio keeps it. let (w, h, ..) = mosaic_size(&mut s, json!({"width": 0.1, "constrain": "width"})); assert!((w - 0.2).abs() < 1e-6 && (h - 0.1).abs() < 1e-6, "{w} × {h}"); + // A side Constrain Ratio works out above 1,000,000 pt shrinks to it, in proportion: a height of + // 1,000,000 pt over the 100 × 50 pt image would need a width of 2,000,000 pt. + assert_eq!(mosaic_size(&mut s, json!({"height": 1e6, "constrain": "height"})), (1e6, 5e5, json!(10), json!(10))); + // An image 20,000,000 times wider than it is tall has no such size: the call is refused. + s.execute("object.scale", &json!({"sx": 1, "sy": 1e-7})).unwrap(); + let r = s.execute("object.createObjectMosaic", &json!({"width": 1e6, "constrain": "width"})); + let msg = "the image's proportions leave no size with both sides between 0.1 and 1000000 pt"; + assert!(matches!(&r, Err(EngineError::BadParams { msg: m, .. }) if m == msg), "{r:?}"); } /// Use Ratio squares the tiles as drawn: with 4 pt between columns, 10 columns of 10 pt cells draw 6 pt wide, so the @@ -4137,6 +4145,8 @@ fn object_mosaic_refuses_a_bad_ratio_side_size_or_switch() { (json!({"width": 0}), "`width` must be between 0.1 and 1000000 (got 0)"), (json!({"height": -5, "percentages": true}), "`height` must be between 0.1 and 1000000 (got -5)"), (json!({"width": 2e6, "percentages": true}), "`width` must be between 0.1 and 1000000 (got 2000000)"), + // A side Constrain Ratio works out is not used, but a size given for it is still checked. + (json!({"width": 200, "height": 0, "constrain": "width"}), "`height` must be between 0.1 and 1000000 (got 0)"), (json!({"useRatio": "true"}), "`useRatio` must be one of \"width\", \"height\", true, false or null"), (json!({"useRatio": 1}), "`useRatio` must be one of \"width\", \"height\", true, false or null"), (json!({"percentages": 1}), "`percentages` must be true or false"), diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index 680ebd4d95..313751320a 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -1,4 +1,4 @@ -//! Object → Create Object Mosaic: the selected image's Current Size, the mosaic's New Size, Tile +//! Object › Create Object Mosaic…: the selected image's Current Size, the mosaic's New Size, Tile //! Spacing and Number of Tiles, Constrain Ratio (Width or Height), Result (Color or Grayscale), //! Resize Using Percentages, Delete Raster and Use Ratio. OK runs `object.createObjectMosaic` as one //! undo step. @@ -234,14 +234,14 @@ fn params(d: &Dialog) -> Value { } /// A Width and a Height field for `keys`: lengths in `unit` of at least `least` points, or -/// percentages with `pct`. With `follows`, the field of that key is grayed (Constrain Ratio sets it). +/// percentages with `pct`, up to 1,000,000. With `follows`, the field of that key is grayed (Constrain Ratio sets it). fn pair(ui: &mut egui::Ui, d: &mut Dialog, keys: [&str; 2], unit: vectorcraft_doc::Unit, (pct, least): (bool, f64), follows: Option<&str>) { for (key, label) in keys.into_iter().zip([tl!("Width:"), tl!("Height:")]) { widgets::dim_label(ui, label); ui.add_enabled_ui(follows != Some(key), |ui| { if pct { if let Some(v) = widgets::spin_plain(ui, ("mosaic", key), d.f64(key, 100.0), "%", 2, FIELD_W, 1.0, 0.1, &[]) { - d.fields.insert(key.into(), json!(v)); + d.fields.insert(key.into(), json!(v.min(*SIZE_RANGE.end()))); } } else { form::length_within(ui, d, key, unit, FIELD_W, Some(least..=1.0e6)); @@ -615,6 +615,45 @@ mod tests { assert_eq!(mosaic(&app), None); } + /// A percentage typed in New Size above 1,000,000 is kept at 1,000,000, the most the command + /// takes, so Enter makes the mosaic: 1,000,000% of the 100 pt width is 1,000,000 pt. + #[test] + fn a_typed_percentage_stays_within_what_the_command_takes() { + let mut app = app_with_image(); + open(&mut app, &json!({"percentages": true})).unwrap(); + let ctx = context(); + let run = |app: &mut VectorcraftApp, events: Vec<egui::Event>| { + let mut out = ctx.run_ui(egui::RawInput { events, ..Default::default() }, |ui| super::super::show(app, ui.ctx())); + out.textures_delta.clear(); + out.shapes + .iter() + .filter_map(|s| { + if let egui::epaint::Shape::Text(t) = &s.shape { + Some((t.galley.text().to_string(), t.visual_bounding_rect().center())) + } else { + None + } + }) + .collect::<Vec<_>>() + }; + run(&mut app, vec![]); + let texts = run(&mut app, vec![]); + // New Size's Width field comes right after the row's Width caption. + let row = texts.iter().position(|(t, _)| t == "New Size:").expect("the New Size row"); + let width = texts[row..].iter().position(|(t, _)| t == "Width:").and_then(|i| texts.get(row + i + 1)); + assert_eq!(width.map(|(t, _)| t.as_str()), Some("100%"), "{texts:?}"); + let at = width.map(|(_, p)| *p).unwrap(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(&mut app, vec![egui::Event::PointerMoved(at), press(true)]); + run(&mut app, vec![press(false)]); + run(&mut app, vec![]); + run(&mut app, vec![egui::Event::Text("2000000".into())]); + let enter = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; + run(&mut app, vec![enter]); + assert!(app.ui.dialog.is_none(), "Enter makes the mosaic: {:?}", app.ui.dialog.as_ref().map(|d| d.str(form::REFUSED))); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((1e6, 50.0))); + } + /// The id of the image in the document. fn image_id(app: &VectorcraftApp) -> u64 { let mut id = None; diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index d50b08f97f..85f6a14baa 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -1128,8 +1128,8 @@ fn a_hex_code_pasted_into_the_hex_field_replaces_its_digits() { } } -/// #1000: a count set in Object › Create Object Mosaic… reaches the command, so the mosaic has that -/// many columns, not the 10 × 10 grid; Enter confirms the dialog. +/// #1000: a count typed in Object › Create Object Mosaic…'s Number of Tiles reaches the command, so +/// the mosaic has that many columns, not the 10 × 10 grid; Enter confirms the dialog. #[test] fn object_mosaic_makes_the_grid_typed_in_its_dialog() { let mut app = app(); @@ -1138,16 +1138,36 @@ fn object_mosaic_makes_the_grid_typed_in_its_dialog() { let ctx = egui::Context::default(); theme::install_fonts(&ctx); theme::apply(&ctx, Default::default()); + // A frame → the texts painted, with their centers. let frame = |app: &mut VectorcraftApp, events: Vec<egui::Event>| { let mut out = ctx.run_ui(egui::RawInput { events, ..Default::default() }, |ui| show(app, ui.ctx())); out.textures_delta.clear(); + fn walk(s: &egui::Shape, out: &mut Vec<(String, egui::Pos2)>) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, out)), + egui::Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect().center())), + _ => {} + } + } + let mut texts = vec![]; + out.shapes.iter().for_each(|c| walk(&c.shape, &mut texts)); + texts }; let entry = crate::menus::menu_entries(&app).into_iter().find(|e| e.label == "Create Object Mosaic…").expect("menu item"); let (cmd, params) = crate::menus::click_target(&entry.label, entry.command.as_deref().unwrap(), &entry.params); crate::menus::invoke(&mut app, &cmd, params); frame(&mut app, vec![]); - app.ui.dialog.as_mut().expect("the mosaic dialog").fields.insert("columns".into(), json!(3.0)); + let texts = frame(&mut app, vec![]); + // Number of Tiles' Width field comes right after the row's Width caption. + let row = texts.iter().position(|(t, _)| t == "Number of Tiles:").expect("the Number of Tiles row"); + let columns = texts[row..].iter().position(|(t, _)| t == "Width:").and_then(|i| texts.get(row + i + 1)); + assert_eq!(columns.map(|(t, _)| t.as_str()), Some("10"), "{texts:?}"); + let at = columns.map(|(_, p)| *p).unwrap(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(&mut app, vec![egui::Event::PointerMoved(at), press(true)]); + frame(&mut app, vec![press(false)]); frame(&mut app, vec![]); + frame(&mut app, vec![egui::Event::Text("3".into())]); let enter = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; frame(&mut app, vec![enter]); assert!(app.ui.dialog.is_none()); diff --git a/docs/mcp.md b/docs/mcp.md index 32acf6084a..7c00e1ca06 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -1882,8 +1882,9 @@ nothing. These Object menu commands refuse a string, a number or another value that is not true or false with `` `copy` must be true or false ``, naming the key, and change nothing: `reflectX`, `reflectY`, `random`, `copy`, -`relative`, `strokes`, `corners`, `objects` and `patterns` in `object.transformEach`; `gray`, `deleteRaster` -and `percentages` in `object.createObjectMosaic`; `trim` in `object.cropImage`; `allArtboards` in `object.createTrimMarks`; and `byColumn`, +`relative`, `strokes`, `corners`, `objects` and `patterns` in `object.transformEach`; `gray`, `deleteRaster` and +`percentages` in `object.createObjectMosaic`; `trim` in `object.cropImage`; `allArtboards` in +`object.createTrimMarks`; and `byColumn`, `moveArtwork`, `patterns` and `lockedAndHidden` in `artboard.rearrange`. A null is read as a key left out. `object.createTrimMarks` refuses a `style` that is not a string, such as `5`, with `` `style` must be roman or japanese ``, the message it gives for a string that names no style. @@ -1896,7 +1897,8 @@ Grayscale), Resize Using Percentages, Delete Raster and Use Ratio. With no image - `percentages: true`: `width` and `height` are percentages of the image's size (a side left out is 100). - `constrain: "width"` or `"height"`: the mosaic keeps the image's proportions. The named side's size is used and the - other side's is worked out from it, so a `height` given with `constrain: "width"` is not used. + other side's is worked out from it, so a `height` given with `constrain: "width"` is not used. It is still checked + against the range below. - `useRatio: "width"` or `"height"`: the tiles are square as drawn, with the spacing taken off. The count on the named side (`columns` for `"width"`) stays, and the other count, within 1 to 1000, is the one whose tiles come closest to square, measured along the image's own sides when it is turned. `useRatio: true` keeps the `constrain` side, or the @@ -1907,7 +1909,12 @@ A `width` or `height` outside 0.1 to 1000000 (points, or percent with `percentag `` `width` must be between 0.1 and 1000000 (got 0) ``. A `constrain` other than `"width"`, `"height"` or null is refused with `` `constrain` must be one of "width", "height" or null ``, and a `useRatio` other than those, true or false with `` `useRatio` must be one of "width", "height", true, false or null ``; the command then changes nothing. A -side that `constrain` works out as under 0.1 pt grows to 0.1 pt, and the other side grows with it. The result also gives the `columns` and `rows` the mosaic was made with, here for a 100 × 50 pt image: +side that `constrain` works out as under 0.1 pt grows to 0.1 pt, and the other side grows with it. A side that +`constrain` works out as over 1000000 pt shrinks to 1000000 pt, and the other side shrinks with it. With `constrain` +on an image more than 10000000 times wider than tall (or taller than wide), no size keeps both sides in the range, and +the call is refused with `` the image's proportions leave no size with both sides between 0.1 and 1000000 pt ``. + +The result also gives the `columns` and `rows` the mosaic was made with, here for a 100 × 50 pt image: ```json {"columns": 10, "rows": 3, "useRatio": true} From 80aa3401c25e549ecf230e1b2a88e83b4fa46b8c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 08:18:49 -0800 Subject: [PATCH 041/247] Plug-ins: plug-ins may call shape.editFlare The new command was in neither reviewed list, so every_command_is_reviewed failed and a plug-in call to it was refused as not reviewed. It goes in ALLOWED next to shape.flare; it takes no file or folder parameter. --- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 67d0fec2a3..39acf8ad1f 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -542,6 +542,7 @@ pub(super) const ALLOWED: &[&str] = &[ "select.toggle", "select.update", "shape.arc", + "shape.editFlare", "shape.ellipse", "shape.flare", "shape.line", From 10b3779c4eafe2944ca63bd7aa91d791e04e5c90 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 08:32:03 -0800 Subject: [PATCH 042/247] Library panels: rows for the Neon & Glow style names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main added the built-in Neon & Glow graphic style library, so the style-name check now lists 86 names. Each complete catalog gets rows for Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet and Cobalt Phosphor, after the other style rows. - ka: main already has rows for Weather Icons, Soft Shadow and Hard Shadow, so the branch's copies of those rows are removed. - hi: Triad Coral and Triad Teal use त्रिक, the term of the Triad row, as the Hindi glossary check requires. --- crates/ui-egui/src/i18n/bg.tsv | 6 ++++++ crates/ui-egui/src/i18n/bs.tsv | 6 ++++++ crates/ui-egui/src/i18n/ca.tsv | 6 ++++++ crates/ui-egui/src/i18n/cs.tsv | 6 ++++++ crates/ui-egui/src/i18n/da.tsv | 6 ++++++ crates/ui-egui/src/i18n/de.tsv | 6 ++++++ crates/ui-egui/src/i18n/el.tsv | 6 ++++++ crates/ui-egui/src/i18n/es.tsv | 6 ++++++ crates/ui-egui/src/i18n/fi.tsv | 6 ++++++ crates/ui-egui/src/i18n/fr.tsv | 6 ++++++ crates/ui-egui/src/i18n/gu.tsv | 6 ++++++ crates/ui-egui/src/i18n/hi.tsv | 10 ++++++++-- crates/ui-egui/src/i18n/hu.tsv | 6 ++++++ crates/ui-egui/src/i18n/id.tsv | 6 ++++++ crates/ui-egui/src/i18n/it.tsv | 6 ++++++ crates/ui-egui/src/i18n/ja.tsv | 6 ++++++ crates/ui-egui/src/i18n/ka.tsv | 9 ++++++--- crates/ui-egui/src/i18n/ko.tsv | 6 ++++++ crates/ui-egui/src/i18n/nl.tsv | 6 ++++++ crates/ui-egui/src/i18n/pl.tsv | 6 ++++++ crates/ui-egui/src/i18n/pt-br.tsv | 6 ++++++ crates/ui-egui/src/i18n/ru.tsv | 6 ++++++ crates/ui-egui/src/i18n/sv.tsv | 6 ++++++ crates/ui-egui/src/i18n/tests.rs | 2 +- crates/ui-egui/src/i18n/tr.tsv | 6 ++++++ crates/ui-egui/src/i18n/uk.tsv | 6 ++++++ crates/ui-egui/src/i18n/vi.tsv | 6 ++++++ crates/ui-egui/src/i18n/zh-hans.tsv | 6 ++++++ crates/ui-egui/src/i18n/zh-hant.tsv | 6 ++++++ 29 files changed, 171 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index d087d39eb1..b53ebee4bb 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6576,6 +6576,12 @@ axis Y Axis Y ос Overlay Glaze Глазура прекриване Screen Light Светлина екран Soft Light Wash Лавиране мека светлина + Cyan Neon Циан неон + Magenta Laser Магента лазер + Amber Tube Кехлибарена тръба + Electric Lime Електрически лайм + Pulse Violet Пулсиращо виолетово + Cobalt Phosphor Кобалтов фосфор Burst Взрив Rounded Square Закръглен квадрат Sun Слънце diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index b9dcce9306..580ba40fa7 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6629,6 +6629,12 @@ axis Y Axis Y osa Overlay Glaze Glazura prekrivanja Screen Light Svjetlo ekrana Soft Light Wash Laviranje mekim svjetlom + Cyan Neon Cijan neon + Magenta Laser Magenta laser + Amber Tube Jantarna cijev + Electric Lime Električna limeta + Pulse Violet Pulsirajuća ljubičasta + Cobalt Phosphor Kobaltni fosfor Burst Prasak Rounded Square Zaobljeni kvadrat Sun Sunce diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index da1e5d9d7c..e0c2f24488 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4289,6 +4289,12 @@ digits Malayalam Malaiàlam Overlay Glaze Veladura superposició Screen Light Llum pantalla Soft Light Wash Aiguada llum suau + Cyan Neon Neó cian + Magenta Laser Làser magenta + Amber Tube Tub ambre + Electric Lime Llima elèctrica + Pulse Violet Violeta polsant + Cobalt Phosphor Fòsfor cobalt Burst Esclat Rounded Square Quadrat arrodonit Sun Sol diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 8735250f67..1acb611f10 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7182,6 +7182,12 @@ axis Y Axis osa Y Overlay Glaze Glazura překrytí Screen Light Světlo závoje Soft Light Wash Lavírka měkkého světla + Cyan Neon Azurový neon + Magenta Laser Purpurový laser + Amber Tube Jantarová trubice + Electric Lime Elektrická limetková + Pulse Violet Pulzující fialová + Cobalt Phosphor Kobaltový luminofor Burst Výbuch Rounded Square Zaoblený čtverec Sun Slunce diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 8dda384bda..be532d49ba 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7262,6 +7262,12 @@ axis Y Axis Y-akse Overlay Glaze Overlejringsglasur Screen Light Skærmlys Soft Light Wash Blødt lys-lavering + Cyan Neon Cyan neon + Magenta Laser Magenta laser + Amber Tube Ravfarvet rør + Electric Lime Elektrisk lime + Pulse Violet Pulserende violet + Cobalt Phosphor Koboltfosfor Burst Udbrud Rounded Square Afrundet kvadrat Sun Sol diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 5d55e89fd2..f73be8d89a 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6769,6 +6769,12 @@ axis Y Axis Y-Achse Overlay Glaze Ineinanderkopieren-Lasur Screen Light Negativ-multiplizieren-Licht Soft Light Wash Weiches-Licht-Lavierung + Cyan Neon Cyan-Neon + Magenta Laser Magenta-Laser + Amber Tube Bernsteinröhre + Electric Lime Elektrisches Limettengrün + Pulse Violet Pulsierendes Violett + Cobalt Phosphor Kobalt-Phosphor Burst Strahlenkranz Rounded Square Abgerundetes Quadrat Sun Sonne diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index c899490936..1e5f32a9e1 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7150,6 +7150,12 @@ axis Y Axis Άξονας Y Overlay Glaze Βερνίκι επικάλυψης Screen Light Φως αρνητικού πολλαπλασιασμού Soft Light Wash Αραίωση απαλού φωτός + Cyan Neon Κυανό νέον + Magenta Laser Ματζέντα λέιζερ + Amber Tube Κεχριμπαρένιος σωλήνας + Electric Lime Ηλεκτρικό λάιμ + Pulse Violet Παλλόμενο βιολετί + Cobalt Phosphor Φωσφόρος κοβαλτίου Burst Έκρηξη Rounded Square Στρογγυλεμένο τετράγωνο Sun Ήλιος diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 49d0c6e3b3..7ead144f0a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7138,6 +7138,12 @@ axis Y Axis Eje Y Overlay Glaze Veladura superponer Screen Light Luz trama Soft Light Wash Aguada luz suave + Cyan Neon Neón cian + Magenta Laser Láser magenta + Amber Tube Tubo ámbar + Electric Lime Lima eléctrica + Pulse Violet Violeta pulsante + Cobalt Phosphor Fósforo cobalto Burst Estallido Rounded Square Cuadrado redondeado Sun Sol diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 691653e8f1..a09bf9a5ab 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7227,6 +7227,12 @@ axis Y Axis Y-akseli Overlay Glaze Sulautus-lasite Screen Light Rasteri-valo Soft Light Wash Pehmeä valo -laveeraus + Cyan Neon Syaani neon + Magenta Laser Magenta laser + Amber Tube Meripihkaputki + Electric Lime Sähköinen lime + Pulse Violet Sykkivä violetti + Cobalt Phosphor Kobolttifosfori Burst Purkaus Rounded Square Pyöristetty neliö Sun Aurinko diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 263a8622be..ff1676c1c9 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7177,6 +7177,12 @@ axis Y Axis Axe Y Overlay Glaze Glacis incrustation Screen Light Lumière superposition Soft Light Wash Lavis lumière tamisée + Cyan Neon Néon cyan + Magenta Laser Laser magenta + Amber Tube Tube ambre + Electric Lime Citron vert électrique + Pulse Violet Violet pulsé + Cobalt Phosphor Phosphore cobalt Burst Éclat Rounded Square Carré arrondi Sun Soleil diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index fd09b9eb9f..842bdc94af 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4819,6 +4819,12 @@ swatch [Registration] [રજિસ્ટ્રેશન] Shield Buff ઢાલ બફ Sketchy Line સ્કેચ જેવી રેખા Soft Light Wash સૉફ્ટ લાઇટ વૉશ + Cyan Neon સાયન નિયૉન + Magenta Laser મજેન્ટા લેસર + Amber Tube એમ્બર ટ્યૂબ + Electric Lime ઇલેક્ટ્રિક લાઇમ + Pulse Violet પલ્સ વાયોલેટ + Cobalt Phosphor કોબાલ્ટ ફૉસ્ફર Soft Shadow નરમ પડછાયો Spiral Copies સર્પાકાર નકલો Spotlight સ્પોટલાઇટ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index f643c33fc2..a53397eefc 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -555,13 +555,13 @@ antiAlias Sharp शार्प Complementary Coral कोरल, पूरक Split Complementary Coral कोरल, विभाजित पूरक Analogous Coral कोरल, अनुरूप - Triad Coral कोरल, त्रिदाद + Triad Coral कोरल, त्रिक Tetrad Coral कोरल, चतुष्क Pentagram Coral कोरल, पेंटाग्राम Complementary Teal टील, पूरक Split Complementary Teal टील, विभाजित पूरक Analogous Teal टील, अनुरूप - Triad Teal टील, त्रिदाद + Triad Teal टील, त्रिक Tetrad Teal टील, चतुष्क Pentagram Teal टील, पेंटाग्राम Soft Spectrum सॉफ़्ट स्पेक्ट्रम @@ -700,6 +700,12 @@ antiAlias Sharp शार्प Overlay Glaze ओवरले ग्लेज़ Screen Light स्क्रीन रोशनी Soft Light Wash सॉफ़्ट लाइट वॉश + Cyan Neon सियान नियॉन + Magenta Laser मैजेंटा लेज़र + Amber Tube एम्बर ट्यूब + Electric Lime इलेक्ट्रिक लाइम + Pulse Violet पल्स वायलेट + Cobalt Phosphor कोबाल्ट फ़ॉस्फ़र Burst विस्फोट Rounded Square गोल कोनों वाला वर्ग Sun सूरज diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a47ff5a67c..8f7aa069a4 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7166,6 +7166,12 @@ axis Y Axis Y tengely Overlay Glaze Átfedés máz Screen Light Képernyő fény Soft Light Wash Lágy fény lavírozás + Cyan Neon Ciánneon + Magenta Laser Bíbor lézer + Amber Tube Borostyáncső + Electric Lime Elektromos lime + Pulse Violet Pulzáló ibolya + Cobalt Phosphor Kobaltfoszfor Burst Robbanás Rounded Square Lekerekített négyzet Sun Nap diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 7054d5be7d..4e0f52973f 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6592,6 +6592,12 @@ axis Y Axis Sumbu Y Overlay Glaze Glasir menimpa Screen Light Cahaya layar Soft Light Wash Sapuan cahaya lembut + Cyan Neon Neon sian + Magenta Laser Laser magenta + Amber Tube Tabung amber + Electric Lime Limau elektrik + Pulse Violet Ungu berdenyut + Cobalt Phosphor Fosfor kobalt Burst Ledakan Rounded Square Persegi bulat Sun Matahari diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 7dd799183f..22eb5bb03d 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6805,6 +6805,12 @@ axis Y Axis Asse Y Overlay Glaze Velatura sovrapponi Screen Light Luce schermo Soft Light Wash Acquerello luce soffusa + Cyan Neon Neon ciano + Magenta Laser Laser magenta + Amber Tube Tubo ambra + Electric Lime Lime elettrico + Pulse Violet Viola pulsante + Cobalt Phosphor Fosforo cobalto Burst Esplosione Rounded Square Quadrato arrotondato Sun Sole diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 6a6bfdb3ba..e35ed53f37 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8682,6 +8682,12 @@ axis Y Axis Y 軸 Overlay Glaze オーバーレイの釉 Screen Light スクリーンの光 Soft Light Wash ソフトライトのにじみ + Cyan Neon シアンのネオン + Magenta Laser マゼンタのレーザー + Amber Tube 琥珀色の管 + Electric Lime エレクトリックライム + Pulse Violet 脈打つ紫 + Cobalt Phosphor コバルトの蛍光体 Burst バースト Rounded Square 角丸の正方形 Sun 太陽 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d97b37ceb1..9ec433bc5e 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -8869,7 +8869,6 @@ axis Y Axis Y ღერძი Checkpoint საკონტროლო წერტილი Inventory Icons ინვენტარის ხატულები Skill Icons უნარების ხატულები - Weather Icons ამინდის ხატულები Attack შეტევა Defend თავდაცვა Heal განკურნება @@ -9178,8 +9177,6 @@ axis Y Axis Y ღერძი Pinched Stripes შევიწროებული ზოლები Chevron Pulse შევრონების პულსი Radiating Lenses მანათობელი ლინზები - Soft Shadow რბილი ჩრდილი - Hard Shadow მკვეთრი ჩრდილი Lifted Card აწეული ბარათი Neon Tube ნეონის მილი Inner Light შიდა სინათლე @@ -9223,6 +9220,12 @@ axis Y Axis Y ღერძი Overlay Glaze გადაფარვის ჭიქური Screen Light ეკრანის სინათლე Soft Light Wash რბილი სინათლის რეცხვა + Cyan Neon ციანის ნეონი + Magenta Laser მაჯენტას ლაზერი + Amber Tube ქარვისფერი მილი + Electric Lime ელექტრული ლაიმი + Pulse Violet მფეთქავი იისფერი + Cobalt Phosphor კობალტის ფოსფორი Burst აფეთქება Rounded Square მომრგვალებული კვადრატი Sun მზე diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 84a7d94c83..e7329f15b0 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6769,6 +6769,12 @@ axis Y Axis Y축 Overlay Glaze 오버레이 유약 Screen Light 스크린 빛 Soft Light Wash 소프트 라이트 번짐 + Cyan Neon 시안 네온 + Magenta Laser 마젠타 레이저 + Amber Tube 호박색 튜브 + Electric Lime 일렉트릭 라임 + Pulse Violet 펄스 바이올렛 + Cobalt Phosphor 코발트 형광체 Burst 폭발 Rounded Square 둥근 사각형 Sun 해 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ce1aec987b..5414354757 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9087,6 +9087,12 @@ axis Y Axis Y-as Overlay Glaze Bedekken-glazuur Screen Light Scherm-licht Soft Light Wash Zacht-licht-wassing + Cyan Neon Cyaan neon + Magenta Laser Magenta laser + Amber Tube Amberkleurige buis + Electric Lime Elektrisch limoen + Pulse Violet Pulserend violet + Cobalt Phosphor Kobaltfosfor Burst Uitbarsting Rounded Square Afgerond vierkant Sun Zon diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 70e62e5286..780575fa3b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -7036,6 +7036,12 @@ axis Y Axis Oś Y Overlay Glaze Glazura nakładki Screen Light Światło mnożenia odwrotnego Soft Light Wash Lawowanie łagodnym światłem + Cyan Neon Cyjanowy neon + Magenta Laser Karmazynowy laser + Amber Tube Bursztynowa rura + Electric Lime Elektryczna limonka + Pulse Violet Pulsujący fiolet + Cobalt Phosphor Kobaltowy luminofor Burst Wybuch Rounded Square Zaokrąglony kwadrat Sun Słońce diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 372c1b3cfd..709adb3b67 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7094,6 +7094,12 @@ axis Y Axis Eixo Y Overlay Glaze Veladura Sobrepor Screen Light Luz Tela Soft Light Wash Aguada Luz Suave + Cyan Neon Neon Ciano + Magenta Laser Laser Magenta + Amber Tube Tubo Âmbar + Electric Lime Lima Elétrica + Pulse Violet Violeta Pulsante + Cobalt Phosphor Fósforo Cobalto Burst Explosão Rounded Square Quadrado Arredondado Sun Sol diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index b7d0a48e08..b800c3313b 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6806,6 +6806,12 @@ axis Y Axis Ось Y Overlay Glaze Глазурь перекрытия Screen Light Свет растра Soft Light Wash Размывка мягким светом + Cyan Neon Голубой неон + Magenta Laser Пурпурный лазер + Amber Tube Янтарная трубка + Electric Lime Электрический лайм + Pulse Violet Пульсирующий фиолетовый + Cobalt Phosphor Кобальтовый люминофор Burst Вспышка Rounded Square Скруглённый квадрат Sun Солнце diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 6b4f7603b8..cc46477bc6 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7170,6 +7170,12 @@ axis Y Axis Y-axel Overlay Glaze Överlägg-glasyr Screen Light Skärm-ljus Soft Light Wash Mjukt ljus-lavering + Cyan Neon Cyan neon + Magenta Laser Magenta laser + Amber Tube Bärnstensrör + Electric Lime Elektrisk lime + Pulse Violet Pulserande violett + Cobalt Phosphor Koboltfosfor Burst Utbrott Rounded Square Rundad kvadrat Sun Sol diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index a83eb27724..b8897c7954 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -522,7 +522,7 @@ fn built_in_library_style_names_are_in_complete_catalogs() { .flat_map(|(_, lib)| lib.styles.iter().map(|s| s.name.clone()).collect::<Vec<_>>()) .collect(), ); - assert_eq!(names.len(), 80, "{names:?}"); + assert_eq!(names.len(), 86, "{names:?}"); let bad = lacking(&names, |c, n| c.plain(n).is_some()); assert!(bad.is_empty(), "{}", bad.join("\n")); } diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 11099c1b8d..ff3da24de9 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9060,6 +9060,12 @@ axis Y Axis Y ekseni Overlay Glaze Kaplama Sırı Screen Light Ekran Işığı Soft Light Wash Yumuşak Işık Lavisi + Cyan Neon Camgöbeği Neon + Magenta Laser Macenta Lazer + Amber Tube Kehribar Tüp + Electric Lime Elektrik Yeşili + Pulse Violet Nabız Moru + Cobalt Phosphor Kobalt Fosfor Burst Patlama Rounded Square Yuvarlatılmış Kare Sun Güneş diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 562245ed70..1df6cbd780 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6787,6 +6787,12 @@ axis Y Axis Вісь Y Overlay Glaze Глазур накладання Screen Light Світло екрана Soft Light Wash Розмивка м’яким світлом + Cyan Neon Блакитний неон + Magenta Laser Пурпуровий лазер + Amber Tube Бурштинова трубка + Electric Lime Електричний лайм + Pulse Violet Пульсуючий фіолетовий + Cobalt Phosphor Кобальтовий люмінофор Burst Спалах Rounded Square Округлений квадрат Sun Сонце diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index c6f1533a1c..2d7c49765e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6804,6 +6804,12 @@ axis Y Axis Trục Y Overlay Glaze Men phủ lên Screen Light Ánh màn hình Soft Light Wash Loang ánh sáng mềm + Cyan Neon Neon lục lam + Magenta Laser Laser đỏ tươi + Amber Tube Ống hổ phách + Electric Lime Chanh điện + Pulse Violet Tím nhấp nháy + Cobalt Phosphor Lân quang coban Burst Bùng nổ Rounded Square Hình vuông bo góc Sun Mặt trời diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c5db33421c..29cbfdc990 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -7020,6 +7020,12 @@ axis Y Axis Y 轴 Overlay Glaze 叠加釉 Screen Light 滤色光 Soft Light Wash 柔光晕染 + Cyan Neon 青色霓虹 + Magenta Laser 品红激光 + Amber Tube 琥珀灯管 + Electric Lime 电光青柠 + Pulse Violet 脉冲紫 + Cobalt Phosphor 钴蓝荧光 Burst 爆发 Rounded Square 圆角正方形 Sun 太阳 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 05c7a69919..52e6fd7579 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6828,6 +6828,12 @@ axis Y Axis Y 軸 Overlay Glaze 覆蓋釉 Screen Light 濾色光 Soft Light Wash 柔光暈染 + Cyan Neon 青色霓虹 + Magenta Laser 洋紅雷射 + Amber Tube 琥珀燈管 + Electric Lime 電光萊姆 + Pulse Violet 脈衝紫 + Cobalt Phosphor 鈷藍螢光 Burst 爆發 Rounded Square 圓角正方形 Sun 太陽 From 0f5a12b58d3f7ad4e8a8882775101375a58e181a Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 08:38:52 -0800 Subject: [PATCH 043/247] Pathfinder: Make Compound Shape warns when a line adds no area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A compound shape closes the open paths in it, so a straight line encloses no area and contributes no area to the shape. Make Compound Shape (and Alt-clicking a Shape Mode) still makes the shape as before, and now returns a warning, shown in the status bar, when a member is or holds an open path that encloses no area once closed, a line inside a group or a compound path included. The warning names Object › Path › Outline Stroke. A self-crossing open path is measured by its fill rule, so a bow tie whose signed area is zero gives no warning. The warning has a row in each complete-message catalog. Reported in #7849. --- crates/engine/src/cmd.rs | 3 + crates/engine/src/cmd/compoundshape.rs | 37 ++++++++- crates/engine/src/tests/compound_shape.rs | 91 +++++++++++++++++++++++ crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tests.rs | 11 +++ crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 4 +- 29 files changed, 167 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index c6aed0a644..98d3ed9b20 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -861,6 +861,9 @@ pub use xform::{AppearanceAttrs, EyedropperAttrs, EyedropperOptions, FillAttrs, /// The shape modes of the selected compound-shape members (the Pathfinder panel lights theirs). pub use compoundshape::selected_member_modes; +/// Make Compound Shape's warning when a member is an open path that encloses no area. +pub use compoundshape::OPEN_PATHS_ADD_NO_AREA; + /// Pathfinder Options (`Prefs::pathfinder`). pub use pathops::{PATHFINDER_PRECISION_RANGE, PathfinderOptions}; diff --git a/crates/engine/src/cmd/compoundshape.rs b/crates/engine/src/cmd/compoundshape.rs index bc93b399a5..74257b528f 100644 --- a/crates/engine/src/cmd/compoundshape.rs +++ b/crates/engine/src/cmd/compoundshape.rs @@ -8,6 +8,8 @@ use std::sync::Arc; use serde_json::{Value, json}; use vectorcraft_doc::{Document, Node, NodeId, NodeKind, ShapeMode}; +use vectorcraft_geom::{FillRule, PathData}; +use vectorcraft_pathops as po; use vectorcraft_render::effects; use super::edit::{roots_of, selected_roots}; @@ -16,6 +18,10 @@ use super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_multi}; const MODE_NAMES: [&str; 4] = ["add", "subtract", "intersect", "exclude"]; +/// Make Compound Shape's warning, which the status bar shows, when a member holds a line or another +/// open path that encloses no area once closed, and so contributes no area to the shape. +pub const OPEN_PATHS_ADD_NO_AREA: &str = "a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first"; + pub fn specs() -> Vec<CommandSpec> { vec![ cmd!( @@ -23,7 +29,7 @@ pub fn specs() -> Vec<CommandSpec> { "Make Compound Shape", ["Window", "Pathfinder"], None, - "{ids?: [id…] (selected first; default: the selection), mode?: \"add\"|\"subtract\"|\"intersect\"|\"exclude\" (default add; Alt-clicking a Shape Mode button gives its mode)} the two or more selected objects (paths, compound paths, groups, compound shapes, type, blends, envelopes) become the members of one compound shape, each with the shape mode, in their stacking order where the frontmost was: it draws as the area they make from the backmost up (open paths closed; a blend as its steps, an envelope as its distorted art, an object with a warp or other geometry effect as it draws), painted with the appearance and transparency of the topmost member in Add, Intersect or Exclude mode (with every member in Subtract, the backmost), and the members stay editable (Direct Selection, Layers panel, isolation mode) → {id}", + "{ids?: [id…] (selected first; default: the selection), mode?: \"add\"|\"subtract\"|\"intersect\"|\"exclude\" (default add; Alt-clicking a Shape Mode button gives its mode)} the two or more selected objects (paths, compound paths, groups, compound shapes, type, blends, envelopes) become the members of one compound shape, each with the shape mode, in their stacking order where the frontmost was: it draws as the area they make from the backmost up (open paths closed; a blend as its steps, an envelope as its distorted art, an object with a warp or other geometry effect as it draws), painted with the appearance and transparency of the topmost member in Add, Intersect or Exclude mode (with every member in Subtract, the backmost), and the members stay editable (Direct Selection, Layers panel, isolation mode) → {id, warning?: when a member is or holds a line or another open path that encloses no area once closed, and so contributes no area}", has_multi, make ), @@ -157,6 +163,7 @@ fn make(s: &mut Session, p: &Value) -> Result<Value> { // all have `mode`, the topmost, or the backmost when they all subtract. let order: Vec<&Node> = if mode == ShapeMode::Subtract { members } else { members.into_iter().rev().collect() }; let hook = |c: &Node| effects::outline_object(Some(d), c); + let no_area = order.iter().any(|n| adds_no_area(d, n, &hook)); let style = order.into_iter().find_map(|n| top_style(d, n, &hook)); let id = s.edit("Make Compound Shape", |d, sel| { let gid = d.alloc_id(); @@ -179,7 +186,33 @@ fn make(s: &mut Session, p: &Value) -> Result<Value> { sel.set([id]); Ok(id) })?; - Ok(json!({ "id": id.0 })) + let mut out = json!({ "id": id.0 }); + if no_area { + out["warning"] = json!(OPEN_PATHS_ADD_NO_AREA); + } + Ok(out) +} + +/// Member `n` holds an open path that adds no area to a compound shape: one of the paths it takes +/// part as ([`effects::member_leaves`]), inside a group or a compound path too, has an open subpath +/// that encloses no area once closed (a straight line, or an evenodd contour traced twice). The area +/// is the one the path's fill rule gives, which also keeps a self-crossing path whose signed area +/// is zero (a bow tie) from the warning, as Divide measures it. +fn adds_no_area(d: &Document, n: &Node, hook: effects::OutlineHook) -> bool { + effects::member_leaves(Some(d), n, Some(hook)).iter().any(|leaf| { + let (paths, rule): (Vec<&PathData>, FillRule) = match &leaf.kind { + NodeKind::Compound { children, rule } => (children.iter().filter_map(|c| c.path_data()).collect(), *rule), + NodeKind::Path { path, rule, .. } => (vec![path], *rule), + _ => return false, + }; + paths.iter().flat_map(|p| &p.subpaths).filter(|sp| !sp.closed).any(|sp| { + let mut closed = sp.clone(); + closed.closed = true; + // The signed-area test alone only holds for nonzero: evenodd can fill nothing where + // the signed area is not zero (a contour traced twice). + !(rule == FillRule::NonZero && po::encloses_area(sp)) && po::area(&PathData::single(closed), rule) <= 0.0 + }) + }) } /// The paint and transparency of the frontmost shape `n` adds to a compound shape's area, from the diff --git a/crates/engine/src/tests/compound_shape.rs b/crates/engine/src/tests/compound_shape.rs index 3f027254b0..8127ea5bcb 100644 --- a/crates/engine/src/tests/compound_shape.rs +++ b/crates/engine/src/tests/compound_shape.rs @@ -696,3 +696,94 @@ fn a_locked_or_hidden_layer_keeps_the_isolated_compound_shape_from_clicks() { assert!(selected(&s).is_empty(), "{prop}: nor by a marquee"); } } + +/// A straight line, closed as a compound shape closes open paths, encloses no area, so it +/// contributes no area to the shape: Make Compound Shape still makes it, in any mode and at any +/// place in the stack, and its reply carries a warning that names Outline Stroke. The shape draws +/// the area the other members make in that mode: the square alone in Add, or on top in Subtract, +/// and nothing in Intersect or when the line is the backmost member in Subtract. A line in a group, +/// beside a closed path too, and an open evenodd square traced twice are the same. An open path that encloses an area once closed (a bow tie +/// whose lobes cancel in signed area included) and closed shapes alone give no warning (#7849). +#[test] +fn lines_that_add_no_area_are_reported() { + use crate::cmd::OPEN_PATHS_ADD_NO_AREA; + fn line_of(s: &mut Session) -> NodeId { + NodeId(run(s, "shape.line", json!({"x1": 20, "y1": 50, "x2": 180, "y2": 50}))["id"].as_u64().unwrap()) + } + fn vee_of(s: &mut Session) -> NodeId { + let anchors = json!([{"x": 20, "y": 50}, {"x": 100, "y": 150}, {"x": 180, "y": 50}]); + NodeId(run(s, "path.create", json!({ "anchors": anchors }))["id"].as_u64().unwrap()) + } + fn bow_tie_of(s: &mut Session) -> NodeId { + let anchors = json!([{"x": 20, "y": 0}, {"x": 180, "y": 100}, {"x": 180, "y": 0}, {"x": 20, "y": 100}]); + NodeId(run(s, "path.create", json!({ "anchors": anchors }))["id"].as_u64().unwrap()) + } + fn twice_around_of(s: &mut Session) -> NodeId { + let d = "M20 20 L80 20 L80 80 L20 80 L20 20 L80 20 L80 80 L20 80"; + let id = NodeId(run(s, "path.create", json!({ "d": d }))["id"].as_u64().unwrap()); + run(s, "path.setFillRule", json!({"rule": "evenOdd"})); + id + } + fn group_of(s: &mut Session, ids: &[NodeId]) -> NodeId { + run(s, "select.set", json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})); + NodeId(run(s, "object.group", json!({}))["id"].as_u64().unwrap()) + } + type Build = fn(&mut Session) -> NodeId; + // (case, mode, the other member, whether it goes behind the 100 pt square, warned, area drawn) + type Case = (&'static str, &'static str, Build, bool, bool, Option<f64>); + let cases: [Case; 11] = [ + ("an open evenodd square traced twice", "add", twice_around_of, false, true, Some(10_000.0)), + ("a line", "add", line_of, false, true, Some(10_000.0)), + ("a line, subtracting", "subtract", line_of, false, true, Some(10_000.0)), + ("a line, intersecting", "intersect", line_of, false, true, Some(0.0)), + ("a line behind, subtracting", "subtract", line_of, true, true, Some(0.0)), + ( + "a group of lines", + "add", + |s| { + let ids = [line_of(s), line_of(s)]; + group_of(s, &ids) + }, + false, + true, + Some(10_000.0), + ), + ( + "a group of a line and a square", + "add", + |s| { + let ids = [line_of(s), square(s, 200.0, "#00ff00")]; + group_of(s, &ids) + }, + false, + true, + Some(20_000.0), + ), + ("an open path that encloses an area", "add", vee_of, false, false, None), + ("an open bow tie, whose signed area is zero", "add", bow_tie_of, false, false, None), + ("a square", "add", |s| square(s, 50.0, "#0000ff"), false, false, Some(15_000.0)), + ("a square, subtracting", "subtract", |s| square(s, 50.0, "#0000ff"), false, false, Some(5_000.0)), + ]; + for (what, mode, build, behind, warned, want) in cases { + let mut s = Session::new(); + run(&mut s, "file.new", json!({"width": 400, "height": 300})); + let (back, front) = if behind { + let other = build(&mut s); + (other, square(&mut s, 0.0, "#ff0000")) + } else { + let sq = square(&mut s, 0.0, "#ff0000"); + (sq, build(&mut s)) + }; + run(&mut s, "select.set", json!({"ids": [back.0, front.0]})); + let r = run(&mut s, "object.compoundShape.make", json!({ "mode": mode })); + let id = NodeId(r["id"].as_u64().unwrap_or_else(|| panic!("{what}: {r}"))); + assert_eq!(node(&s, id).children().unwrap().len(), 2, "{what}: both are members"); + assert_eq!(r.get("warning").and_then(Value::as_str), warned.then_some(OPEN_PATHS_ADD_NO_AREA), "{what}: {r}"); + if let Some(want) = want { + let d = &s.doc().unwrap().doc; + let hook = |c: &Node| effects::outline_object(Some(d), c); + let got = effects::compound_shape_area(None, &node(&s, id), Some(&hook)).map_or(0.0, |p| area(&p)); + assert!((got - want).abs() < 0.5, "{what}: draws {got}, not {want}"); + } + } +} diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index f98daa7f92..123c568192 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7771,3 +7771,4 @@ breakText Glyphs Glifs @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} píxels és massa gran per a Targa (com a màxim 65535 píxels per costat): reduïu la resolució @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} píxels és massa gran per a PSD (com a màxim {MAX_SIDE} píxels per costat): reduïu la resolució @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línia o un altre traçat obert que no tanca cap àrea no aporta cap àrea a la forma composta; per incloure’l, apliqueu-hi primer Objecte › Traçat › Contorneja el traç diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index b174608032..00bdc239f9 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9198,6 +9198,7 @@ breakText Glyphs Glyfy @msg the character's size can't be measured velikost znaku nelze změřit @msg the code runs past its last instruction kód běží za svou poslední instrukci @msg the compound shape is too complex to expand složený tvar je příliš složitý na rozložení +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first čára nebo jiná otevřená cesta, která neohraničuje žádnou plochu, nepřidá složenému tvaru žádnou plochu; chcete-li ji zahrnout, použijte na ni nejprve Objekt › Cesta › Převést tah na obrys @msg the container of the listed objects is gone kontejner uvedených objektů už neexistuje @msg the copy `{user_id}` can't be read as a library kopii `{user_id}` nelze přečíst jako knihovnu @msg the copy would leave the canvas kopie by opustila plátno diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 0ae36e3699..447632af9e 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7681,3 +7681,4 @@ breakText Glyphs Glyffer Nest Shapes Pak figurer tæt Roll Rulle @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first en linje eller anden åben kurve, der ikke omslutter noget område, tilføjer intet område til den sammensatte figur; anvend først Objekt › Kurve › Streg til kontur på den for at tage den med diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 99e487ecb1..f27e8ad350 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -8741,6 +8741,7 @@ breakText Glyphs Glyphen @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size die Zeichenflächen passen nicht auf die Arbeitsfläche: weniger Zeichenflächen, weniger Abstand oder eine kleinere Größe @msg the character's size can't be measured die Größe des Zeichens kann nicht gemessen werden @msg the compound shape is too complex to expand die zusammengesetzte Form ist zu komplex zum Umwandeln +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first eine Linie oder ein anderer offener Pfad, der keine Fläche umschließt, trägt keine Fläche zur zusammengesetzten Form bei; um ihn einzubeziehen, wenden Sie zuerst Objekt › Pfad › Konturlinie darauf an @msg the container of the listed objects is gone der Container der aufgelisteten Objekte ist nicht mehr vorhanden @msg the copy `{user_id}` can't be read as a library die Kopie `{user_id}` kann nicht als Bibliothek gelesen werden @msg the copy would leave the canvas die Kopie würde die Arbeitsfläche verlassen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 7fe692d27e..5c3596686f 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7745,3 +7745,4 @@ breakText Glyphs Γλύφοι @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution τα {width} × {height} εικονοστοιχεία είναι υπερβολικό μέγεθος για Targa (το πολύ 65535 εικονοστοιχεία ανά πλευρά): μειώστε την ανάλυση @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution τα {w} × {h} εικονοστοιχεία είναι υπερβολικό μέγεθος για PSD (το πολύ {MAX_SIDE} εικονοστοιχεία ανά πλευρά): μειώστε την ανάλυση @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first μια γραμμή ή άλλη ανοιχτή διαδρομή που δεν περικλείει εμβαδόν δεν προσθέτει εμβαδόν στο σύνθετο σχήμα· για να τη συμπεριλάβετε, εφαρμόστε της πρώτα Αντικείμενο › Διαδρομή › Μετατροπή περιγράμματος σε διαδρομή diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f0a5d12844..d3416d928f 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7732,3 +7732,4 @@ breakText Glyphs Glifos Nest Shapes Anidar formas Roll Rollo @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línea u otro trazado abierto que no encierra ningún área no aporta ningún área a la forma compuesta; para incluirlo, aplícale primero Objeto › Trazado › Contornear trazo diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 718b99ea1b..be6b4be6c1 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7828,3 +7828,4 @@ breakText Glyphs Merkit @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} pikseliä on liian suuri Targa-kuvalle (enintään 65535 pikseliä sivua kohti): pienennä tarkkuutta @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pikseliä on liian suuri PSD-kuvalle (enintään {MAX_SIDE} pikseliä sivua kohti): pienennä tarkkuutta @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first viiva tai muu avoin polku, joka ei rajaa aluetta, ei lisää yhdistelmämuotoon aluetta; jos haluat sisällyttää sen, käytä siihen ensin komentoa Objekti › Polku › Ääriviivaa viiva diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 6b946a7f1e..4e3fedef24 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9059,6 +9059,7 @@ breakText Glyphs Glyphes @msg the character's size can't be measured la taille du caractère ne peut pas être mesurée @msg the code runs past its last instruction le code s’exécute au-delà de sa dernière instruction @msg the compound shape is too complex to expand la forme composée est trop complexe pour être décomposée +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first une ligne ou un autre tracé ouvert qui n’entoure aucune surface n’ajoute aucune surface à la forme composée ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour @msg the container of the listed objects is gone le conteneur des objets listés a disparu @msg the copy `{user_id}` can't be read as a library la copie `{user_id}` ne peut pas être lue comme une bibliothèque @msg the copy would leave the canvas la copie sortirait de la zone de travail diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 2bb71a0b45..4263661e34 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8229,6 +8229,7 @@ antiAlias Sharp शार्प @msg the CMYK image couldn't be written CMYK इमेज को नहीं लिखा जा सकता @msg the Color Picker is not open रंग पिकर खुला नहीं है @msg the compound shape is too complex to expand मिश्रित आकार का विस्तार करने के लिए बहुत जटिल है +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first कोई रेखा या अन्य खुला पाथ जो कोई क्षेत्र नहीं घेरता, मिश्रित आकार में कोई क्षेत्र नहीं जोड़ता; इसे शामिल करने के लिए पहले उस पर ऑब्जेक्ट › पाथ › स्ट्रोक को आउटलाइन में बदलें लागू करें @msg the compressed file unpacks to more than {_1} MB संकुचित फ़ाइल {_1} MB से अधिक के लिए अनपैक @msg the compressed file unpacks to more than VectorCraft reads ({_1} MB of document, {_2} MB per image) संपीड़ित फ़ाइल खुलकर उससे बड़ी हो जाती है जितना VectorCraft पढ़ता है (डॉक्यूमेंट के {_1} MB, हर इमेज के {_2} MB) @msg the container of the listed objects is gone सूचीबद्ध ऑब्जेक्ट्स का कंटेनर चला गया है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 253e8f6764..ce74a3a071 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9069,6 +9069,7 @@ breakText Glyphs Glifák @msg the character's size can't be measured a karakter mérete nem mérhető meg @msg the code runs past its last instruction a kód túlfut az utolsó utasításán @msg the compound shape is too complex to expand az összetett alakzat túl bonyolult a kibontáshoz +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first egy vonal vagy más nyitott útvonal, amely nem zár közre területet, nem ad területet az összetett alakzathoz; a felvételéhez előbb alkalmazza rá az Objektum › Útvonal › Körvonal útvonallá alakítása parancsot @msg the container of the listed objects is gone a felsorolt objektumok tárolója már nincs meg @msg the copy `{user_id}` can't be read as a library a másolat nem olvasható be könyvtárként: `{user_id}` @msg the copy would leave the canvas a másolat kikerülne a vászonról diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index b0ef62f97a..4d3ba9de5d 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -8791,6 +8791,7 @@ breakText Glyphs Glifi @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size le tavole da disegno non entrano nell'area di lavoro: usa meno tavole da disegno, una spaziatura minore o una dimensione più piccola @msg the character's size can't be measured impossibile misurare la dimensione del carattere @msg the compound shape is too complex to expand la forma composta è troppo complessa da espandere +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una linea o un altro tracciato aperto che non racchiude alcuna area non aggiunge alcuna area alla forma composta; per includerlo, applica prima Oggetto › Tracciato › Contorna traccia @msg the container of the listed objects is gone il contenitore degli oggetti elencati non esiste più @msg the copy `{user_id}` can't be read as a library la copia `{user_id}` non può essere letta come libreria @msg the copy would leave the canvas la copia uscirebbe dall'area di lavoro diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ed4981b977..5d2a4487e4 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -7992,6 +7992,7 @@ axis Y Axis Y 軸 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size アートボードがキャンバスに収まりません: アートボードの数を減らすか、間隔またはサイズを小さくしてください @msg the character's size can't be measured 文字のサイズを計測できません @msg the compound shape is too complex to expand 複合シェイプが複雑すぎて拡張できません +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 領域を囲まない直線などのオープンパスは、複合シェイプに領域を加えません。含めるには、先にそのパスに「オブジェクト › パス › パスのアウトライン」を適用してください @msg the container of the listed objects is gone 指定したオブジェクトを含むコンテナがなくなりました @msg the copy `{user_id}` can't be read as a library コピー `{user_id}` をライブラリとして読み込めません @msg the copy would leave the canvas コピーがキャンバスからはみ出します diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 358960bd37..b218a84b52 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1553,6 +1553,7 @@ @msg the color book is cut short ფერთა წიგნი შეკვეცილია @msg the color book's names take more than {_1} MB ფერთა წიგნის სახელები {_1} MB-ზე მეტს იკავებს @msg the compound shape is too complex to expand შედგენილი ფიგურა ზედმეტად რთულია გასაშლელად +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first ხაზი ან სხვა ღია ტრაექტორია, რომელიც ფართობს არ შემოსაზღვრავს, შედგენილ ფიგურას ფართობს არ უმატებს; მის ჩასართავად ჯერ გამოიყენეთ ობიექტი › ტრაექტორია › კონტურის ფიგურად გარდაქმნა @msg the container of the listed objects is gone ჩამოთვლილი ობიექტების კონტეინერი აღარ არსებობს @msg the copy `{user_id}` can't be read as a library ასლის `{user_id}` ბიბლიოთეკად წაკითხვა შეუძლებელია @msg the copy would leave the canvas ასლი ტილოს გარეთ გავიდოდა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index cd7130d7ef..36f5ee2fac 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -8796,6 +8796,7 @@ breakText Glyphs 글리프 @msg the character's size can't be measured 글자의 크기를 잴 수 없습니다 @msg the code runs past its last instruction 코드가 마지막 명령을 지나 실행됩니다 @msg the compound shape is too complex to expand 컴파운드 모양이 너무 복잡해서 확장할 수 없습니다 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 영역을 둘러싸지 않는 선이나 기타 열린 패스는 컴파운드 모양에 영역을 더하지 않습니다. 포함하려면 먼저 개체 › 패스 › 선 윤곽선화를 적용하세요 @msg the container of the listed objects is gone 나열한 개체의 컨테이너가 없어졌습니다 @msg the copy `{user_id}` can't be read as a library 복사본 `{user_id}`을(를) 라이브러리로 읽을 수 없습니다 @msg the copy would leave the canvas 복사본이 캔버스를 벗어납니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 101d37b1e6..1be0b7a1e0 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -7119,6 +7119,7 @@ imageTrace Outline Contour @msg the character's size can't be measured de grootte van het teken kan niet worden gemeten @msg the code runs past its last instruction de code loopt voorbij de laatste instructie @msg the compound shape is too complex to expand de samengestelde vorm is te complex om uit te breiden +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first een lijn of ander open pad dat geen oppervlak omsluit, voegt geen oppervlak toe aan de samengestelde vorm; pas er eerst Object › Pad › Contour omzetten op toe om het op te nemen @msg the container of the listed objects is gone de container van de vermelde objecten is verdwenen @msg the copy `{user_id}` can't be read as a library de kopie `{user_id}` kan niet als bibliotheek worden gelezen @msg the copy would leave the canvas de kopie zou buiten het canvas vallen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f5db22b1be..3531ca7f7f 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9031,6 +9031,7 @@ breakText Glyphs Glify @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size obszary kompozycji nie mieszczą się na płótnie: użyj mniejszej liczby obszarów, mniejszych odstępów lub mniejszego rozmiaru @msg the character's size can't be measured nie można zmierzyć rozmiaru znaku @msg the compound shape is too complex to expand kształt złożony jest zbyt skomplikowany, aby go rozszerzyć +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first linia lub inna otwarta ścieżka, która nie obejmuje żadnego obszaru, nie dodaje obszaru do kształtu złożonego; aby ją uwzględnić, najpierw zastosuj do niej Obiekt › Ścieżka › Obrys konturu @msg the container of the listed objects is gone kontener wymienionych obiektów już nie istnieje @msg the copy `{user_id}` can't be read as a library kopii `{user_id}` nie można odczytać jako biblioteki @msg the copy would leave the canvas kopia wykroczyłaby poza płótno diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index a2b5cd06ba..9e9a3565c4 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9259,6 +9259,7 @@ swatch Yellow Green Verde-amarelado @msg the character's size can't be measured não é possível medir o tamanho do caractere @msg the code runs past its last instruction o código passa da última instrução @msg the compound shape is too complex to expand a forma composta é complexa demais para expandir +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first uma linha ou outro caminho aberto que não envolve nenhuma área não acrescenta nenhuma área à forma composta; para incluí-lo, aplique primeiro Objeto › Caminho › Contornar Traçado a ele @msg the container of the listed objects is gone o contêiner dos objetos listados não existe mais @msg the copy `{user_id}` can't be read as a library a cópia `{user_id}` não pode ser lida como uma biblioteca @msg the copy would leave the canvas a cópia sairia da tela diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e5113d70ba..c69c294274 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9179,6 +9179,7 @@ shape Open Открытый @msg the character's size can't be measured размер символа невозможно измерить @msg the code runs past its last instruction код выполняется дальше своей последней инструкции @msg the compound shape is too complex to expand составная фигура слишком сложна, чтобы её разобрать +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first линия или другой открытый контур, не охватывающий площади, не добавляет площади к составной фигуре; чтобы включить его, сначала примените к нему Объект › Контур › Обвести обводку @msg the container of the listed objects is gone контейнер перечисленных объектов больше не существует @msg the copy `{user_id}` can't be read as a library копию `{user_id}` невозможно прочитать как библиотеку @msg the copy would leave the canvas копия вышла бы за пределы холста diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index e344e63b8f..1eb63b7f21 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -8725,6 +8725,7 @@ digits Hindi Hindi @msg the character's size can't be measured tecknets storlek kan inte mätas @msg the CMYK image couldn't be written CMYK-bilden kunde inte skrivas @msg the compound shape is too complex to expand den sammansatta formen är för komplex för att expanderas +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first en linje eller annan öppen bana som inte omsluter någon yta lägger inte till någon yta i den sammansatta formen; för att ta med den, använd först Objekt › Bana › Konvertera kontur till form på den @msg the container of the listed objects is gone behållaren för de listade objekten finns inte längre @msg the copy `{user_id}` can't be read as a library kopian `{user_id}` kan inte läsas som ett bibliotek @msg the copy would leave the canvas kopian skulle hamna utanför arbetsytan diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index b632e5cac3..2f89cb8894 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -451,6 +451,17 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() { } } +/// Make Compound Shape's warning for a member that adds no area, which the status bar shows and +/// the message scan doesn't read, is translated in each language of [`COMPLETE_MESSAGES`]. +#[test] +fn compound_shape_no_area_warning_is_translated() { + let warning = vectorcraft_engine::cmd::OPEN_PATHS_ADD_NO_AREA; + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + assert_ne!(message(lang, warning), warning, "{code}"); + } +} + /// The Window › Brush Libraries menu, built from the built-in library table, names each library. #[test] fn built_in_brush_library_names_are_in_complete_catalogs() { diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index c999e476e1..cad99b3afd 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -8371,6 +8371,7 @@ axis Y Axis Y ekseni @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size çalışma yüzeyleri tuvale sığmıyor: daha az çalışma yüzeyi, daha az aralık veya daha küçük bir boyut kullanın @msg the character's size can't be measured karakterin boyutu ölçülemiyor @msg the compound shape is too complex to expand bileşik şekil genişletilemeyecek kadar karmaşık +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first alan çevrelemeyen bir çizgi veya başka bir açık yol bileşik şekle hiçbir alan eklemez; dahil etmek için önce ona Nesne › Yol › Anahat Konturu uygulayın @msg the container of the listed objects is gone listelenen nesnelerin kapsayıcısı artık yok @msg the copy `{user_id}` can't be read as a library `{user_id}` kopyası bir kütüphane olarak okunamıyor @msg the copy would leave the canvas kopya tuvalin dışına çıkardı diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index f4aed127a4..c7fcbad04b 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -8793,6 +8793,7 @@ breakText Glyphs Гліфи @msg the character's size can't be measured розмір символу не можна виміряти @msg the code runs past its last instruction код виконується далі своєї останньої інструкції @msg the compound shape is too complex to expand складена фігура занадто складна для розбирання +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first лінія чи інший відкритий контур, що не охоплює площі, не додає площі до складеної фігури; щоб включити його, спершу застосуйте до нього Об’єкт › Контур › Обвести обведення @msg the container of the listed objects is gone контейнера перелічених об’єктів більше немає @msg the copy `{user_id}` can't be read as a library копію `{user_id}` не вдалося прочитати як бібліотеку @msg the copy would leave the canvas копія вийшла б за межі полотна diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 5a901079b3..cd59268ed1 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7402,3 +7402,4 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first một đường thẳng hoặc đường dẫn mở khác không bao quanh vùng nào sẽ không thêm vùng nào vào hình phức hợp; để đưa nó vào, trước tiên hãy áp dụng Đối tượng › Đường dẫn › Đường bao nét cho nó diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 8d4c110afd..887664579b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9017,6 +9017,7 @@ breakText Glyphs 字形 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size 画板在画布上放不下:请减少画板、缩小间距或减小尺寸 @msg the character's size can't be measured 无法测量该字符的大小 @msg the compound shape is too complex to expand 复合形状过于复杂,无法扩展 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 直线或其他不围成区域的开放路径不会为复合形状增加任何区域;要包含它,请先对其应用“对象 › 路径 › 轮廓化描边” @msg the container of the listed objects is gone 所列对象的容器已不存在 @msg the copy `{user_id}` can't be read as a library 副本 `{user_id}` 无法作为库读取 @msg the copy would leave the canvas 副本会超出画布 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 30da93ab71..5ebec809e5 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -8945,6 +8945,7 @@ breakText Glyphs 字符 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size 工作區域無法容納於畫布:請減少工作區域、縮小間距或縮小尺寸 @msg the character's size can't be measured 無法測量字元的大小 @msg the compound shape is too complex to expand 複合形狀過於複雜,無法展開 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 直線或其他不圍成區域的開放路徑不會為複合形狀增加任何區域;若要納入,請先對其套用「物件 › 路徑 › 外框筆畫」 @msg the container of the listed objects is gone 所列物件的容器已不存在 @msg the copy `{user_id}` can't be read as a library 複本 `{user_id}` 無法讀取為資料庫 @msg the copy would leave the canvas 複本會超出畫布 diff --git a/docs/mcp.md b/docs/mcp.md index c38d6fc7a2..f4fc94e310 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5076,7 +5076,9 @@ envelopes) the members of one live compound shape, each in shape mode `mode` (`" as its steps, an envelope as its distorted art, an object with a warp or another geometry effect as it draws, each updated when the member is edited), painted with its own appearance, which it takes from the topmost member not in Subtract (with every member subtracting, the backmost); a -fill or stroke given to it or to a member paints the compound shape. The members stay editable (Direct Selection, +fill or stroke given to it or to a member paints the compound shape. Open paths are closed, so a straight line encloses +no area and contributes no area to the shape. When a member is or holds such a path, the reply's `warning` says so +and names Object › Path › Outline Stroke. The members stay editable (Direct Selection, the Layers panel, isolation mode). `object.compoundShape.setMode {mode, ids?}` sets the mode of the members the selection is or is in, `object.compoundShape.release` gives the members back as they were, and `object.compoundShape.expand` turns each compound shape into the path, or compound path, of its area. A saved file From 9389acc81e9a256d469834e75f6ebc531b5c165e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 09:23:53 -0800 Subject: [PATCH 044/247] i18n: drop Spanish catalog rows main already has Main added Spanish rows for ten of the dialog-answer messages this branch also translates. The branch's copies are removed so each message has one row and bundled_catalogs_are_consistent passes; main's translations are identical. --- crates/ui-egui/src/i18n/es.tsv | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f8070aa2dd..84ab97441e 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7752,9 +7752,6 @@ breakText Glyphs Glifos @msg `alignOn` must be a string `alignOn` debe ser una cadena @msg `align` must be a string `align` debe ser una cadena @msg `answer` for this {kind} dialog must be one of: {_1} `answer` para este cuadro de diálogo {kind} debe ser uno de: {_1} -@msg `answers` has more than {MAX_ANSWERS} answers `answers` tiene más de {MAX_ANSWERS} respuestas -@msg `answers` is larger than 1 MiB `answers` ocupa más de 1 MiB -@msg `answers` must be a list of answers `answers` debe ser una lista de respuestas @msg `artboard` must be the index of an artboard of the document `artboard` debe ser el índice de una mesa de trabajo del documento @msg `artboardsAt` must be [x, y] `artboardsAt` debe ser [x, y] @msg `artboards` names an artboard the document does not have `artboards` nombra una mesa de trabajo que el documento no tiene @@ -7924,10 +7921,6 @@ breakText Glyphs Glifos @msg invalid regular expression flag '{_1}' indicador de expresión regular no válido '{_1}' @msg invalid regular expression: {m} expresión regular no válida: {m} @msg invalid time value valor de tiempo no válido -@msg is a confirm's answer, whose `value` must be true or false es la respuesta de un confirm, cuyo `value` debe ser true o false -@msg is a prompt's answer, whose `value` must be a string or null es la respuesta de un prompt, cuyo `value` debe ser una cadena o null -@msg is an alert's answer, whose `value` must be "ok" es la respuesta de un alert, cuyo `value` debe ser "ok" -@msg is longer than 16 KiB ocupa más de 16 KiB @msg it draws its image through a clipping path dibuja su imagen a través de un trazado de recorte @msg it draws no image no dibuja ninguna imagen @msg it is larger than {MAX_DICTIONARY_FILE_BYTES} bytes ocupa más de {MAX_DICTIONARY_FILE_BYTES} bytes @@ -7945,9 +7938,6 @@ breakText Glyphs Glifos @msg localize: the first argument must be a localization object or a string localize: el primer argumento debe ser un objeto de localización o una cadena @msg missing `picks` falta `picks` @msg missing `word` falta `word` -@msg must be an object with `kind` and `value` debe ser un objeto con `kind` y `value` -@msg must have `kind` alert, confirm or prompt debe tener `kind` alert, confirm o prompt -@msg must have exactly `kind` and `value` debe tener exactamente `kind` y `value` @msg needs a closing quote after the name necesita unas comillas de cierre después del nombre @msg needs a name necesita un nombre @msg needs a name of at most 64 bytes necesita un nombre de como máximo 64 bytes From f026c911591d1623be19baae4753e9b4e73b1388 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 09:50:19 -0800 Subject: [PATCH 045/247] Flare: shape.editFlare's rotation says it turns the rays clockwise The engine's turn-direction check requires every rotation param to say which way it turns. shape.editFlare's rotation is shape.flare's setting, which turns the rays clockwise. --- crates/engine/src/cmd/create.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/create.rs b/crates/engine/src/cmd/create.rs index cb0ef7a6a5..b0bce422ee 100644 --- a/crates/engine/src/cmd/create.rs +++ b/crates/engine/src/cmd/create.rs @@ -62,7 +62,7 @@ pub fn specs() -> Vec<CommandSpec> { "Edit Flare", [], None, - "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation?, pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", + "{ids?|id?: flares (default: the selected flares), cx?, cy? (the center, where it is drawn now), x2?, y2? (the rings' end point, where it is drawn now; else pathLength at direction from the center, both where it is drawn now, when either is given; else where it was), diameter?, opacity?, brightness?, growth?, fuzziness?, rays?, longest?, rayFuzziness?, rotation? (deg, turns the rays clockwise), pathLength?, rings?, largest?, direction? (as shape.flare: what is left out stays as it was)} draws each flare again in its place, moved, scaled, rotated, reflected or sheared as it has been since it was drawn, as one undo step (none when nothing changes); a flare whose parts were edited, or that is locked or hidden, is not one → {ids}", has_doc, super::flare::edit_flare ), From 22f68ebb8d3e571eb8905018388caecf64e83261 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 10:41:07 -0800 Subject: [PATCH 046/247] Flare: shape.editFlare refuses an end point that is not finite On a flare scaled far down, a large pathLength gave an end point that overflowed when taken back to where the flare was drawn. The settings then stored the end point as null, and the flare was drawn again with the default path. shape.flare and shape.editFlare now return an error naming x2 or y2 instead. --- crates/engine/src/cmd/flare.rs | 13 +++++++++++-- crates/engine/src/tests.rs | 13 +++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/flare.rs b/crates/engine/src/cmd/flare.rs index 187496f137..05b25421eb 100644 --- a/crates/engine/src/cmd/flare.rs +++ b/crates/engine/src/cmd/flare.rs @@ -36,6 +36,15 @@ fn count_or(p: &Value, key: &str, default: u64, cmd: &str) -> Result<u64> { } } +/// `end`, the rings' end point, or an error naming `x2` or `y2` when that coordinate is not a +/// finite number (a `pathLength` so large that the end point overflows). +fn finite_end(end: Point, cmd: &str) -> Result<Point> { + match [("x2", end.x), ("y2", end.y)].into_iter().find(|(_, v)| !v.is_finite()) { + None => Ok(end), + Some((key, _)) => Err(bad(cmd, format!("{key} must be a finite coordinate"))), + } +} + /// `shape.flare`'s params `p` with every setting given: the defaults filled in, the counts at most /// 50 and the rings' end point as `x2`, `y2` (from `pathLength` and `direction` when `p` gives no /// end point), with `ringSeed` when `p` gives one. @@ -60,7 +69,7 @@ fn settings_of(p: &Value, cmd: &str) -> Result<Value> { (Some(x), Some(y)) => Point::new(x, y), _ => { let a = f64_or(p, "direction", 45.0).to_radians(); - c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0) + finite_end(c + Vec2::new(a.cos(), -a.sin()) * f64_or(p, "pathLength", 300.0), cmd)? } }; let mut v = json!({ "cx": c.x, "cy": c.y, "x2": end.x, "y2": end.y, "rays": rays, "rings": rings, "seed": seed }); @@ -173,7 +182,7 @@ fn edited(old: &Value, p: &Value, xf: Affine) -> Result<Value> { let (c, e) = (xf * centre, xf * old_end); let d = e - c; let a = number_or(p, "direction", (-d.y).atan2(d.x).to_degrees(), C)?.to_radians(); - inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?) + finite_end(inv * (c + Vec2::new(a.cos(), -a.sin()) * number_or(p, "pathLength", d.hypot(), C)?), C)? } // Moving the center leaves the rings' end point where it is. None => old_end, diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 10c7069ce0..09b78d8a89 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -3360,6 +3360,19 @@ fn flare_counts_are_whole_numbers() { assert!(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 2.5})).is_err()); } +/// `shape.editFlare` on a flare scaled far down: a `pathLength` whose end point, taken back to +/// where the flare was drawn, is not a finite number is an error, and the flare keeps its settings. +#[test] +fn edit_flare_end_points_that_are_not_finite_are_errors() { + let mut s = session(); + let id = NodeId(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rings": 2})).unwrap()["id"].as_u64().unwrap()); + s.execute("object.scale", &json!({"sx": 1e-4, "sy": 1e-4})).unwrap(); + let before = flare_settings(&s.doc().unwrap().doc, id).expect("a flare"); + let err = s.execute("shape.editFlare", &json!({"pathLength": 1e305})).unwrap_err().to_string(); + assert!(err.ends_with("x2 must be a finite coordinate"), "{err}"); + assert_eq!(flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"), before); +} + /// A flare drawn again keeps its parts' pixel-aligned property, whatever the document's Align New /// Objects to Pixel Grid is now, and a pixel-aligned flare that was moved is still a flare. #[test] From 0cf59a764990de4ffebb3a34d257bf51d3e41d99 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 09:52:48 -0800 Subject: [PATCH 047/247] Shortcuts: a tool or command can have a hold shortcut that runs when its key is held MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit › Keyboard Shortcuts gets a Hold Shortcuts checkbox, off by default, with a ? button that explains it. While it is off, the dialog has no Hold column and every key runs on its press as before. While it is on, the dialog shows a Hold column and the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s), and a letter, digit or punctuation key, alone or with Shift, can hold a tool or command. Held for the delay, the key runs its hold shortcut once and its repeats are ignored until it is let go; a quicker press runs what the key runs without one, at the release. Another key, or Cmd, Ctrl or Alt, ends the wait first; focus loss, a dialog, a text field, Presentation Mode or an input method composition ends it without running anything. A hold on a letter alone leaves the letter with Shift as it is, and a key the active tool uses itself (E with the Extend Path tool) does not wait. A tool key with a hold shortcut runs the hold instead of choosing its tool temporarily (`holdToolKeys`). Preferences › General › Options lists both settings too, with the delay dimmed while Hold Shortcuts is off. Hold shortcuts are stored apart from the shortcuts (`shortcut_holds`). `shortcuts.set` takes `hold`, `shortcuts.list` rows have `hold`, `shortcuts.conflicts` lists hold clashes, Export… writes `holds` and Import… reads it, and Export Text… adds a `Hold X` column while the checkbox is on. Reset to Defaults and the presets clear them. The new strings have rows in every catalog. --- crates/engine/src/cmd/prefscmds.rs | 2 + crates/engine/src/lib.rs | 2 +- crates/engine/src/prefs.rs | 24 + crates/engine/src/tests/prefs_file.rs | 21 + crates/mcp/src/ui_catalog.rs | 11 +- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/i18n/bg.tsv | 10 + crates/ui-egui/src/i18n/bs.tsv | 10 + crates/ui-egui/src/i18n/ca.tsv | 10 + crates/ui-egui/src/i18n/cs.tsv | 10 + crates/ui-egui/src/i18n/da.tsv | 10 + crates/ui-egui/src/i18n/de.tsv | 10 + crates/ui-egui/src/i18n/el.tsv | 10 + crates/ui-egui/src/i18n/es.tsv | 10 + crates/ui-egui/src/i18n/fi.tsv | 10 + crates/ui-egui/src/i18n/fr.tsv | 10 + crates/ui-egui/src/i18n/gu.tsv | 10 + crates/ui-egui/src/i18n/hi.tsv | 10 + crates/ui-egui/src/i18n/hu.tsv | 10 + crates/ui-egui/src/i18n/id.tsv | 10 + crates/ui-egui/src/i18n/it.tsv | 10 + crates/ui-egui/src/i18n/ja.tsv | 10 + crates/ui-egui/src/i18n/ka.tsv | 10 + crates/ui-egui/src/i18n/ko.tsv | 10 + crates/ui-egui/src/i18n/nl.tsv | 10 + crates/ui-egui/src/i18n/pl.tsv | 10 + crates/ui-egui/src/i18n/pt-br.tsv | 10 + crates/ui-egui/src/i18n/ru.tsv | 10 + crates/ui-egui/src/i18n/sv.tsv | 10 + crates/ui-egui/src/i18n/tr.tsv | 10 + crates/ui-egui/src/i18n/uk.tsv | 10 + crates/ui-egui/src/i18n/vi.tsv | 10 + crates/ui-egui/src/i18n/zh-hans.tsv | 10 + crates/ui-egui/src/i18n/zh-hant.tsv | 10 + crates/ui-egui/src/lib.rs | 3 + crates/ui-egui/src/menus/ui_commands.rs | 11 +- crates/ui-egui/src/prefs_dialog.rs | 12 + crates/ui-egui/src/prefs_dialog/tests.rs | 39 ++ crates/ui-egui/src/shortcut_editor.rs | 539 +++++++++++++++++- crates/ui-egui/src/shortcuts.rs | 89 ++- crates/ui-egui/src/shortcuts/hold_keys.rs | 321 +++++++++++ .../ui-egui/src/shortcuts/hold_keys/tests.rs | 517 +++++++++++++++++ crates/ui-egui/src/state.rs | 7 + docs/mcp.md | 32 +- docs/target-app-parity.md | 1 + 45 files changed, 1849 insertions(+), 63 deletions(-) create mode 100644 crates/ui-egui/src/shortcuts/hold_keys.rs create mode 100644 crates/ui-egui/src/shortcuts/hold_keys/tests.rs diff --git a/crates/engine/src/cmd/prefscmds.rs b/crates/engine/src/cmd/prefscmds.rs index b6c500749f..d255558e7b 100644 --- a/crates/engine/src/cmd/prefscmds.rs +++ b/crates/engine/src/cmd/prefscmds.rs @@ -156,6 +156,8 @@ pub const PREF_SPECS: &[PrefSpec] = &[ p!("scrubNumericFields", "General", "Options", "Scrub Numeric Fields by Dragging", bool), p!("trackpadRotateView", "General", "Options", "Trackpad Gesture to Rotate View", bool), p!("holdToolKeys", "General", "Options", "Hold a Tool Shortcut to Use the Tool Temporarily", bool), + p!("holdShortcuts", "General", "Options", "Hold Shortcuts", bool), + p!("keyHoldDelay", "General", "Options", "Hold Shortcut Delay", num(0.2, 1.0, "s")), p!("boundingBoxWhileMovingAndDrawing", "General", "Options", "Show Bounding Box While Moving and Drawing", bool), // Selection & Anchor Display p!("selectionTolerance", "Selection & Anchor Display", "Selection", "Tolerance", num(1.0, 8.0, "px")), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index aeb723c963..2b89a31966 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -408,7 +408,7 @@ use history::history_budget_for; pub use history::{History, HistoryEntry, NamedStep, default_history_budget}; pub(crate) use interaction::PreviewCopies; pub use interaction::{Interaction, LastTransform, UndoGroup, UndoScope}; -pub use prefs::{DrawMode, Prefs}; +pub use prefs::{DrawMode, KEY_HOLD_DELAY, KEY_HOLD_DELAY_RANGE, Prefs}; pub use sanity::TOO_DEEP; pub(crate) use sanity::{deselect_hidden, is_guide_path}; #[cfg(test)] diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 86525e9214..710604e524 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -71,6 +71,13 @@ pub struct Prefs { /// A single-key tool shortcut held down chooses its tool until the key is let go, and then the /// tool active before comes back; a quick press chooses the tool for good. pub hold_tool_keys: bool, + /// Hold shortcuts act (Edit › Keyboard Shortcuts › Hold Shortcuts, off by default): a key with a + /// hold shortcut runs it when held for [`Self::key_hold_delay`], and its own shortcut when let go + /// sooner. Off, every key runs on its press and the dialog shows no Hold column. + pub hold_shortcuts: bool, + /// Seconds a key with a hold shortcut must stay down before the hold shortcut runs (Hold + /// Shortcut Delay, 0.2 to 1.0). VectorCraft's own default, 0.35. + pub key_hold_delay: f64, /// With View › Show Bounding Box on, the bounding box stays visible while a drag moves the /// selection, and the shape tools that show it draw it around the shape being drawn. Off (the /// default), it hides during a move and while a shape is drawn, except that a Selection tool @@ -385,6 +392,21 @@ pub struct Prefs { pub import_matches: Vec<cmd::importmatches::ImportMatch>, } +/// The default Hold Shortcut Delay, in seconds (VectorCraft's own value). +pub const KEY_HOLD_DELAY: f64 = 0.35; +/// The range of the Hold Shortcut Delay, in seconds. +pub const KEY_HOLD_DELAY_RANGE: (f64, f64) = (0.2, 1.0); + +impl Prefs { + /// The Hold Shortcut Delay in seconds, inside its range. A restored settings file is not + /// checked against the range, so a value outside it is brought inside, and one that is not a + /// number gives the default. + pub fn key_hold_delay(&self) -> f64 { + let (min, max) = KEY_HOLD_DELAY_RANGE; + if self.key_hold_delay.is_finite() { self.key_hold_delay.clamp(min, max) } else { KEY_HOLD_DELAY } + } +} + impl Default for Prefs { fn default() -> Self { let s = |v: &str| v.to_string(); @@ -415,6 +437,8 @@ impl Default for Prefs { scrub_numeric_fields: true, trackpad_rotate_view: true, hold_tool_keys: true, + hold_shortcuts: false, + key_hold_delay: KEY_HOLD_DELAY, bounding_box_while_moving_and_drawing: false, paste_offset: 10.0, selection_tolerance: 3.0, diff --git a/crates/engine/src/tests/prefs_file.rs b/crates/engine/src/tests/prefs_file.rs index c2822ba937..bfe98b901b 100644 --- a/crates/engine/src/tests/prefs_file.rs +++ b/crates/engine/src/tests/prefs_file.rs @@ -176,3 +176,24 @@ fn a_file_over_the_limit_is_refused_before_it_is_parsed() { assert!(s.execute("prefs.import", &json!({"path": missing.to_string_lossy()})).is_err()); assert_eq!(s.prefs.to_json().to_string(), before); } + +/// Hold Shortcuts is off by default. The Hold Shortcut Delay takes 0.2 to 1.0 s and refuses other +/// values; a value from a settings file outside the range is brought inside it. +#[test] +fn hold_shortcut_preferences() { + let mut s = Session::new(); + assert!(!s.prefs.hold_shortcuts); + assert_eq!(s.prefs.key_hold_delay(), 0.35); + for ok in [0.2, 1.0] { + s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": ok})).unwrap(); + assert_eq!(s.prefs.key_hold_delay(), ok); + } + for bad in [0.1, 1.5] { + assert!(is_bad_params(s.execute("prefs.set", &json!({"key": "keyHoldDelay", "value": bad}))), "{bad}"); + } + s.execute("prefs.set", &json!({"key": "holdShortcuts", "value": true})).unwrap(); + assert!(s.prefs.hold_shortcuts); + let restored: Prefs = serde_json::from_value(json!({"keyHoldDelay": 5.0})).unwrap(); + assert_eq!(restored.key_hold_delay(), 1.0); + assert!(!restored.hold_shortcuts); +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 8e651622af..3774177db0 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -173,8 +173,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+I", "{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options", ), - ("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:<id>, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"), - ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"), + ( + "shortcuts.set", + "Set Keyboard Shortcut", + "", + "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + ), + ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), ("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"), ( @@ -188,7 +193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.exportText", "Export Keyboard Shortcuts as Text…", "", - "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none; without `path`, pick a file", + "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold <key>` column on a row with a hold shortcut; without `path`, pick a file", ), ("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"), ( diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index f708d0f454..e5f5cfc91c 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -191,6 +191,7 @@ impl VectorcraftApp { input_frames: vec![], shortcuts_frames: vec![], held_tool: Vec::new(), + hold_keys: Default::default(), synthetic_injected: false, injected_events: vec![], injected_generation: InputGeneration::default(), diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a6a69d9100..8b4fba95fc 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -7018,3 +7018,13 @@ breakText Glyphs Глифи Open a document to mark its fold lines. Отворете документ, за да отбележите линиите му на сгъване. Remove Fold Line Role Премахни вида на линията @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Tap Кратко натискане + Clear Hold Изчистване на задържането + Hold Shortcuts Комбинации със задържане + Hold Shortcut Delay Забавяне на комбинациите със задържане + How hold shortcuts work Как работят комбинациите със задържане + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щракнете и натиснете клавиш, който да се задържа за това (Esc отменя). Задържането на клавиша изпълнява това; краткото натискане изпълнява собствената комбинация на клавиша. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Краткото натискане на клавиш изпълнява неговата комбинация. Задържането на клавиша за времето на забавяне изпълнява вместо това инструмента или командата от колоната му „Задръжте“. Комбинация със задържане е клавиш с буква, цифра или препинателен знак, самостоятелно или с Shift. +@msg Hold {_1} is already used by {_2} Задържането на {_1} вече се използва от {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) комбинация със задържане е клавиш, който въвежда знак, самостоятелно или с Shift ({shown} съдържа Cmd, Ctrl или Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може да бъде комбинация със задържане: използвайте буква, цифра или препинателен знак diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 5da48b6cff..bbfca4e045 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -7071,3 +7071,13 @@ shape Open Otvoren Open a document to mark its fold lines. Otvorite dokument da označite njegove linije savijanja. Remove Fold Line Role Ukloni vrstu linije @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine" + Tap Kratki pritisak + Clear Hold Očisti zadržavanje + Hold Shortcuts Prečice zadržavanjem + Hold Shortcut Delay Kašnjenje prečica zadržavanjem + How hold shortcuts work Kako rade prečice zadržavanjem + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknite, zatim pritisnite tipku koju treba zadržati za ovo (Esc otkazuje). Zadržavanje tipke pokreće ovo; kratki pritisak pokreće vlastitu prečicu tipke. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kratki pritisak tipke pokreće njenu prečicu. Zadržavanje tipke tokom kašnjenja umjesto toga pokreće alat ili naredbu iz njene kolone Zadrži. Prečica zadržavanjem je tipka sa slovom, cifrom ili interpunkcijskim znakom, sama ili sa Shift. +@msg Hold {_1} is already used by {_2} Zadržavanje {_1} već koristi {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) prečica zadržavanjem je tipka koja upisuje znak, sama ili sa Shift ({shown} ima Cmd, Ctrl ili Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne može biti prečica zadržavanjem: koristite slovo, cifru ili interpunkcijsku tipku diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e861e61fec..91f334b451 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7793,3 +7793,13 @@ breakText Glyphs Glifs Open a document to mark its fold lines. Obre un document per marcar-ne les línies de plegat. Remove Fold Line Role Elimina el tipus de línia @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Tap Pulsació breu + Clear Hold Esborra la pulsació llarga + Hold Shortcuts Dreceres de pulsació llarga + Hold Shortcut Delay Retard de les dreceres de pulsació llarga + How hold shortcuts work Com funcionen les dreceres de pulsació llarga + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fes clic i prem una tecla per mantenir premuda per a això (Esc cancel·la). Mantenir premuda la tecla executa això; una pulsació breu executa la drecera pròpia de la tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsació breu d’una tecla executa la seva drecera. Mantenir premuda la tecla durant el retard executa en canvi l’eina o l’ordre de la seva columna Mantén. Una drecera de pulsació llarga és una tecla de lletra, xifra o puntuació, sola o amb Shift. +@msg Hold {_1} is already used by {_2} La pulsació llarga de {_1} ja la fa servir {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una drecera de pulsació llarga és una tecla que escriu un caràcter, sola o amb Shift ({shown} té Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no pot ser una drecera de pulsació llarga: fes servir una lletra, una xifra o una tecla de puntuació diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 1a4d359b93..eacda6ef61 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9613,3 +9613,13 @@ breakText Glyphs Glyfy No objects are selected. Nejsou vybrány žádné objekty. Open a document to mark its fold lines. Otevřete dokument, abyste označili jeho linie skladu. Remove Fold Line Role Odstranit typ linie + Tap Krátký stisk + Clear Hold Vymazat podržení + Hold Shortcuts Zkratky podržením + Hold Shortcut Delay Prodleva zkratek podržením + How hold shortcuts work Jak fungují zkratky podržením + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klikněte a stiskněte klávesu, kterou pro toto podržíte (Esc zruší). Podržení klávesy spustí toto; krátký stisk spustí vlastní zkratku klávesy. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krátký stisk klávesy spustí její zkratku. Podržení klávesy po dobu prodlevy místo toho spustí nástroj nebo příkaz z jejího sloupce Podržení. Zkratka podržením je klávesa s písmenem, číslicí nebo interpunkcí, samotná nebo se Shiftem. +@msg Hold {_1} is already used by {_2} Podržení {_1} už používá {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) zkratka podržením je klávesa, která píše znak, samotná nebo se Shiftem ({shown} obsahuje Cmd, Ctrl nebo Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nemůže být zkratkou podržením: použijte písmeno, číslici nebo interpunkční klávesu diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 723766f020..5ba395314d 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7703,3 +7703,13 @@ breakText Glyphs Glyffer Open a document to mark its fold lines. Åbn et dokument for at markere dets foldelinjer. Remove Fold Line Role Fjern linjetype @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" + Tap Kort tryk + Clear Hold Ryd hold + Hold Shortcuts Holdegenveje + Hold Shortcut Delay Forsinkelse for holdegenveje + How hold shortcuts work Sådan virker holdegenveje + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, og tryk derefter på en tast, der skal holdes nede for dette (Esc annullerer). Når tasten holdes nede, køres dette; et kort tryk kører tastens egen genvej. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Et kort tryk på en tast kører dens genvej. Når tasten holdes nede i forsinkelsens varighed, køres i stedet værktøjet eller kommandoen i dens Hold-kolonne. En holdegenvej er en bogstav-, ciffer- eller tegnsætningstast, alene eller med Shift. +@msg Hold {_1} is already used by {_2} Hold {_1} bruges allerede af {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) en holdegenvej er en tast, der skriver et tegn, alene eller med Shift ({shown} har Cmd, Ctrl eller Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan ikke være en holdegenvej: brug et bogstav, et ciffer eller en tegnsætningstast diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 21a07e09e5..113b51e3bd 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9211,3 +9211,13 @@ breakText Glyphs Glyphen No objects are selected. Es sind keine Objekte ausgewählt. Open a document to mark its fold lines. Öffnen Sie ein Dokument, um seine Faltlinien festzulegen. Remove Fold Line Role Linienart entfernen + Tap Kurz drücken + Clear Hold Halten löschen + Hold Shortcuts Halte-Tastaturbefehle + Hold Shortcut Delay Verzögerung für Halte-Tastaturbefehle + How hold shortcuts work So funktionieren Halte-Tastaturbefehle + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicken Sie und drücken Sie dann eine Taste, die hierfür gehalten werden soll (Esc bricht ab). Halten der Taste führt dies aus; kurzes Drücken führt den eigenen Tastaturbefehl der Taste aus. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kurzes Drücken einer Taste führt ihren Tastaturbefehl aus. Halten der Taste für die Dauer der Verzögerung führt stattdessen das Werkzeug oder den Befehl in ihrer Spalte „Halten“ aus. Ein Halte-Tastaturbefehl ist eine Buchstaben-, Ziffern- oder Satzzeichentaste, allein oder mit Shift. +@msg Hold {_1} is already used by {_2} Halten {_1} wird bereits von {_2} verwendet +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) Ein Halte-Tastaturbefehl ist eine Taste, die ein Zeichen eingibt, allein oder mit Shift ({shown} enthält Cmd, Ctrl oder Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kann kein Halte-Tastaturbefehl sein: Verwenden Sie einen Buchstaben, eine Ziffer oder eine Satzzeichentaste diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index ebd167f397..62a69a7f97 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7767,3 +7767,13 @@ breakText Glyphs Γλύφοι Open a document to mark its fold lines. Ανοίξτε ένα έγγραφο για να σημειώσετε τις γραμμές δίπλωσής του. Remove Fold Line Role Αφαίρεση τύπου γραμμής @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" + Tap Σύντομο πάτημα + Clear Hold Εκκαθάριση παρατεταμένου πατήματος + Hold Shortcuts Συντομεύσεις παρατεταμένου πατήματος + Hold Shortcut Delay Καθυστέρηση συντομεύσεων παρατεταμένου πατήματος + How hold shortcuts work Πώς λειτουργούν οι συντομεύσεις παρατεταμένου πατήματος + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Κάντε κλικ και πατήστε ένα πλήκτρο που θα κρατάτε πατημένο για αυτό (Esc για ακύρωση). Το παρατεταμένο πάτημα του πλήκτρου εκτελεί αυτό. Ένα σύντομο πάτημα εκτελεί τη συντόμευση του ίδιου του πλήκτρου. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ένα σύντομο πάτημα πλήκτρου εκτελεί τη συντόμευσή του. Αν κρατήσετε πατημένο το πλήκτρο για τον χρόνο καθυστέρησης, εκτελείται αντί γι’ αυτό το εργαλείο ή η εντολή της στήλης «Κρατήστε πατημένο». Μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο γράμματος, ψηφίου ή σημείου στίξης, μόνο του ή με Shift. +@msg Hold {_1} is already used by {_2} το παρατεταμένο πάτημα του {_1} χρησιμοποιείται ήδη από το {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) μια συντόμευση παρατεταμένου πατήματος είναι ένα πλήκτρο που πληκτρολογεί έναν χαρακτήρα, μόνο του ή με Shift (το {shown} έχει Cmd, Ctrl ή Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key το {shown} δεν μπορεί να είναι συντόμευση παρατεταμένου πατήματος: χρησιμοποιήστε γράμμα, ψηφίο ή πλήκτρο στίξης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 27d7d4aaf8..b4df50d6b1 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7754,3 +7754,13 @@ breakText Glyphs Glifos Open a document to mark its fold lines. Abre un documento para marcar sus líneas de plegado. Remove Fold Line Role Quitar tipo de línea @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Tap Pulsación breve + Clear Hold Borrar pulsación larga + Hold Shortcuts Métodos abreviados de pulsación larga + Hold Shortcut Delay Retardo de pulsación larga + How hold shortcuts work Cómo funcionan los métodos abreviados de pulsación larga + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Haz clic y presiona una tecla que mantener pulsada para esto (Esc cancela). Mantener pulsada la tecla ejecuta esto; una pulsación breve ejecuta el método abreviado propio de la tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pulsación breve de una tecla ejecuta su método abreviado. Mantener pulsada la tecla durante el retardo ejecuta en su lugar la herramienta o el comando de su columna Mantener pulsado. Un método abreviado de pulsación larga es una tecla de letra, dígito o puntuación, sola o con Shift. +@msg Hold {_1} is already used by {_2} La pulsación larga de {_1} ya la usa {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un método abreviado de pulsación larga es una tecla que escribe un carácter, sola o con Shift ({shown} tiene Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} no puede ser un método abreviado de pulsación larga: usa una letra, un dígito o una tecla de puntuación diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 3f29fd7f7a..fca0c1cda1 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7850,3 +7850,13 @@ breakText Glyphs Merkit Open a document to mark its fold lines. Avaa asiakirja, niin voit merkitä sen taittoviivat. Remove Fold Line Role Poista viivatyyppi @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" + Tap Lyhyt painallus + Clear Hold Tyhjennä pitkä painallus + Hold Shortcuts Pitkän painalluksen pikanäppäimet + Hold Shortcut Delay Pitkän painalluksen viive + How hold shortcuts work Näin pitkän painalluksen pikanäppäimet toimivat + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Napsauta ja paina sitten näppäintä, jota pidetään pohjassa tätä varten (Esc peruuttaa). Näppäimen pitäminen pohjassa suorittaa tämän; lyhyt painallus suorittaa näppäimen oman pikanäppäimen. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Näppäimen lyhyt painallus suorittaa sen pikanäppäimen. Kun näppäintä pidetään pohjassa viiveen ajan, suoritetaan sen sijaan sen Pidä pohjassa -sarakkeen työkalu tai komento. Pitkän painalluksen pikanäppäin on kirjain-, numero- tai välimerkkinäppäin yksin tai Shiftin kanssa. +@msg Hold {_1} is already used by {_2} Pitkä painallus {_1} on jo käytössä kohteella {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pitkän painalluksen pikanäppäin on merkin kirjoittava näppäin yksin tai Shiftin kanssa ({shown} sisältää Cmd-, Ctrl- tai Alt-näppäimen) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ei voi olla pitkän painalluksen pikanäppäin: käytä kirjainta, numeroa tai välimerkkinäppäintä diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 20e94749c5..e18a7cbda1 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9598,4 +9598,14 @@ breakText Glyphs Glyphes No objects are selected. Aucun objet n’est sélectionné. Open a document to mark its fold lines. Ouvrez un document pour marquer ses lignes de pliage. Remove Fold Line Role Supprimer le type de ligne + Tap Appui bref + Clear Hold Effacer le maintien + Hold Shortcuts Raccourcis de maintien + Hold Shortcut Delay Délai des raccourcis de maintien + How hold shortcuts work Fonctionnement des raccourcis de maintien + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Cliquez, puis appuyez sur une touche à maintenir pour cet élément (Échap annule). Maintenir la touche exécute cet élément ; un appui bref exécute le raccourci propre à la touche. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Un appui bref sur une touche exécute son raccourci. Maintenir la touche pendant le délai exécute à la place l’outil ou la commande de sa colonne Maintenir. Un raccourci de maintien est une touche de lettre, de chiffre ou de ponctuation, seule ou avec Maj. +@msg Hold {_1} is already used by {_2} Le maintien de {_1} est déjà utilisé par {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) un raccourci de maintien est une touche qui saisit un caractère, seule ou avec Maj ({shown} comporte Cmd, Ctrl ou Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ne peut pas être un raccourci de maintien : utilisez une lettre, un chiffre ou une touche de ponctuation @msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index ff59a464c5..814251df4f 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4798,3 +4798,13 @@ swatch [Registration] [રજિસ્ટ્રેશન] Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine" + Tap ટૂંકું દબાણ + Clear Hold હોલ્ડ સાફ કરો + Hold Shortcuts હોલ્ડ શોર્ટકટ + Hold Shortcut Delay હોલ્ડ શોર્ટકટ વિલંબ + How hold shortcuts work હોલ્ડ શોર્ટકટ કેવી રીતે કામ કરે છે + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. ક્લિક કરો, પછી આ માટે દબાવી રાખવાની કી દબાવો (Esc રદ કરે છે). કી દબાવી રાખવાથી આ ચાલે છે; ટૂંકું દબાણ કીનો પોતાનો શોર્ટકટ ચલાવે છે. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. કીને ટૂંકું દબાવવાથી તેનો શોર્ટકટ ચાલે છે. વિલંબ જેટલો સમય કી દબાવી રાખવાથી તેના બદલે તેની હોલ્ડ કૉલમમાંનું ટૂલ અથવા આદેશ ચાલે છે. હોલ્ડ શોર્ટકટ એ અક્ષર, અંક અથવા વિરામચિહ્નની કી છે, એકલી અથવા Shift સાથે. +@msg Hold {_1} is already used by {_2} હોલ્ડ {_1} પહેલેથી {_2} વાપરે છે +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) હોલ્ડ શોર્ટકટ એ અક્ષર લખતી કી છે, એકલી અથવા Shift સાથે ({shown} માં Cmd, Ctrl અથવા Alt છે) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} હોલ્ડ શોર્ટકટ ન હોઈ શકે: અક્ષર, અંક અથવા વિરામચિહ્નની કી વાપરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 6fe8f254f4..1e37429de3 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -9205,3 +9205,13 @@ theme Appearance अपीयरेंस No objects are selected. कोई ऑब्जेक्ट सिलेक्ट नहीं है। Open a document to mark its fold lines. फ़ोल्ड लाइनें मार्क करने के लिए कोई डॉक्यूमेंट ओपन करें। Remove Fold Line Role लाइन प्रकार हटाएँ + Tap जल्दी दबाना + Clear Hold होल्ड साफ़ करें + Hold Shortcuts होल्ड शॉर्टकट + Hold Shortcut Delay होल्ड शॉर्टकट विलंब + How hold shortcuts work होल्ड शॉर्टकट कैसे काम करते हैं + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. क्लिक करें, फिर इसके लिए दबाए रखने वाली कुंजी दबाएँ (Esc रद्द)। कुंजी दबाए रखने पर यह चलता है; जल्दी से दबाने पर कुंजी का अपना शॉर्टकट चलता है। + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. किसी कुंजी को जल्दी से दबाने पर उसका शॉर्टकट चलता है। कुंजी को विलंब जितनी देर दबाए रखने पर इसके बजाय उसके होल्ड कॉलम का टूल या कमांड चलता है। होल्ड शॉर्टकट कोई अक्षर, अंक या विराम चिह्न वाली कुंजी होती है, अकेले या Shift के साथ। +@msg Hold {_1} is already used by {_2} होल्ड {_1} का उपयोग पहले से ही {_2} द्वारा किया जाता है +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) होल्ड शॉर्टकट ऐसी कुंजी होती है जो अकेले या Shift के साथ कोई कैरेक्टर टाइप करती है ({shown} में Cmd, Ctrl या Alt है) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} होल्ड शॉर्टकट नहीं हो सकता: कोई अक्षर, अंक या विराम चिह्न वाली कुंजी उपयोग करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 4a93411b47..d6a795b6b1 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9601,3 +9601,13 @@ breakText Glyphs Glifák No objects are selected. Nincs kijelölt objektum. Open a document to mark its fold lines. Nyiss meg egy dokumentumot a hajtásvonalai megjelöléséhez. Remove Fold Line Role Vonaltípus eltávolítása + Tap Rövid lenyomás + Clear Hold Nyomva tartás törlése + Hold Shortcuts Nyomva tartásos billentyűparancsok + Hold Shortcut Delay Nyomva tartás késleltetése + How hold shortcuts work Így működnek a nyomva tartásos billentyűparancsok + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kattints, majd nyomd le a billentyűt, amelyet ehhez nyomva kell tartani (Esc: mégse). A billentyű nyomva tartása ezt futtatja; a rövid lenyomás a billentyű saját billentyűparancsát futtatja. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Egy billentyű rövid lenyomása a billentyűparancsát futtatja. Ha a késleltetés idejéig nyomva tartod, helyette a Nyomva tartás oszlopában lévő eszköz vagy parancs fut. Nyomva tartásos billentyűparancs lehet egy betű-, szám- vagy írásjelbillentyű, önmagában vagy Shifttel. +@msg Hold {_1} is already used by {_2} már foglalt: nyomva tartás {_1} (használja: {_2}) +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) a nyomva tartásos billentyűparancs egy karaktert beíró billentyű, önmagában vagy Shifttel ({shown} Cmd, Ctrl vagy Alt billentyűt tartalmaz) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nem lehet nyomva tartásos billentyűparancs: használj betű-, szám- vagy írásjelbillentyűt diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index bf029526f7..6c30d93fa3 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -7033,3 +7033,13 @@ breakText Glyphs Glif Open a document to mark its fold lines. Buka dokumen untuk menandai garis lipatnya. Remove Fold Line Role Hapus jenis garis @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine" + Tap Tekan singkat + Clear Hold Hapus Tahan + Hold Shortcuts Pintasan tahan + Hold Shortcut Delay Jeda pintasan tahan + How hold shortcuts work Cara kerja pintasan tahan + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik, lalu tekan tombol yang ditahan untuk ini (Esc membatalkan). Menahan tombol menjalankan ini; tekan singkat menjalankan pintasan milik tombol itu sendiri. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Tekan singkat sebuah tombol menjalankan pintasannya. Menahan tombol selama jeda menjalankan alat atau perintah di kolom Tahan sebagai gantinya. Pintasan tahan adalah tombol huruf, angka, atau tanda baca, sendiri atau dengan Shift. +@msg Hold {_1} is already used by {_2} Tahan {_1} sudah digunakan oleh {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) pintasan tahan adalah tombol yang mengetik karakter, sendiri atau dengan Shift ({shown} memakai Cmd, Ctrl, atau Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} tidak bisa menjadi pintasan tahan: gunakan huruf, angka, atau tombol tanda baca diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 360ec1d5ba..bc0c3854e8 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9245,3 +9245,13 @@ breakText Glyphs Glifi No objects are selected. Nessun oggetto selezionato. Open a document to mark its fold lines. Apri un documento per segnarne le linee di piega. Remove Fold Line Role Rimuovi tipo di linea + Tap Pressione breve + Clear Hold Cancella pressione prolungata + Hold Shortcuts Scorciatoie a pressione prolungata + Hold Shortcut Delay Ritardo delle scorciatoie a pressione prolungata + How hold shortcuts work Come funzionano le scorciatoie a pressione prolungata + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Fai clic, poi premi un tasto da tenere premuto per questo (Esc annulla). Tenere premuto il tasto esegue questo; una pressione breve esegue la scorciatoia del tasto stesso. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Una pressione breve di un tasto esegue la sua scorciatoia. Tenere premuto il tasto per la durata del ritardo esegue invece lo strumento o il comando della sua colonna Tieni premuto. Una scorciatoia a pressione prolungata è un tasto di lettera, cifra o punteggiatura, da solo o con Shift. +@msg Hold {_1} is already used by {_2} La pressione prolungata di {_1} è già usata da {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) una scorciatoia a pressione prolungata è un tasto che digita un carattere, da solo o con Shift ({shown} ha Cmd, Ctrl o Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} non può essere una scorciatoia a pressione prolungata: usa una lettera, una cifra o un tasto di punteggiatura diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 37089bb835..5262880734 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -9312,3 +9312,13 @@ breakText Glyphs 字形 No objects are selected. オブジェクトが選択されていません。 Open a document to mark its fold lines. ドキュメントを開くと折り線を設定できます。 Remove Fold Line Role 線種を解除 + Tap 短押し + Clear Hold 長押しを消去 + Hold Shortcuts 長押しショートカット + Hold Shortcut Delay 長押しショートカットの遅延 + How hold shortcuts work 長押しショートカットのしくみ + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. クリックしてから、これに使う長押しのキーを押します (Esc でキャンセル)。キーを長押しするとこれを実行し、短く押すとキー自体のショートカットを実行します。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. キーを短く押すと、そのショートカットを実行します。遅延の時間だけキーを押し続けると、代わりに長押し列のツールまたはコマンドを実行します。長押しショートカットには、文字、数字、句読点のキーを単独で、または Shift と組み合わせて使用できます。 +@msg Hold {_1} is already used by {_2} 長押し {_1} はすでに {_2} で使用されています +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 長押しショートカットは、文字を入力するキーを単独で、または Shift と組み合わせたものです ({shown} には Cmd、Ctrl、Alt のいずれかが含まれています) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} は長押しショートカットにできません: 文字、数字、句読点のいずれかのキーを使用してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 25fb4f87ed..759bc441c0 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9885,3 +9885,13 @@ font-script Japanese იაპონური Open a document to mark its fold lines. გახსენით დოკუმენტი მისი მოკეცვის ხაზების მოსანიშნად. Remove Fold Line Role ხაზის ტიპის მოხსნა @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine" + Tap მოკლე დაჭერა + Clear Hold ხანგრძლივი დაჭერის გასუფთავება + Hold Shortcuts ხანგრძლივი დაჭერის მალსახმობები + Hold Shortcut Delay ხანგრძლივი დაჭერის დაყოვნება + How hold shortcuts work როგორ მუშაობს ხანგრძლივი დაჭერის მალსახმობები + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. დაწკაპეთ, შემდეგ დააჭირეთ კლავიშს, რომელიც ამისთვის უნდა დაიჭიროთ (Esc აუქმებს). კლავიშის ხანგრძლივი დაჭერა ამას უშვებს; მოკლე დაჭერა კლავიშის საკუთარ მალსახმობს უშვებს. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. კლავიშის მოკლე დაჭერა მის მალსახმობს უშვებს. თუ კლავიშს დაყოვნების ხანგრძლივობით დაიჭერთ, ამის ნაცვლად გაეშვება მისი „დაჭერა“ სვეტის ხელსაწყო ან ბრძანება. ხანგრძლივი დაჭერის მალსახმობი არის ასოს, ციფრის ან სასვენი ნიშნის კლავიში, ცალკე ან Shift კლავიშთან ერთად. +@msg Hold {_1} is already used by {_2} ხანგრძლივი დაჭერა {_1} უკვე გამოიყენება ამისთვის: {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ხანგრძლივი დაჭერის მალსახმობი არის კლავიში, რომელიც სიმბოლოს წერს, ცალკე ან Shift კლავიშთან ერთად ({shown} შეიცავს Cmd, Ctrl ან Alt კლავიშს) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} ვერ იქნება ხანგრძლივი დაჭერის მალსახმობი: გამოიყენეთ ასო, ციფრი ან სასვენი ნიშნის კლავიში diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 0787180a1c..f482021c87 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9208,3 +9208,13 @@ breakText Glyphs 글리프 No objects are selected. 선택한 개체가 없습니다. Open a document to mark its fold lines. 접는 선을 지정하려면 문서를 여세요. Remove Fold Line Role 선 종류 제거 + Tap 짧게 누르기 + Clear Hold 길게 누르기 지우기 + Hold Shortcuts 길게 누르기 단축키 + Hold Shortcut Delay 길게 누르기 단축키 지연 시간 + How hold shortcuts work 길게 누르기 단축키 작동 방식 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 클릭한 다음 이 항목에 길게 누를 키를 누르세요 (Esc로 취소). 키를 길게 누르면 이 항목이 실행되고, 짧게 누르면 키 자체의 단축키가 실행됩니다. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 키를 짧게 누르면 해당 단축키가 실행됩니다. 지연 시간 동안 키를 누르고 있으면 대신 누르고 있기 열의 도구나 명령이 실행됩니다. 길게 누르기 단축키는 문자, 숫자 또는 문장 부호 키이며, 단독으로 또는 Shift와 함께 사용합니다. +@msg Hold {_1} is already used by {_2} 길게 누르기 {_1}은(는) 이미 {_2}에서 사용 중입니다 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 길게 누르기 단축키는 문자를 입력하는 키를 단독으로 또는 Shift와 함께 사용해야 합니다 ({shown}에 Cmd, Ctrl 또는 Alt가 있음) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown}은(는) 길게 누르기 단축키가 될 수 없습니다: 문자, 숫자 또는 문장 부호 키를 사용하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ab30a3639f..4c6a1784f8 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9646,3 +9646,13 @@ breakText Glyphs Glyphs No objects are selected. Er zijn geen objecten geselecteerd. Open a document to mark its fold lines. Open een document om de vouwlijnen te markeren. Remove Fold Line Role Lijnsoort verwijderen + Tap Kort drukken + Clear Hold Vasthouden wissen + Hold Shortcuts Vasthoudsneltoetsen + Hold Shortcut Delay Vertraging vasthoudsneltoetsen + How hold shortcuts work Zo werken vasthoudsneltoetsen + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klik en druk vervolgens een toets in die hiervoor wordt vastgehouden (Esc annuleert). De toets vasthouden voert dit uit; kort drukken voert de eigen sneltoets van de toets uit. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Kort drukken op een toets voert de sneltoets ervan uit. De toets vasthouden gedurende de vertraging voert in plaats daarvan het gereedschap of de opdracht in de kolom Houd uit. Een vasthoudsneltoets is een letter-, cijfer- of leestekentoets, alleen of met Shift. +@msg Hold {_1} is already used by {_2} Vasthouden {_1} wordt al gebruikt door {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) een vasthoudsneltoets is een toets die een teken typt, alleen of met Shift ({shown} bevat Cmd, Ctrl of Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan geen vasthoudsneltoets zijn: gebruik een letter, een cijfer of een leestekentoets diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 085935a9bd..598e2cc6eb 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9466,3 +9466,13 @@ breakText Glyphs Glify No objects are selected. Nie zaznaczono żadnych obiektów. Open a document to mark its fold lines. Otwórz dokument, aby oznaczyć jego linie zgięcia. Remove Fold Line Role Usuń rodzaj linii + Tap Krótkie naciśnięcie + Clear Hold Wyczyść przytrzymanie + Hold Shortcuts Skróty przytrzymania + Hold Shortcut Delay Opóźnienie skrótów przytrzymania + How hold shortcuts work Jak działają skróty przytrzymania + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Kliknij, a następnie naciśnij klawisz, który ma być przytrzymywany dla tego elementu (Esc anuluje). Przytrzymanie klawisza uruchamia ten element; krótkie naciśnięcie uruchamia własny skrót klawisza. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Krótkie naciśnięcie klawisza uruchamia jego skrót. Przytrzymanie klawisza przez czas opóźnienia uruchamia zamiast tego narzędzie lub polecenie z jego kolumny Przytrzymaj. Skrót przytrzymania to klawisz litery, cyfry lub znaku interpunkcyjnego, sam lub z Shift. +@msg Hold {_1} is already used by {_2} Przytrzymanie {_1} jest już używane przez {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) skrót przytrzymania to klawisz wpisujący znak, sam lub z Shift ({shown} zawiera Cmd, Ctrl lub Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} nie może być skrótem przytrzymania: użyj litery, cyfry lub klawisza interpunkcyjnego diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 0289161fe4..d2bb22f8be 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9684,3 +9684,13 @@ swatch Yellow Green Verde-amarelado No objects are selected. Nenhum objeto selecionado. Open a document to mark its fold lines. Abra um documento para marcar suas linhas de dobra. Remove Fold Line Role Remover Tipo de Linha + Tap Toque Rápido + Clear Hold Limpar Pressionamento Longo + Hold Shortcuts Atalhos de Pressionamento Longo + Hold Shortcut Delay Atraso dos Atalhos de Pressionamento Longo + How hold shortcuts work Como funcionam os atalhos de pressionamento longo + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Clique e depois pressione uma tecla para manter pressionada para isto (Esc cancela). Manter a tecla pressionada executa isto; um toque rápido executa o atalho da própria tecla. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Um toque rápido em uma tecla executa o atalho dela. Manter a tecla pressionada pelo tempo do atraso executa, em vez disso, a ferramenta ou o comando da coluna Manter pressionado. Um atalho de pressionamento longo é uma tecla de letra, número ou pontuação, sozinha ou com Shift. +@msg Hold {_1} is already used by {_2} O pressionamento longo de {_1} já é usado por {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) um atalho de pressionamento longo é uma tecla que digita um caractere, sozinha ou com Shift ({shown} tem Cmd, Ctrl ou Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} não pode ser um atalho de pressionamento longo: use uma letra, um número ou uma tecla de pontuação diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e45ac9423a..bd4c98a94a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9709,3 +9709,13 @@ shape Open Открытый Remove Fold Line Role Убрать тип линии @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Tap Короткое нажатие + Clear Hold Очистить удержание + Hold Shortcuts Клавиши удержания + Hold Shortcut Delay Задержка клавиш удержания + How hold shortcuts work Как работают клавиши удержания + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Щелкните, затем нажмите клавишу, которую нужно удерживать для этого (Esc отменяет). Удержание клавиши запускает это; короткое нажатие запускает собственное сочетание клавиши. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Короткое нажатие клавиши запускает ее сочетание. Удержание клавиши в течение задержки запускает вместо этого инструмент или команду из ее столбца «Удерживать». Клавиша удержания — это клавиша буквы, цифры или знака препинания, отдельно или с Shift. +@msg Hold {_1} is already used by {_2} Удержание {_1} уже используется для {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавиша удержания — это клавиша, которая вводит символ, отдельно или с Shift ({shown} содержит Cmd, Ctrl или Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не может быть клавишей удержания: используйте букву, цифру или клавишу знака препинания diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 95e7c34b47..5b599e4df9 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9283,3 +9283,13 @@ digits Hindi Hindi Open a document to mark its fold lines. Öppna ett dokument för att markera dess falslinjer. Remove Fold Line Role Ta bort linjetyp @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen + Tap Kort tryck + Clear Hold Rensa håll + Hold Shortcuts Hållkortkommandon + Hold Shortcut Delay Fördröjning för hållkortkommandon + How hold shortcuts work Så fungerar hållkortkommandon + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Klicka och tryck sedan på en tangent som ska hållas ned för detta (Esc avbryter). Att hålla ned tangenten kör detta; ett kort tryck kör tangentens eget kortkommando. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Ett kort tryck på en tangent kör dess kortkommando. Att hålla ned tangenten under fördröjningen kör i stället verktyget eller kommandot i dess Håll-kolumn. Ett hållkortkommando är en bokstavs-, siffer- eller skiljeteckentangent, ensam eller med Shift. +@msg Hold {_1} is already used by {_2} Håll {_1} används redan av {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) ett hållkortkommando är en tangent som skriver ett tecken, ensam eller med Shift ({shown} har Cmd, Ctrl eller Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} kan inte vara ett hållkortkommando: använd en bokstav, en siffra eller en skiljeteckentangent diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d8249b1c79..ef10a57c7d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9567,3 +9567,13 @@ breakText Glyphs Glifler No objects are selected. Hiçbir nesne seçili değil. Open a document to mark its fold lines. Katlama çizgilerini işaretlemek için bir belgeyi açın. Remove Fold Line Role Çizgi Türünü Kaldır + Tap Kısa Basma + Clear Hold Basılı Tutmayı Temizle + Hold Shortcuts Basılı Tutma Kısayolları + Hold Shortcut Delay Basılı Tutma Kısayolu Gecikmesi + How hold shortcuts work Basılı tutma kısayolları nasıl çalışır + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Tıklayın, ardından bunun için basılı tutulacak tuşa basın (Esc iptal edilir). Tuşu basılı tutmak bunu çalıştırır; kısa basmak tuşun kendi kısayolunu çalıştırır. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Bir tuşa kısa basmak onun kısayolunu çalıştırır. Tuşu gecikme süresi boyunca basılı tutmak bunun yerine Basılı tutun sütunundaki aracı veya komutu çalıştırır. Basılı tutma kısayolu, tek başına veya Shift ile bir harf, rakam ya da noktalama tuşudur. +@msg Hold {_1} is already used by {_2} Basılı tutma {_1} zaten {_2} tarafından kullanılıyor +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) basılı tutma kısayolu, tek başına veya Shift ile bir karakter yazan tuştur ({shown} Cmd, Ctrl veya Alt içeriyor) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} basılı tutma kısayolu olamaz: bir harf, rakam veya noktalama tuşu kullanın diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 8ebb97a5be..e5ab45e496 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9220,3 +9220,13 @@ breakText Glyphs Гліфи No objects are selected. Об’єкти не виділено. Open a document to mark its fold lines. Відкрийте документ, щоб позначити його лінії згину. Remove Fold Line Role Прибрати тип лінії + Tap Коротке натискання + Clear Hold Очистити утримання + Hold Shortcuts Клавіші утримання + Hold Shortcut Delay Затримка клавіш утримання + How hold shortcuts work Як працюють клавіші утримання + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Клацніть, потім натисніть клавішу, яку слід утримувати для цього (Esc скасовує). Утримання клавіші запускає це; коротке натискання запускає власне сполучення клавіші. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Коротке натискання клавіші запускає її сполучення. Утримання клавіші протягом затримки запускає натомість інструмент або команду з її стовпця «Утримувати». Клавіша утримання — це клавіша літери, цифри або розділового знака, окремо або з Shift. +@msg Hold {_1} is already used by {_2} Утримання {_1} вже використовується для {_2} +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) клавіша утримання — це клавіша, що вводить символ, окремо або з Shift ({shown} містить Cmd, Ctrl або Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} не може бути клавішею утримання: використайте літеру, цифру або клавішу розділового знака diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index a9a9cb140a..23ef3d3845 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7424,3 +7424,13 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" + Tap Nhấn nhanh + Clear Hold Xóa nhấn giữ + Hold Shortcuts Phím tắt nhấn giữ + Hold Shortcut Delay Độ trễ phím tắt nhấn giữ + How hold shortcuts work Cách phím tắt nhấn giữ hoạt động + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. Nhấp, rồi nhấn phím cần giữ cho mục này (Esc để hủy). Giữ phím sẽ chạy mục này; nhấn nhanh sẽ chạy phím tắt riêng của phím đó. + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. Nhấn nhanh một phím sẽ chạy phím tắt của phím đó. Giữ phím trong khoảng độ trễ sẽ chạy công cụ hoặc lệnh trong cột Giữ của phím thay vào đó. Phím tắt nhấn giữ là một phím chữ cái, chữ số hoặc dấu câu, dùng riêng hoặc cùng Shift. +@msg Hold {_1} is already used by {_2} Nhấn giữ {_1} đã được {_2} sử dụng +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) phím tắt nhấn giữ là một phím gõ ra ký tự, dùng riêng hoặc cùng Shift ({shown} có Cmd, Ctrl hoặc Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} không thể là phím tắt nhấn giữ: hãy dùng chữ cái, chữ số hoặc phím dấu câu diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index f3a87e6b84..76ff60f06d 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9452,3 +9452,13 @@ breakText Glyphs 字形 Open a document to mark its fold lines. 打开文档以标记其折线。 Remove Fold Line Role 移除线条类型 @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率 + Tap 短按 + Clear Hold 清除按住 + Hold Shortcuts 按住快捷键 + Hold Shortcut Delay 按住快捷键延迟 + How hold shortcuts work 按住快捷键的工作方式 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 单击后按下要为此按住的键 (Esc 取消)。按住该键会运行此项;短按会运行该键自己的快捷键。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按一个键会运行它的快捷键。按住该键达到延迟时间,则改为运行其“按住”列中的工具或命令。按住快捷键是字母、数字或标点键,可单独使用或与 Shift 组合。 +@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快捷键是可输入字符的键,单独使用或与 Shift 组合 ({shown} 含有 Cmd、Ctrl 或 Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作为按住快捷键:请使用字母、数字或标点键 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 52715f8360..e7a8224e13 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9262,3 +9262,13 @@ breakText Glyphs 字符 Open a document to mark its fold lines. 開啟文件以標記其摺線。 Remove Fold Line Role 移除線條類型 @msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小 + Tap 短按 + Clear Hold 清除按住 + Hold Shortcuts 按住快速鍵 + Hold Shortcut Delay 按住快速鍵延遲 + How hold shortcuts work 按住快速鍵的運作方式 + Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut. 按一下後按下要為此按住的按鍵 (Esc 取消)。按住該按鍵會執行此項;短按會執行該按鍵本身的快速鍵。 + A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift. 短按按鍵會執行它的快速鍵。按住按鍵達延遲時間,則改為執行其「按住」欄中的工具或命令。按住快速鍵是字母、數字或標點符號按鍵,可單獨使用或搭配 Shift。 +@msg Hold {_1} is already used by {_2} 按住 {_1} 已被 {_2} 使用 +@msg a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt) 按住快速鍵是可輸入字元的按鍵,可單獨使用或搭配 Shift ({shown} 含有 Cmd、Ctrl 或 Alt) +@msg {shown} can't be a hold shortcut: use a letter, a digit or a punctuation key {shown} 不能作為按住快速鍵:請使用字母、數字或標點符號按鍵 diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 3f89789d5d..7f13d34da3 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -368,6 +368,9 @@ pub struct VectorcraftApp { /// The single-key tool shortcuts held down, the last held last, and the tool each goes back to /// when it is let go ([`shortcuts::HeldTool`]). pub(crate) held_tool: Vec<shortcuts::HeldTool>, + /// A key with a hold shortcut that waits for its release, and the keys whose repeats are held + /// back until they are let go ([`shortcuts::HoldKeys`]). + pub(crate) hold_keys: shortcuts::HoldKeys, /// A synthetic batch is in the host's raw input and no settled UI pass has taken it yet. synthetic_injected: bool, /// The exact events of [`Self::synthetic_injected`], to remove them if the state they belong diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 4c286f1da9..dbe67c5916 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -174,8 +174,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+I", "{} open the Check Spelling dialog to walk through unrecognized words with suggestions, ignore, change and dictionary options", ), - ("shortcuts.set", "Set Keyboard Shortcut", "", "{id: command id or tool:<id>, shortcut: \"Cmd+Shift+K\" | \"\" (none) | null (default), force?}"), - ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, default, overridden}]"), + ( + "shortcuts.set", + "Set Keyboard Shortcut", + "", + "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + ), + ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), ("shortcuts.reset", "Reset Keyboard Shortcuts", "", "{}"), ( @@ -189,7 +194,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.exportText", "Export Keyboard Shortcuts as Text…", "", - "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none; without `path`, pick a file", + "{path?} save the current set's tools and menu commands with their shortcuts as a UTF-8 text file (Keyboard Shortcuts › Export Text…): the set's name, then a Tools and a Menu Commands section in the dialog's order, one `name<TAB>shortcut` line per row, empty after the tab when it has none, and while the holdShortcuts preference is on a third `Hold <key>` column on a row with a hold shortcut; without `path`, pick a file", ), ("shortcuts.import", "Import Keyboard Shortcuts…", "", "{path? | data?}"), ( diff --git a/crates/ui-egui/src/prefs_dialog.rs b/crates/ui-egui/src/prefs_dialog.rs index f9939177de..c01a31d754 100644 --- a/crates/ui-egui/src/prefs_dialog.rs +++ b/crates/ui-egui/src/prefs_dialog.rs @@ -580,6 +580,18 @@ fn category_fields(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog, } } PrefKind::Bool => bool_row(ui, d, sp.key, sp.label), + // General › Hold Shortcut Delay acts only while Hold Shortcuts is on: dimmed while it + // is off, as in Edit › Keyboard Shortcuts, which shows it only then. + PrefKind::Num { min, max, unit } if sp.key == "keyHoldDelay" => { + ui.add_enabled_ui(d.bool("holdShortcuts"), |ui| { + labeled(ui, sp.label, |ui, _| { + let x = v.as_f64().unwrap_or(min); + if let Some(x) = widgets::range_field(ui, sp.key, x, min..=max, &format!(" {unit}"), 3, 110.0) { + d.fields.insert(sp.key.into(), json!(x)); + } + }); + }); + } PrefKind::Num { min, max, unit } => { labeled(ui, sp.label, |ui, label_id| { let mut x = v.as_f64().unwrap_or(min); diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 5c9356edd9..84b9abd4af 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1093,6 +1093,45 @@ fn scroll_sideways_with_cmd_wheel_dims_with_zoom_with_mouse_wheel() { } } +/// General › Hold Shortcut Delay: its field is dimmed while Hold Shortcuts is unchecked in the +/// dialog, and a click on it then does not give it the keyboard. +#[test] +fn hold_shortcut_delay_dims_without_hold_shortcuts() { + fn text(s: &egui::Shape, f: &dyn Fn(&str) -> bool) -> Option<egui::Rect> { + match s { + egui::Shape::Text(t) if f(t.galley.text()) => Some(t.visual_bounding_rect()), + egui::Shape::Vec(v) => v.iter().find_map(|s| text(s, f)), + _ => None, + } + } + for on in [true, false] { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let mut a = app(); + let mut d = Dialog::new("preferences", json!({"holdShortcuts": on, "keyHoldDelay": 0.35})); + let mut frame = |d: &mut Dialog, events: Vec<egui::Event>| { + let raw = egui::RawInput { + screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 2400.0))), + events, + ..Default::default() + }; + let mut out = ctx.run_ui(raw, |ui| category_fields(ui, &mut a, d, "General")); + out.textures_delta.clear(); + let label = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("Hold Shortcut Delay"))); + let field = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("0.35"))); + (label, field) + }; + let (label, field) = frame(&mut d, vec![]); + assert!(label.is_some(), "no label (on {on})"); + let at = field.unwrap_or_else(|| panic!("no field (on {on})")); + let press = + |pressed| egui::Event::PointerButton { pos: at.center(), button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(&mut d, vec![egui::Event::PointerMoved(at.center()), press(true)]); + frame(&mut d, vec![press(false)]); + assert_eq!(ctx.memory(|m| m.focused().is_some()), on, "a click gives the field the keyboard only while Hold Shortcuts is on ({on})"); + } +} + /// Type › Show samples on white: its checkbox is dimmed while Enable in-menu font previews is /// unchecked in the dialog, and a click on it then leaves the setting as it was. #[test] diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 88a97206c7..da0448162c 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1141,6 +1141,89 @@ pub fn reset_one(overrides: &mut Overrides, key: &str) { crate::keymap::remove_override(overrides, key); } +/// Hold shortcuts: entry key → chord text ([`UiState::shortcut_holds`]). +pub type Holds = BTreeMap<String, String>; + +/// The chord of hold shortcut text `text`, or why it can't be one. A hold shortcut is a key that +/// types a character, alone or with Shift. Space and the backtick key are refused: the canvas reads +/// them while they are held. +pub fn hold_chord(text: &str) -> Result<craft_keymap::Chord, String> { + let chord = vc_chord(text).ok_or_else(|| format!("can't parse shortcut `{text}`"))?; + let shown = menus::pretty_shortcut(&vc_format(&chord)); + if chord.mods.cmd || chord.mods.ctrl || chord.mods.alt { + return Err(format!("a hold shortcut is a key that types a character, alone or with Shift ({shown} has Cmd, Ctrl or Alt)")); + } + if chord.key == craft_keymap::Key::Backtick || !crate::shortcuts::types_text(chord.key) { + return Err(format!("{shown} can't be a hold shortcut: use a letter, a digit or a punctuation key")); + } + Ok(chord) +} + +/// The hold shortcut of `key` in `holds`, in VectorCraft's chord spelling, when it is usable. +pub fn hold_of(holds: &Holds, key: &str) -> Option<String> { + holds.get(key).and_then(|t| hold_chord(t).ok()).map(|c| vc_format(&c)) +} + +/// The entry whose usable hold shortcut is `chord`: the first in `holds`' order when several are. +/// An entry no longer listed (a removed plug-in's) keeps its text but does not hold. +pub(crate) fn hold_for<'a>(holds: &'a Holds, chord: &craft_keymap::Chord) -> Option<&'a str> { + holds.iter().find(|(k, t)| hold_chord(t).is_ok_and(|c| c == *chord) && entry(k).is_some()).map(|(k, _)| k.as_str()) +} + +/// Sets (`Some`) or removes (`None` or `""`) the hold shortcut of `key`. Another entry that holds +/// the same key loses it when `force`; otherwise that is an error. Returns the entries that lost +/// it. Nothing changes on an error. +pub fn assign_hold(holds: &mut Holds, key: &str, text: Option<&str>, force: bool) -> Result<Vec<String>, String> { + if entry(key).is_none() { + return Err(format!("unknown tool or command `{key}`")); + } + let Some(text) = text.filter(|t| !t.is_empty()) else { + holds.remove(key); + return Ok(vec![]); + }; + let chord = hold_chord(text)?; + let taken: Vec<String> = holds.iter().filter(|(k, t)| *k != key && vc_chord(t) == Some(chord)).map(|(k, _)| k.clone()).collect(); + if !taken.is_empty() && !force { + let names: Vec<String> = taken.iter().map(|k| entry(k).map_or(k.clone(), |e| english_name(&e))).collect(); + return Err(format!("Hold {} is already used by {}", menus::pretty_shortcut(&vc_format(&chord)), names.join(", "))); + } + for k in &taken { + holds.remove(k); + } + holds.insert(key.to_string(), vc_format(&chord)); + Ok(taken) +} + +/// Hold shortcuts used by more than one entry: (chord text, entry keys). +pub fn hold_conflicts(holds: &Holds) -> Vec<(String, Vec<String>)> { + let mut by: BTreeMap<String, Vec<String>> = BTreeMap::new(); + for (k, t) in holds { + if let Ok(c) = hold_chord(t) { + by.entry(vc_format(&c)).or_default().push(k.clone()); + } + } + by.into_iter().filter(|(_, keys)| keys.len() > 1).collect() +} + +/// The hold shortcuts of an exported set's `holds` member: none when it is missing. Every value +/// must be a usable hold shortcut; otherwise the error names the first entry that is not. +pub fn import_holds(v: &Value) -> Result<Holds, String> { + let Some(h) = v.get("holds") else { return Ok(Holds::new()) }; + let h = h.as_object().ok_or("`holds` must be an object")?; + let mut out = Holds::new(); + for (k, v) in h { + let s = v.as_str().ok_or_else(|| format!("hold shortcut for `{k}` must be a string"))?; + let c = hold_chord(s).map_err(|e| format!("hold shortcut for `{k}`: {e}"))?; + out.insert(k.clone(), vc_format(&c)); + } + Ok(out) +} + +/// The hold shortcuts of the Keyboard Shortcuts dialog's working set. +fn dialog_holds(d: &Dialog) -> Holds { + d.fields.get("holds").and_then(|v| serde_json::from_value(v.clone()).ok()).unwrap_or_default() +} + /// Text shown for all active chords in a dialog row, with the backtick key shown as `typed` /// ([`backtick_text`]). fn dialog_shortcuts_with(km: &Keymap, key: &str, typed: Option<&str>) -> Option<String> { @@ -1161,7 +1244,17 @@ pub fn preset(name: &str) -> Option<Overrides> { /// Export format: `{"format": "vectorcraft-shortcuts", "set": name, "overrides": {...}}`. pub fn export_json(set: &str, overrides: &Overrides) -> Value { - json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)}) + export_json_with(set, overrides, &Holds::new()) +} + +/// [`export_json`] with the set's hold shortcuts, written as `holds` when there are any. The +/// version stays 1: earlier versions read `overrides` only, so they import the file without them. +pub fn export_json_with(set: &str, overrides: &Overrides, holds: &Holds) -> Value { + let mut v = json!({"format": "vectorcraft-shortcuts", "version": 1, "set": set, "overrides": stored::to_value(overrides)}); + if !holds.is_empty() { + v["holds"] = json!(holds); + } + v } pub fn import_json(v: &Value) -> Result<(String, Overrides), String> { @@ -1181,6 +1274,11 @@ pub fn import_json(v: &Value) -> Result<(String, Overrides), String> { /// row per line with the name and the shortcuts as the dialog shows them, separated by a tab. A /// row with no shortcut ends after the tab. pub fn export_text(set: &str, overrides: &Overrides) -> String { + export_text_with(set, overrides, &Holds::new()) +} + +/// [`export_text`] with the set's hold shortcuts: a row with one gets a third column, `Hold X`. +pub fn export_text_with(set: &str, overrides: &Overrides, holds: &Holds) -> String { let snapshot = snapshot(); let km = crate::keymap::keymap_in(&snapshot, overrides); let backtick = backtick_text(); @@ -1191,7 +1289,10 @@ pub fn export_text(set: &str, overrides: &Overrides) -> String { for e in snapshot.entries.iter().filter(|e| e.is_tool == tools && listed(km.overrides(), e)) { let name = shown_name(e); let sc = dialog_shortcuts_with(&km, &e.key, backtick.as_deref()).unwrap_or_default(); - out += &format!("{name}\t{sc}\n"); + match hold_of(holds, &e.key) { + Some(h) => out += &format!("{name}\t{sc}\t{} {}\n", tl!("Hold"), menus::pretty_shortcut(&h)), + None => out += &format!("{name}\t{sc}\n"), + } } } out @@ -1203,10 +1304,35 @@ pub fn open(app: &mut VectorcraftApp) { let ov = stored::to_value(&app.ui.shortcut_overrides); app.ui.dialog = Some(Dialog::new( "shortcuts", - json!({"tab": "tools", "query": "", "set": app.ui.shortcut_set, "overrides": ov, "__recording": "", "__selected": "", "__message": "", "__conflict": ""}), + json!({ + "tab": "tools", + "query": "", + "set": app.ui.shortcut_set, + "overrides": ov, + "holds": app.ui.shortcut_holds, + "holdShortcuts": app.session.prefs.hold_shortcuts, + "keyHoldDelay": app.session.prefs.key_hold_delay(), + "__holdInfo": false, + "__recording": "", + "__recordingHold": false, + "__selected": "", + "__message": "", + "__conflict": "" + }), )); } +/// Hold Shortcuts in the Keyboard Shortcuts dialog's working copy. +fn dialog_holds_on(d: &Dialog) -> bool { + d.bool("holdShortcuts") +} + +/// The Hold Shortcut Delay in the Keyboard Shortcuts dialog's working copy, in its range. +fn dialog_hold_delay(d: &Dialog) -> f64 { + let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE; + d.fields.get("keyHoldDelay").and_then(Value::as_f64).filter(|x| x.is_finite()).map_or(vectorcraft_engine::KEY_HOLD_DELAY, |x| x.clamp(min, max)) +} + fn dialog_overrides(d: &Dialog) -> Overrides { d.fields.get("overrides").map(|v| stored::from_value(v.clone())).unwrap_or_default() } @@ -1214,7 +1340,13 @@ fn dialog_overrides(d: &Dialog) -> Overrides { /// OK: commit the working set. pub fn confirm(app: &mut VectorcraftApp) -> Result<Value, String> { let Some(d) = app.ui.dialog.clone() else { return Err("no dialog open".into()) }; + let (on, delay) = (dialog_holds_on(&d), dialog_hold_delay(&d)); + let prefs = &app.session.prefs; + if d.kind == "shortcuts" && (on != prefs.hold_shortcuts || delay != prefs.key_hold_delay()) { + app.run("prefs.set", json!({"values": {"holdShortcuts": on, "keyHoldDelay": delay}})).map_err(|e| e.to_string())?; + } app.ui.shortcut_overrides = dialog_overrides(&d); + app.ui.shortcut_holds = dialog_holds(&d); app.ui.shortcut_set = d.str("set"); app.ui.dialog = None; sync(&app.ui); @@ -1244,18 +1376,45 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu (Ok(key), Ok(shortcut), Ok(force)) => (key.unwrap_or_default(), shortcut, force.unwrap_or(false)), (Err(e), _, _) | (_, Err(e), _) | (_, _, Err(e)) => return Some(Err(e)), }; + let hold = match s("hold") { + Ok(hold) => hold, + Err(e) => return Some(Err(e)), + }; + // Without `hold`, a missing `shortcut` removes the shortcut, as it always has; with + // `hold` alone, the shortcut is left as it is. Both are checked before either is kept. + let has_hold = p.get("hold").is_some(); + let has_shortcut = p.get("shortcut").is_some() || !has_hold; let mut ov = app.ui.shortcut_overrides.clone(); - let r = if p.get("shortcut").is_some_and(Value::is_null) { + let mut holds = app.ui.shortcut_holds.clone(); + let r = if !has_shortcut { + Ok(vec![]) + } else if p.get("shortcut").is_some_and(Value::is_null) { reset_one(&mut ov, &key); Ok(vec![]) } else { assign(&mut ov, &key, shortcut.as_deref(), force) }; + let r = r.and_then(|mut removed| { + if has_hold { + for k in assign_hold(&mut holds, &key, hold.as_deref(), force)? { + if !removed.contains(&k) { + removed.push(k); + } + } + } + Ok(removed) + }); r.map(|removed| { app.ui.shortcut_overrides = ov; + app.ui.shortcut_holds = holds; app.ui.shortcut_set = CUSTOM.into(); sync(&app.ui); - json!({"id": key, "shortcut": effective_in(&app.ui.shortcut_overrides, &key), "removedFrom": removed}) + json!({ + "id": key, + "shortcut": effective_in(&app.ui.shortcut_overrides, &key), + "hold": hold_of(&app.ui.shortcut_holds, &key), + "removedFrom": removed + }) }) } "shortcuts.list" => { @@ -1272,15 +1431,19 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu .iter() .filter(|e| listed(ov, e)) .filter(|e| q.is_empty() || e.label.to_lowercase().contains(&q) || e.key.to_lowercase().contains(&q)) - .map(|e| json!({"id": e.key, "label": e.label, "group": e.group, "shortcut": effective_with(&km, &e.key), "default": default_of(&e.key), "overridden": crate::keymap::has_override(ov, &e.key)})) + .map(|e| json!({"id": e.key, "label": e.label, "group": e.group, "shortcut": effective_with(&km, &e.key), "hold": hold_of(&app.ui.shortcut_holds, &e.key), "default": default_of(&e.key), "overridden": crate::keymap::has_override(ov, &e.key)})) .collect(), )) } "shortcuts.conflicts" => { - Ok(json!(all_conflicts(&app.ui.shortcut_overrides).into_iter().map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::<Vec<_>>())) + let holds = hold_conflicts(&app.ui.shortcut_holds).into_iter().map(|(c, k)| (format!("Hold {c}"), k)); + Ok(json!( + all_conflicts(&app.ui.shortcut_overrides).into_iter().chain(holds).map(|(c, k)| json!({"shortcut": c, "ids": k})).collect::<Vec<_>>() + )) } "shortcuts.reset" => { app.ui.shortcut_overrides.clear(); + app.ui.shortcut_holds.clear(); app.ui.shortcut_set = PRESETS[0].into(); sync(&app.ui); Ok(Value::Null) @@ -1288,6 +1451,8 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu "shortcuts.preset" => match s("name").map(|n| n.as_deref().map(set_name).and_then(|n| preset(n).map(|p| (n.to_string(), p)))) { Ok(Some((n, p))) => { app.ui.shortcut_overrides = p; + // The presets have no hold shortcuts. + app.ui.shortcut_holds.clear(); app.ui.shortcut_set = n; sync(&app.ui); Ok(Value::Null) @@ -1300,7 +1465,7 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu Ok(path) => path, Err(e) => return Some(Err(e)), }; - let v = export_json(&app.ui.shortcut_set, &app.ui.shortcut_overrides); + let v = export_json_with(&app.ui.shortcut_set, &app.ui.shortcut_overrides, &app.ui.shortcut_holds); let bytes = serde_json::to_vec_pretty(&v).unwrap_or_default(); let pick = crate::FilePick { filters: vec![crate::FilePick::filter("Shortcut sets", &["json"])], @@ -1329,7 +1494,9 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu return Some(Err(format!("`{key}` must be a string"))); } }; - let text = export_text(&app.ui.shortcut_set, &app.ui.shortcut_overrides); + // The hold shortcuts are listed while they act. + let holds = if app.session.prefs.hold_shortcuts { app.ui.shortcut_holds.clone() } else { Holds::new() }; + let text = export_text_with(&app.ui.shortcut_set, &app.ui.shortcut_overrides, &holds); let pick = crate::FilePick { filters: vec![crate::FilePick::filter("Text", &["txt"])], ..crate::FilePick::named("VectorCraft Shortcuts.txt") }; match path.or_else(|| crate::picks::save(app, &pick)) { @@ -1374,13 +1541,15 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu (_, None) => Err("no file reader".into()), } }; - data.and_then(|v| import_json(&v)).map(|(set, ov)| { + data.and_then(|v| Ok((import_json(&v)?, import_holds(&v)?))).map(|((set, ov), holds)| { let n = ov.len(); app.ui.shortcut_overrides = ov; + app.ui.shortcut_holds = holds; app.ui.shortcut_set = set; sync(&app.ui); if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") { d.fields.insert("overrides".into(), stored::to_value(&app.ui.shortcut_overrides)); + d.fields.insert("holds".into(), json!(app.ui.shortcut_holds)); d.fields.insert("set".into(), json!(app.ui.shortcut_set)); } json!({"overrides": n}) @@ -1466,7 +1635,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let mut cancel = false; drop_hidden(&mut d, km.overrides()); let saved = dialog_overrides(&d); + let mut holds = dialog_holds(&d); let recording = d.str("__recording"); + // Which column records: the Hold column, or the Shortcut column. + let recording_hold = !recording.is_empty() && d.bool("__recordingHold"); // Record a chord (before widgets see the keys). Modifiers held down are part of the next key's // chord, not a chord of their own. if !recording.is_empty() { @@ -1481,7 +1653,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if key == Key::Escape { d.fields.insert("__recording".into(), json!("")); } else if let Some(chord) = chord_from_event(key, m) { - record(&mut d, km.to_mut(), &recording, &chord); + if recording_hold { + record_hold(&mut d, &mut holds, &recording, &chord); + } else { + record(&mut d, km.to_mut(), &recording, &chord); + } } } } @@ -1503,6 +1679,8 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { && let Some(p) = preset(name) { km.to_mut().set_overrides(p); + // The presets have no hold shortcuts. + holds.clear(); d.fields.insert("set".into(), json!(name)); d.fields.insert("__message".into(), json!("")); } @@ -1518,10 +1696,13 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } if ui.button(tl!("Reset to Defaults")).clicked() { km.to_mut().reset_all(); + holds.clear(); d.fields.insert("set".into(), json!(PRESETS[0])); d.fields.insert("__message".into(), json!(tl!("All shortcuts reset to defaults."))); } }); + ui.add_space(6.0); + hold_row(ui, &t, &mut d); ui.add_space(8.0); // Tabs + search. ui.horizontal(|ui| { @@ -1544,14 +1725,25 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let q = d.str("query").to_lowercase(); let selected = d.str("__selected"); let rec = d.str("__recording"); + let rec_hold = d.bool("__recordingHold"); + let holds_on = dialog_holds_on(&d); let scroll_to = d.fields.remove("__scrollTo").and_then(|v| v.as_str().map(str::to_string)); egui::Frame::NONE.fill(t.input).stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(4)).show(ui, |ui| { ui.horizontal(|ui| { - ui.allocate_ui_with_layout(egui::vec2(360.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(360.0); + let name_width = if holds_on { 340.0 } else { 360.0 }; + ui.allocate_ui_with_layout(egui::vec2(name_width, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(name_width); ui.label(egui::RichText::new(if tools { tl!("Tool") } else { tl!("Command") }).color(t.text_dim).size(11.0)); }); - ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + if holds_on { + ui.allocate_ui_with_layout(egui::vec2(150.0, 16.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(150.0); + ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + }); + ui.label(egui::RichText::new(tl!("Hold")).color(t.text_dim).size(11.0)); + } else { + ui.label(egui::RichText::new(tl!("Shortcut")).color(t.text_dim).size(11.0)); + } }); egui::ScrollArea::vertical().max_height(360.0).auto_shrink([false, false]).show(ui, |ui| { for (i, e) in view.entries.iter().enumerate().filter(|(_, e)| e.is_tool == tools && listed(km.overrides(), e)) { @@ -1564,23 +1756,44 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } let row = ui.horizontal(|ui| { let name = shown_name(e); + let name_width = if holds_on { 340.0 } else { 360.0 }; let r = ui - .allocate_ui_with_layout(egui::vec2(360.0, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { - ui.set_min_width(360.0); + .allocate_ui_with_layout(egui::vec2(name_width, 20.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { + ui.set_min_width(name_width); ui.add(egui::Button::selectable(selected == e.key, egui::RichText::new(name).color(t.text)).truncate()) }) .inner; if r.clicked() { d.fields.insert("__selected".into(), json!(e.key)); } - let label = if rec == e.key { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) }; + let recording_here = rec == e.key && !rec_hold; + let label = if recording_here { tl!("Press keys…").to_string() } else { sc.unwrap_or_else(|| "—".into()) }; let changed = crate::keymap::has_override(&saved, &e.key); let txt = egui::RichText::new(label).color(if changed { t.accent } else { t.text }); let b = ui - .add_sized([150.0, 20.0], egui::Button::new(txt).selected(rec == e.key)) + .add_sized([150.0, 20.0], egui::Button::new(txt).selected(recording_here)) .on_hover_text(tl!("Click, then press the new shortcut (Esc cancels)")); if b.clicked() { d.fields.insert("__recording".into(), json!(e.key)); + d.fields.insert("__recordingHold".into(), json!(false)); + d.fields.insert("__selected".into(), json!(e.key)); + } + if !holds_on { + return; + } + let holding_here = rec == e.key && rec_hold; + let hold = hold_of(&holds, &e.key); + let label = if holding_here { + tl!("Press keys…").to_string() + } else { + hold.as_deref().map_or_else(|| "—".into(), menus::pretty_shortcut) + }; + let h = ui.add_sized([90.0, 20.0], egui::Button::new(egui::RichText::new(label).color(t.text)).selected(holding_here)).on_hover_text( + tl!("Click, then press a key to hold for this (Esc cancels). Holding the key runs this; a quick press runs the key's own shortcut."), + ); + if h.clicked() { + d.fields.insert("__recording".into(), json!(e.key)); + d.fields.insert("__recordingHold".into(), json!(true)); d.fields.insert("__selected".into(), json!(e.key)); } }); @@ -1604,6 +1817,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if ui.button(tl!("Use Default")).clicked() { km.to_mut().reset(&command_of(&sel)); } + if dialog_holds_on(&d) && ui.add_enabled(holds.contains_key(&sel), egui::Button::new(tl!("Clear Hold"))).clicked() { + holds.remove(&sel); + d.fields.insert("set".into(), json!(CUSTOM)); + } }); let conflict = d.str("__conflict"); if !conflict.is_empty() && ui.button(tl!("Go to Conflict")).clicked() { @@ -1622,7 +1839,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let n = match &km { Cow::Borrowed(_) => view.conflicts, Cow::Owned(km) => conflicts_in(km).len(), - }; + } + if dialog_holds_on(&d) { hold_conflicts(&holds).len() } else { 0 }; if n > 0 { ui.label( egui::RichText::new(crate::i18n::tn( @@ -1648,6 +1865,10 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if let Cow::Owned(km) = &km { d.fields.insert("overrides".into(), stored::to_value(&saved_overrides(km.overrides(), &saved))); } + d.fields.insert("holds".into(), json!(holds)); + if d.str("__recording").is_empty() { + d.fields.insert("__recordingHold".into(), json!(false)); + } let import = d.fields.remove("__import").is_some(); let export = d.fields.remove("__export").is_some(); let export_text = d.fields.remove("__exportText").is_some(); @@ -1682,14 +1903,15 @@ fn import_into_dialog(app: &mut VectorcraftApp) { app.status(crate::picks::dialog_gone()); return; } - let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone()); + let saved = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone()); match run_command(app, "shortcuts.import", &json!({})) { Some(Ok(_)) => { - let (o, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_set.clone()); - (app.ui.shortcut_overrides, app.ui.shortcut_set) = saved; + let (o, h, s) = (app.ui.shortcut_overrides.clone(), app.ui.shortcut_holds.clone(), app.ui.shortcut_set.clone()); + (app.ui.shortcut_overrides, app.ui.shortcut_holds, app.ui.shortcut_set) = saved; sync(&app.ui); if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == "shortcuts") { d.fields.insert("overrides".into(), stored::to_value(&o)); + d.fields.insert("holds".into(), json!(h)); d.fields.insert("set".into(), json!(s)); d.fields.insert("__message".into(), json!(tl!("Imported. Press OK to keep the imported set."))); } @@ -1715,13 +1937,19 @@ fn export_dialog_set(app: &mut VectorcraftApp, command: &str) { app.status(crate::picks::dialog_gone()); return; } - let (ov, set) = app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), d.str("set"))).unwrap_or_default(); + let (ov, holds, set, on) = + app.ui.dialog.as_ref().map(|d| (dialog_overrides(d), dialog_holds(d), d.str("set"), dialog_holds_on(d))).unwrap_or_default(); let saved = std::mem::replace(&mut app.ui.shortcut_overrides, ov); + let saved_holds = std::mem::replace(&mut app.ui.shortcut_holds, holds); let saved_set = std::mem::replace(&mut app.ui.shortcut_set, set); + // Export Text… lists the hold shortcuts while the dialog's Hold Shortcuts is on. + let saved_on = std::mem::replace(&mut app.session.prefs.hold_shortcuts, on); if let Some(Err(e)) = run_command(app, command, &json!({})) { app.status(e); } + app.session.prefs.hold_shortcuts = saved_on; app.ui.shortcut_overrides = saved; + app.ui.shortcut_holds = saved_holds; app.ui.shortcut_set = saved_set; } @@ -1779,6 +2007,107 @@ fn record(d: &mut Dialog, km: &mut Keymap, key: &str, chord: &str) { } } +/// The Hold Shortcuts row of the Keyboard Shortcuts dialog: the checkbox that turns hold shortcuts +/// on (and shows the Hold column), a button that shows how they work, and, while on, the Hold +/// Shortcut Delay. +fn hold_row(ui: &mut egui::Ui, t: &Tokens, d: &mut Dialog) { + ui.horizontal(|ui| { + let mut on = dialog_holds_on(d); + if ui.checkbox(&mut on, egui::RichText::new(tl!("Hold Shortcuts")).color(t.text)).changed() { + d.fields.insert("holdShortcuts".into(), json!(on)); + if !on && d.bool("__recordingHold") { + d.fields.insert("__recording".into(), json!("")); + d.fields.insert("__recordingHold".into(), json!(false)); + } + } + let info = d.bool("__holdInfo"); + if ui + .add(egui::Button::new(egui::RichText::new("?").color(t.text_dim)).selected(info).small()) + .on_hover_text(tl!("How hold shortcuts work")) + .clicked() + { + d.fields.insert("__holdInfo".into(), json!(!info)); + } + if on { + ui.add_space(12.0); + ui.label(egui::RichText::new(tl!("Hold Shortcut Delay")).color(t.text_dim)); + let (min, max) = vectorcraft_engine::KEY_HOLD_DELAY_RANGE; + let mut delay = dialog_hold_delay(d); + if ui.add(egui::DragValue::new(&mut delay).range(min..=max).speed(0.01).fixed_decimals(2).suffix(" s")).changed() { + d.fields.insert("keyHoldDelay".into(), json!(delay)); + } + } + }); + if d.bool("__holdInfo") { + egui::Frame::NONE.stroke(egui::Stroke::new(1.0, t.input_border)).inner_margin(egui::Margin::same(8)).show(ui, |ui| { + ui.horizontal(|ui| { + hold_illustration(ui, t); + ui.add_space(8.0); + ui.add( + egui::Label::new( + egui::RichText::new(tl!( + "A quick press of a key runs its shortcut. Holding the key for the delay runs the tool or command in its Hold column instead. A hold shortcut is a letter, digit or punctuation key, alone or with Shift." + )) + .color(t.text) + .size(11.5), + ) + .wrap(), + ); + }); + }); + } +} + +/// A key and two presses of it drawn in code: a short press (Tap) ends before the delay, and a long +/// one (Hold) reaches it. +fn hold_illustration(ui: &mut egui::Ui, t: &Tokens) { + let (rect, _) = ui.allocate_exact_size(egui::vec2(200.0, 52.0), egui::Sense::hover()); + let p = ui.painter_at(rect); + let key = egui::Rect::from_min_size(rect.min + egui::vec2(2.0, 12.0), egui::vec2(28.0, 28.0)); + p.rect(key, 4.0, t.input, egui::Stroke::new(1.0, t.input_border), egui::StrokeKind::Inside); + p.text(key.center(), egui::Align2::CENTER_CENTER, "X", egui::FontId::proportional(13.0), t.text); + let start = key.right() + 10.0; + let delay_x = start + 70.0; + let rows = [(tl!("Tap"), 40.0, key.top() + 6.0), (tl!("Hold"), 100.0, key.bottom() - 6.0)]; + for (label, len, y) in rows { + let color = if start + len >= delay_x { t.accent } else { t.text_dim }; + p.line_segment([egui::pos2(start, y), egui::pos2(start + len, y)], egui::Stroke::new(4.0, color)); + p.text(egui::pos2(start + len + 4.0, y), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(10.5), t.text); + } + // The delay. + let mut y = rect.top() + 4.0; + while y < rect.bottom() - 4.0 { + p.line_segment([egui::pos2(delay_x, y), egui::pos2(delay_x, (y + 3.0).min(rect.bottom() - 4.0))], egui::Stroke::new(1.0, t.text_dim)); + y += 6.0; + } +} + +/// Apply a recorded key as `key`'s hold shortcut in the working set. Another entry that held the +/// key loses it, with the same warning as a shortcut; a key that can't hold says why. +fn record_hold(d: &mut Dialog, holds: &mut Holds, key: &str, chord: &str) { + d.fields.insert("__recording".into(), json!("")); + d.fields.insert("__recordingHold".into(), json!(false)); + match assign_hold(holds, key, Some(chord), true) { + Ok(removed) => { + d.fields.insert("set".into(), json!(CUSTOM)); + let names: Vec<String> = removed.iter().map(|k| entry(k).map(|e| shown_name(&e)).unwrap_or(k.clone())).collect(); + let message = if names.is_empty() { + String::new() + } else { + crate::i18n::fmt( + tl!("⚠ {chord} was already used by {names} — it has been removed there."), + &[("chord", &menus::pretty_shortcut(chord)), ("names", &names.join(", "))], + ) + }; + d.fields.insert("__message".into(), json!(message)); + d.fields.insert("__conflict".into(), json!("")); + } + Err(e) => { + d.fields.insert("__message".into(), json!(e)); + } + } +} + #[cfg(test)] mod tests { use super::*; @@ -2839,4 +3168,168 @@ mod tests { assert_eq!(r["shortcut"], "Cmd+Alt+Shift+F11"); assert!(app.run("shortcuts.preset", json!({"name": null})).unwrap_err().starts_with("unknown preset")); } + + /// `shortcuts.set {hold}` gives an entry a hold shortcut and leaves its shortcut, its default + /// and its overridden state alone; `shortcuts.list` shows it; Clear (`shortcut: null`) keeps it. + #[test] + fn a_hold_shortcut_is_kept_apart_from_the_shortcut() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let before = effective_in(&app.ui.shortcut_overrides, "paint.swap"); + let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "x"})).unwrap(); + assert_eq!((r["hold"].as_str(), r["shortcut"].as_str().map(str::to_string)), (Some("X"), before.clone())); + assert!(app.ui.shortcut_overrides.is_empty(), "no shortcut changed"); + assert_eq!(app.ui.shortcut_set, CUSTOM); + let rows = with_steady_plugins(|| app.run("shortcuts.list", json!({"query": "paint.swap"})).unwrap()); + let row = rows.as_array().unwrap().iter().find(|r| r["id"] == "paint.swap").unwrap().clone(); + assert_eq!((row["hold"].as_str(), row["overridden"].as_bool()), (Some("X"), Some(false))); + app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": null})).unwrap(); + assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "Use Default keeps the hold"); + app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": "Cmd+Alt+Shift+F9"})).unwrap(); + assert_eq!(hold_of(&app.ui.shortcut_holds, "paint.swap").as_deref(), Some("X"), "a new shortcut keeps the hold"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": ""})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "an empty hold removes it"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": null})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "a null hold removes it"); + } + + /// A hold shortcut is a key that types a character, alone or with Shift; other keys, a clash + /// without `force` and a hold that is not a string are refused and change nothing. + #[test] + fn hold_shortcuts_refuse_keys_that_cannot_wait() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + for bad in ["Space", "Shift+Space", "~", "Shift+~", "Cmd+X", "Alt+X", "Ctrl+X", "Left", "F5", "Enter", "Delete"] { + let r = app.run("shortcuts.set", json!({"id": "paint.swap", "hold": bad})); + assert!(r.is_err(), "{bad}: {r:?}"); + } + assert_eq!(app.run("shortcuts.set", json!({"id": "paint.swap", "hold": 5})), Err("`hold` must be a string".to_string())); + assert!(app.ui.shortcut_holds.is_empty()); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+X"})).unwrap(); + let clash = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X"})).unwrap_err(); + assert!(clash.starts_with("Hold "), "{clash}"); + // A refused hold leaves the shortcut given with it unchanged too. + let r = app.run("shortcuts.set", json!({"id": "select.none", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Shift+X"})); + assert!(r.is_err()); + assert!(app.ui.shortcut_overrides.is_empty()); + let r = app.run("shortcuts.set", json!({"id": "select.none", "hold": "Shift+X", "force": true})).unwrap(); + assert_eq!(r["removedFrom"], json!(["paint.swap"])); + assert_eq!(app.ui.shortcut_holds.keys().collect::<Vec<_>>(), ["select.none"]); + } + + /// Reset All and a preset clear the hold shortcuts; two entries holding one key are a conflict. + #[test] + fn hold_shortcut_conflicts_reset_and_presets() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.ui.shortcut_holds.insert("paint.swap".into(), "X".into()); + app.ui.shortcut_holds.insert("select.none".into(), "X".into()); + let c = app.run("shortcuts.conflicts", json!({})).unwrap(); + assert!(c.as_array().unwrap().iter().any(|c| c["shortcut"] == "Hold X"), "{c}"); + app.run("shortcuts.reset", json!({})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty()); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + app.run("shortcuts.preset", json!({"name": PRESETS[0]})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty()); + } + + /// Export… writes the hold shortcuts as `holds` (version 1) only when there are any; Import… + /// reads them, a file without them has none, and a bad one fails and applies nothing. + #[test] + fn hold_shortcuts_export_and_import() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let none = export_json("Studio", &Overrides::new()); + assert!(none.get("holds").is_none()); + let holds: Holds = [("paint.swap".to_string(), "X".to_string())].into(); + let v = export_json_with("Studio", &Overrides::new(), &holds); + assert_eq!((v["version"].as_u64(), v["holds"].clone()), (Some(1), json!({"paint.swap": "X"}))); + app.run("shortcuts.import", json!({"data": v})).unwrap(); + assert_eq!(app.ui.shortcut_holds, holds); + for bad in [json!("X"), json!({"paint.swap": 5}), json!({"paint.swap": "Space"})] { + let mut v = export_json("Other", &Overrides::new()); + v["holds"] = bad.clone(); + assert!(app.run("shortcuts.import", json!({"data": v})).is_err(), "{bad}"); + assert_eq!((app.ui.shortcut_holds.clone(), app.ui.shortcut_set.as_str()), (holds.clone(), "Studio"), "{bad}"); + } + app.run("shortcuts.import", json!({"data": none})).unwrap(); + assert!(app.ui.shortcut_holds.is_empty(), "an import replaces the whole set"); + } + + /// Export Text… gives a row with a hold shortcut a third column while Hold Shortcuts is on. + #[test] + fn export_text_lists_hold_shortcuts_while_they_act() { + type Files = std::rc::Rc<std::cell::RefCell<Vec<String>>>; + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let written: Files = Default::default(); + let w = written.clone(); + app.services.write = Some(Box::new(move |_: &str, b: &[u8]| { + w.borrow_mut().push(String::from_utf8(b.to_vec()).map_err(|e| e.to_string())?); + Ok(()) + })); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + let row = |text: &str| text.lines().find(|l| l.starts_with(&english_name(&entry("paint.swap").unwrap()))).map(str::to_string); + with_steady_plugins(|| { + written.borrow_mut().clear(); + app.run("shortcuts.exportText", json!({"path": "/a.txt"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": true})).unwrap(); + app.run("shortcuts.exportText", json!({"path": "/b.txt"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + }); + let files = written.borrow(); + let (off, on) = (row(&files[0]).unwrap(), row(&files[1]).unwrap()); + assert_eq!(off.split('\t').count(), 2, "{off}"); + assert_eq!(on.split('\t').nth(2), Some(format!("Hold {}", menus::pretty_shortcut("X")).as_str()), "{on}"); + } + + /// The text the Keyboard Shortcuts dialog draws in its second frame. + fn dialog_texts(app: &mut VectorcraftApp) -> Vec<String> { + let ctx = egui::Context::default(); + theme::install_fonts(&ctx); + // The modal draws nothing in its first frame, which only sizes it. + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx())); + out.textures_delta.clear(); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui.ctx())); + out.textures_delta.clear(); + out.shapes + .iter() + .filter_map(|c| match &c.shape { + egui::Shape::Text(t) => Some(t.galley.text().to_string()), + _ => None, + }) + .collect() + } + + /// Hold Shortcuts is off by default: the dialog shows its checkbox and no Hold column. Turned + /// on, the dialog shows the column and the delay, and OK turns hold shortcuts on; Cancel keeps + /// them off. + #[test] + fn the_hold_shortcuts_checkbox_shows_the_hold_column() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + assert!(!app.session.prefs.hold_shortcuts); + open(&mut app); + let off = dialog_texts(&mut app); + assert!(off.iter().any(|t| t == "Hold Shortcuts"), "{off:?}"); + assert!(!off.iter().any(|t| t == "Hold" || t == "Hold Shortcut Delay"), "{off:?}"); + app.ui.dialog.as_mut().unwrap().fields.insert("holdShortcuts".into(), json!(true)); + let on = dialog_texts(&mut app); + assert!(on.iter().any(|t| t == "Hold") && on.iter().any(|t| t == "Hold Shortcut Delay"), "{on:?}"); + app.ui.dialog = None; + assert!(!app.session.prefs.hold_shortcuts, "Cancel keeps them off"); + open(&mut app); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("holdShortcuts".into(), json!(true)); + d.fields.insert("keyHoldDelay".into(), json!(0.5)); + confirm(&mut app).unwrap(); + assert!(app.session.prefs.hold_shortcuts); + assert_eq!(app.session.prefs.key_hold_delay, 0.5); + } + + /// The info button shows how hold shortcuts work. + #[test] + fn the_info_button_explains_hold_shortcuts() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + open(&mut app); + assert!(!dialog_texts(&mut app).iter().any(|t| t.starts_with("A quick press"))); + app.ui.dialog.as_mut().unwrap().fields.insert("__holdInfo".into(), json!(true)); + let texts = dialog_texts(&mut app); + assert!(texts.iter().any(|t| t.starts_with("A quick press")) && texts.iter().any(|t| t == "Tap"), "{texts:?}"); + } } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index d102c40d7e..257e63ecfc 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -12,11 +12,13 @@ use vectorcraft_tools::{Mods, SurroundingUnit, ToolKey}; use crate::VectorcraftApp; mod held_tool; +mod hold_keys; mod paste; mod presentation; mod typing; pub(crate) use held_tool::{HeldTool, note_tool_use}; +pub(crate) use hold_keys::HoldKeys; use paste::unclip_chords; pub(crate) use paste::{PasteChord, paste_command}; pub(crate) use presentation::presentation_step; @@ -196,6 +198,8 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) { note_key_surfaces(app, ctx); forget_opening_key(ctx); let focused = ctx.input(|input| input.focused) || app.forwarded_frame && ctx.viewport_id() == egui::ViewportId::ROOT; + // The repeats of a key with a hold shortcut stay out of every frame until it is let go. + hold_keys::guard(app, ctx, focused); // A held tool shortcut that is let go returns to the tool active before it. held_tool::follow(app, ctx, focused); if !focused { @@ -243,6 +247,11 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) { presentation_keys(app, ctx); return; } + // Keys with a hold shortcut wait before anything else reads the frame's keys, so a key pressed + // after one acts after it. + if hold_keys::intake(app, ctx) { + return; + } // Escape that cancels a ruler-origin drag or floating Tools move skips the tool and later Escape actions, // and so do its repeats while it is held. let escape_ended_gesture = escape_ended_gesture(ctx); @@ -580,42 +589,60 @@ fn single_key_shortcuts(app: &mut VectorcraftApp, ctx: &egui::Context) { }) .collect() }); - let keymap = crate::shortcut_editor::current(); for (text, m, pressed, repeat) in events { if m.command || m.alt || m.ctrl { continue; } - let upper = text.to_uppercase(); - let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() }; - // A shifted punctuation character can also be written with its Shift (the Curvature tool's - // Shift+~ arrives as `~`). - let shifted = m.shift.then(|| format!("Shift+{text}")); - let mut chords: Vec<craft_keymap::Chord> = - [Some(key), Some(text), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect(); - // A character no chord names (`"`, which the backtick key types on Turkish Q) is read as - // the key that typed it, as the Keyboard Shortcuts editor records that press. - if chords.is_empty() { - let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE })); - chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t))); + let chords = text_chords(&text, m, pressed); + if run_single_key(app, ctx, &chords, pressed, repeat) { + break; } - let hits: Vec<CommandRef> = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect(); - // Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before - // tools. - let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { continue }; - // A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens - // its slider, and Move opens its dialog. - match hit.id.strip_prefix("tool:") { - Some(tool) => held_tool::choose(app, ctx, tool, pressed, repeat), - None => { - run_hit(app, ctx, hit); - if dialog_or_palette_open(app) { - if let Some(key) = pressed { - let id = opening_key_id(ctx); - ctx.data_mut(|m| m.insert_temp(id, key)); - } - break; - } + } +} + +/// The chords a single-key shortcut reads for `text`, typed with `m` by the key `pressed`. +fn text_chords(text: &str, m: Modifiers, pressed: Option<Key>) -> Vec<craft_keymap::Chord> { + let upper = text.to_uppercase(); + let key = if m.shift && text.chars().all(|c| c.is_alphabetic()) { format!("Shift+{upper}") } else { upper.clone() }; + // A shifted punctuation character can also be written with its Shift (the Curvature tool's + // Shift+~ arrives as `~`). + let shifted = m.shift.then(|| format!("Shift+{text}")); + let mut chords: Vec<craft_keymap::Chord> = + [Some(key), Some(text.to_string()), shifted].into_iter().flatten().filter_map(|t| crate::keymap::vc_chord(&t)).collect(); + // A character no chord names (`"`, which the backtick key types on Turkish Q) is read as + // the key that typed it, as the Keyboard Shortcuts editor records that press. + if chords.is_empty() { + let typed_by = pressed.and_then(|k| crate::shortcut_editor::chord_from_event(k, Modifiers { shift: m.shift, ..Modifiers::NONE })); + chords.extend(typed_by.and_then(|t| crate::keymap::vc_chord(&t))); + } + chords +} + +/// Runs the single-key shortcut of `chords`, typed by the key `pressed`. True when it opened a +/// dialog or the palette: the shortcuts after it in the frame do not run. +fn run_single_key(app: &mut VectorcraftApp, ctx: &egui::Context, chords: &[craft_keymap::Chord], pressed: Option<Key>, repeat: bool) -> bool { + let keymap = crate::shortcut_editor::current(); + let hits: Vec<CommandRef> = chords.iter().filter_map(|c| crate::keymap::lookup(&keymap.keymap, c)).collect(); + // Single-key command shortcuts (X, Shift+X, D, /, Shift+D, F, Shift+F by default) before + // tools. + let Some(hit) = hits.iter().find(|c| !c.id.starts_with("tool:")).or(hits.first()) else { return false }; + // A command runs as it does on a chord ([`run_hit`]): what its menu item runs. Smooth opens + // its slider, and Move opens its dialog. + match hit.id.strip_prefix("tool:") { + Some(tool) => { + held_tool::choose(app, ctx, tool, pressed, repeat); + false + } + None => { + run_hit(app, ctx, hit); + if !dialog_or_palette_open(app) { + return false; } + if let Some(key) = pressed { + let id = opening_key_id(ctx); + ctx.data_mut(|m| m.insert_temp(id, key)); + } + true } } } @@ -1077,7 +1104,7 @@ fn run_hit(app: &mut VectorcraftApp, ctx: &egui::Context, c: &CommandRef) { } /// Keys that type a character: letters, digits and punctuation (not Space). -fn types_text(key: craft_keymap::Key) -> bool { +pub(crate) fn types_text(key: craft_keymap::Key) -> bool { key.name().chars().count() == 1 } diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs new file mode 100644 index 0000000000..eb7c92ab04 --- /dev/null +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -0,0 +1,321 @@ +//! Hold shortcuts (Edit › Keyboard Shortcuts, Hold Shortcuts on, the Hold column): a character key +//! with a hold shortcut waits when it goes down. Held for the Hold Shortcut Delay (`keyHoldDelay`), +//! it runs its hold shortcut once, and its repeats are ignored until it is let go. Let go sooner, it +//! runs what a press of the key runs without a hold shortcut, at the release. A key without a hold +//! shortcut runs on its press, as before, and so does every key while Hold Shortcuts is off. + +use super::{Key, Modifiers, VectorcraftApp}; +use vectorcraft_tools::ToolKey; + +/// A press of a key with a hold shortcut, waiting for its release or for the delay to pass. +pub(crate) struct Pending { + /// The entry the hold shortcut runs (`tool:<id>`, a command id or `panel:<id>`). + entry: String, + /// The chords the press names, first match first, for the tap. + chords: Vec<craft_keymap::Chord>, + /// The key as egui reported the press, before any rewrite of the dispatcher. + key: Key, + /// The key's position, when the press gave one. + physical: Option<Key>, + /// The modifiers held at the press. + mods: Modifiers, + /// When the key went down (`egui::InputState::time`). + since: f64, + /// The Hold Shortcut Delay read at the press: a later change does not move this wait. + delay: f64, + /// The viewport whose frame saw the press. Frames of other viewports leave the wait alone. + viewport: egui::ViewportId, +} + +/// A key whose repeats, and the text they type, are dropped until it is let go. +#[derive(Clone, Copy, PartialEq)] +struct Swallowed { + key: Key, + physical: Option<Key>, + viewport: egui::ViewportId, +} + +/// The hold shortcut state of the app: at most one waiting press, and the keys held down after +/// their wait ended. +#[derive(Default)] +pub(crate) struct HoldKeys { + pending: Option<Pending>, + swallowed: Vec<Swallowed>, +} + +/// Is `e` the release of the key `key` at `physical`? The position decides when both events give +/// one; otherwise the key decides. +fn releases(e: &egui::Event, key: Key, physical: Option<Key>) -> bool { + matches!(e, egui::Event::Key { key: k, physical_key: p, pressed: false, .. } if same_key(*k, *p, key, physical)) +} + +fn same_key(k: Key, p: Option<Key>, key: Key, physical: Option<Key>) -> bool { + match (p, physical) { + (Some(p), Some(q)) => p == q, + _ => k == key || Some(k) == physical, + } +} + +/// Is the key still down? egui keeps the keys down by the key it reported for the press. +fn is_down(i: &egui::InputState, key: Key, physical: Option<Key>) -> bool { + i.key_down(key) || physical.is_some_and(|p| i.key_down(p)) +} + +/// What stops a wait: anything that takes the keyboard from the canvas. +fn blocked(app: &VectorcraftApp, ctx: &egui::Context) -> bool { + crate::scrub::phase(ctx) != crate::scrub::Phase::Idle + || crate::updates_ui::blocks_input(app) + || app.ui.dialog.is_some() + || app.ui.palette_open + || app.ui.screen_mode == 3 + || ctx.egui_wants_keyboard_input() + || app.session.tool_wants_text() + || app.session.tool_composing() + || app.session.tool_busy() + // An input method composing on the canvas with any tool. + || ctx.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Ime(egui::ImeEvent::Preedit { text, .. }) if !text.is_empty()))) +} + +/// Every frame, before anything can return: drops the repeats of the keys held after their wait +/// ended or while it waits, and the text they type, also on frames that run no shortcut. Ends the +/// wait without running anything when the window lost the keyboard, or when a field, a dialog, +/// Presentation Mode, a numeric scrub, an IME composition or a busy tool has it. +pub(super) fn guard(app: &mut VectorcraftApp, ctx: &egui::Context, focused: bool) { + let viewport = ctx.viewport_id(); + if !focused { + // egui lets go of every key when the window loses the keyboard. + if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) { + app.hold_keys.pending = None; + } + app.hold_keys.swallowed.retain(|s| s.viewport != viewport); + return; + } + if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) && (blocked(app, ctx) || !app.session.prefs.hold_shortcuts) { + cancel(app, ctx); + } + let mut held: Vec<(Key, Option<Key>)> = app.hold_keys.swallowed.iter().filter(|s| s.viewport == viewport).map(|s| (s.key, s.physical)).collect(); + held.extend(app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport).map(|p| (p.key, p.physical))); + if held.is_empty() { + return; + } + drop_repeats(ctx, &held); + // A key let go, or pressed anew, is no longer held back after this frame: a repeat that came + // in the same frame as its release was dropped above. + ctx.input(|i| { + app.hold_keys.swallowed.retain(|s| { + s.viewport != viewport + || is_down(i, s.key, s.physical) + && !i.events.iter().any(|e| { + releases(e, s.key, s.physical) + || matches!(e, egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, s.key, s.physical)) + }) + }); + }); +} + +/// Removes this frame's repeats of the keys `held`, and the text they type. +fn drop_repeats(ctx: &egui::Context, held: &[(Key, Option<Key>)]) { + let repeat = |e: Option<&egui::Event>| { + matches!(e, Some(egui::Event::Key { key, physical_key, pressed: true, repeat: true, .. }) + if held.iter().any(|(k, p)| same_key(*key, *physical_key, *k, *p))) + }; + ctx.input_mut(|i| { + let typed_by = super::typing_presses(&i.events); + let drop: Vec<bool> = i + .events + .iter() + .zip(typed_by) + .map(|(e, by)| repeat(Some(e)) || matches!(e, egui::Event::Text(_)) && repeat(by.and_then(|k| i.events.get(k)))) + .collect(); + let mut drop = drop.into_iter(); + i.events.retain(|_| !drop.next().unwrap_or(false)); + }); +} + +/// Ends the wait without running anything; the key's repeats stay held back until it is let go. +fn cancel(app: &mut VectorcraftApp, ctx: &egui::Context) { + let Some(p) = app.hold_keys.pending.take() else { return }; + if ctx.input(|i| is_down(i, p.key, p.physical)) { + app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport }); + } +} + +/// Runs the result of the wait: the hold shortcut when `hold`, otherwise the tap. `down`: the key +/// is still down, so its repeats are held back until it is let go. True when the result opened a +/// dialog or the palette. +fn settle(app: &mut VectorcraftApp, ctx: &egui::Context, hold: bool, down: bool) -> bool { + let Some(p) = app.hold_keys.pending.take() else { return false }; + if down { + app.hold_keys.swallowed.push(Swallowed { key: p.key, physical: p.physical, viewport: p.viewport }); + } + if hold { + super::run_hit(app, ctx, &crate::keymap::command_of(&p.entry)); + } else { + // The key is already up, or another key went down: a tool it chooses is chosen for good. + super::run_single_key(app, ctx, &p.chords, None, false); + } + let opened = super::dialog_or_palette_open(app); + if opened && down { + // The key's repeats do not reach the dialog. + let id = super::opening_key_id(ctx); + ctx.data_mut(|m| m.insert_temp(id, p.key)); + } + opened +} + +/// The chords a press names for a hold shortcut, first match first: those of the text it typed, as +/// a single-key shortcut reads them, then the key itself with its Shift (Shift+1 typing `!`). A +/// letter names only the chord with its own Shift state: a hold on X does not catch Shift+X. +fn press_chords(text: &str, key: Key, m: Modifiers) -> Vec<craft_keymap::Chord> { + let mut chords = super::text_chords(text, m, Some(key)); + if !text.is_empty() && text.chars().all(char::is_alphabetic) { + chords.retain(|c| c.mods.shift == m.shift); + } + let shift = Modifiers { shift: m.shift, ..Modifiers::NONE }; + if let Some(c) = crate::shortcut_editor::chord_from_event(key, shift).and_then(|t| crate::keymap::vc_chord(&t)) + && !chords.contains(&c) + { + chords.push(c); + } + chords +} + +/// The chords a quick press runs, as the key runs without a hold shortcut: a shortcut on a shifted +/// punctuation key itself (Shift+.), which the shortcuts read from the key press, then those of +/// the text it typed. +fn tap_chords(text: &str, key: Key, m: Modifiers) -> Vec<craft_keymap::Chord> { + let shift = Modifiers { shift: m.shift, ..Modifiers::NONE }; + let pressed = crate::shortcut_editor::chord_from_event(key, shift) + .and_then(|t| crate::keymap::vc_chord(&t)) + .filter(|c| c.mods.shift && c.key.name().chars().all(|ch| !ch.is_alphanumeric())); + let mut chords: Vec<craft_keymap::Chord> = super::text_chords(text, m, Some(key)).into_iter().filter(|c| pressed.as_ref() != Some(c)).collect(); + if let Some(c) = pressed { + chords.insert(0, c); + } + chords +} + +/// Does the active tool take this key itself (a digit with the perspective grid showing, a bracket +/// with the Blob Brush, E with the Extend Path tool)? Then the key keeps doing that and does not +/// wait. +fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { + let view = app.view_info(); + let tool_key = match text { + "[" | "{" => Some(ToolKey::BracketLeft), + "]" | "}" => Some(ToolKey::BracketRight), + _ => super::digit_of(key).map(ToolKey::Digit).or_else(|| super::letter_of(key).map(ToolKey::Letter)), + }; + tool_key.is_some_and(|k| app.session.tool_claims_key(k, view)) +} + +/// Before the frame's shortcuts run: goes through the frame's events in order. A release of the +/// waiting key ends the wait (the hold when the delay has passed, otherwise the tap); a press of +/// another key, or a change of Cmd, Ctrl or Alt, ends it first, so the keys act in the order they +/// went down; and a new press of a key with a hold shortcut starts a wait, taking the press and +/// its text from the frame. Then a wait whose delay has passed with the key down runs the hold +/// shortcut. True when a result opened a dialog or the palette: the rest of the frame's keys are +/// dropped and no other shortcut runs. +pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { + // Off (Keyboard Shortcuts › Hold Shortcuts), every key runs on its press. + if !app.session.prefs.hold_shortcuts || blocked(app, ctx) { + return false; + } + let viewport = ctx.viewport_id(); + let (events, now) = ctx.input(|i| (i.events.clone(), i.time)); + let typed_by = super::typing_presses(&events); + let text_of = |k: usize| typed_by.iter().position(|by| *by == Some(k)).and_then(|j| events.get(j).map(|e| (j, e))); + let mut taken: Vec<usize> = vec![]; + let mut stop_at = None; + for (j, e) in events.iter().enumerate() { + if let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) { + let overdue = now - p.since >= p.delay; + let ended = if releases(e, p.key, p.physical) { + Some((overdue, false)) + } else { + match e { + egui::Event::Key { key, physical_key, pressed: true, .. } + if !super::is_modifier(*key) && !same_key(*key, *physical_key, p.key, p.physical) => + { + Some((overdue, true)) + } + // A new press of the waiting key whose release was never seen. + egui::Event::Key { key, physical_key, pressed: true, repeat: false, .. } if same_key(*key, *physical_key, p.key, p.physical) => { + Some((false, false)) + } + egui::Event::ModifiersChanged(m) if (m.command, m.ctrl, m.alt) != (p.mods.command, p.mods.ctrl, p.mods.alt) => { + Some((false, true)) + } + _ => None, + } + }; + if let Some((hold, down)) = ended + && settle(app, ctx, hold, down) + { + stop_at = Some(j); + break; + } + } + let egui::Event::Key { key, physical_key, pressed: true, repeat: false, modifiers: m } = e else { continue }; + if m.command || m.ctrl || m.alt || m.mac_cmd || super::is_modifier(*key) { + continue; + } + // Only a press that typed a text waits: a text alone has no key to let go. + let Some((t, egui::Event::Text(text))) = text_of(j) else { continue }; + let typed = super::latin(text, *physical_key); + let Some(entry) = + press_chords(&typed, *key, *m).iter().find_map(|c| crate::shortcut_editor::hold_for(&app.ui.shortcut_holds, c)).map(str::to_string) + else { + continue; + }; + let chords = tap_chords(&typed, *key, *m); + if tool_takes(app, *key, text) { + continue; + } + taken.extend([j, t]); + // A wait left in another viewport ends without running: that window lost the keyboard to + // this one. Its key's repeats stay held back there until it is let go. + if let Some(old) = app.hold_keys.pending.take_if(|p| p.viewport != viewport) { + app.hold_keys.swallowed.push(Swallowed { key: old.key, physical: old.physical, viewport: old.viewport }); + } + let delay = app.session.prefs.key_hold_delay(); + app.hold_keys.pending = Some(Pending { entry, chords, key: *key, physical: *physical_key, mods: *m, since: now, delay, viewport }); + } + // Take the waiting presses and their texts, and after a result that opened a dialog, the key + // event that ended the wait and every later key event and text of the frame, with the text a + // press typed before it (the web build sends a press's text first): none of them reaches the + // dialog. + ctx.input_mut(|i| { + if i.events.len() != events.len() { + return; + } + let mut j = 0; + i.events.retain(|e| { + let k = j; + j += 1; + let later = stop_at.is_some_and(|s| { + k >= s && matches!(e, egui::Event::Key { .. } | egui::Event::Text(_)) + || matches!(e, egui::Event::Text(_)) && typed_by.get(k).copied().flatten().is_some_and(|by| by >= s) + }); + !(taken.contains(&k) || later) + }); + }); + if stop_at.is_some() { + return true; + } + let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) else { return false }; + let deadline = p.since + p.delay; + let down = ctx.input(|i| is_down(i, p.key, p.physical)); + if !down { + // Let go without a release this frame saw. + return settle(app, ctx, now >= deadline, false); + } + if now >= deadline { + return settle(app, ctx, true, true); + } + // egui draws only on input, and a held key need not repeat: draw again at the deadline. + ctx.request_repaint_after_secs((deadline - now) as f32); + false +} + +#[cfg(test)] +mod tests; diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs new file mode 100644 index 0000000000..be7765f8f3 --- /dev/null +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -0,0 +1,517 @@ +use serde_json::json; + +use super::super::handle; +use super::*; + +/// A keyboard on one context, so egui keeps the keys held down from frame to frame and marks a +/// held key's later presses as repeats, with the frame times the test sets. +struct Keyboard { + ctx: egui::Context, +} + +impl Keyboard { + fn new() -> Self { + Self { ctx: egui::Context::default() } + } + + /// One frame at `time` seconds delivering `events`, with the window having the keyboard + /// (`focused`) or not. + fn frame_with_focus(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>, focused: bool) { + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))); + let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused, ..Default::default() }, |ui| { + app.logic(ui.ctx()); + handle(app, ui.ctx()); + }); + out.textures_delta.clear(); + } + + fn frame(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>) { + self.frame_with_focus(app, time, events, true); + } + + /// [`Self::frame`], giving the events the shortcuts left in the first pass for what is drawn + /// after them. + fn frame_left(&self, app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>) -> Vec<egui::Event> { + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))); + let mut left = None; + let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect, time: Some(time), focused: true, ..Default::default() }, |ui| { + app.logic(ui.ctx()); + handle(app, ui.ctx()); + if left.is_none() { + left = Some(ui.ctx().input(|i| i.events.clone())); + } + }); + out.textures_delta.clear(); + left.unwrap_or_default() + } + + /// `key` pressed (a repeat when it is already down) at `time`, typing `text`. + fn press(&self, app: &mut VectorcraftApp, time: f64, key: Key, text: &str) { + self.frame(app, time, press(key, text, Modifiers::NONE)); + } + + fn release(&self, app: &mut VectorcraftApp, time: f64, key: Key) { + self.frame(app, time, vec![release(key)]); + } +} + +fn press(key: Key, text: &str, modifiers: Modifiers) -> Vec<egui::Event> { + vec![egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }, egui::Event::Text(text.into())] +} + +fn release(key: Key) -> egui::Event { + egui::Event::Key { key, physical_key: Some(key), pressed: false, repeat: false, modifiers: Modifiers::NONE } +} + +/// A document with a selected rectangle filled red with a blue stroke, the Pen tool chosen, and +/// Hold Shortcuts `on`. +fn app_with(on: bool) -> VectorcraftApp { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + crate::shortcut_editor::sync(&app.ui); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + app.run("shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 50})).unwrap(); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap(); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": on})).unwrap(); + app.select_tool("pen"); + app +} + +/// erolka's X: a quick press chooses the Eyedropper, and holding X swaps fill and stroke. +fn erolka_x(on: bool) -> VectorcraftApp { + let mut app = app_with(on); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "X", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + app +} + +/// The fill of the selected object, as `#rrggbb`. +fn fill(app: &VectorcraftApp) -> String { + let d = app.session.active().unwrap(); + let id = *d.selection.objects.first().unwrap(); + d.doc.node(id).unwrap().appearance.fill_paint().color().unwrap().to_hex() +} + +fn selected(app: &VectorcraftApp) -> usize { + app.session.active().unwrap().selection.objects.len() +} + +/// A quick press of X runs its tap at the release, and holding X runs the hold once at the delay, +/// also with no repeats; the repeats until the release run nothing more. +#[test] +fn a_tap_runs_the_key_and_a_hold_runs_the_hold_shortcut() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert_eq!(app.session.tool_id(), "pen", "the press waits"); + keys.release(&mut app, 0.1, Key::X); + assert_eq!(app.session.tool_id(), "eyedropper", "the quick press chooses the Eyedropper"); + assert_eq!(fill(&app), "#ff0000", "and swaps nothing"); + + app.select_tool("pen"); + keys.press(&mut app, 1.0, Key::X, "x"); + keys.frame(&mut app, 1.2, vec![]); + assert_eq!(fill(&app), "#ff0000", "before the delay nothing runs"); + keys.frame(&mut app, 1.35, vec![]); + assert_eq!(fill(&app), "#0000ff", "at the delay the hold swaps fill and stroke"); + assert_eq!(app.session.tool_id(), "pen", "and chooses no tool"); + for t in [1.5, 1.6, 1.7] { + keys.press(&mut app, t, Key::X, "x"); + } + keys.release(&mut app, 1.8, Key::X); + assert_eq!(fill(&app), "#0000ff", "the repeats and the release swap nothing more"); + assert_eq!(app.session.tool_id(), "pen"); +} + +/// The delay is the Hold Shortcut Delay read at the press. +#[test] +fn the_hold_waits_for_the_hold_shortcut_delay() { + let mut app = erolka_x(true); + app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.8})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + app.run("prefs.set", json!({"key": "keyHoldDelay", "value": 0.2})).unwrap(); + keys.frame(&mut app, 0.5, vec![]); + assert_eq!(fill(&app), "#ff0000", "a later change does not move the wait"); + keys.frame(&mut app, 0.8, vec![]); + assert_eq!(fill(&app), "#0000ff"); +} + +/// erolka's `.`: a quick press keeps the key's own command (Apply Last Gradient) and keeps the +/// selection, and holding it deselects. +#[test] +fn the_period_key_taps_its_own_command_and_holds_to_deselect() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "select.none", "hold": "."})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::Period, "."); + keys.release(&mut app, 0.1, Key::Period); + assert_eq!(selected(&app), 1, "the quick press keeps the selection"); + let d = app.session.active().unwrap(); + let id = *d.selection.objects.first().unwrap(); + let appearance = &d.doc.node(id).unwrap().appearance; + let gradient = |p: vectorcraft_color::Paint| matches!(p, vectorcraft_color::Paint::Gradient(_)); + assert!(gradient(appearance.fill_paint()) || gradient(appearance.stroke_paint()), "and applies the last gradient"); + // Solid paint again, so a hold that also ran the tap would show. + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap(); + keys.press(&mut app, 1.0, Key::Period, "."); + keys.frame(&mut app, 1.4, vec![]); + assert_eq!(selected(&app), 0, "the hold deselects"); + keys.release(&mut app, 1.5, Key::Period); + let appearance = &app.session.active().unwrap().doc.node(id).unwrap().appearance; + assert!(!gradient(appearance.fill_paint()) && !gradient(appearance.stroke_paint()), "and applies no gradient"); +} + +/// A hold on a letter alone does not catch the letter with Shift: Shift+X, held, does with Hold +/// Shortcuts on what it does with them off, and does not wait. +#[test] +fn a_hold_on_a_letter_leaves_the_letter_with_shift_alone() { + let mut results = vec![]; + for on in [false, true] { + let mut app = erolka_x(on); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::X, "X", Modifiers::SHIFT)); + assert!(app.hold_keys.pending.is_none(), "Shift+X does not wait (on {on})"); + let pressed = (fill(&app), app.session.tool_id().to_string()); + keys.frame(&mut app, 1.0, vec![]); + keys.frame(&mut app, 1.1, vec![release(Key::X)]); + results.push((pressed, fill(&app), app.session.tool_id().to_string())); + } + assert_eq!(results[0], results[1], "holding Shift+X does not run X's hold"); +} + +/// A letter the active tool takes itself (E with the Extend Path tool) does not wait, also with a +/// hold shortcut on it. +#[test] +fn a_letter_the_tool_takes_does_not_wait() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "E"})).unwrap(); + app.select_tool(vectorcraft_tools::addons::extend_path::ID); + assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::E, "e"); + assert!(app.hold_keys.pending.is_none(), "E stays the tool's"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::E); + assert_eq!(fill(&app), "#ff0000", "the hold does not run"); + assert_eq!(app.session.tool_id(), vectorcraft_tools::addons::extend_path::ID); +} + +/// An input method that starts composing while a key waits ends the wait without running anything. +#[test] +fn an_input_method_composition_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some()); + keys.frame(&mut app, 0.1, vec![egui::Event::Ime(egui::ImeEvent::Preedit { text: "か".into(), active_range_chars: Some(1..1) })]); + assert!(app.hold_keys.pending.is_none(), "the composition ends the wait"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::X); + assert_eq!(app.session.tool_id(), "pen", "no tap ran"); + assert_eq!(fill(&app), "#ff0000", "and no hold"); +} + +/// A dialog opened, or Presentation Mode entered, while a key waits ends the wait without running +/// anything. +#[test] +fn a_dialog_or_presentation_mode_ends_the_wait() { + for what in ["dialog", "Presentation Mode"] { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some(), "{what}"); + if what == "dialog" { + app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({}))); + } else { + app.ui.screen_mode = 3; + } + keys.frame(&mut app, 0.1, vec![]); + assert!(app.hold_keys.pending.is_none(), "{what} ends the wait"); + app.ui.dialog = None; + app.ui.screen_mode = 0; + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::X); + assert_eq!(app.session.tool_id(), "pen", "{what}: no tap ran"); + assert_eq!(fill(&app), "#ff0000", "{what}: and no hold"); + } +} + +/// A new wait does not drop a wait left in another viewport unseen: that wait ends, and its key's +/// repeats stay held back in its viewport. +#[test] +fn a_wait_in_another_viewport_ends_when_a_new_one_starts() { + let mut app = erolka_x(true); + let other = egui::ViewportId::from_hash_of("another window"); + app.hold_keys.pending = Some(Pending { + entry: "paint.swap".into(), + chords: vec![], + key: Key::X, + physical: Some(Key::X), + mods: Modifiers::NONE, + since: 0.0, + delay: 0.35, + viewport: other, + }); + let keys = Keyboard::new(); + keys.press(&mut app, 0.1, Key::X, "x"); + assert!(app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == egui::ViewportId::ROOT), "the new press waits here"); + assert!(app.hold_keys.swallowed.iter().any(|s| s.viewport == other && s.key == Key::X), "the other window's key stays held back"); + assert_eq!(fill(&app), "#ff0000", "the other wait ran nothing"); +} + +/// With Hold Shortcuts off, a key with a hold shortcut runs on its press, as every key does, and +/// holding it runs nothing else. +#[test] +fn with_hold_shortcuts_off_every_key_runs_on_its_press() { + let mut app = erolka_x(false); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert_eq!(app.session.tool_id(), "eyedropper", "the press runs at once"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.2, Key::X); + assert_eq!(fill(&app), "#ff0000", "the hold shortcut does not act"); + assert!(app.hold_keys.pending.is_none()); +} + +/// Turning Hold Shortcuts off while a key waits ends the wait without running anything. +#[test] +fn turning_hold_shortcuts_off_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some()); + app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + keys.frame(&mut app, 0.5, vec![]); + keys.release(&mut app, 0.6, Key::X); + assert!(app.hold_keys.pending.is_none()); + assert_eq!(fill(&app), "#ff0000", "no hold ran"); + assert_eq!(app.session.tool_id(), "pen", "and no tap"); +} + +/// A key without a hold shortcut runs in its press frame, and a waiting key pressed before it acts +/// first. +#[test] +fn another_key_ends_the_wait_and_runs_after_it() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::P, "p"); + assert_eq!(app.session.tool_id(), "pen", "P runs on its press"); + keys.release(&mut app, 0.05, Key::P); + keys.press(&mut app, 0.1, Key::X, "x"); + keys.press(&mut app, 0.2, Key::V, "v"); + assert_eq!(app.session.tool_id(), "selection", "X's tap (Eyedropper) ran, then V (Selection)"); + assert_eq!(fill(&app), "#ff0000"); + keys.release(&mut app, 0.3, Key::X); + assert_eq!(app.session.tool_id(), "selection", "the release of X runs nothing more"); +} + +/// Two keys pressed in one frame act in the order they went down. +#[test] +fn keys_in_one_frame_act_in_order() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.extend(press(Key::V, "v", Modifiers::NONE)); + keys.frame(&mut app, 0.0, events); + assert_eq!(app.session.tool_id(), "selection", "X's tap first, then V"); + let mut events = press(Key::V, "v", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + app.select_tool("pen"); + keys.frame(&mut app, 1.0, vec![release(Key::X), release(Key::V)]); + keys.frame(&mut app, 2.0, events); + keys.frame(&mut app, 2.1, vec![release(Key::X)]); + assert_eq!(app.session.tool_id(), "eyedropper", "V first, then X's tap at its release"); +} + +/// A press and its release in one frame are a tap, run in that frame. +#[test] +fn a_press_and_release_in_one_frame_is_a_tap() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.push(release(Key::X)); + keys.frame(&mut app, 0.0, events); + assert_eq!(app.session.tool_id(), "eyedropper"); + assert!(app.hold_keys.pending.is_none()); + keys.frame(&mut app, 5.0, vec![]); + assert_eq!(fill(&app), "#ff0000", "nothing waits after it"); +} + +/// Another key pressed after the delay has passed, before a frame ran the hold, runs the hold. +#[test] +fn an_overdue_wait_ended_by_another_key_runs_the_hold() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.press(&mut app, 0.5, Key::V, "v"); + assert_eq!(fill(&app), "#0000ff", "the hold ran"); + assert_eq!(app.session.tool_id(), "selection", "then V"); +} + +/// The window losing the keyboard ends the wait without running anything. +#[test] +fn losing_the_keyboard_ends_the_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.frame_with_focus(&mut app, 0.1, vec![], false); + keys.frame(&mut app, 1.0, vec![]); + assert_eq!(app.session.tool_id(), "pen"); + assert_eq!(fill(&app), "#ff0000"); + assert!(app.hold_keys.pending.is_none()); +} + +/// Cmd, Ctrl or Alt pressed while a key waits ends the wait as a tap, before the chord runs. +#[test] +fn a_command_modifier_ends_the_wait_as_a_tap() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + keys.frame(&mut app, 0.1, vec![egui::Event::ModifiersChanged(Modifiers::COMMAND)]); + assert_eq!(app.session.tool_id(), "eyedropper"); + keys.frame(&mut app, 1.0, vec![]); + assert_eq!(fill(&app), "#ff0000", "nothing waits after it"); +} + +/// A tool key with a hold shortcut runs the hold, and the tool is not chosen for the time the key +/// is held (`holdToolKeys`); a quick press chooses the tool for good. +#[test] +fn a_hold_shortcut_takes_a_tool_key_from_hold_tool_keys() { + let mut app = app_with(true); + assert!(app.session.prefs.hold_tool_keys); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "S"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::S, "s"); + keys.frame(&mut app, 0.4, vec![]); + assert_eq!(fill(&app), "#0000ff", "the hold runs"); + assert_eq!(app.session.tool_id(), "pen", "Scale is not chosen while S is held"); + keys.release(&mut app, 1.0, Key::S); + assert_eq!(app.session.tool_id(), "pen"); + keys.press(&mut app, 2.0, Key::S, "s"); + keys.release(&mut app, 2.1, Key::S); + assert_eq!(app.session.tool_id(), "scale", "a quick press chooses Scale"); + keys.frame(&mut app, 3.0, vec![]); + assert_eq!(app.session.tool_id(), "scale", "for good"); + assert!(app.held_tool.is_empty()); +} + +/// A tool key without a hold shortcut still chooses its tool while held when another key has one. +#[test] +fn other_tool_keys_keep_hold_tool_keys() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::S, "s"); + assert_eq!(app.session.tool_id(), "scale"); + keys.frame(&mut app, 1.0, vec![]); + keys.release(&mut app, 1.1, Key::S); + assert_eq!(app.session.tool_id(), "pen", "the Pen comes back"); +} + +/// A hold on Shift and a digit recorded in the dialog (Shift+1) holds when the press types `!`. +#[test] +fn a_shifted_digit_holds_when_it_types_its_symbol() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::Num1, "!", Modifiers::SHIFT)); + keys.frame(&mut app, 0.4, vec![]); + assert_eq!(fill(&app), "#0000ff"); +} + +/// A quick press of a shifted key with a hold shortcut runs what the key runs without one: a +/// shortcut on Shift+. (typing `>`) runs, and Shift+1 (typing `!`) runs what `!` runs. +#[test] +fn a_quick_press_of_a_shifted_key_runs_what_it_runs_without_a_hold() { + for (key, text, chord) in [(Key::Period, ">", "Shift+."), (Key::Num1, "!", "Shift+1")] { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": chord, "force": true})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(key, text, Modifiers::SHIFT)); + keys.frame(&mut app, 0.05, vec![release(key)]); + let without = app.session.tool_id().to_string(); + app.select_tool("pen"); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": chord})).unwrap(); + keys.frame(&mut app, 1.0, press(key, text, Modifiers::SHIFT)); + assert_eq!(app.session.tool_id(), "pen", "{chord} waits"); + keys.frame(&mut app, 1.05, vec![release(key)]); + assert_eq!(app.session.tool_id(), without, "a quick press of {chord}"); + assert_eq!(fill(&app), "#ff0000"); + } +} + +/// The Shift+. shortcut runs on its press without a hold shortcut, and at the release of a quick +/// press with one. +#[test] +fn a_quick_press_of_shift_period_runs_its_shortcut() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "tool:eyedropper", "shortcut": "Shift+.", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+."})).unwrap(); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::Period, ">", Modifiers::SHIFT)); + keys.frame(&mut app, 0.05, vec![release(Key::Period)]); + assert_eq!(app.session.tool_id(), "eyedropper"); +} + +/// A text with no key press that typed it does not wait: it has no key to let go. +#[test] +fn a_text_without_its_key_press_does_not_wait() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, vec![egui::Event::Text("x".into())]); + assert!(app.hold_keys.pending.is_none()); + assert_eq!(app.session.tool_id(), "eyedropper", "it runs as a single-key shortcut, as before"); +} + +/// A hold whose command opens a dialog holds back the key's repeats from it. +#[test] +fn a_hold_that_opens_a_dialog_keeps_the_repeats_from_it() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + keys.frame(&mut app, 0.4, vec![]); + assert!(app.ui.dialog.is_some(), "the hold opened Preferences"); + let opening = keys.ctx.data(|m| m.get_temp::<Key>(super::super::opening_key_id(&keys.ctx))); + assert_eq!(opening, Some(Key::K), "K is the key that opened it"); + keys.press(&mut app, 0.5, Key::K, "k"); + assert!(app.hold_keys.swallowed.iter().any(|s| s.key == Key::K), "K's repeats are held back until it is let go"); + // A repeat in the same frame as the release is held back too. + let mut events = press(Key::K, "k", Modifiers::NONE); + events.push(release(Key::K)); + let left = keys.frame_left(&mut app, 0.6, events); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); + assert!(app.hold_keys.swallowed.is_empty()); +} + +/// A key that ends a wait whose tap opens a dialog does not reach the dialog: Enter does not +/// confirm it. +#[test] +fn the_key_that_ends_a_wait_does_not_reach_the_dialog_it_opened() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + let enter = egui::Event::Key { key: Key::Enter, physical_key: Some(Key::Enter), pressed: true, repeat: false, modifiers: Modifiers::NONE }; + let left = keys.frame_left(&mut app, 0.1, vec![enter]); + assert!(app.ui.dialog.is_some(), "the tap opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Key { key: Key::Enter, .. })), "{left:?}"); + assert_eq!(fill(&app), "#ff0000"); +} + +/// On the web build a press's text comes before it: the text of the key that ends such a wait +/// does not reach the dialog either. +#[test] +fn the_text_before_the_key_that_ends_a_wait_does_not_reach_the_dialog() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "K", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "K"})).unwrap(); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::K, "k"); + let m = egui::Event::Key { key: Key::M, physical_key: Some(Key::M), pressed: true, repeat: false, modifiers: Modifiers::NONE }; + let left = keys.frame_left(&mut app, 0.1, vec![egui::Event::Text("m".into()), m]); + assert!(app.ui.dialog.is_some(), "the tap opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); +} diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 2fbe54d633..dc83db59bc 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -670,6 +670,12 @@ pub struct UiState { /// stored in the form every earlier version reads. #[serde(default, with = "crate::keymap::stored")] pub shortcut_overrides: craft_keymap::Overrides, + /// Hold shortcuts: command id, `tool:<id>` or `panel:<id>` → a character key, alone or with + /// Shift ("X", "Shift+X", "."). Holding the key for the Hold Shortcut Delay runs the entry; a + /// quick press runs the key's own shortcut when it is let go. Kept apart from + /// `shortcut_overrides`, so earlier versions read the settings without them. + #[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")] + pub shortcut_holds: std::collections::BTreeMap<String, String>, /// Name of the shortcut set (preset or "Custom"). #[serde(default = "default_shortcut_set", deserialize_with = "crate::shortcut_editor::deserialize_set_name")] pub shortcut_set: String, @@ -1221,6 +1227,7 @@ impl Default for UiState { action_playback: Default::default(), action_playing: None, shortcut_overrides: Default::default(), + shortcut_holds: Default::default(), shortcut_set: default_shortcut_set(), workspace: default_workspace(), touch_workspace_restore: None, diff --git a/docs/mcp.md b/docs/mcp.md index e623b86cac..d67835d549 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6330,6 +6330,33 @@ page describes saving the list from the Keyboard Shortcuts dialog as a text file {"name":"run_command","arguments":{"command":"shortcuts.exportText","params":{"path":"/Users/me/Shortcuts.txt"}}} ``` +A tool or command can also have a hold shortcut: a key that types a character (a letter, a digit or a punctuation +key), alone or with Shift. Space and the backtick key cannot be hold shortcuts, and neither can a key with Cmd, Ctrl or +Alt. Hold shortcuts act only while the preference `holdShortcuts` is on; it is off by default, and Edit › Keyboard +Shortcuts shows it as the Hold Shortcuts checkbox, with a ? button that explains it. While it is off, the dialog shows +no Hold column and every key runs on its press. While it is on, the dialog shows a Hold column and the Hold Shortcut +Delay (`keyHoldDelay`, 0.2 to 1.0 s, 0.35 s by default; VectorCraft's own values). Preferences › General › Options +lists both settings too, with Hold Shortcut Delay dimmed while Hold Shortcuts is off. A key with a hold shortcut then +waits when it goes down: held for the delay, it runs its hold shortcut once and its repeats are ignored until it is let +go; let go sooner, it runs what the key runs without a hold shortcut, at the release. Another key pressed while one +waits, or Cmd, Ctrl or Alt pressed then, ends the wait first, so keys act in the order they went down. The window losing +the keyboard, a dialog, a text field, Presentation Mode or an input method composition ends the wait and runs nothing. +Keys without a hold shortcut run on their press as before, and so does a letter with Shift when only the letter alone +has a hold shortcut, or a key the active tool uses itself (E with the Extend Path tool). + +`shortcuts.set {id, hold}` sets a hold shortcut, and `hold: ""` or `null` removes it; `hold` alone leaves the entry's +shortcut as it is, and a key that another entry already holds is refused unless `force` is true. Hold shortcuts are +kept apart from shortcuts: Use Default, Clear and `shortcut: null` leave them, and `overridden` in `shortcuts.list` is +about the shortcut only. `shortcuts.list` rows give the hold shortcut as `hold`, `shortcuts.conflicts` lists a key two +entries hold as `"Hold X"`, and Reset to Defaults and a preset remove every hold shortcut. `shortcuts.export` writes +them as a `holds` object (entry id to key) when there are any, and `shortcuts.import` reads it; a file without `holds` +has none, and a `holds` value that is not a usable hold shortcut fails the import, which then changes nothing. +`shortcuts.exportText` adds a third `Hold X` column to a row with a hold shortcut while `holdShortcuts` is on. + +```json +{"name":"run_command","arguments":{"command":"shortcuts.set","params":{"id":"paint.swap","hold":"X"}}} +``` + The desktop app adds its active artboard, the one the Artboards panel highlights, to the `object.align`, `object.distribute`, `object.distributeSpacing` and `select.allOnArtboard` calls it runs without `artboard`, as it does for `edit.pasteInPlace`, `edit.pasteInFront` and `edit.pasteInBack` (while the Artboard tool has several artboards @@ -6556,8 +6583,9 @@ interface and not the art: a zoom shows the art at the same size at every UI Sca preference `holdToolKeys` also needs the desktop app. It is on by default: a single-key tool shortcut held for 0.25 s or more, or held while its tool is used, chooses the tool until the key is let go and then returns to the tool active before, after any drag in progress; a quicker press chooses the tool for good. With it off, every press and every key -repeat chooses the tool. The canvas preference `boundingBoxWhileMovingAndDrawing` (off by default) also needs the -desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the +repeat chooses the tool. While `holdShortcuts` is on, a tool key that also has a hold shortcut runs the hold shortcut +when held, and a quick press chooses its tool for good. The canvas preference `boundingBoxWhileMovingAndDrawing` (off +by default) also needs the desktop app: on, with View › Show Bounding Box, the bounding box and its handles stay visible while a drag moves the selection, and the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools draw the box around the shape being drawn; off, the box hides during both, except that a Selection tool move with `realTimeDrawing` off still moves the box. `highlightAlternateGlyphs` (off by default: on, the canvas paints a pink cell behind glyphs OpenType features diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 10d476361a..566c19f635 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1233,6 +1233,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A Space+Shift drag rotates the view whatever the tool, as a Rotate View tool drag does, and Shift does not round the angle to 15°. While the Type tool edits text, Space types a space: held, it does not show the hand, pan or rotate the view, and Cmd+Space still zooms ([the help page](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) lists the Spacebar as the Hand tool when not in text-edit mode). Test: `canvas::tests::space_types_a_space_while_editing_text_and_does_not_pan`. As VectorCraft's own rule, a zoom marquee that Cmd+Space starts while the Type tool edits text keeps the marquee's Space rules after Cmd is let go: Space held since the press sizes it, Space pressed again moves it ([the help page](https://helpx.adobe.com/illustrator/using/viewing-artwork.html) describes holding the spacebar to move the marquee), and that Space types no space, nor does it during an animated zoom drag. With no zoom drag, Space types a space. Test: `canvas::tests::space_moves_a_text_edit_zoom_marquee_after_cmd_is_let_go`. + - **Hold shortcuts:** Edit › Keyboard Shortcuts › Hold Shortcuts (off by default, `holdShortcuts`) shows a Hold column, where a tool or command gets a letter, digit or punctuation key, alone or with Shift. Holding that key for the Hold Shortcut Delay (`keyHoldDelay`, 0.35 s, 0.2 to 1.0 s) runs it once; a quicker press runs what the key runs without one, at the release (`shortcuts.set {id, hold}`). On a tool key, the hold shortcut takes precedence over Hold a Tool Shortcut to Use the Tool Temporarily. This is VectorCraft's own feature and its own delay. Tests `shortcuts::hold_keys::tests` and `shortcut_editor::tests::{a_hold_shortcut_is_kept_apart_from_the_shortcut, hold_shortcuts_refuse_keys_that_cannot_wait, the_hold_shortcuts_checkbox_shows_the_hold_column}`. - **Swatches panel clicks:** Ctrl/Cmd-clicking New Swatch makes a spot color, and Ctrl/Cmd+Shift-clicking it makes a global process color. - **Panel drag and drop:** art dragged off the canvas onto the Symbols panel becomes a symbol, art dragged onto the Swatches panel becomes a pattern swatch, and art dropped on the Brushes panel opens New Brush for that art; a symbol dragged onto the canvas places an instance where it is dropped, and a brush dragged onto a path is applied to it. New Brush asks for the type of brush first, as the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes. The Brushes panel's New Brush button, its menu's New Brush… and art dropped on the panel open the New Brush dialog, where Scatter Brush, Art Brush and Pattern Brush need selected or dropped art. OK opens that type's Brush Options for the new brush, and their OK makes the brush with the name and options set; Cancel in either dialog adds no brush (`ui.newBrush`). The menu's New Calligraphic Brush, New Bristle Brush and New Art, Scatter and Pattern Brush from Selection items still make a brush at once. From c4af93eea906b21d8c1b7d2af93926425f0f2d63 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 12:17:00 -0800 Subject: [PATCH 048/247] MCP: the Tool Options entry in the UI catalog describes editing a selected flare The flare change updated the Tool Options description in crates/ui-egui/src/menus/ui_commands.rs but not its generated mirror, crates/mcp/src/ui_catalog.rs, so `cargo xtask ui-commands --check` stopped the gate. The mirror now carries the same text. --- crates/mcp/src/ui_catalog.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index ecbdf780fb..43824ba015 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -967,7 +967,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront and filledLines held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront and filledLines held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool, diameter (pt), intensity and density (1–10), shared by the eight tools; OK runs tool.setOption {tool, values}), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", From cf869562d1edb693cf7c719731ad5d5d81fe3e7e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 14:20:17 -0800 Subject: [PATCH 049/247] Flare: a flare scaled far down, or with a narrow gradient, keeps its settings A flare whose transform had a determinant under 1e-12, for example one scaled to 0.00001%, lost its handles and shape.editFlare answered "select a flare", although the transform can be undone. The flare's parts are now compared with its settings for any finite transform that can be inverted. A part's gradient ellipse was compared as squared lengths, so at a small scale, or for a narrow gradient, an edited shape could fall within the tolerance and be redrawn over. The ellipse is now compared as the length of its longer half-axis, which a pixel-aligned part may move by up to a pixel, and its shape: the ratio of its axes and its orientation, which are compared without that allowance. --- crates/doc/src/flare.rs | 111 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 5 deletions(-) diff --git a/crates/doc/src/flare.rs b/crates/doc/src/flare.rs index 024714b0ea..2a180fa7fc 100644 --- a/crates/doc/src/flare.rs +++ b/crates/doc/src/flare.rs @@ -127,8 +127,33 @@ fn ellipse(geom: &GradientGeom) -> [f64; 3] { [u.x * u.x + w.x * w.x, u.x * u.y + w.x * w.y, u.y * u.y + w.y * w.y] } +/// The ellipse `[xx, xy, yy]` ([`ellipse`]) as its size, the length of its longer half-axis, and +/// its shape: the ratio of its shorter axis to its longer one, then the cosine and sine of twice +/// the longer axis's angle, each times one minus that ratio (0 for a circle). Each number is a +/// length or a ratio of lengths, never a squared length that a tiny flare or a narrow gradient +/// makes smaller than the tolerance. +fn ellipse_size_and_shape(geom: &GradientGeom) -> (f64, [f64; 3]) { + let [xx, xy, yy] = ellipse(geom); + let half_diff = (xx - yy) / 2.0; + let d = half_diff.hypot(xy); + let longer = (xx + yy) / 2.0 + d; + if longer.is_nan() || longer <= 0.0 { + return (0.0, [0.0; 3]); + } + // The product of the half-axes is the area factor of the map from the unit circle, `u` across + // `w` as [`ellipse`] builds them: a sum of squares times the aspect, without the cancellation + // of `xx * yy - xy * xy` for a narrow ellipse. + let u = geom.end - geom.start; + let w = Vec2::new(-u.y, u.x) * geom.aspect; + let ratio = ((u.x * w.y - u.y * w.x).abs() / longer).min(1.0); + let (cos, sin) = if d > 0.0 { (half_diff / d, xy / d) } else { (0.0, 0.0) }; + (longer.sqrt(), [ratio, (1.0 - ratio) * cos, (1.0 - ratio) * sin]) +} + /// `n` as JSON without what depends on how its transforms were applied: its id, the angle of its -/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays). +/// bounding box, and which axis of a gradient's ellipse its end point is on (the ellipse stays: its +/// size in the placement, and its shape beside the placement, out of reach of a pixel-aligned +/// part's snap allowance, which is a length). fn comparable(n: &Node) -> Value { fn strip(v: &mut Value) { match v { @@ -140,9 +165,11 @@ fn comparable(n: &Node) -> Value { && let Ok(g) = serde_json::from_value::<GradientGeom>(geom.clone()) && let Value::Object(geom) = geom { + let (size, shape) = ellipse_size_and_shape(&g); geom.remove("end"); geom.remove("aspect"); - geom.insert("ellipse".into(), serde_json::json!(ellipse(&g))); + geom.insert("ellipse".into(), serde_json::json!(size)); + m.insert("ellipseShape".into(), serde_json::json!(shape)); } m.values_mut().for_each(strip); } @@ -173,7 +200,12 @@ fn close(a: &Value, b: &Value, tol: f64, snap: f64, geometry: bool) -> bool { }, (Value::Array(x), Value::Array(y)) => x.len() == y.len() && x.iter().zip(y).all(|(x, y)| close(x, y, tol, snap, geometry)), (Value::Object(x), Value::Object(y)) => { - x.len() == y.len() && x.iter().all(|(k, v)| y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom"))) + x.len() == y.len() + && x.iter().all(|(k, v)| { + // A gradient's shape is ratios: compared as closely as geometry, without the snap. + let snap = if k == "ellipseShape" { 0.0 } else { snap }; + y.get(k).is_some_and(|w| close(v, w, tol, snap, geometry || k == "path" || k == "geom" || k == "ellipseShape")) + }) } _ => a == b, } @@ -237,10 +269,11 @@ impl FlareSpec { } /// Whether `group`'s parts are still the ones these settings draw, in place: none was edited, - /// distorted, removed or added, and the transform can be undone. + /// distorted, removed or added, and the transform can be undone. The parts are compared where + /// they are in the document, at any scale. pub fn draws(&self, group: &Node) -> bool { let NodeKind::Group { children, .. } = &group.kind else { return false }; - if self.transform.determinant().abs() < 1e-12 || !self.transform.as_coeffs().iter().all(|c| c.is_finite()) { + if !self.transform.is_finite() || self.transform.determinant() == 0.0 || !self.transform.inverse().is_finite() { return false; } let expected = parts(&self.params); @@ -330,4 +363,72 @@ mod tests { assert!(!spec(&squashed).draws(&squashed), "gradient shape, aligned {aligned}"); } } + + /// An ellipse's size and shape are the same whichever axis its end point is on, and a narrow + /// gradient made narrower, or turned, changes its shape by more than [`GEOMETRY_TOL`]. + #[test] + fn an_ellipse_shape_tells_narrow_gradients_apart() { + let geom = |end: (f64, f64), aspect: f64| GradientGeom { start: Point::new(1.0, 2.0), end: Point::new(end.0, end.1), aspect, focal: None }; + let of = ellipse_size_and_shape; + let (size, shape) = of(&geom((11.0, 2.0), 0.5)); + // The same ellipse with its end point on the other axis. + let (size2, shape2) = of(&geom((1.0, 7.0), 2.0)); + assert!((size - size2).abs() < 1e-12 && shape.iter().zip(shape2).all(|(a, b)| (a - b).abs() < 1e-12), "{shape:?} {shape2:?}"); + // A very narrow ellipse, given both ways, keeps its shape to within the tolerance. + let (thin, thin2) = (of(&geom((11.0, 2.0), 1e-8)).1, of(&geom((1.0, 2.0 + 1e-7), 1e8)).1); + assert!(thin.iter().zip(thin2).all(|(a, b)| (a - b).abs() < GEOMETRY_TOL), "{thin:?} {thin2:?}"); + let narrow = of(&geom((11.0, 2.0), 1e-4)).1; + for other in [of(&geom((11.0, 2.0), 5e-5)).1, of(&geom((1.0, 12.0), 1e-4)).1] { + assert!(narrow.iter().zip(other).any(|(a, b)| (a - b).abs() > 1e3 * GEOMETRY_TOL), "{narrow:?} {other:?}"); + } + assert_eq!(of(&geom((1.0, 2.0), 1.0)), (0.0, [0.0; 3])); + } + + /// A flare scaled far down, in one direction or in all, anywhere on the canvas, still draws its + /// settings, and a part's gradient whose shape was edited is still told apart; a flattened flare + /// does not draw its settings. + #[test] + fn a_flare_scaled_far_down_still_draws_its_settings() { + let v = json!({ "cx": 50.0, "cy": 50.0, "x2": 250.0, "y2": 50.0, "rays": 5, "rings": 2, "seed": 9, "diameter": 40.0 }); + let flare_aligned = |xf: Affine, aligned: bool| { + let children = parts(&v).into_iter().enumerate().map(|(i, p)| std::sync::Arc::new(part_node(NodeId(10 + i as u64), p, xf, aligned))); + let mut g = Node::group(NodeId(1), children.collect()); + g.extras_mut().flare = Some(Box::new(FlareSpec { params: v.clone(), transform: xf })); + g + }; + let flare = |xf: Affine| flare_aligned(xf, false); + // The center's gradient placement, to edit. + let center_geom = |g: &mut Node, f: &dyn Fn(&mut GradientGeom)| { + let NodeKind::Group { children, .. } = &mut g.kind else { panic!("not a group") }; + if let Some(crate::AppearanceItem::Fill(fill)) = std::sync::Arc::make_mut(&mut children[2]).appearance.items.first_mut() + && let Paint::Gradient(gp) = &mut fill.paint + && let Some(geom) = &mut gp.geom + { + f(geom); + } else { + panic!("the center has no gradient fill"); + } + }; + let draws = |g: &Node| g.extras().flare.as_deref().is_some_and(|spec| spec.draws(g)); + assert!(draws(&flare(Affine::scale(1e-7))), "scaled to 0.00001%"); + assert!(draws(&flare(Affine::rotate(0.3) * Affine::scale_non_uniform(1.0, 1e-10))), "shrunk far on one axis"); + assert!(draws(&flare(Affine::translate((crate::MAX_COORD - 1000.0, 0.0)) * Affine::scale(0.5))), "near the edge of the canvas"); + assert!(draws(&flare(Affine::translate((1000.0, 0.0)) * Affine::scale(1e-5))), "scaled to 0.001% and moved away"); + assert!(!draws(&flare(Affine::scale_non_uniform(1.0, 0.0))), "flattened"); + // At that size a part whose gradient's shape was edited no longer draws the settings. + let mut squashed = flare(Affine::scale(1e-6)); + assert!(draws(&squashed), "scaled to 0.0001%"); + center_geom(&mut squashed, &|geom| geom.aspect *= 0.5); + assert!(!draws(&squashed), "gradient shape at 0.0001%"); + // A pixel-aligned part may sit up to a pixel off, but its gradient's shape may not change, + // even when the ellipse keeps its size. + let mut reshaped = flare_aligned(Affine::IDENTITY, true); + assert!(draws(&reshaped), "aligned"); + center_geom(&mut reshaped, &|geom| { + let a = geom.aspect; + geom.aspect = a * 0.5; + geom.end = geom.start + (geom.end - geom.start) * ((1.0 + a * a) / (1.0 + a * a / 4.0)).sqrt(); + }); + assert!(!draws(&reshaped), "gradient shape of the same size, aligned"); + } } From dfa2b5aac9f72a2ab4edc07cfeba39ce533a5c5d Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 16:10:42 -0800 Subject: [PATCH 050/247] i18n: Spanish rows for three literal-brace messages use doubled-brace keys The rows for the `scope`, quantifier and freeform-gradient messages had placeholders where the messages print braces as text, so each row also matched other text with the same start and end. They now use the doubled-brace keys the catalog scanner writes, next to the composite font rows that use the same form. --- crates/ui-egui/src/i18n/es.tsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 84ab97441e..8a9d775519 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3765,6 +3765,9 @@ digits Malayalam Malayálam @msg `{_1}` is the name of an installed font `{_1}` es el nombre de una fuente instalada @msg `{_1}`: {_2} is set in `{font}`, a composite font `{_1}`: {_2} usa `{font}`, una fuente compuesta @msg give fonts: [{name, parts}…] indique fonts: [{name, parts}…] +@msg `scope` must be "document", {{artboards: [index, …]}} or {{layers: [id, …]}} `scope` debe ser "document", {{artboards: [index, …]}} o {{layers: [id, …]}} +@msg numbers out of order in {{}} quantifier números desordenados en el cuantificador {{}} +@msg the paint is not a freeform gradient (apply one with paint.editGradient {{kind: "freeform"}}) la pintura no es un degradado de forma libre (aplique uno con paint.editGradient {{kind: "freeform"}}) @msg path is empty path está vacío @msg fonts must be a list of composite fonts fonts debe ser una lista de fuentes compuestas @msg names must be strings names debe contener cadenas @@ -7790,7 +7793,6 @@ breakText Glyphs Glifos @msg `rows` must be lists of numbers or nulls, not {r} `rows` deben ser listas de números o valores null, no {r} @msg `scale` must be a number from 0.001 to 1000 `scale` debe ser un número entre 0.001 y 1000 @msg `scope.{key}` must be a non-empty array `scope.{key}` debe ser una lista que no esté vacía -@msg `scope` must be "document", {artboards} or {layers} `scope` debe ser "document", {artboards} o {layers} @msg `side` must be "left", "right", "top" or "bottom" `side` debe ser "left", "right", "top" o "bottom" @msg `side` places the artboard: leave out x, y, width and height `side` coloca la mesa de trabajo: omite x, y, width y height @msg `source` is the only path in series group `target` `source` es el único trazado del grupo de serie `target` @@ -7963,7 +7965,6 @@ breakText Glyphs Glifos @msg not a regular expression no es una expresión regular @msg not an action set: the text doesn't start with /version and a number no es un conjunto de acciones: el texto no empieza con /version y un número @msg nothing to repeat nada que repetir -@msg numbers out of order in {_1} quantifier números desordenados en el cuantificador {_1} @msg object {_1} needs a 3D effect el objeto {_1} necesita un efecto 3D @msg object {_1}: a hollow Extrude & Bevel has no caps: turn on Cap to map a graphic objeto {_1}: una Extrusión y biselado hueca no tiene extremos: activa Extremo para asignar un gráfico @msg object {_1}: with a depth of 0 the object has one face: map its graphics onto the front objeto {_1}: con una profundidad de 0 el objeto tiene una sola cara: asigna sus gráficos a la parte frontal @@ -8031,7 +8032,6 @@ breakText Glyphs Glifos @msg the guide is hidden or locked la guía está oculta o bloqueada @msg the library's file is outside the read roots el archivo de la biblioteca está fuera de las raíces de lectura @msg the method needs an XML value el método necesita un valor XML -@msg the paint is not a freeform gradient (apply one with paint.editGradient {kind}) la pintura no es un degradado de forma libre (aplica uno con paint.editGradient {kind}) @msg the parameters or body do not form one function los parámetros o el cuerpo no forman una sola función @msg the pasted SVG filter {name} draws differently from the document's filter of that name, and no free name fits it el filtro SVG pegado {name} dibuja de forma distinta al filtro del documento con ese nombre, y no hay ningún nombre libre para él @msg the pen table holds more than 255 pens la tabla de plumillas contiene más de 255 plumillas From 81faa1787db78bbe69e5fe5a548e63f75d62928b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 15:47:53 -0800 Subject: [PATCH 051/247] PDF export: warn when art at the trim edge stops short of the bleed When a PDF page carries a bleed (a PDF/X preset, bleed.useDocument or an explicit bleed), the export now adds one warning that counts the objects that reach an artboard's trim edge (within 0.5 pt) on a side whose bleed is more than 0.5 pt but end before that side's bleed edge. Hidden objects, guides, unpainted paths and objects at 0% opacity are left out. Objects with brushed strokes or an opacity mask, area type, type on a path, and groups that hold one of them are not measured. Template layers, layers with an opacity mask, and layers that don't print unless includeNonPrinting is on are left out. Clip groups and clipping layers are measured by the art inside the clipping path's geometric bounds and by the fill and stroke the clipping path paints itself. Art and page boxes are written unchanged. When OK in File > Document Setup raises the bleed on a side, the status bar counts the objects that stop short of the new bleed on the sides OK raised. A page of the art's bounds does not warn, and neither does an Export for Screens PDF row when Include Bleed grows the artboards or the page holds assets, layers or a selection. .ai saves do not warn. The message has a row in every catalog; docs/mcp.md and the exportPdf params text describe the check. --- crates/engine/src/cmd/fileio/pdf.rs | 209 ++++++++++++++++- crates/engine/src/cmd/fileio/screens.rs | 8 +- crates/engine/src/cmd/fileio/tests_pdfx.rs | 220 ++++++++++++++++++ crates/engine/src/cmd/fileio/tests_screens.rs | 19 ++ crates/ui-egui/src/dialogs/document_setup.rs | 67 +++++- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tests.rs | 15 ++ crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 14 ++ docs/target-app-parity.md | 1 + 36 files changed, 572 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/fileio/pdf.rs b/crates/engine/src/cmd/fileio/pdf.rs index 78f40a0072..006c3ae898 100644 --- a/crates/engine/src/cmd/fileio/pdf.rs +++ b/crates/engine/src/cmd/fileio/pdf.rs @@ -69,7 +69,7 @@ pub(crate) const OPTIONS: &[FormatOption] = &[ name: "bleed", ty: "object", default: "null", - description: "{useDocument, top, bottom, left, right} in points: the page grows by the bleed (BleedBox) around its artboard (TrimBox); a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning", + description: "{useDocument, top, bottom, left, right} in points: the page grows by the bleed (BleedBox) around its artboard (TrimBox); a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so do objects that reach the trim edge on a side with a bleed but stop short of the bleed edge", }, FormatOption { name: "output", @@ -128,7 +128,7 @@ pub fn specs() -> Vec<CommandSpec> { "Export PDF", [], None, - "{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in another profile)|preserveNumbers (only colours of the other model and Lab; those in the destination's model keep their numbers) (grey stays grey; images are converted too, and with destination and an sRGB destination a gray or RGB image tagged with an ICC profile is converted from it and written untagged; with destination and a CMYK destination, or another RGB one images are converted to (not when colours are ICC-tagged), an RGB image tagged with one is converted from it through sRGB; with preserveNumbers (and pdfX1a) only untagged images keep their numbers: an RGB image tagged with one is converted from it to sRGB or through sRGB to the destination, and a gray one is converted from it in an sRGB destination; any other image whose colors are converted (a CMYK image, an RGB one going to a CMYK destination, or with destination to an RGB one other than sRGB) but whose pixels can't be decoded or written that way is left out with a warning; printer's marks are not), destination: profile name (edit.colorSettings lists them; default: the document's profile for its colour mode), profiles: none (device colours; images are written without the ICC profiles they carry, a JPEG without its ICC_PROFILE segments, but in PDF/A, pdfX3 and pdfX4)|all|destination|taggedSource (documents assigned a profile: edit.assignProfile)|default (not set, the default; \"default\" unsets a preset's value, null keeps it: device colours, and gray and RGB images keep the profiles they carry, but in pdfX1a) (ICC-based colours: CMYK with the destination or document CMYK profile, RGB as sRGB, grey with the sRGB tone curve; PDF/A, pdfX3 and pdfX4 always, whatever profiles says; a CMYK image that keeps its numbers carries the CMYK profile it embeds with all and taggedSource, and in PDF/A, pdfX3 and pdfX4 unless destination, never in pdfX1a), outputIntent: profile name (embedded as the catalog's /GTS_PDFX output intent; a name that isn't a profile is only named, which pdfX1a and pdfX3 allow only with a registry and pdfX4 refuses; pdfX1a needs a CMYK one), outputCondition, outputConditionId (default: outputIntent), registry, trapped (/Trapped /True; /False when an output intent is written)} (PDF/A files keep their own output intent), advanced?: {fontSubsetPercent: 100 (below 100 is accepted with a warning: fonts are always embedded as subsets), outlineText: false (type as real, selectable and searchable text in embedded subset fonts with a ToUnicode map; fonts whose licence forbids embedding, or allows only whole fonts, stay outlines with a warning; true: every glyph as an outline), overprint: preserve (overprinting fills and strokes set /OP /op true, /OPM 1; white ones knock out with document.setup discardWhiteOverprint)|discard (they knock out)}, security?: {openPassword, permissionsPassword, printing: none|low|high, changes: none|pages|forms|comments|any, copy, screenReader, plaintextMetadata}, acknowledgeLoss?: bool (write over the file the document was read from although reading it left things out), format?: \"pdf\"} → {path, bytes, warnings}; no path → {dataBase64, bytes, warnings}. The options apply over the preset (null keeps its value); options accepted but not applied yet come back as warnings; a standard with a PDF version it doesn't allow and a password with a standard are refused, and so is a PDF/X file that would still break its standard (transparency the flattener left, RGB in pdfX1a, a font not embedded) or a PDF 1.3 file with transparency left. document.export {format: pdf} takes the same options. A key PDF doesn't take, and an unknown key inside one of the option objects, are refused", + "{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so does a count of the visible objects that reach the trim edge (within 0.5 pt) on a side with a bleed but end before the bleed edge; layers that don't print are left out unless includeNonPrinting, and art and boxes are written unchanged). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in another profile)|preserveNumbers (only colours of the other model and Lab; those in the destination's model keep their numbers) (grey stays grey; images are converted too, and with destination and an sRGB destination a gray or RGB image tagged with an ICC profile is converted from it and written untagged; with destination and a CMYK destination, or another RGB one images are converted to (not when colours are ICC-tagged), an RGB image tagged with one is converted from it through sRGB; with preserveNumbers (and pdfX1a) only untagged images keep their numbers: an RGB image tagged with one is converted from it to sRGB or through sRGB to the destination, and a gray one is converted from it in an sRGB destination; any other image whose colors are converted (a CMYK image, an RGB one going to a CMYK destination, or with destination to an RGB one other than sRGB) but whose pixels can't be decoded or written that way is left out with a warning; printer's marks are not), destination: profile name (edit.colorSettings lists them; default: the document's profile for its colour mode), profiles: none (device colours; images are written without the ICC profiles they carry, a JPEG without its ICC_PROFILE segments, but in PDF/A, pdfX3 and pdfX4)|all|destination|taggedSource (documents assigned a profile: edit.assignProfile)|default (not set, the default; \"default\" unsets a preset's value, null keeps it: device colours, and gray and RGB images keep the profiles they carry, but in pdfX1a) (ICC-based colours: CMYK with the destination or document CMYK profile, RGB as sRGB, grey with the sRGB tone curve; PDF/A, pdfX3 and pdfX4 always, whatever profiles says; a CMYK image that keeps its numbers carries the CMYK profile it embeds with all and taggedSource, and in PDF/A, pdfX3 and pdfX4 unless destination, never in pdfX1a), outputIntent: profile name (embedded as the catalog's /GTS_PDFX output intent; a name that isn't a profile is only named, which pdfX1a and pdfX3 allow only with a registry and pdfX4 refuses; pdfX1a needs a CMYK one), outputCondition, outputConditionId (default: outputIntent), registry, trapped (/Trapped /True; /False when an output intent is written)} (PDF/A files keep their own output intent), advanced?: {fontSubsetPercent: 100 (below 100 is accepted with a warning: fonts are always embedded as subsets), outlineText: false (type as real, selectable and searchable text in embedded subset fonts with a ToUnicode map; fonts whose licence forbids embedding, or allows only whole fonts, stay outlines with a warning; true: every glyph as an outline), overprint: preserve (overprinting fills and strokes set /OP /op true, /OPM 1; white ones knock out with document.setup discardWhiteOverprint)|discard (they knock out)}, security?: {openPassword, permissionsPassword, printing: none|low|high, changes: none|pages|forms|comments|any, copy, screenReader, plaintextMetadata}, acknowledgeLoss?: bool (write over the file the document was read from although reading it left things out), format?: \"pdf\"} → {path, bytes, warnings}; no path → {dataBase64, bytes, warnings}. The options apply over the preset (null keeps its value); options accepted but not applied yet come back as warnings; a standard with a PDF version it doesn't allow and a password with a standard are refused, and so is a PDF/X file that would still break its standard (transparency the flattener left, RGB in pdfX1a, a font not embedded) or a PDF 1.3 file with transparency left. document.export {format: pdf} takes the same options. A key PDF doesn't take, and an unknown key inside one of the option objects, are refused", has_doc, export_pdf ), @@ -295,6 +295,8 @@ pub(super) fn encode_art_page(cmd: &str, doc: &Document, p: &Value) -> Result<Op o.insert("preserveEditing".into(), json!(false)); } let (bytes, mut notes) = encode(cmd, &art, &q)?; + // The page is the art's bounds, so every object at its edge would count. + notes.retain(|n| !is_short_of_bleed(&n.text)); if left_out { notes.push(Note::setting(EDITING_NEEDS_THE_ARTBOARDS)); } @@ -317,6 +319,191 @@ pub(super) fn art_page(cmd: &str, doc: &Document, p: &Value) -> Result<Option<(D /// ([`vectorcraft_pdf::PdfSettings::leaves_out_bleed`]). pub const BLEED_LEFT_OUT: &str = "the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings"; +/// How far, in points, an object's edge may sit inside the trim edge, or short of the bleed edge, +/// and still count as reaching it in [`short_of_bleed`]. A side whose bleed is no larger has none. +const EDGE_TOLERANCE: f64 = 0.5; + +/// How many objects of `doc` reach the trim edge (an artboard's edge, within [`EDGE_TOLERANCE`]) of +/// one of `artboards` (`None`: all of them) on a side where `bleed` (`[top, bottom, left, right]` +/// in points) is set, but end before that side's bleed edge. The objects are the members of the +/// visible layers and sublayers, a group counted as one, measured as [`drawn_bounds`] measures them +/// and cut to the clipping paths of the layers they are on. Template layers, layers with an opacity +/// mask and, unless `non_printing`, layers whose Print option is off are left out. A side whose +/// bleed is [`EDGE_TOLERANCE`] or less counts as having none. Each object counts once. +pub fn short_of_bleed(doc: &Document, bleed: [f64; 4], artboards: Option<&[usize]>, non_printing: bool) -> usize { + let bleed = bleed.map(|b| if b.is_finite() && b > EDGE_TOLERANCE { b } else { 0.0 }); + if bleed.iter().all(|b| *b == 0.0) { + return 0; + } + let trims: Vec<vectorcraft_geom::Rect> = match artboards { + Some(picked) => picked.iter().filter_map(|&i| doc.artboards.get(i)).map(|a| a.rect).collect(), + None => doc.artboards.iter().map(|a| a.rect).collect(), + }; + let symbols = doc.symbol_boxes(); + let mut count = 0; + // Each object with the clipping path of the layers above it. + let mut stack: Vec<(&Node, Option<vectorcraft_geom::Rect>)> = doc.layers.iter().map(|l| (&**l, None)).collect(); + while let Some((n, clip)) = stack.pop() { + if let NodeKind::Layer { template, printable, children, clip: clipping, .. } = &n.kind { + // An opacity mask decides what shows, so a masked layer's art is not measured. + if !n.visible || *template || !(*printable || non_printing) || n.opacity <= 0.0 || n.extras().mask.is_some() { + continue; + } + // A clipping layer's first child clips the others, and its fills and strokes are an + // object of their own. + let (inner, members) = if *clipping { + let Some(own) = clip_region(children, &symbols) else { continue }; + let inner = clip.map_or(own, |c| c.intersect(own)); + if let Some(first) = children.first() + && let Drawn::Bounds(b) = clip_paint_drawn(first, inner, &symbols) + { + let b = clip.map_or(b, |c| c.intersect(b)); + if b.area() > 0.0 && trims.iter().any(|t| stops_short(b, *t, bleed)) { + count += 1; + } + } + (Some(inner), children.get(1..).unwrap_or_default()) + } else { + (clip, &children[..]) + }; + stack.extend(members.iter().map(|c| (&**c, inner))); + continue; + } + let Drawn::Bounds(b) = drawn_bounds(n, &symbols) else { continue }; + let b = clip.map_or(b, |c| c.intersect(b)); + if b.area() > 0.0 && trims.iter().any(|t| stops_short(b, *t, bleed)) { + count += 1; + } + } + count +} + +/// What [`drawn_bounds`] finds an object draws. +enum Drawn { + /// Nothing: it is hidden, a guide, at 0% opacity, or a path that paints nothing. + Nothing, + /// Art within these bounds. + Bounds(vectorcraft_geom::Rect), + /// Art whose bounds aren't known, which is not measured: brush art paints past the visual + /// bounds by an amount they don't give, an opacity mask hides part of what they hold, and area + /// type and type on a path are bounded by their frame or path. + Unknown, +} + +/// Whether path or compound path `n` paints: one of its fills and strokes is visible, has a paint +/// and an opacity above 0 and, a stroke, a width above 0. Other objects count as painting. +fn paints(n: &Node) -> bool { + !matches!(n.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) + || n.appearance.items.iter().any(|i| { + i.visible() && i.opacity() > 0.0 && !i.paint().is_none() && !matches!(i, vectorcraft_doc::AppearanceItem::Stroke(s) if s.width <= 0.0) + }) +} + +/// What `n` draws on a page, by its visual bounds (strokes included): a group without a clipping +/// path by the members that draw, and a clip group by the part of them inside its clipping path +/// together with what the clipping path paints itself ([`clip_paint_drawn`]). +/// Hidden objects, guides, objects at 0% opacity and paths that paint nothing draw nothing. Art +/// with a brushed stroke that draws, in `n` or (outside groups) in the objects it holds, art with +/// an opacity mask, and area type and type on a path are [`Drawn::Unknown`]. +fn drawn_bounds(n: &Node, symbols: &vectorcraft_doc::SymbolBoxes) -> Drawn { + if !n.visible || n.is_guide() || n.opacity <= 0.0 || !paints(n) { + return Drawn::Nothing; + } + // An opacity mask decides what shows of the object, and the bounds of area type and type on a + // path are its frame or path, not its glyphs. + let frame_bounds = matches!(&n.kind, NodeKind::Text(t) if !matches!(t.kind, vectorcraft_doc::TextKind::Point)); + if vectorcraft_brush::reach(n) > 0.0 || n.extras().mask.is_some() || frame_bounds { + return Drawn::Unknown; + } + let members = |children: &[Arc<Node>]| { + let mut out = Some(None); + for c in children { + out = match (out, drawn_bounds(c, symbols)) { + (None, _) | (_, Drawn::Unknown) => None, + (Some(acc), Drawn::Bounds(b)) => Some(vectorcraft_geom::union_opt(acc, Some(b))), + (keep, Drawn::Nothing) => keep, + }; + } + out + }; + let measured = match &n.kind { + NodeKind::Group { clip: false, .. } => match members(n.editing_children()) { + Some(art) => art.and_then(|_| n.visual_of_members(std::iter::once(art))), + None => return Drawn::Unknown, + }, + NodeKind::Group { clip: true, children } => { + let Some(region) = clip_region(children, symbols) else { return Drawn::Nothing }; + let Some(art) = members(children.get(1..).unwrap_or_default()) else { return Drawn::Unknown }; + let art = art.map(|a| region.intersect(a)).filter(|b| b.area() > 0.0); + match children.first().map_or(Drawn::Nothing, |first| clip_paint_drawn(first, region, symbols)) { + Drawn::Unknown => return Drawn::Unknown, + Drawn::Bounds(b) => vectorcraft_geom::union_opt(art, Some(b)), + Drawn::Nothing => art, + } + } + _ if vectorcraft_brush::reach_within(n) > 0.0 => return Drawn::Unknown, + _ => n.visual_bounds_with(symbols), + }; + measured.map_or(Drawn::Nothing, Drawn::Bounds) +} + +/// The region the clipping path of a clip group or clipping layer with `children` clips to: its +/// geometric bounds, without its strokes. +fn clip_region(children: &[Arc<Node>], symbols: &vectorcraft_doc::SymbolBoxes) -> Option<vectorcraft_geom::Rect> { + children.first()?.geometric_bounds_with(symbols) +} + +/// What clipping path `clip` paints itself ([`Node::clip_paint`]): its fills inside `region`, the +/// region it clips to, and its strokes over the clipped art, unclipped. +fn clip_paint_drawn(clip: &Node, region: vectorcraft_geom::Rect, symbols: &vectorcraft_doc::SymbolBoxes) -> Drawn { + let paint = clip.clip_paint(); + let mut out = None; + for (part, clipped) in [(paint.fill, true), (paint.stroke, false)] { + let Some(part) = part else { continue }; + match drawn_bounds(&part, symbols) { + Drawn::Unknown => return Drawn::Unknown, + Drawn::Nothing => {} + Drawn::Bounds(b) => { + let b = if clipped { region.intersect(b) } else { b }; + out = vectorcraft_geom::union_opt(out, Some(b).filter(|b| b.area() > 0.0)); + } + } + } + out.map_or(Drawn::Nothing, Drawn::Bounds) +} + +/// Whether bounds `b` reach the trim edge `t` (within [`EDGE_TOLERANCE`] on either side of it) on a +/// side where `bleed` (`[top, bottom, left, right]`) is above 0 and end before the bleed edge there. +/// Document space has y down. +fn stops_short(b: vectorcraft_geom::Rect, t: vectorcraft_geom::Rect, [top, bottom, left, right]: [f64; 4]) -> bool { + let tol = EDGE_TOLERANCE; + let across = b.x0 < t.x1 && b.x1 > t.x0; + let down = b.y0 < t.y1 && b.y1 > t.y0; + let reaches = |near: f64, far: f64, edge: f64| near <= edge + tol && far >= edge - tol; + (across && top > 0.0 && reaches(b.y0, b.y1, t.y0) && b.y0 > t.y0 - top + tol) + || (across && bottom > 0.0 && reaches(-b.y1, -b.y0, -t.y1) && b.y1 < t.y1 + bottom - tol) + || (down && left > 0.0 && reaches(b.x0, b.x1, t.x0) && b.x0 > t.x0 - left + tol) + || (down && right > 0.0 && reaches(-b.x1, -b.x0, -t.x1) && b.x1 < t.x1 + right - tol) +} + +/// The warning for `n` objects that [`short_of_bleed`] finds; `None` for none. +pub fn short_of_bleed_warning(n: usize) -> Option<String> { + match n { + 0 => None, + 1 => Some(format!("1 object {SHORT_OF_BLEED_ONE}")), + _ => Some(format!("{n} objects {SHORT_OF_BLEED_OTHER}")), + } +} + +/// The end of [`short_of_bleed_warning`] for one object and for more. +const SHORT_OF_BLEED_ONE: &str = "reaches the trim edge but stops short of the bleed"; +const SHORT_OF_BLEED_OTHER: &str = "reach the trim edge but stop short of the bleed"; + +/// Whether `text` is a warning [`short_of_bleed_warning`] gives. +pub fn is_short_of_bleed(text: &str) -> bool { + text.ends_with(SHORT_OF_BLEED_ONE) || text.ends_with(SHORT_OF_BLEED_OTHER) +} + /// The end of the writer's warning for a page longer than 14,400 pt written with a `UserUnit` /// above 1. const SHOWN_SMALLER: &str = "so apps that ignore UserUnit show it that many times smaller"; @@ -338,7 +525,8 @@ pub(super) fn encode_at(cmd: &str, doc: &Document, p: &Value, modified: Option<i // Keep the editable object tree independent of preview fallbacks used by the drawn pages. let (full, placed) = crate::cmd::place::document::full_documents(doc); let mut notes: Vec<Note> = placed.into_iter().map(Note::loss).collect(); - let (bytes, drawn) = encode_carrying_at(cmd, &full, p, modified, || Ok(vectorcraft_format::save(doc, false)), || Ok(None))?; + let native = || Ok(vectorcraft_format::save(doc, false)); + let (bytes, drawn) = encode_carrying_at(cmd, &full, p, modified, true, native, || Ok(None))?; notes.extend(drawn); if notes.iter().any(|n| n.text.ends_with(SHOWN_SMALLER)) && options(cmd, &full, p)?.settings.standard == Standard::None { for n in notes.iter_mut().filter(|n| n.text.ends_with(SHOWN_SMALLER)) { @@ -362,7 +550,8 @@ fn overflow_warning(cmd: &str, doc: &Document, p: &Value) -> Result<Option<Strin /// [`encode`] the pages of `doc`, carrying `native()` as the editing data (a `.ai` file: the /// native document with its save options, whose pages may be left blank), and `private()`, the -/// editing copy of the art for other apps with what it couldn't hold, on every page. +/// editing copy of the art for other apps with what it couldn't hold, on every page. It doesn't +/// warn about art that stops short of the bleed ([`short_of_bleed`]), which PDF export does. pub(super) fn encode_carrying( cmd: &str, doc: &Document, @@ -370,20 +559,26 @@ pub(super) fn encode_carrying( native: impl FnOnce() -> Result<Vec<u8>>, private: impl FnOnce() -> Result<Option<(vectorcraft_pdf::PrivateData, Vec<String>)>>, ) -> Result<(Vec<u8>, Vec<Note>)> { - encode_carrying_at(cmd, doc, p, None, native, private) + encode_carrying_at(cmd, doc, p, None, false, native, private) } /// [`encode_carrying`] modified at `modified` (Unix seconds) when given, instead of the time of -/// writing. +/// writing, warning about art that stops short of the bleed when `bleed_check` is true. fn encode_carrying_at( cmd: &str, doc: &Document, p: &Value, modified: Option<i64>, + bleed_check: bool, native: impl FnOnce() -> Result<Vec<u8>>, private: impl FnOnce() -> Result<Option<(vectorcraft_pdf::PrivateData, Vec<String>)>>, ) -> Result<(Vec<u8>, Vec<Note>)> { let mut opts = options_at(cmd, doc, p, modified.or_else(vectorcraft_doc::metadata::output_time))?; + // Measured before the pages' background colors join the art. Only art that prints counts: + // createLayers writes non-printing layers with /PrintState /OFF, so they count only with + // includeNonPrinting, which writes them as printing art. + let set = &opts.settings; + let short = if bleed_check { short_of_bleed(doc, set.bleed_of(doc), opts.artboards.as_deref(), set.include_non_printing) } else { 0 }; // The pages' background colors, behind the art (the editing data keeps them as colors). let pages = opts.artboards.clone().unwrap_or_else(|| (0..doc.artboards.len()).collect()); let filled = super::export::with_artboard_fills(doc, p, pages).map_err(|e| bad(cmd, e))?; @@ -399,6 +594,8 @@ fn encode_carrying_at( if opts.settings.leaves_out_bleed(doc) { notes.push(Note::loss(BLEED_LEFT_OUT)); } + // Art that reaches the trim edge but leaves part of the page's bleed empty. + notes.extend(short_of_bleed_warning(short).map(Note::loss)); if opts.settings.preserve_editing { if opts.artboards.as_ref().is_none_or(|v| v.iter().copied().eq(0..doc.artboards.len())) { opts.native = Some(native()?); diff --git a/crates/engine/src/cmd/fileio/screens.rs b/crates/engine/src/cmd/fileio/screens.rs index 61e5fede2a..75aba76edf 100644 --- a/crates/engine/src/cmd/fileio/screens.rs +++ b/crates/engine/src/cmd/fileio/screens.rs @@ -1237,10 +1237,16 @@ fn encode_and_write(export: ScreenExport, writer: &mut dyn FnMut(&str, &[u8]) -> // Include Bleed: a grown artboard already holds the bleed. Assets, layers and a selection are // written on a page of their own bounds, which it doesn't grow. let bleed_on_page = o.include_bleed && o.assets.is_none() && o.layers.is_none() && o.selection.is_none(); + // A grown artboard's trim edge is the bleed edge, and a page of its art's bounds has every + // object at its edge: neither says whether art stops short of the bleed. + let artboard_page = o.assets.is_none() && o.layers.is_none() && o.selection.is_none(); let mut write = |doc: &Document, format: &str, options: &Value| -> Result<Vec<u8>> { + // Include Bleed grows the artboards only when the document has a bleed. + let trim_on_page = artboard_page && !(o.include_bleed && doc.setup.has_bleed()); // The steps are the files: an encoder's own steps (artboards, pages) are not reported. let (bytes, given) = vectorcraft_doc::cancel::quiet(|| encode_with_notes(doc, format, options))?; - for n in given.into_iter().filter(|n| !(bleed_on_page && n.text == super::pdf::BLEED_LEFT_OUT)) { + let shown = |n: &Note| !(bleed_on_page && n.text == super::pdf::BLEED_LEFT_OUT) && (trim_on_page || !super::pdf::is_short_of_bleed(&n.text)); + for n in given.into_iter().filter(shown) { add_note(&mut notes, n); } Ok(bytes) diff --git a/crates/engine/src/cmd/fileio/tests_pdfx.rs b/crates/engine/src/cmd/fileio/tests_pdfx.rs index 68df66bd93..608418b6e9 100644 --- a/crates/engine/src/cmd/fileio/tests_pdfx.rs +++ b/crates/engine/src/cmd/fileio/tests_pdfx.rs @@ -139,6 +139,226 @@ fn a_pdfx_file_that_leaves_out_the_document_bleed_warns() { assert!(!left_out(&warnings), "{warnings:?}"); } +/// A 200 × 100 pt document with no art, bleed `bleed` (pt). +fn bleed_session(bleed: Value) -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 200, "height": 100})).unwrap(); + s.execute("document.setup", &json!({ "bleed": bleed })).unwrap(); + s +} + +/// A rectangle from (x0, y0) to (x1, y1) without a stroke, on the current layer. +fn plain_rect(s: &mut Session, [x0, y0, x1, y1]: [f64; 4]) -> Value { + let id = s.execute("shape.rectangle", &json!({"x": x0, "y": y0, "width": x1 - x0, "height": y1 - y0})).unwrap()["id"].clone(); + s.execute("paint.setStroke", &json!({"ids": [id], "none": true})).unwrap(); + id +} + +/// The warnings of a PDF that carries the document's bleed that say art stops short of it. +fn short_of_bleed(s: &mut Session) -> Vec<String> { + let (_, warnings) = pdf(s, json!({"bleed": {"useDocument": true}})); + warnings.into_iter().filter(|w| super::pdf::is_short_of_bleed(w)).collect() +} + +const MM: f64 = 72.0 / 25.4; + +/// A bleed raised from 2 mm to 5 mm leaves a background that filled the old bleed, and a band +/// placed against the trim edge, short of the new one: the export warns once, counting both. +#[test] +fn art_that_reaches_the_trim_edge_but_stops_short_of_the_bleed_warns() { + let mut s = bleed_session(json!(2.0 * MM)); + let (b, w, h) = (2.0 * MM, 200.0, 100.0); + plain_rect(&mut s, [-b, -b, w + b, h + b]); + plain_rect(&mut s, [0.0, 0.0, w, 20.0]); + // At 2 mm the background reaches the bleed; the band stops at the trim edge. + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); + s.execute("document.setup", &json!({"bleed": 5.0 * MM})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["2 objects reach the trim edge but stop short of the bleed"]); + // The PDF/X presets carry the document's bleed. + let (_, warnings) = pdf(&mut s, json!({"preset": "PDF/X-4:2010"})); + assert!(warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + // A PDF/X file with a bleed on the top alone leaves out the rest of the document's bleed, and + // the background and the band stop short at the top: the warning comes right after + // BLEED_LEFT_OUT. + let (_, warnings) = pdf(&mut s, json!({"standard": "pdfX4", "bleed": {"top": 9}})); + assert_eq!(warnings.first().map(String::as_str), Some(super::pdf::BLEED_LEFT_OUT), "{warnings:?}"); + assert_eq!(warnings.get(1).map(String::as_str), Some("2 objects reach the trim edge but stop short of the bleed"), "{warnings:?}"); + // A page without the bleed (the default preset) doesn't warn, and neither does a page of the art's bounds. + let (_, warnings) = pdf(&mut s, json!({})); + assert!(!warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + let (_, warnings) = pdf(&mut s, json!({"bleed": {"useDocument": true}, "useArtboards": false})); + assert!(!warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + // An explicit bleed counts too, and the Summary lists the warning. + let (_, warnings) = pdf(&mut s, json!({"bleed": {"top": 9, "bottom": 9, "left": 9, "right": 9}})); + assert!(warnings.iter().any(|w| super::pdf::is_short_of_bleed(w)), "{warnings:?}"); + let v = s.execute("document.pdfSettings", &json!({"bleed": {"useDocument": true}, "includeDocument": true})).unwrap(); + assert!(v["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())), "{v}"); + // A group counts once, measured by its visible members: a hidden member that fills the bleed + // doesn't hide a visible one at the trim edge. + let mut s = bleed_session(json!(9)); + let fill = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let side = plain_rect(&mut s, [0.0, 40.0, 20.0, 60.0]); + s.execute("object.group", &json!({"ids": [fill, band, side]})).unwrap(); + s.execute("object.hide", &json!({"ids": [fill]})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); + // A clip group is measured by the art inside its clipping path, not by a clipping path that + // reaches the bleed edge. + let mut s = bleed_session(json!(9)); + let art = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let clip = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + s.execute("select.set", &json!({"ids": [art, clip]})).unwrap(); + s.execute("object.clippingMask.make", &json!({})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A clipping path that paints a fill reaching the trim edge counts, though the art it clips is + // inside: in a clip group, and as an object of its own in a clipping layer. + let mut s = bleed_session(json!(9)); + let art = plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + let clip = plain_rect(&mut s, [0.0, 0.0, 200.0, 100.0]); + s.execute("select.set", &json!({"ids": [art, clip]})).unwrap(); + s.execute("object.clippingMask.make", &json!({})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + s.execute("paint.setFill", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + let clip = plain_rect(&mut s, [0.0, 0.0, 200.0, 100.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + s.execute("paint.setFill", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A hidden brushed member doesn't keep a group's visible art at the trim edge from counting. + let mut s = bleed_session(json!(9)); + let brushed = plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + s.execute("brush.apply", &json!({"ids": [brushed], "name": "Charcoal"})).unwrap(); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.group", &json!({"ids": [brushed, band]})).unwrap(); + s.execute("object.hide", &json!({"ids": [brushed]})).unwrap(); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // A clipping layer clips its art to the clipping path's geometry, not to the stroke around it: + // the stroke reaches the trim edge, but the art it clips stops 5 pt inside. + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + let clip = plain_rect(&mut s, [5.0, 5.0, 195.0, 95.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [clip], "color": "#ff0000"})).unwrap(); + s.execute("stroke.set", &json!({"ids": [clip], "weight": 10})).unwrap(); + assert_eq!(short_of_bleed(&mut s), ["1 object reaches the trim edge but stops short of the bleed"]); +} + +/// No warning for art that already fills the bleed, art inside the trim, a document without a +/// bleed, art on hidden, non-printing or template layers, a side without a bleed, area type, a +/// masked object, or a `.ai` save. +#[test] +fn art_that_fills_the_bleed_or_stays_inside_does_not_warn() { + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [-9.0, -9.0, 209.0, 109.0]); + plain_rect(&mut s, [-20.0, 40.0, 50.0, 60.0]); + plain_rect(&mut s, [10.0, 10.0, 190.0, 90.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // A document without a bleed has nothing to fall short of. + let mut s = bleed_session(json!(0)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // Layers that don't print. + for props in [json!({"visible": false}), json!({"printable": false}), json!({"template": true})] { + let mut s = bleed_session(json!(9)); + let layer = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let mut p = props.clone(); + p["id"] = layer; + s.execute("layer.setProps", &p).unwrap(); + assert!(short_of_bleed(&mut s).is_empty(), "{props}"); + } + // A hidden object, and a group whose hidden member is the one at the trim edge. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.hide", &json!({"ids": [id]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + let mut s = bleed_session(json!(9)); + let edge = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let inside = plain_rect(&mut s, [10.0, 30.0, 50.0, 60.0]); + s.execute("object.group", &json!({"ids": [edge, inside]})).unwrap(); + s.execute("object.hide", &json!({"ids": [edge]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // Art that lies in the bleed alone, away from the trim edge. + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [20.0, -5.0, 60.0, -3.0]); + assert!(short_of_bleed(&mut s).is_empty()); + // A guide in a group at the trim edge. + let mut s = bleed_session(json!(9)); + let guide = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("view.guides.make", &json!({})).unwrap(); + let inside = plain_rect(&mut s, [10.0, 30.0, 50.0, 60.0]); + s.execute("object.group", &json!({"ids": [guide, inside]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A brushed stroke, whose brush art can paint past its visual bounds, is not measured. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("brush.apply", &json!({"ids": [id], "name": "Charcoal"})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A path with no fill and no stroke paints nothing. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("paint.setFill", &json!({"ids": [id], "none": true})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // An object at 0% opacity draws nothing. + let mut s = bleed_session(json!(9)); + let id = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + s.execute("object.setProps", &json!({"ids": [id], "opacity": 0})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A clipping layer whose clipping path lies inside the trim draws none of its art at the edge. + let mut s = bleed_session(json!(9)); + let clipping = s.execute("layer.new", &json!({})).unwrap()["id"].clone(); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + plain_rect(&mut s, [10.0, 10.0, 60.0, 60.0]); + s.execute("layer.clippingMask.toggle", &json!({"id": clipping})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A bleed on the top alone: art short at the left doesn't count, art short at the top does. + let mut s = bleed_session(json!([9, 0, 0, 0])); + plain_rect(&mut s, [0.0, 30.0, 40.0, 60.0]); + assert!(short_of_bleed(&mut s).is_empty()); + plain_rect(&mut s, [60.0, 0.0, 100.0, 40.0]); + assert_eq!(short_of_bleed(&mut s).len(), 1); + // Area type is bounded by its frame, not its glyphs: a frame at the trim edge is not measured. + let mut s = bleed_session(json!(9)); + s.execute("text.create", &json!({"x": 0, "y": 0, "text": "Title", "size": 12, "area": {"width": 200, "height": 40}})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // An opacity mask decides what shows of the object, so a masked object is not measured. + let mut s = bleed_session(json!(9)); + let band = plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let mask = plain_rect(&mut s, [20.0, 30.0, 60.0, 60.0]); + s.execute("transparency.makeOpacityMask", &json!({"ids": [band, mask]})).unwrap(); + assert!(short_of_bleed(&mut s).is_empty()); + // A `.ai` save with a bleed doesn't warn: the check is PDF export's. + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + assert_eq!(short_of_bleed(&mut s).len(), 1); + let r = s.execute("document.export", &json!({"format": "ai", "bleed": {"useDocument": true}})).unwrap(); + assert!(!r["warnings"].to_string().contains("short of the bleed"), "{}", r["warnings"]); +} + +/// The warning changes neither the art nor the page boxes. +#[test] +fn the_bleed_warning_changes_no_geometry_and_no_page_box() { + let mut s = bleed_session(json!(9)); + plain_rect(&mut s, [0.0, 0.0, 200.0, 20.0]); + let before = s.doc().unwrap().doc.clone(); + let v = s.execute("document.exportPdf", &json!({"bleed": {"useDocument": true}})).unwrap(); + assert!(v["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())), "{v}"); + assert_eq!(s.doc().unwrap().doc, before); + let info = s.execute("document.pdfInfo", &json!({"name": "x.pdf", "dataBase64": v["dataBase64"]})).unwrap(); + let boxes = &info["pageInfo"][0]["boxes"]; + let side = |b: &Value| { + let n: Vec<f64> = b.as_array().unwrap().iter().map(|x| x.as_f64().unwrap()).collect(); + (((n[2] - n[0]) * 100.0).round() / 100.0, ((n[3] - n[1]) * 100.0).round() / 100.0) + }; + assert_eq!(side(&boxes["trim"]), (200.0, 100.0), "{info}"); + assert_eq!(side(&boxes["bleed"]), (218.0, 118.0), "{info}"); +} + /// The ink amounts (0..1) `doc` shows at `p` in its images (the topmost image there). fn image_inks_at(doc: &vectorcraft_doc::Document, p: vectorcraft_geom::Point) -> Option<[f32; 4]> { fn visit(n: &vectorcraft_doc::Node, out: &mut Vec<vectorcraft_doc::ImageObject>) { diff --git a/crates/engine/src/cmd/fileio/tests_screens.rs b/crates/engine/src/cmd/fileio/tests_screens.rs index 1746be6c97..d950590241 100644 --- a/crates/engine/src/cmd/fileio/tests_screens.rs +++ b/crates/engine/src/cmd/fileio/tests_screens.rs @@ -569,6 +569,25 @@ fn include_bleed_pdfx_rows_do_not_warn_about_the_bleed() { assert!(warned(&export(&mut s, json!({"includeBleed": true, "selection": "one", "formats": row})))); } +/// A PDF row with the document's bleed warns about art that stops short of it on an artboard's +/// page, but not on a page Include Bleed grows or on a page of a selection's bounds. +#[test] +fn pdf_rows_warn_about_art_short_of_the_bleed_on_artboard_pages_only() { + let mut s = session(1); + s.execute("document.setup", &json!({"bleed": 6})).unwrap(); + // Against the artboard's top edge. + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 10})).unwrap(); + let warned = |r: &Value| r["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())); + let row = json!([{"format": "pdf", "bleed": {"useDocument": true}}]); + assert!(warned(&export(&mut s, json!({"formats": row})))); + assert!(!warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); + assert!(!warned(&export(&mut s, json!({"selection": "one", "formats": row})))); + // Without a document bleed, Include Bleed doesn't grow the artboard, so a row's own bleed warns. + s.execute("document.setup", &json!({"bleed": 0})).unwrap(); + let row = json!([{"format": "pdf", "bleed": {"top": 6, "bottom": 6, "left": 6, "right": 6}}]); + assert!(warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); +} + #[test] fn png_8_rows_write_indexed_colour() { let mut s = session(1); diff --git a/crates/ui-egui/src/dialogs/document_setup.rs b/crates/ui-egui/src/dialogs/document_setup.rs index 1946cc86b2..a56a619949 100644 --- a/crates/ui-egui/src/dialogs/document_setup.rs +++ b/crates/ui-egui/src/dialogs/document_setup.rs @@ -7,13 +7,16 @@ //! tab's `colorMode`, `convertColors`, `rgbProfile` and `cmykProfile` (null: the working space). //! OK runs `document.setup` with them: one undo step. When the Color tab changed something, OK runs //! `document.setup`, `edit.assignProfile` and `file.documentColorMode` in one `command.batch`, -//! and the document's changes are still one undo step. On an error the dialog stays open. +//! and the document's changes are still one undo step. On an error the dialog stays open. When OK +//! raises the bleed on a side, the status bar counts the objects that reach an artboard's trim edge +//! on a side OK raised but stop short of the new bleed there. use serde_json::{Map, Value, json}; use vectorcraft_color::cms::ProfileKind; -use vectorcraft_doc::setup::{GRID_COLOR_PRESETS, LANGUAGES}; +use vectorcraft_doc::setup::{GRID_COLOR_PRESETS, LANGUAGES, bleed_in_range}; use vectorcraft_doc::{ColorMode, GridSize, Quotes, Unit}; use vectorcraft_engine::cmd::colormgmt::doc_profiles; +use vectorcraft_engine::cmd::fileio::pdf; use super::{DialogSpec, form}; use crate::state::Dialog; @@ -102,6 +105,7 @@ fn color_commands(app: &VectorcraftApp, d: &Dialog) -> Result<Vec<Value>, String fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { let params: Map<String, Value> = d.fields.iter().filter(|(k, _)| !UI_ONLY.contains(&k.as_str())).map(|(k, v)| (k.clone(), v.clone())).collect(); let color = color_commands(app, d)?; + let before = app.session.active().map(|st| st.doc.setup.bleed); let r = if color.is_empty() { app.run("document.setup", Value::Object(params)) } else { @@ -110,10 +114,24 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { }; if r.is_ok() { app.ui.dialog = None; + if let Some(note) = before.and_then(|b| short_of_bleed_note(app, b)) { + app.status(note); + } } r } +/// The status note after OK raised the bleed on a side from `before`: how many objects reach an +/// artboard's trim edge on a side whose bleed grew but stop short of the new bleed there. `None` +/// when no side grew or no object stops short. +fn short_of_bleed_note(app: &VectorcraftApp, before: [f64; 4]) -> Option<String> { + let doc = &app.session.active()?.doc; + // In the range the PDF pages keep the document's bleed to. + let (bleed, before) = (bleed_in_range(doc.setup.bleed), bleed_in_range(before)); + let raised: [f64; 4] = std::array::from_fn(|i| if bleed[i] > before[i] { bleed[i] } else { 0.0 }); + pdf::short_of_bleed_warning(pdf::short_of_bleed(doc, raised, None, false)) +} + fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let tab = TABS.iter().position(|t| *t == d.str("tab")).unwrap_or(0); if let Some(i) = widgets::tab_bar(ui, &TABS, tab) { @@ -428,6 +446,51 @@ mod tests { assert!(app.ui.dialog.is_some()); } + /// OK with a larger bleed shows how many objects reach the trim edge but stop short of it; a + /// smaller bleed, or a larger one that no object falls short of, shows no such note. + #[test] + fn ok_with_a_larger_bleed_counts_the_art_short_of_it() { + let short = |app: &VectorcraftApp| app.ui.status.contains("short of the bleed"); + let ok_with_sides = |app: &mut VectorcraftApp, bleed: [f64; 4]| { + app.status(""); + app.run("file.documentSetup", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("bleed".into(), json!(bleed)); + crate::dialogs::confirm(app).unwrap(); + }; + let ok_with_bleed = |app: &mut VectorcraftApp, bleed: f64| ok_with_sides(app, [bleed; 4]); + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + // A background that fills a 4 pt bleed on the top, left and right. + let id = app.run("shape.rectangle", json!({"x": -4, "y": -4, "width": 208, "height": 50})).unwrap()["id"].clone(); + app.run("paint.setStroke", json!({"ids": [id], "none": true})).unwrap(); + ok_with_bleed(&mut app, 4.0); + assert!(!short(&app), "{}", app.ui.status); + ok_with_bleed(&mut app, 9.0); + assert_eq!(app.ui.status, "1 object reaches the trim edge but stops short of the bleed"); + ok_with_bleed(&mut app, 6.0); + assert!(!short(&app), "{}", app.ui.status); + // Only the sides whose bleed grows count: the background stops short at the top, left and + // right, so a larger bottom bleed alone shows no note, and a larger top bleed does. + ok_with_sides(&mut app, [6.0, 12.0, 6.0, 6.0]); + assert!(!short(&app), "{}", app.ui.status); + ok_with_sides(&mut app, [12.0, 12.0, 6.0, 6.0]); + assert!(short(&app), "{}", app.ui.status); + // Art inside the trim falls short of no bleed. + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + ok_with_bleed(&mut app, 9.0); + assert!(!short(&app), "{}", app.ui.status); + assert_eq!(app.session.active().unwrap().doc.setup.bleed, [9.0; 4]); + // A bleed that isn't a number, as a file can hold, counts as none before OK, as in the PDF. + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 200, "height": 50})).unwrap(); + std::sync::Arc::make_mut(&mut app.session.doc_mut().unwrap().doc).setup.bleed = [f64::NAN; 4]; + ok_with_bleed(&mut app, 9.0); + assert_eq!(app.ui.status, "1 object reaches the trim edge but stops short of the bleed"); + } + /// Highlight Substituted Fonts is in Preferences › Type, so the General tab shows only the /// substituted glyphs highlight, and OK still applies. #[test] diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c18df53992..c955ce8354 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -4902,6 +4902,7 @@ axis Both И двете @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} свързано изображение е променено на диска: „Обновяване на връзките“ показва новата версия|{n} свързани изображения са променени на диска: „Обновяване на връзките“ показва новите версии @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Обновен е {n} свързан файл, променен на диска|Обновени са {n} свързани файла, променени на диска @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings документът задава изтичане, което този PDF/X файл пропуска: включете „Използване на настройките за изтичане на документа“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} обект достига ръба на обрязване, но не стига до изтичането|{n} обекта достигат ръба на обрязване, но не стигат до изтичането @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} е експортиран с {n} бележка: {first}|{what} е експортиран с {n} бележки: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} шрифтов файл вече е в {folder}|{n} шрифтови файла вече са в {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} шрифтов файл вече е в {folder}; {failed} не можаха да бъдат добавени: {reason}|{n} шрифтови файла вече са в {folder}; {failed} не можаха да бъдат добавени: {reason} diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3484e06bdf..db8d4dbc61 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -5316,6 +5316,7 @@ imageTrace Outline Obris @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} povezana slika promijenjena je na disku: Ažuriraj veze prikazuje novu verziju|{n} povezane slike promijenjene su na disku: Ažuriraj veze prikazuje nove verzije|{n} povezanih slika promijenjeno je na disku: Ažuriraj veze prikazuje nove verzije @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Ažurirana je {n} povezana datoteka promijenjena na disku|Ažurirane su {n} povezane datoteke promijenjene na disku|Ažurirano je {n} povezanih datoteka promijenjenih na disku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument zadaje napust koji ova PDF/X datoteka izostavlja: uključite „Koristi postavke napusta dokumenta“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt doseže rub obreza, ali ne doseže napust|{n} objekta dosežu rub obreza, ali ne dosežu napust|{n} objekata doseže rub obreza, ali ne doseže napust @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Izvezeno {what} s {n} bilješkom: {first}|Izvezeno {what} s {n} bilješke: {first}|Izvezeno {what} s {n} bilješki: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} datoteka fonta sada je u {folder}|{n} datoteke fontova sada su u {folder}|{n} datoteka fontova sada je u {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} datoteka fonta sada je u {folder}; {failed} nije moguće dodati: {reason}|{n} datoteke fontova sada su u {folder}; {failed} nije moguće dodati: {reason}|{n} datoteka fontova sada je u {folder}; {failed} nije moguće dodati: {reason} diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 5970f572d8..5f88354313 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6243,6 +6243,7 @@ liquify-list-end {0}, {1} {0} i {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imatge enllaçada ha canviat al disc: Actualitza els enllaços mostra la versió nova|{n} imatges enllaçades han canviat al disc: Actualitza els enllaços mostra les versions noves @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk S’ha actualitzat {n} fitxer enllaçat que ha canviat al disc|S’han actualitzat {n} fitxers enllaçats que han canviat al disc @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings el document defineix un sangrat que aquest fitxer PDF/X omet: activeu «Utilitza la configuració de sangrat del document» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objecte arriba a la vora de tall però no arriba al sangrat|{n} objectes arriben a la vora de tall però no arriben al sangrat @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} S’ha exportat {what} amb {n} nota: {first}|S’ha exportat {what} amb {n} notes: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fitxer de tipus de lletra ja és a {folder}|{n} fitxers de tipus de lletra ja són a {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fitxer de tipus de lletra ja és a {folder}; {failed} no s’han pogut afegir: {reason}|{n} fitxers de tipus de lletra ja són a {folder}; {failed} no s’han pogut afegir: {reason} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 3aecd729a9..69cc5c6c85 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5586,6 +5586,7 @@ liquify-list-end {0}, {1} {0} a {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions Na disku se změnil {n} propojený obrázek: novou verzi zobrazí Aktualizovat propojení|Na disku se změnily {n} propojené obrázky: nové verze zobrazí Aktualizovat propojení|Na disku se změnilo {n} propojených obrázků: nové verze zobrazí Aktualizovat propojení @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Aktualizován {n} propojený soubor změněný na disku|Aktualizovány {n} propojené soubory změněné na disku|Aktualizováno {n} propojených souborů změněných na disku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument nastavuje spadávku, kterou tento soubor PDF/X vynechává: zapněte „Použít nastavení spadávky dokumentu“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt sahá k hraně ořezu, ale nedosahuje do spadávky|{n} objekty sahají k hraně ořezu, ale nedosahují do spadávky|{n} objektů sahá k hraně ořezu, ale nedosahuje do spadávky @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exportováno: {what}, {n} poznámka: {first}|Exportováno: {what}, {n} poznámky: {first}|Exportováno: {what}, {n} poznámek: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} soubor písma je nyní ve složce {folder}|{n} soubory písem jsou nyní ve složce {folder}|{n} souborů písem je nyní ve složce {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} soubor písma je nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason}|{n} soubory písem jsou nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason}|{n} souborů písem je nyní ve složce {folder}; nepodařilo se přidat {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 59a09bca8b..bf7d9216af 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7677,6 +7677,7 @@ imageTrace Outline Kontur @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} linket billede er ændret på disken: Opdatér links viser den nye version|{n} linkede billeder er ændret på disken: Opdatér links viser de nye versioner @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Opdaterede {n} linket fil ændret på disken|Opdaterede {n} linkede filer ændret på disken @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumentet angiver et udløb, som denne PDF/X-fil udelader: slå „Brug dokumentets udløbsindstillinger“ til +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt når til beskæringskanten, men stopper før udløbet|{n} objekter når til beskæringskanten, men stopper før udløbet @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Eksporterede {what} med {n} note: {first}|Eksporterede {what} med {n} noter: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} skrifttypefil er nu i {folder}|{n} skrifttypefiler er nu i {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} skrifttypefil er nu i {folder}; {failed} kunne ikke tilføjes: {reason}|{n} skrifttypefiler er nu i {folder}; {failed} kunne ikke tilføjes: {reason} diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index afa0451e48..c6574608bc 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5191,6 +5191,7 @@ liquify-list-end {0}, {1} {0} und {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} verknüpftes Bild wurde auf dem Datenträger geändert: „Verknüpfungen aktualisieren“ zeigt die neue Version|{n} verknüpfte Bilder wurden auf dem Datenträger geändert: „Verknüpfungen aktualisieren“ zeigt die neuen Versionen @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} auf dem Datenträger geänderte verknüpfte Datei aktualisiert|{n} auf dem Datenträger geänderte verknüpfte Dateien aktualisiert @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings das Dokument legt einen Anschnitt fest, den diese PDF/X-Datei auslässt: „Anschnitteinstellungen des Dokuments verwenden“ aktivieren +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} Objekt reicht bis zur Endformatkante, endet aber vor dem Anschnitt|{n} Objekte reichen bis zur Endformatkante, enden aber vor dem Anschnitt @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} mit {n} Hinweis exportiert: {first}|{what} mit {n} Hinweisen exportiert: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} Schriftdatei liegt jetzt in {folder}|{n} Schriftdateien liegen jetzt in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} Schriftdatei liegt jetzt in {folder}; {failed} konnten nicht hinzugefügt werden: {reason}|{n} Schriftdateien liegen jetzt in {folder}; {failed} konnten nicht hinzugefügt werden: {reason} diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 726e0630a0..e495db3ea3 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5232,6 +5232,7 @@ digits Malayalam Μαλαγιάλαμ @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} συνδεδεμένη εικόνα άλλαξε στον δίσκο: η Ενημέρωση συνδέσμων εμφανίζει τη νέα έκδοση|{n} συνδεδεμένες εικόνες άλλαξαν στον δίσκο: η Ενημέρωση συνδέσμων εμφανίζει τις νέες εκδόσεις @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Ενημερώθηκε {n} συνδεδεμένο αρχείο που άλλαξε στον δίσκο|Ενημερώθηκαν {n} συνδεδεμένα αρχεία που άλλαξαν στον δίσκο @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings το έγγραφο ορίζει ξάκρισμα που αυτό το αρχείο PDF/X παραλείπει: ενεργοποιήστε τη «Χρήση ρυθμίσεων ξακρίσματος εγγράφου» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} αντικείμενο φτάνει στο άκρο κοπής αλλά σταματά πριν από το ξάκρισμα|{n} αντικείμενα φτάνουν στο άκρο κοπής αλλά σταματούν πριν από το ξάκρισμα @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Εξήχθη το {what} με {n} σημείωση: {first}|Εξήχθη το {what} με {n} σημειώσεις: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} αρχείο γραμματοσειράς βρίσκεται πλέον στον φάκελο {folder}|{n} αρχεία γραμματοσειρών βρίσκονται πλέον στον φάκελο {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} αρχείο γραμματοσειράς βρίσκεται πλέον στον φάκελο {folder}· δεν ήταν δυνατή η προσθήκη {failed}: {reason}|{n} αρχεία γραμματοσειρών βρίσκονται πλέον στον φάκελο {folder}· δεν ήταν δυνατή η προσθήκη {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c668971d37..8305edafc7 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5281,6 +5281,7 @@ liquify-list-end {0}, {1} {0}, {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imagen vinculada cambió en el disco: Actualizar vínculos muestra la versión nueva|{n} imágenes vinculadas cambiaron en el disco: Actualizar vínculos muestra las versiones nuevas @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Se actualizó {n} archivo vinculado que cambió en el disco|Se actualizaron {n} archivos vinculados que cambiaron en el disco @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings el documento define un sangrado que este archivo PDF/X omite: activa «Usar los ajustes de sangrado del documento» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objeto llega al borde de corte pero no alcanza el sangrado|{n} objetos llegan al borde de corte pero no alcanzan el sangrado @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Se exportó {what} con {n} nota: {first}|Se exportó {what} con {n} notas: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} archivo de fuentes ahora está en {folder}|{n} archivos de fuentes ahora están en {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} archivo de fuentes ahora está en {folder}; no se pudieron agregar {failed}: {reason}|{n} archivos de fuentes ahora están en {folder}; no se pudieron agregar {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 08a84268a7..7a66465ba7 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5497,6 +5497,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} linkitetty kuva muuttui levyllä: Päivitä linkit näyttää uuden version|{n} linkitettyä kuvaa muuttui levyllä: Päivitä linkit näyttää uudet versiot @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Päivitettiin {n} levyllä muuttunut linkitetty tiedosto|Päivitettiin {n} levyllä muuttunutta linkitettyä tiedostoa @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings asiakirjassa on leikkuuvara, jonka tämä PDF/X-tiedosto jättää pois: ota käyttöön ”Käytä asiakirjan leikkuuvara-asetuksia” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekti ulottuu leikkuureunaan mutta ei leikkuuvaraan|{n} objektia ulottuu leikkuureunaan mutta ei leikkuuvaraan @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Vietiin {what}, {n} huomautus: {first}|Vietiin {what}, {n} huomautusta: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fonttitiedosto on nyt kansiossa {folder}|{n} fonttitiedostoa on nyt kansiossa {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fonttitiedosto on nyt kansiossa {folder}; {failed} ei voitu lisätä: {reason}|{n} fonttitiedostoa on nyt kansiossa {folder}; {failed} ei voitu lisätä: {reason} diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 197e20565c..c970ec6bcb 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5256,6 +5256,7 @@ liquify-list-end {0}, {1} {0} et {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} image liée modifiée sur le disque : Mettre à jour les liens affiche la nouvelle version|{n} images liées modifiées sur le disque : Mettre à jour les liens affiche les nouvelles versions @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} fichier lié modifié sur le disque mis à jour|{n} fichiers liés modifiés sur le disque mis à jour @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings le document définit un fond perdu que ce fichier PDF/X omet : activez « Utiliser les paramètres de fond perdu du document » +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objet atteint le bord de coupe mais s’arrête avant le fond perdu|{n} objets atteignent le bord de coupe mais s’arrêtent avant le fond perdu @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} exporté avec {n} remarque : {first}|{what} exporté avec {n} remarques : {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} fichier de polices se trouve maintenant dans {folder}|{n} fichiers de polices se trouvent maintenant dans {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} fichier de polices se trouve maintenant dans {folder} ; {failed} n’ont pas pu être ajoutés : {reason}|{n} fichiers de polices se trouvent maintenant dans {folder} ; {failed} n’ont pas pu être ajoutés : {reason} diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 1051a2f25d..29a279c3e4 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4348,6 +4348,7 @@ antiAlias Sharp શાર્પ Gurmukhi ગુરમુખી @plural Result: {n}|Results: {n} પરિણામ: {n}|પરિણામો: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings દસ્તાવેજ એવી બ્લીડ સેટ કરે છે જે આ PDF/X ફાઇલ છોડી દે છે: "દસ્તાવેજની બ્લીડ સેટિંગ્સ વાપરો" ચાલુ કરો +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} ઑબ્જેક્ટ ટ્રિમ કિનારી સુધી પહોંચે છે પણ બ્લીડ પહેલાં અટકી જાય છે|{n} ઑબ્જેક્ટ ટ્રિમ કિનારી સુધી પહોંચે છે પણ બ્લીડ પહેલાં અટકી જાય છે @msgplural Saved {path} with {n} note: {first}|Saved {path} with {n} notes: {first} {path} સાચવ્યું, {n} નોંધ સાથે: {first}|{path} સાચવ્યું, {n} નોંધો સાથે: {first} @msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {folder} માં {n} ફાઇલ ({note}) પેકેજ થઈ|{folder} માં {n} ફાઇલો ({note}) પેકેજ થઈ @msgplural Packaged {n} file {note}|Packaged {n} files {note} {n} ફાઇલ પેકેજ થઈ {note}|{n} ફાઇલો પેકેજ થઈ {note} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 2014f66fdc..7ba2e9e46e 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8812,6 +8812,7 @@ liquify-list-end {0}, {1} {0} और {1} @msgplural Exported {n} document|Exported {n} documents {n} डॉक्यूमेंट एक्सपोर्ट हुआ|{n} डॉक्यूमेंट एक्सपोर्ट हुए @msgplural Exported {n} file to {folder}|Exported {n} files to {folder} {folder} में {n} फ़ाइल एक्सपोर्ट हुई|{folder} में {n} फ़ाइलें एक्सपोर्ट हुईं @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings डॉक्यूमेंट एक ब्लीड सेट करता है जिसे यह PDF/X फ़ाइल छोड़ देती है: "डॉक्यूमेंट की ब्लीड सेटिंग्स उपयोग करें" चालू करें +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} ऑब्जेक्ट ट्रिम किनारे तक पहुँचता है पर ब्लीड से पहले रुक जाता है|{n} ऑब्जेक्ट ट्रिम किनारे तक पहुँचते हैं पर ब्लीड से पहले रुक जाते हैं @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} एक्सपोर्ट हुआ, {n} नोट के साथ: {first}|{what} एक्सपोर्ट हुआ, {n} नोट्स के साथ: {first} @msgplural Opened with {n} note: {first}|Opened with {n} notes: {first} {n} नोट के साथ खुला: {first}|{n} नोट्स के साथ खुला: {first} @msgplural {notice}. Opened with {n} note: {first}|{notice}. Opened with {n} notes: {first} {notice}। {n} नोट के साथ खुला: {first}|{notice}। {n} नोट्स के साथ खुला: {first} diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 9b536ed556..e2be99b695 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5760,6 +5760,7 @@ liquify-list-end {0}, {1} {0} és {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions A lemezen módosult csatolt képek: {n}; a Csatolások frissítése az új változatokat mutatja @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Frissített, a lemezen módosult csatolt fájlok: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings a dokumentum kifutót állít be, amelyet ez a PDF/X-fájl kihagy: kapcsolja be „A dokumentum kifutóbeállításainak használata” beállítást +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objektum eléri a vágási élt, de nem ér ki a kifutóig @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exportálva: {what}; megjegyzések: {n}, az első: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} Betűtípusfájlok száma: {n}, mappa: {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} Betűtípusfájlok száma: {n}, mappa: {folder}; nem sikerült hozzáadni: {failed} ({reason}) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 760f0b591a..fba2c958db 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4990,6 +4990,7 @@ imageTrace Outline Kontur @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} gambar tertaut di disk telah berubah: Perbarui Tautan menampilkan versi barunya @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Telah memperbarui {n} berkas tertaut yang berubah di disk @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumen menetapkan bleed yang dihilangkan oleh file PDF/X ini: aktifkan "Gunakan pengaturan bleed dokumen" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objek mencapai tepi potong tetapi berhenti sebelum bleed @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} diekspor dengan {n} catatan: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} berkas font kini berada di {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} berkas font kini berada di {folder}; {failed} tidak dapat ditambahkan: {reason} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 2540830b01..64ff36d462 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5320,6 +5320,7 @@ liquify-list-end {0}, {1} {0} e {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} immagine collegata modificata su disco: Aggiorna collegamenti mostra la nuova versione|{n} immagini collegate modificate su disco: Aggiorna collegamenti mostra le nuove versioni @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Aggiornato {n} file collegato modificato su disco|Aggiornati {n} file collegati modificati su disco @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings il documento imposta un'abbondanza che questo file PDF/X omette: attiva «Usa impostazioni abbondanza del documento» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} oggetto raggiunge il bordo di rifilo ma si ferma prima dell'abbondanza|{n} oggetti raggiungono il bordo di rifilo ma si fermano prima dell'abbondanza @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Esportato {what} con {n} nota: {first}|Esportato {what} con {n} note: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} file di font ora in {folder}|{n} file di font ora in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} file di font ora in {folder}; impossibile aggiungerne {failed}: {reason}|{n} file di font ora in {folder}; impossibile aggiungerne {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 084c59e9a0..55a4d806c0 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5389,6 +5389,7 @@ liquify-list-end {0}, {1} {0}、{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} 個のリンク画像がディスク上で変更されました: 「リンクを更新」で新しいバージョンを表示できます @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk ディスク上で変更された {n} 個のリンクファイルを更新しました @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings ドキュメントに設定された裁ち落としがこの PDF/X ファイルには含まれません: 「ドキュメントの裁ち落とし設定を使用」をオンにしてください +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 個のオブジェクトが仕上がり線に達していますが、裁ち落としまで届いていません @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} を書き出しましたが、注意事項が {n} 件あります: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 個のフォントファイルが {folder} に入りました @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 個のフォントファイルが {folder} に入りましたが、{failed} 個は追加できませんでした: {reason} diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index bd069f4b9b..859cd0a3c8 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6979,6 +6979,7 @@ font-technology Variable ცვლადი @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions დაკავშირებული გამოსახულებები შეიცვალა დისკზე ({n}): ბმულების განახლება აჩვენებს ახალ ვერსიებს @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk განახლდა დისკზე შეცვლილი დაკავშირებული ფაილები: {n} @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings დოკუმენტი ადგენს ჭრისპირა არეს, რომელსაც ეს PDF/X ფაილი გამოტოვებს: ჩართეთ „დოკუმენტის ჭრისპირა არის პარამეტრების გამოყენება“ +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed ობიექტები, რომლებიც ჭრის კიდეს აღწევს, მაგრამ ჭრისპირა არემდე ვერა: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} ექსპორტირებულია {what}, შენიშვნები: {n}: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} შრიფტის ფაილები ({n}) ახლა აქ არის: {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} შრიფტის ფაილები ({n}) ახლა აქ არის: {folder}; ვერ დაემატა {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 239a805465..0181ce2f20 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5316,6 +5316,7 @@ liquify-list-end {0}, {1} {0} 및 {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 링크된 이미지 {n}개가 디스크에서 바뀌었습니다: 링크 업데이트를 하면 새 버전이 표시됩니다 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 디스크에서 바뀐 링크된 파일 {n}개를 업데이트했습니다 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 문서에 설정된 도련이 이 PDF/X 파일에서 빠집니다: "문서 도련 설정 사용"을 켜세요 +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed 객체 {n}개가 재단선에 닿지만 도련까지 이어지지 않습니다 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 참고 {n}건과 함께 {what}을(를) 내보냈습니다: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} 글꼴 파일 {n}개가 이제 {folder}에 있습니다 @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} 글꼴 파일 {n}개가 이제 {folder}에 있으며, {failed}개는 추가할 수 없었습니다: {reason} diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 2f98ee84fe..84a5218d4a 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5584,6 +5584,7 @@ imageTrace Outline Contour @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} gekoppelde afbeelding is gewijzigd op de schijf: Koppelingen bijwerken toont de nieuwe versie|{n} gekoppelde afbeeldingen zijn gewijzigd op de schijf: Koppelingen bijwerken toont de nieuwe versies @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Bijgewerkt: {n} gekoppeld bestand gewijzigd op de schijf|Bijgewerkt: {n} gekoppelde bestanden gewijzigd op de schijf @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings het document stelt een afloop in die dit PDF/X-bestand weglaat: schakel 'Afloopinstellingen van document gebruiken' in +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} object reikt tot de snijrand maar stopt voor de afloop|{n} objecten reiken tot de snijrand maar stoppen voor de afloop @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} geëxporteerd met {n} opmerking: {first}|{what} geëxporteerd met {n} opmerkingen: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} er staat nu {n} lettertypebestand in {folder}|er staan nu {n} lettertypebestanden in {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} er staat nu {n} lettertypebestand in {folder}; {failed} konden niet worden toegevoegd: {reason}|er staan nu {n} lettertypebestanden in {folder}; {failed} konden niet worden toegevoegd: {reason} diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index bf8c7593a1..7083a62c90 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5412,6 +5412,7 @@ liquify-list-end {0}, {1} {0} i {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} połączony obraz zmienił się na dysku: Aktualizuj łącza pokaże nową wersję|{n} połączone obrazy zmieniły się na dysku: Aktualizuj łącza pokaże nowe wersje|{n} połączonych obrazów zmieniło się na dysku: Aktualizuj łącza pokaże nowe wersje @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Zaktualizowano {n} połączony plik zmieniony na dysku|Zaktualizowano {n} połączone pliki zmienione na dysku|Zaktualizowano {n} połączonych plików zmienionych na dysku @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokument ustawia spad, który ten plik PDF/X pomija: włącz „Użyj ustawień spadu dokumentu” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n}|Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n}|Obiekty sięgające linii cięcia, ale niedochodzące do spadu: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Wyeksportowano {what} z {n} uwagą: {first}|Wyeksportowano {what} z {n} uwagami: {first}|Wyeksportowano {what} z {n} uwagami: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} plik czcionki jest teraz w {folder}|{n} pliki czcionek są teraz w {folder}|{n} plików czcionek jest teraz w {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} plik czcionki jest teraz w {folder}; nie udało się dodać {failed}: {reason}|{n} pliki czcionek są teraz w {folder}; nie udało się dodać {failed}: {reason}|{n} plików czcionek jest teraz w {folder}; nie udało się dodać {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 03b9998eb2..6ef3854d5f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4619,6 +4619,7 @@ axis Both Ambos @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} imagem vinculada mudou no disco: Atualizar links mostra a nova versão|{n} imagens vinculadas mudaram no disco: Atualizar links mostra as novas versões @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk {n} arquivo vinculado alterado no disco atualizado|{n} arquivos vinculados alterados no disco atualizados @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings o documento define uma sangria que este arquivo PDF/X omite: ative "Usar configurações de sangria do documento" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objeto chega à borda de corte, mas para antes da sangria|{n} objetos chegam à borda de corte, mas param antes da sangria @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} exportado com {n} observação: {first}|{what} exportado com {n} observações: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} arquivo de fonte agora está em {folder}|{n} arquivos de fonte agora estão em {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} arquivo de fonte agora está em {folder}; não foi possível adicionar {failed}: {reason}|{n} arquivos de fonte agora estão em {folder}; não foi possível adicionar {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index a729b05460..554905ebad 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5318,6 +5318,7 @@ liquify-list-end {0}, {1} {0} и {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} связанное изображение изменилось на диске: «Обновить связи» покажет новую версию|{n} связанных изображения изменились на диске: «Обновить связи» покажет новые версии|{n} связанных изображений изменились на диске: «Обновить связи» покажет новые версии @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Обновлён {n} связанный файл, изменённый на диске|Обновлено {n} связанных файла, изменённых на диске|Обновлено {n} связанных файлов, изменённых на диске @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings в документе задан вылет, который этот файл PDF/X не включает: включите «Использовать параметры вылета документа» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed Объектов, доходящих до обрезного края, но не до вылета: {n}|Объектов, доходящих до обрезного края, но не до вылета: {n}|Объектов, доходящих до обрезного края, но не до вылета: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Экспортировано: {what} с {n} примечанием: {first}|Экспортировано: {what} с {n} примечаниями: {first}|Экспортировано: {what} с {n} примечаниями: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} файл шрифта теперь в {folder}|{n} файла шрифтов теперь в {folder}|{n} файлов шрифтов теперь в {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} файл шрифта теперь в {folder}; не удалось добавить {failed}: {reason}|{n} файла шрифтов теперь в {folder}; не удалось добавить {failed}: {reason}|{n} файлов шрифтов теперь в {folder}; не удалось добавить {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index d4c923d87d..f4d619e842 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5173,6 +5173,7 @@ liquify-list-end {0}, {1} {0} och {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} länkad bild har ändrats på disken: Uppdatera länkar visar den nya versionen|{n} länkade bilder har ändrats på disken: Uppdatera länkar visar de nya versionerna @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Uppdaterade {n} länkad fil som ändrats på disken|Uppdaterade {n} länkade filer som ändrats på disken @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings dokumentet anger ett utfall som den här PDF/X-filen utelämnar: slå på ”Använd dokumentets inställningar för utfall” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} objekt når skärkanten men slutar före utfallet|{n} objekt når skärkanten men slutar före utfallet @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Exporterade {what} med {n} anteckning: {first}|Exporterade {what} med {n} anteckningar: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} typsnittsfil finns nu i {folder}|{n} typsnittsfiler finns nu i {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} typsnittsfil finns nu i {folder}; {failed} kunde inte läggas till: {reason}|{n} typsnittsfiler finns nu i {folder}; {failed} kunde inte läggas till: {reason} diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index be51c93d96..45fe91f0b5 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4359,6 +4359,21 @@ fn pdfx_bleed_warning_is_translated() { } } +/// The warning about art that reaches the trim edge but stops short of the bleed is translated in +/// every complete-message catalog, for one object and for more, alone and in the status bar's note. +#[test] +fn short_of_bleed_warning_is_translated() { + for n in [1, 3, 5, 21] { + let w = vectorcraft_engine::cmd::fileio::pdf::short_of_bleed_warning(n).expect("a warning"); + let status = format!("Saved /tmp/a.pdf with 1 note: {w}"); + for code in COMPLETE_MESSAGES { + for shown in [message(Lang::from_code(code).expect("registered"), &w), message(Lang::from_code(code).expect("registered"), &status)] { + assert!(!shown.contains("trim edge") && !shown.contains("short of") && shown.contains(&n.to_string()), "{code}: {shown}"); + } + } + } +} + /// The errors of saving, renaming and deleting a tracing preset are translated in every language /// that translates every message. #[test] diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 2017637952..74b75cc8e2 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5014,6 +5014,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} bağlantılı görsel diskte değişti: Bağlantıları Güncelle yeni sürümleri gösterir @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Diskte değişen {n} bağlantılı dosya güncellendi @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings belge, bu PDF/X dosyasının dışarıda bıraktığı bir taşma payı ayarlıyor: "Belge taşma payı ayarlarını kullan" seçeneğini açın +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} nesne kesim kenarına ulaşıyor ancak taşma payından önce bitiyor @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} {what} {n} notla dışa aktarıldı: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} yazı tipi dosyası artık {folder} içinde @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} yazı tipi dosyası artık {folder} içinde; {failed} eklenemedi: {reason} diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 53ca6b8a43..daac22878e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5304,6 +5304,7 @@ liquify-list-end {0}, {1} {0} і {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} пов’язане зображення змінилося на диску: «Оновити зв’язки» покаже нову версію|{n} пов’язані зображення змінилися на диску: «Оновити зв’язки» покаже нові версії|{n} пов’язаних зображень змінилися на диску: «Оновити зв’язки» покаже нові версії @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Оновлено {n} пов’язаний файл, змінений на диску|Оновлено {n} пов’язані файли, змінені на диску|Оновлено {n} пов’язаних файлів, змінених на диску @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings у документі задано виліт, який цей файл PDF/X не містить: увімкніть «Використовувати параметри вильоту документа» +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed об’єктів, що доходять до краю обрізу, але не до вильоту: {n}|об’єктів, що доходять до краю обрізу, але не до вильоту: {n}|об’єктів, що доходять до краю обрізу, але не до вильоту: {n} @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Експортовано: {what} з {n} приміткою: {first}|Експортовано: {what} з {n} примітками: {first}|Експортовано: {what} з {n} примітками: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} файл шрифту тепер у {folder}|{n} файли шрифтів тепер у {folder}|{n} файлів шрифтів тепер у {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} файл шрифту тепер у {folder}; не вдалося додати {failed}: {reason}|{n} файли шрифтів тепер у {folder}; не вдалося додати {failed}: {reason}|{n} файлів шрифтів тепер у {folder}; не вдалося додати {failed}: {reason} diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 7dcf6219fd..eeff3f867b 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5433,6 +5433,7 @@ liquify-list-end {0}, {1} {0} và {1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions {n} ảnh liên kết đã thay đổi trên đĩa: Cập nhật liên kết hiển thị phiên bản mới @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk Đã cập nhật {n} tệp liên kết đã thay đổi trên đĩa @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings tài liệu đặt bleed mà tệp PDF/X này bỏ qua: hãy bật "Dùng cài đặt bleed của tài liệu" +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} đối tượng chạm mép xén nhưng dừng trước bleed @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} Đã xuất {what} với {n} ghi chú: {first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} tệp phông chữ hiện ở trong {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} tệp phông chữ hiện ở trong {folder}; {failed} không thể thêm: {reason} diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5c8ea12be7..d43ae4fb38 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5066,6 +5066,7 @@ liquify-list-end {0}, {1} {0}和{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 有 {n} 个链接图像已在磁盘上更改:“更新链接”可显示新版本 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 已更新 {n} 个在磁盘上更改的链接文件 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 文档设置了出血,但此 PDF/X 文件未包含:请打开“使用文档的出血设置” +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 个对象到达裁切线,但未延伸到出血区域 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 已导出 {what},有 {n} 条注释:{first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 个字体文件现已位于 {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 个字体文件现已位于 {folder};有 {failed} 个无法添加:{reason} diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 2134e31d7f..0729104ff5 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2703,6 +2703,7 @@ liquify-list-end {0}, {1} {0}和{1} @msgplural {n} linked image changed on disk: Update Links shows the new version|{n} linked images changed on disk: Update Links shows the new versions 有 {n} 個連結影像已在磁碟上變更:「更新連結」可顯示新版本 @msgplural Updated {n} linked file changed on disk|Updated {n} linked files changed on disk 已更新 {n} 個在磁碟上變更的連結檔案 @msg the document sets a bleed that this PDF/X file leaves out: turn on Use document bleed settings 文件設定了出血,但此 PDF/X 檔案未包含:請開啟「使用文件的出血設定」 +@msgplural {n} object reaches the trim edge but stops short of the bleed|{n} objects reach the trim edge but stop short of the bleed {n} 個物件到達裁切線,但未延伸到出血區域 @msgplural Exported {what} with {n} note: {first}|Exported {what} with {n} notes: {first} 已匯出 {what},附有 {n} 則註解:{first} @msgplural {n} font file is now in {folder}|{n} font files are now in {folder} {n} 個字體檔案現已位於 {folder} @msgplural {n} font file is now in {folder}; {failed} couldn't be added: {reason}|{n} font files are now in {folder}; {failed} couldn't be added: {reason} {n} 個字體檔案現已位於 {folder};有 {failed} 個無法加入:{reason} diff --git a/docs/mcp.md b/docs/mcp.md index 948bee5d94..d82c54b946 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5984,6 +5984,20 @@ information (title, artboard, export date in UTC) are drawn in Registration (`/S the colour bars are process, spot and black-tint patches. Layers whose Print option is off (`layer.setProps {printable: false}`) are left out unless `includeNonPrinting` (or `createLayers`) is on. +VectorCraft also checks the art against the bleed. When a page has a bleed, the export warns with a count of the +objects that reach the trim edge (within 0.5 pt) on a side whose bleed is more than 0.5 pt but end before the bleed +edge, for example `3 objects reach the trim edge but stop short of the bleed`. The check measures each object on the +visible layers (a group counts as one) by its visual bounds, strokes included. It measures a clip group or a clipping +layer by the art inside the clipping path's geometric bounds and by the fill and stroke the clipping path paints +itself. It leaves out hidden objects, guides, objects at 0% opacity and paths with no fill or stroke. It does not +measure objects with brushed strokes or an opacity mask, area type, type on a path, or groups that hold one of them. +It leaves out template layers, layers with an opacity mask, and layers that don't print unless `includeNonPrinting` is +on. The export writes the art and the page boxes unchanged. A page of the +art's bounds (`useArtboards: false`) does not warn. Export for Screens does not warn for a PDF row when Include Bleed +grows the artboards, or for a page of assets, layers or a selection. `.ai` saves do not warn. When OK in File › +Document Setup raises the bleed on a side, the status bar counts the objects that stop short of the new bleed on the +sides OK raised, on every artboard. + ```json {"name":"run_command","arguments":{"command":"document.exportPdf","params":{"path":"/tmp/press.pdf","preset":"Press Quality","marks":{"trim":true,"registration":true,"colorBars":true,"pageInfo":true}}}} ``` diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fdb66b722f..196a292718 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1886,6 +1886,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`). That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`). PDF export warns when a PDF/X file has no bleed on a side where the document's bleed has one, and writes the file as asked. + PDF export, and Document Setup when OK raises the bleed, count the objects that reach the trim edge on a side with a bleed but stop short of the bleed edge, and change no art or page box (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). In a PDF without a standard, the warning for a page longer than 14,400 pt written with a `UserUnit` names "Write pages longer than 200 in at full size in points" (`crates/engine/src/cmd/fileio/tests_pdf.rs`). A PDF/A-2b export at PDF 1.4 with a page longer than 14,400 pt is written as PDF 1.6 with a `UserUnit` and a warning, whether or not `longPagesInPoints` is on, so its page boundaries stay within PDF/A-2's limit of 14,400 units (ISO 19005-2, 6.1.13) unless the page is too narrow for that (`crates/pdf/src/tests/marks.rs`). PDF/X-1a, PDF/X-3 and PDF 1.3 files keep the art under the hidden part of a picture, gradient, pattern, mesh or raster effect that a clipping mask or clipping layer crops: flattening rasterizes only the part of such art that its clipping path shows, on its own page and on the next one. Layers the file leaves out are left out of the flattening, and transparent art that a clipping path hides entirely is removed (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). From 84308c53d75ebbafb3f3a115289b366253aa44f5 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 16:12:02 -0800 Subject: [PATCH 052/247] Path Precision Tools: Smooth Bridge joins many circles and keeps a constant gap Smooth Bridge now takes three or more circles. Every two whose outlines are within a reach of each other are bridged, the bridges that connect are united into one shape each, and a circle bridged to no other stays as it is. - `addon.pathtools.bridge` takes `gap` (0 to 1000 pt) in place of `radius`: the arcs' radius is the smaller circle's radius plus the gap, so each arc stays the gap away from a circle of the smaller circle's size about the arc's center. In a triangular grid of equal circles that gap apart, the channels around an empty place keep one width. Giving both is an error. - `reach` (0 to 10000 pt, 10 by default) sets how far apart two circles' outlines may be for a bridge between them. It applies to three or more circles; two are bridged at any distance, and the dialog's Reach field is unavailable then. Pairs are found through a grid of cells, so each circle is compared only with its near neighbors. Holes smaller than 1% of the smallest circle's area are filled. - A pair within reach but too far apart for the radius or gap gets no bridge. One circle inside another, no pair that can be bridged, no two circles within reach, more than 2000 circles and more than 8000 bridges are refused with a message. An id given twice counts once. - Each shape replaces its circles, painted as the topmost of them, or with `keepOriginals` goes directly above that circle. One undo step; the shapes and the circles left alone are selected, and the result is `{ids, alone}`, with `id` as well for two circles. - `smooth_bridge` refuses circles whose sizes overflow when squared; it returned a path whose points were not numbers. - The selection message becomes "select two or more circles to bridge". - The dialog adds Constant Gap (a Gap field in place of Radius) and Reach. Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP. --- ROADMAP.md | 2 +- .../engine/src/cmd/addons/pathtools/bridge.rs | 152 ++++-- .../src/cmd/addons/pathtools/bridge/tests.rs | 167 ++++++- crates/engine/src/cmd/params.rs | 3 +- crates/engine/tests/command_sweep.rs | 2 + crates/pathops/src/addons/pathtools.rs | 7 +- crates/pathops/src/addons/pathtools/bridge.rs | 444 +++++++++++++++++- crates/ui-egui/src/addons/pathtools/bridge.rs | 81 +++- crates/ui-egui/src/i18n/bg.tsv | 10 +- crates/ui-egui/src/i18n/bs.tsv | 10 +- crates/ui-egui/src/i18n/ca.tsv | 10 +- crates/ui-egui/src/i18n/cs.tsv | 10 +- crates/ui-egui/src/i18n/da.tsv | 10 +- crates/ui-egui/src/i18n/de.tsv | 10 +- crates/ui-egui/src/i18n/el.tsv | 10 +- crates/ui-egui/src/i18n/es.tsv | 10 +- crates/ui-egui/src/i18n/fi.tsv | 10 +- crates/ui-egui/src/i18n/fr.tsv | 10 +- crates/ui-egui/src/i18n/gu.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 10 +- crates/ui-egui/src/i18n/hu.tsv | 10 +- crates/ui-egui/src/i18n/id.tsv | 10 +- crates/ui-egui/src/i18n/it.tsv | 10 +- crates/ui-egui/src/i18n/ja.tsv | 10 +- crates/ui-egui/src/i18n/ka.tsv | 10 +- crates/ui-egui/src/i18n/ko.tsv | 10 +- crates/ui-egui/src/i18n/nl.tsv | 10 +- crates/ui-egui/src/i18n/pl.tsv | 10 +- crates/ui-egui/src/i18n/pt-br.tsv | 10 +- crates/ui-egui/src/i18n/ru.tsv | 10 +- crates/ui-egui/src/i18n/sv.tsv | 10 +- crates/ui-egui/src/i18n/tr.tsv | 10 +- crates/ui-egui/src/i18n/uk.tsv | 10 +- crates/ui-egui/src/i18n/vi.tsv | 10 +- crates/ui-egui/src/i18n/zh-hans.tsv | 10 +- crates/ui-egui/src/i18n/zh-hant.tsv | 10 +- docs/mcp.md | 39 +- docs/target-app-parity.md | 2 + docs/ui-parity.md | 2 +- 39 files changed, 1058 insertions(+), 115 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 317174e231..9fab724e07 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -144,7 +144,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-01: New Symbols from Layers joins the Document Tools add-on (Object › Plug-ins › Document Tools): one symbol of each top-level layer's art (the layers highlighted in the Layers panel when two or more are, else every layer), named after the layer, made as New Symbol makes one; Convert Layers to Symbols also puts an instance of each in place of its layer's art. Empty layers are skipped and reported; one undo step. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `<name>_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged. -- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), and Keep Originals adds the outline above the circles instead of replacing them. A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. +- 2026-11-15: Smooth Bridge joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): two selected circles become one closed outline joined by two concave arcs that touch both circles, so every anchor is smooth; the arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default), or with Constant Gap the smaller circle's radius plus a gap, and Keep Originals adds the outline above the circles instead of replacing them. With three or more circles, every two whose outlines are within Reach (10 pt by default) are joined, the bridges that connect become one shape each, and a circle bridged to no other stays as it is (at most 2000 circles). A dialog with Preview, one undo step (`addon.pathtools.bridge`). A VectorCraft addition: headline numbers unchanged. - 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). A VectorCraft addition: headline numbers unchanged. - 2026-11-01: Group Overlapping Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects whose visual bounds overlap or touch, chains included, go into one group each, within their own layer or group, at the stacking place of their frontmost member; objects that overlap nothing stay as they are. One undo step, a sweep along x so thousands of loose pieces group quickly (at most 20000 objects). A VectorCraft addition: headline numbers unchanged. - 2026-10-31: Export for Screens works as the reference app's dialog: Artboards and Assets tabs with a grid or list of thumbnails, Clear Selection and Prefix, Create Sub-folders by Scale or Format (on by default), Export PDFs As Single File (the chosen artboards as one PDF's pages, `pdfs: "single"`) or Multiple Files, iOS and Android rows, format presets in a ☰ menu, and a count of the files the export writes (#4895). About 55 community PRs and fixes landed the same day: Find Font, Replace Font, Outline Stroke and Expand leave hidden and locked art alone (with a warning); DXF export writes LINE and ELLIPSE entities and outlines only the strokes a CAD line can't draw; Blob Brush Angle and Roundness; Shift-constrained Perspective Selection; Grid Repeat Options Preview; a gradient mesh from a file budgeted at about a million quads; width-profile strokes keep their shape zoomed out; `.ai`/EPS import fidelity (area type, envelopes, transparency in dictionaries, character styles); PDF import finds hyphenated and CMap-suffixed font names; Windows renders follow the process's core affinity; Enter or Escape in a floating panel's field no longer reaches the canvas (#4803); Properties shows Blend Options for any selected blend (#4817); Artwork Cleanup finds doubled type (#4835) and joins stacked lines into one object (Join Point Text, #4826). Headline numbers unchanged. diff --git a/crates/engine/src/cmd/addons/pathtools/bridge.rs b/crates/engine/src/cmd/addons/pathtools/bridge.rs index 2120b040e7..1c7181f43e 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge.rs @@ -1,5 +1,6 @@ //! Smooth Bridge: two selected circles joined into one outline by two concave arcs that touch both -//! circles, replacing the circles or added above them. +//! circles, or three or more each joined the same way to the others within reach and united where +//! the bridges connect, replacing the circles or added above them. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -20,6 +21,12 @@ const LABEL: &str = "Smooth Bridge"; /// The arcs' radius as a percentage of the smaller circle's radius: by default, and the range. const RADIUS: f64 = 100.0; const RADII: (f64, f64) = (1.0, 1000.0); +/// The gap (pt) added to the smaller circle's radius to give the arcs' radius: the range. +const GAPS: (f64, f64) = (0.0, 1000.0); +/// How far apart (pt) the outlines of two of three or more circles may be for a bridge between +/// them: by default, and the range. +const REACH: f64 = 10.0; +const REACHES: (f64, f64) = (0.0, 10000.0); pub(super) fn specs() -> Vec<CommandSpec> { vec![cmd!( @@ -27,16 +34,33 @@ pub(super) fn specs() -> Vec<CommandSpec> { "Smooth Bridge", ["Object", "Plug-ins", "Path Precision Tools"], None, - "{radius?: % 1..1000 (100; the radius of the bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), keepOriginals?: bool (false: the outline replaces the two circles, painted as the upper one; true: it goes directly above the upper one and the circles stay), ids?: [id, id] (default: the selection)} join two circles (paths whose outline is a circle, not hidden or locked) into one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. Overlapping and touching circles are joined too; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both, or would cross), is an error, which suggests a larger radius when one up to 1000% would bridge them. One undo step; the outline is selected → {id}", + "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", has_selection, bridge )] } fn bridge(s: &mut Session, p: &Value) -> Result<Value> { - let percent = given(p, "radius", Some(RADII), C)?.unwrap_or(RADIUS); + let percent = given(p, "radius", Some(RADII), C)?; + let gap = given(p, "gap", Some(GAPS), C)?; + let reach = given(p, "reach", Some(REACHES), C)?.unwrap_or(REACH); + if percent.is_some() && gap.is_some() { + // As the parameter check words it (`EXCLUSIVE_KEYS`), for a caller that skips that check. + let (key, other) = ("radius", "gap"); + return Err(bad(C, format!("give `{key}` or `{other}`, not both"))); + } + let arc = match gap { + Some(gap) => pt::ArcRadius::Gap(gap), + None => pt::ArcRadius::Share(percent.unwrap_or(RADIUS) / 100.0), + }; let keep = switch_or(p, "keepOriginals", false, C)?; - let roots = checked_ids_or_selection(s, p, C)?; + let mut roots = checked_ids_or_selection(s, p, C)?; + // An id given twice is one circle. + roots.sort_unstable(); + roots.dedup(); + if roots.len() > pt::MAX_BRIDGED_CIRCLES { + return Err(bad(C, "select at most 2000 circles to bridge")); + } let circles: Vec<(NodeId, pt::Circle)> = { let d = &s.doc()?.doc; let editable = d.editable(); @@ -48,48 +72,94 @@ fn bridge(s: &mut Session, p: &Value) -> Result<Value> { }) .collect() }; - let ([(below, a), (above, b)], 2) = (circles.as_slice(), roots.len()) else { - return Err(bad(C, "select two circles to bridge")); - }; - let (below, above) = (*below, *above); - let at = |percent: f64| pt::smooth_bridge(*a, *b, a.radius.min(b.radius) * percent / 100.0); - let outline = match at(percent) { - Ok(sp) => PathData::single(sp), - Err(pt::BridgeError::Inside) => return Err(bad(C, "one circle is inside the other")), - // A larger radius bridges circles a smaller one cannot, so only suggest one that is allowed. - Err(pt::BridgeError::TooFar) if at(RADII.1).is_ok() => { - return Err(bad(C, "the circles are too far apart for this radius: raise the radius")); + if circles.len() != roots.len() || circles.len() < 2 { + return Err(bad(C, "select two or more circles to bridge")); + } + let only: Vec<pt::Circle> = circles.iter().map(|(_, c)| *c).collect(); + // Each shape: the circles it joins, in paint order, and its outline. + let (shapes, alone): (Vec<(Vec<NodeId>, PathData)>, Vec<NodeId>) = match only.as_slice() { + [a, b] => match pt::smooth_bridge(*a, *b, arc.between(*a, *b)) { + Ok(sp) => (vec![(roots_of(&circles, &[0, 1]), PathData::single(sp))], vec![]), + Err(e) => return Err(refusal(e, arc, *a, *b)), + }, + _ => { + let made = pt::bridge_many(&only, arc, reach).map_err(|e| match e { + pt::ManyError::TooManyCircles => bad(C, "select at most 2000 circles to bridge"), + pt::ManyError::TooManyBridges => bad(C, "that makes too many bridges (at most 8000): lower the reach"), + pt::ManyError::NoneInReach => bad(C, "no two circles are within reach: raise the reach"), + pt::ManyError::TooComplex => bad(C, "the bridged circles are too complex to unite"), + pt::ManyError::Pair(i, j, e) => match (only.get(i), only.get(j)) { + (Some(a), Some(b)) => refusal(e, arc, *a, *b), + _ => bad(C, "select two or more circles to bridge"), + }, + pt::ManyError::Bad => bad(C, "select two or more circles to bridge"), + })?; + let shapes = made.joined.into_iter().map(|j| (roots_of(&circles, &j.members), j.outline)).collect(); + (shapes, roots_of(&circles, &made.alone)) } - Err(pt::BridgeError::TooFar) => return Err(bad(C, "the circles are too far apart for this radius")), - Err(pt::BridgeError::Bad) => return Err(bad(C, "select two circles to bridge")), }; - let id = s.edit(LABEL, |d, sel| { - let id = if keep { - // A copy of the upper circle (its appearance) with the outline as its path, right above - // it; the circles stay as they are, live shapes included. - // Fresh ids throughout, its opacity mask's art included. - let upper = d.node(above).cloned().ok_or(EngineError::NoNode(above))?; - let mut n = d.reid(&upper); - if let NodeKind::Path { path, live, .. } = &mut n.kind { - *path = outline; - *live = None; + let made = s.edit(LABEL, |d, sel| { + let mut made = Vec::with_capacity(shapes.len()); + if keep { + // A copy of each shape's topmost circle (its appearance) with the outline as its path, + // right above it; the circles stay as they are, live shapes included. Fresh ids + // throughout, an opacity mask's art included. + let tops: Vec<NodeId> = shapes.iter().filter_map(|(members, _)| members.last().copied()).collect(); + let mut beside = Beside::above(d, &tops); + for ((_, outline), top) in shapes.into_iter().zip(tops) { + let upper = d.node(top).cloned().ok_or(EngineError::NoNode(top))?; + let mut n = d.reid(&upper); + if let NodeKind::Path { path, live, .. } = &mut n.kind { + *path = outline; + *live = None; + } + made.push(n.id); + beside.put(d, top, vec![n])?; } - let id = n.id; - let mut beside = Beside::above(d, &[above]); - beside.put(d, above, vec![n])?; beside.finish(d)?; - id } else { - // The upper circle becomes the outline (a plain path now) and the lower one goes. - if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(above).map(|n| &mut n.kind) { - *path = outline; - *live = None; + // Each shape's topmost circle becomes its outline (a plain path now) and the others go. + let mut gone = vec![]; + for (members, outline) in shapes { + let Some((&top, rest)) = members.split_last() else { continue }; + if let Some(NodeKind::Path { path, live, .. }) = d.node_mut(top).map(|n| &mut n.kind) { + *path = outline; + *live = None; + } + made.push(top); + gone.extend_from_slice(rest); } - remove_each(d, &[below])?; - above - }; - sel.set([id]); - Ok(id) + remove_each(d, &gone)?; + } + sel.set(made.iter().chain(&alone).copied()); + Ok(made) })?; - Ok(json!({ "id": id.0 })) + let mut out = json!({ "ids": made.iter().map(|id| id.0).collect::<Vec<_>>(), "alone": alone.iter().map(|id| id.0).collect::<Vec<_>>() }); + if let ([id], 2) = (made.as_slice(), only.len()) { + out["id"] = json!(id.0); + } + Ok(out) +} + +/// The ids of `circles` at indices `at`, in paint order (the circles are listed in paint order). +fn roots_of(circles: &[(NodeId, pt::Circle)], at: &[usize]) -> Vec<NodeId> { + at.iter().filter_map(|&i| circles.get(i)).map(|(id, _)| *id).collect() +} + +/// The error for circles `a` and `b` that arcs of `arc` can't bridge. A larger radius or gap +/// bridges circles a smaller one cannot, so it suggests one only when the largest allowed would. +fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, a: pt::Circle, b: pt::Circle) -> EngineError { + let largest = match arc { + pt::ArcRadius::Share(_) => pt::ArcRadius::Share(RADII.1 / 100.0), + pt::ArcRadius::Gap(_) => pt::ArcRadius::Gap(GAPS.1), + }; + let would = pt::smooth_bridge(a, b, largest.between(a, b)).is_ok(); + match (e, arc, would) { + (pt::BridgeError::Inside, ..) => bad(C, "one circle is inside the other"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), true) => bad(C, "the circles are too far apart for this radius: raise the radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), false) => bad(C, "the circles are too far apart for this radius"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), true) => bad(C, "the circles are too far apart for this gap: raise the gap"), + (pt::BridgeError::TooFar, pt::ArcRadius::Gap(_), false) => bad(C, "the circles are too far apart for this gap"), + (pt::BridgeError::Bad, ..) => bad(C, "select two or more circles to bridge"), + } } diff --git a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs index 01320c07c1..6c491904e6 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs @@ -1,5 +1,5 @@ -//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius, -//! and what it refuses. +//! Smooth Bridge: the outline in place of the circles or above them, one undo step, the radius or +//! gap, many circles joined to their neighbors within reach, and what it refuses. use serde_json::{Value, json}; use vectorcraft_doc::{NodeId, NodeKind}; @@ -46,6 +46,8 @@ fn two_circles_become_one_outline_in_the_upper_ones_place() { let steps = s.doc().unwrap().history.undo.len(); let r = s.execute(BRIDGE, &json!({})).unwrap(); assert_eq!(r["id"], json!(b.0)); + assert_eq!(r["ids"], json!([b.0]), "the same result fields as for more circles"); + assert_eq!(r["alone"], json!([])); assert_eq!(top_level(&s), [b]); let d = &s.doc().unwrap().doc; let NodeKind::Path { path, live, .. } = &d.node(b).unwrap().kind else { panic!("a path") }; @@ -158,9 +160,11 @@ fn far_apart_nested_and_other_objects_are_refused() { assert!(e.ends_with("the circles are too far apart for this radius"), "{e}"); } assert!(err(&mut s, json!({"ids": [a.0, inner.0]})).contains("one circle is inside the other")); - for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, inner.0])] { - assert!(err(&mut s, json!({ "ids": ids })).contains("select two circles to bridge"), "{ids}"); + for ids in [json!([a.0, square.0]), json!([a.0, oval.0]), json!([a.0]), json!([a.0, far.0, square.0])] { + assert!(err(&mut s, json!({ "ids": ids })).contains("select two or more circles to bridge"), "{ids}"); } + // Three circles: each two within reach are bridged, and one inside another is refused there too. + assert!(err(&mut s, json!({"ids": [a.0, far.0, inner.0]})).contains("one circle is inside the other")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 0.5})).contains("`radius` must be from 1 to 1000")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": 1001})).contains("`radius`")); assert!(err(&mut s, json!({"ids": [a.0, far.0], "radius": "big"})).contains("`radius` must be a number")); @@ -169,6 +173,157 @@ fn far_apart_nested_and_other_objects_are_refused() { assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); } +/// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), in rows from (100, 100). +fn grid(s: &mut Session) -> Vec<NodeId> { + (0..9).map(|k| circle(s, 100.0 + 24.0 * (k % 3) as f64, 100.0 + 24.0 * (k / 3) as f64, 10.0)).collect() +} + +fn ids(v: &Value) -> Vec<NodeId> { + v.as_array().unwrap().iter().map(|i| NodeId(i.as_u64().unwrap())).collect() +} + +fn path(s: &Session, id: NodeId) -> vectorcraft_geom::PathData { + s.doc().unwrap().doc.node(id).unwrap().path_data().unwrap().clone() +} + +#[test] +fn a_grid_of_circles_joins_each_to_its_neighbors_in_one_shape() { + let mut s = session(); + let g = grid(&mut s); + select(&mut s, &g); + let steps = s.doc().unwrap().history.undo.len(); + // Reach 5: the side neighbors (4 apart) are bridged, the diagonal ones (about 13.9 apart) not. + let r = s.execute(BRIDGE, &json!({"gap": 4, "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8]], "one shape, in the topmost circle's place"); + assert_eq!(ids(&r["alone"]), []); + assert_eq!(top_level(&s), [g[8]]); + assert_eq!(s.doc().unwrap().selection.objects.to_vec(), [g[8]]); + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "one undo step"); + // Its outline and a hole in each square of four circles, which no diagonal bridge fills. + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 5, "{}", outline.subpaths.len()); + let inside = |p: &vectorcraft_geom::PathData, x: f64, y: f64| p.to_bezpath().winding(vectorcraft_geom::kurbo::Point::new(x, y)) != 0; + assert!(inside(&outline, 112.0, 100.0) && inside(&outline, 100.0, 112.0) && !inside(&outline, 112.0, 112.0)); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(top_level(&s), g); + // Reach 15 takes in the diagonal neighbors, whose bridges fill the middle of each square. + select(&mut s, &g); + s.execute(BRIDGE, &json!({"gap": 4, "reach": 15})).unwrap(); + let outline = path(&s, g[8]); + assert_eq!(outline.subpaths.len(), 1); + assert!(inside(&outline, 112.0, 112.0)); +} + +#[test] +fn a_circle_with_no_neighbor_in_reach_stays_as_it_is() { + let mut s = session(); + let g = grid(&mut s); + let far = circle(&mut s, 300.0, 250.0, 10.0); + let pair = [circle(&mut s, 300.0, 40.0, 8.0), circle(&mut s, 320.0, 40.0, 8.0)]; + let mut all = g.clone(); + all.extend([far, pair[0], pair[1]]); + let r = s.execute(BRIDGE, &json!({"ids": all.iter().map(|i| i.0).collect::<Vec<_>>(), "reach": 5})).unwrap(); + assert_eq!(ids(&r["ids"]), [g[8], pair[1]]); + assert_eq!(ids(&r["alone"]), [far]); + assert_eq!(top_level(&s), [g[8], far, pair[1]]); + assert!(matches!(&s.doc().unwrap().doc.node(far).unwrap().kind, NodeKind::Path { live: Some(_), .. }), "untouched"); + let mut selected = s.doc().unwrap().selection.objects.to_vec(); + selected.sort(); + let mut want = vec![g[8], pair[1], far]; + want.sort(); + assert_eq!(selected, want, "the shapes and the circle left alone"); +} + +#[test] +fn keep_originals_adds_each_shape_above_its_topmost_circle() { + let mut s = session(); + let row: Vec<NodeId> = (0..3).map(|i| circle(&mut s, 100.0 + 25.0 * i as f64, 100.0, 10.0)).collect(); + let other = [circle(&mut s, 100.0, 200.0, 10.0), circle(&mut s, 122.0, 200.0, 10.0)]; + s.execute("paint.setFill", &json!({"ids": [row[2].0], "color": "#00ff00"})).unwrap(); + let all: Vec<u64> = row.iter().chain(&other).map(|i| i.0).collect(); + let r = s.execute(BRIDGE, &json!({"ids": all, "keepOriginals": true})).unwrap(); + let made = ids(&r["ids"]); + assert_eq!(made.len(), 2); + assert_eq!(top_level(&s), [row[0], row[1], row[2], made[0], other[0], other[1], made[1]]); + let d = &s.doc().unwrap().doc; + assert_eq!(d.node(made[0]).unwrap().appearance, d.node(row[2]).unwrap().appearance, "painted as the topmost circle"); + let b = d.node(made[0]).unwrap().path_data().unwrap().bounds().unwrap(); + assert!((b.x0 - 90.0).abs() < 1e-2 && (b.x1 - 160.0).abs() < 1e-2, "{b:?}"); +} + +#[test] +fn the_gap_form_gives_arcs_the_smaller_radius_plus_the_gap() { + let area_with = |p: Value| { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 10.0); + let b = circle(&mut s, 124.0, 100.0, 10.0); + let mut p = p; + p["ids"] = json!([a.0, b.0]); + let id = NodeId(s.execute(BRIDGE, &p).unwrap()["id"].as_u64().unwrap()); + area(&s, id) + }; + // Radius 10 plus a gap of 4 is 140% of 10. + let (gap, percent) = (area_with(json!({"gap": 4})), area_with(json!({"radius": 140}))); + assert!((gap - percent).abs() < 1e-9, "{gap} {percent}"); + assert!(area_with(json!({"gap": 0})) < gap && gap < area_with(json!({"gap": 20}))); +} + +#[test] +fn many_circle_and_gap_refusals() { + let mut s = session(); + let a = circle(&mut s, 50.0, 100.0, 10.0); + let b = circle(&mut s, 250.0, 100.0, 10.0); + let c = circle(&mut s, 330.0, 100.0, 10.0); + let far = circle(&mut s, 380.0, 100.0, 10.0); + let before = top_level(&s); + let steps = s.doc().unwrap().history.undo.len(); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "radius": 100, "gap": 4})).contains("give `radius` or `gap`, not both")); + // Centers 200 apart: a gap of 0 does not bridge them, the largest (1000 pt) does. With centers + // 330 apart even that one closes the neck: it stays open only below 2 × √(10² + 2 × 10 × 1010) + // ≈ 285. + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 0})).ends_with("too far apart for this gap: raise the gap")); + assert!(err(&mut s, json!({"ids": [a.0, far.0], "gap": 0})).ends_with("the circles are too far apart for this gap")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 5})).contains("no two circles are within reach: raise the reach")); + // b and c are 60 apart: within a reach of 100, but too far for the default radius. + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": 100})).ends_with("too far apart for this radius: raise the radius")); + assert!(err(&mut s, json!({"ids": [a.0, b.0, c.0], "reach": -1})).contains("`reach` must be from 0 to 10000")); + assert!(err(&mut s, json!({"ids": [a.0, b.0], "gap": 1001})).contains("`gap` must be from 0 to 1000")); + assert_eq!(top_level(&s), before); + assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); +} + +#[test] +fn too_many_circles_or_bridges_are_refused() { + let mut s = session(); + // 130 overlapping circles in a row: 8,385 pairs within reach. + let row: Vec<u64> = (0..130).map(|i| circle(&mut s, 20.0 + i as f64 * 0.2, 100.0, 10.0).0).collect(); + assert!(err(&mut s, json!({ "ids": row })).contains("that makes too many bridges (at most 8000): lower the reach")); + let many: Vec<u64> = (0..2001).map(|i| circle(&mut s, 20.0 + (i % 50) as f64 * 7.0, 150.0 + (i / 50) as f64 * 3.0, 1.0).0).collect(); + assert!(err(&mut s, json!({ "ids": many })).contains("select at most 2000 circles to bridge")); +} + +#[test] +fn an_id_given_twice_is_one_circle() { + let mut s = session(); + let a = circle(&mut s, 100.0, 100.0, 20.0); + let b = circle(&mut s, 150.0, 100.0, 20.0); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, a.0, b.0]})).unwrap(); + assert_eq!(r["id"], json!(b.0), "two circles, bridged"); + assert_eq!(top_level(&s), [b]); +} + +#[test] +fn small_circles_at_the_default_reach_bridge_the_pairs_the_arcs_can_join() { + let mut s = session(); + // Radius 3: arcs of 3 pt (100%) join a and b (2 apart) but close before reaching c (6 from b, + // within the default reach of 10). + let (a, b, c) = (circle(&mut s, 100.0, 100.0, 3.0), circle(&mut s, 108.0, 100.0, 3.0), circle(&mut s, 120.0, 100.0, 3.0)); + let r = s.execute(BRIDGE, &json!({"ids": [a.0, b.0, c.0]})).unwrap(); + assert_eq!(ids(&r["ids"]), [b]); + assert_eq!(ids(&r["alone"]), [c]); + assert_eq!(top_level(&s), [b, c]); +} + #[test] fn locked_and_hidden_circles_are_not_bridged() { let mut s = session(); @@ -176,9 +331,9 @@ fn locked_and_hidden_circles_are_not_bridged() { let b = circle(&mut s, 150.0, 100.0, 20.0); select(&mut s, &[b]); s.execute("object.lock", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); s.execute("object.unlockAll", &json!({})).unwrap(); select(&mut s, &[a]); s.execute("object.hide", &json!({})).unwrap(); - assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two circles to bridge")); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).contains("select two or more circles to bridge")); } diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index fdf7dd4b19..098bd473de 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -258,7 +258,8 @@ pub fn check_keys(id: &str, doc: &'static str, params: &Value) -> Result<()> { /// Parameters a command takes instead of one another: (command, key, other key). Giving both, /// neither null, is a parameter error ([`check_exclusive_keys`]). -const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids")]; +const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = + &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids"), ("addon.pathtools.bridge", "radius", "gap")]; /// `params` of command `id` give at most one of each pair in [`EXCLUSIVE_KEYS`], or the parameter /// error naming the pair. diff --git a/crates/engine/tests/command_sweep.rs b/crates/engine/tests/command_sweep.rs index 42286f2efd..b3c11f1c0f 100644 --- a/crates/engine/tests/command_sweep.rs +++ b/crates/engine/tests/command_sweep.rs @@ -990,6 +990,8 @@ fn structured_junk() { ("addon.pathtools.bridge", json!({"radius": 1e-308, "keepOriginals": "x"})), ("addon.pathtools.bridge", json!({"radius": 1000, "keepOriginals": true, "ids": [0, 1, 2, 3, u64::MAX]})), ("addon.pathtools.bridge", json!({"radius": f64::MAX, "ids": [1, 1], "junk": [0]})), + ("addon.pathtools.bridge", json!({"gap": -1e308, "reach": f64::MAX, "ids": [0, 1, 2]})), + ("addon.pathtools.bridge", json!({"gap": 1000, "reach": 10000, "radius": null, "keepOriginals": true})), // Refused before anything is written: no format of that name, a time that is no time. ("addon.document.saveTimestampedCopy", json!({"format": "png", "folder": 7})), ("addon.document.saveTimestampedCopy", json!({"format": "svg", "time": [1e308], "folder": null})), diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index fb3cf15520..6e7ac43bb6 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -4,7 +4,8 @@ //! tool shows over a path, open paths lengthened or shortened at an end ([`extend`]), the places //! where paths cross ([`crossings`]), the stretches between them ([`spans`]), anchors slid along //! their path ([`slide`]), touching edges merged ([`shared_edge`]), paths divided into dashes -//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) and the +//! ([`divide_dashes`]), two circles joined by a smooth bridge ([`smooth_bridge`]) or many circles +//! joined to their neighbors ([`bridge_many`]) and the //! Parametric Shape Tool's shapes ([`shapes`]). mod bridge; @@ -23,7 +24,9 @@ use std::collections::BTreeSet; use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Vec2}; use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; -pub use bridge::{BridgeError, Circle, circle_of, smooth_bridge}; +pub use bridge::{ + ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, circle_of, smooth_bridge, +}; pub use crossings::{MAX_CROSSED_BY_SEGMENTS, MAX_CROSSING_SEGMENTS, Place, Work, crossings, crossings_on, crossings_on_within, insert_at}; pub use dashes::{DashSpec, Piece, divide_dashes}; pub use extend::{ExtendMode, extend_length_to, extend_open}; diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index d30c0ce87a..89cee8977b 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -1,10 +1,14 @@ //! Smooth Bridge: two circles joined into one outline by two concave arcs, each touching both -//! circles from outside, so the outline runs on smoothly from each circle into the bridge. +//! circles from outside, so the outline runs on smoothly from each circle into the bridge; and +//! many circles joined at once, each to the others within reach ([`bridge_many`]). +use std::collections::{BTreeMap, HashMap, HashSet}; use std::f64::consts::{FRAC_PI_2, PI, TAU}; use kurbo::{CubicBez, ParamCurve, Point, Shape, Vec2}; -use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; +use vectorcraft_geom::{Anchor, AnchorKind, FillRule, PathData, SubPath, shapes}; + +use crate::boolean::{DEFAULT_PRECISION, try_unite_all_with}; /// How far (as a share of the radius) a path's outline may stray from a circle and still be read /// as that circle. @@ -63,6 +67,58 @@ pub fn circle_of(path: &PathData) -> Option<Circle> { /// a tangent there. Overlapping and touching circles are joined too. A larger radius makes a wider, /// gentler bridge; farther apart circles make a narrower one, until the arcs would cross. pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result<SubPath, BridgeError> { + let t = touches(a, b, radius)?; + let mut segs = vec![]; + arc(&mut segs, a.center, a.radius, t.a1, t.a2, Some(-t.u)); + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + arc(&mut segs, b.center, b.radius, t.b2, t.b1, Some(t.u)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + Ok(closed(&segs, AnchorKind::Smooth)) +} + +/// The part of [`smooth_bridge`]'s outline between the circles: the two arcs, joined across each +/// circle by a straight line between the arc ends on it. Each line lies inside its circle, so the +/// two circles and this shape unite into the outline, with each circle drawn once however many +/// bridges it has. +fn neck(a: Circle, b: Circle, radius: f64) -> Result<SubPath, BridgeError> { + let t = touches(a, b, radius)?; + let line = |p: Point, q: Point| CubicBez::new(p, p, q, q); + let mut segs = vec![]; + arc(&mut segs, t.p2, radius, t.a2, t.b2, None); + segs.push(line(t.b2, t.b1)); + arc(&mut segs, t.p1, radius, t.b1, t.a1, None); + segs.push(line(t.a1, t.a2)); + Ok(closed(&segs, AnchorKind::Corner)) +} + +/// A closed subpath through the cubics `segs`, each starting where the one before it ends, with +/// anchors of `kind`. +fn closed(segs: &[CubicBez], kind: AnchorKind) -> SubPath { + let count = segs.len(); + let anchors = (0..count) + .filter_map(|i| { + let (prev, seg) = (segs.get((i + count - 1) % count)?, segs.get(i)?); + Some(Anchor { p: seg.p0, h_in: prev.p2, h_out: seg.p1, kind }) + }) + .collect(); + SubPath::new(anchors, true) +} + +/// Where the arcs of radius `radius` that bridge circles `a` and `b` lie: the unit vector from +/// `a`'s center to `b`'s, and on each side the arc's center (`p1`, `p2`) and where it touches `a` +/// and `b`. +struct Touches { + u: Vec2, + p1: Point, + a1: Point, + b1: Point, + p2: Point, + a2: Point, + b2: Point, +} + +/// The arcs of [`smooth_bridge`], or why there are none. +fn touches(a: Circle, b: Circle, radius: f64) -> Result<Touches, BridgeError> { let finite = |x: f64| x.is_finite() && x > 0.0; let points = [a.center, b.center].iter().all(|c| c.x.is_finite() && c.y.is_finite()); if !finite(radius) || !finite(a.radius) || !finite(b.radius) || !points { @@ -81,6 +137,10 @@ pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result<SubPath, Bridg } let along = (d * d + ra * ra - rb * rb) / (2.0 * d); let across = (ra * ra - along * along).max(0.0).sqrt(); + // Sizes near the largest float overflow when squared. + if !(along.is_finite() && across.is_finite()) { + return Err(BridgeError::Bad); + } // Each arc runs between its points on `a` and `b`, which lie towards the two centers from the // arc's center. Its point nearest the axis is the foot of its center on the axis when that foot // is between the two centers, else one of its ends, which are off the axis. So the two arcs @@ -91,25 +151,197 @@ pub fn smooth_bridge(a: Circle, b: Circle, radius: f64) -> Result<SubPath, Bridg } let u = axis / d; let n = Vec2::new(-u.y, u.x); - let mut segs = vec![]; // Each side's arc center and where its arc touches `a` and `b`. let side = |s: f64| { let p = a.center + u * along + n * (s * across); (p, a.center + (p - a.center) * (a.radius / ra), b.center + (p - b.center) * (b.radius / rb)) }; let ((p1, a1, b1), (p2, a2, b2)) = (side(1.0), side(-1.0)); - arc(&mut segs, a.center, a.radius, a1, a2, Some(-u)); - arc(&mut segs, p2, radius, a2, b2, None); - arc(&mut segs, b.center, b.radius, b2, b1, Some(u)); - arc(&mut segs, p1, radius, b1, a1, None); - let count = segs.len(); - let anchors = (0..count) - .map(|i| { - let (prev, seg) = (segs[(i + count - 1) % count], segs[i]); - Anchor { p: seg.p0, h_in: prev.p2, h_out: seg.p1, kind: AnchorKind::Smooth } - }) - .collect(); - Ok(SubPath::new(anchors, true)) + Ok(Touches { u, p1, a1, b1, p2, a2, b2 }) +} + +/// The most circles [`bridge_many`] takes. +pub const MAX_BRIDGED_CIRCLES: usize = 2000; +/// The most bridges [`bridge_many`] makes. +pub const MAX_BRIDGES: usize = 8000; +/// Holes [`bridge_many`] fills: those smaller than this share of the area of the smallest circle +/// they join. +const SPECK: f64 = 0.01; + +/// The radius of the arcs that bridge two circles. +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ArcRadius { + /// This share of the smaller circle's radius (1 is the same radius). + Share(f64), + /// The smaller circle's radius plus this gap (pt). Each arc is then this gap outside a circle + /// of the smaller circle's radius about the arc's center: for equal circles that gap apart, + /// the place of a third circle that gap from both, as in a triangular grid. + Gap(f64), +} + +impl ArcRadius { + /// The arcs' radius (pt) for circles `a` and `b`. + pub fn between(self, a: Circle, b: Circle) -> f64 { + let r = a.radius.min(b.radius); + match self { + ArcRadius::Share(share) => r * share, + ArcRadius::Gap(gap) => r + gap, + } + } +} + +/// Circles that bridges join into one shape: their indices, ascending, and the shape's outline. +#[derive(Clone, Debug, PartialEq)] +pub struct Joined { + pub members: Vec<usize>, + pub outline: PathData, +} + +/// What [`bridge_many`] makes: the joined shapes, in the order of their first member, and the +/// indices of the circles left alone, ascending. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Bridged { + pub joined: Vec<Joined>, + pub alone: Vec<usize>, +} + +/// Why [`bridge_many`] makes nothing. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ManyError { + /// More than [`MAX_BRIDGED_CIRCLES`] circles. + TooManyCircles, + /// More than [`MAX_BRIDGES`] pairs of circles within reach that the arcs can bridge. + TooManyBridges, + /// No two circles are within reach of each other. + NoneInReach, + /// The circles at these indices are within reach but [`smooth_bridge`] can't join them: one is + /// inside the other, or no pair within reach is near enough for the arcs (the first such pair). + Pair(usize, usize, BridgeError), + /// A reach that is not a finite size of 0 or more, or a circle that is not a finite size above 0. + Bad, + /// A joined shape too complex to unite. + TooComplex, +} + +/// Every pair of `circles` whose outlines are at most `reach` (pt) apart, overlapping ones +/// included, joined by a [`smooth_bridge`] with arcs of radius `arc`, and the bridges that connect +/// united into one shape each, without holes smaller than 1% of the smallest circle's area. A pair +/// too far apart for the arcs gets no bridge; a circle bridged to no other is left alone. One +/// circle inside another is an error, and so is no pair that the arcs can join. +pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bridged, ManyError> { + if circles.len() > MAX_BRIDGED_CIRCLES { + return Err(ManyError::TooManyCircles); + } + let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; + if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { + return Err(ManyError::Bad); + } + let (pairs, too_far) = pairs_within(circles, reach, arc)?; + match (pairs.is_empty(), too_far) { + (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), + (true, None) => return Err(ManyError::NoneInReach), + (false, _) => {} + } + // Each set of connected circles, under its lowest index. + let mut parent: Vec<usize> = (0..circles.len()).collect(); + let mut necks = Vec::with_capacity(pairs.len()); + for &(i, j) in &pairs { + let (a, b) = (circles[i], circles[j]); + let sp = neck(a, b, arc.between(a, b)).map_err(|e| ManyError::Pair(i, j, e))?; + necks.push(((i, j), PathData::single(sp))); + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let mut sets: BTreeMap<usize, (Vec<usize>, Vec<&PathData>)> = BTreeMap::new(); + for &((i, j), ref neck) in &necks { + let (members, parts) = sets.entry(root(&mut parent, i)).or_default(); + members.extend([i, j]); + parts.push(neck); + } + let mut out = Bridged::default(); + for (_, (mut members, parts)) in sets { + members.sort_unstable(); + members.dedup(); + // Each circle once, and the necks between them. + let rounds: Vec<PathData> = members + .iter() + .filter_map(|&i| circles.get(i)) + .map(|c| shapes::ellipse(kurbo::Rect::from_center_size(c.center, (2.0 * c.radius, 2.0 * c.radius)))) + .collect(); + let fills: Vec<(&PathData, FillRule)> = rounds.iter().chain(parts).map(|p| (p, FillRule::NonZero)).collect(); + let smallest = members.iter().filter_map(|&i| circles.get(i)).map(|c| c.radius).fold(f64::INFINITY, f64::min); + // Fine enough for the smallest circle, whose bridges are narrower than it. + let precision = DEFAULT_PRECISION.min(smallest * 1e-3); + let mut outline = try_unite_all_with(&fills, precision).map_err(|_| ManyError::TooComplex)?; + // Where three bridges' arcs nearly meet, the union leaves a speck of a hole; a contour that + // encloses a circle is far larger than this. + let speck = SPECK * PI * smallest * smallest; + outline.subpaths.retain(|sp| PathData::single(sp.clone()).to_bezpath().area().abs() >= speck); + out.joined.push(Joined { members, outline }); + } + let joined: HashSet<usize> = necks.iter().flat_map(|&((i, j), _)| [i, j]).collect(); + out.alone = (0..circles.len()).filter(|i| !joined.contains(i)).collect(); + Ok(out) +} + +/// Two circles' indices, the lower first. +type Pair = (usize, usize); + +/// The set `i` is in: the lowest index in it, with the path to it shortened on the way. +fn root(parent: &mut [usize], mut i: usize) -> usize { + while parent[i] != i { + parent[i] = parent[parent[i]]; + i = parent[i]; + } + i +} + +/// Every pair of indices `(i, j)`, `i < j`, ascending, of `circles` whose outlines are at most +/// `reach` apart and that arcs of `arc` can bridge, and the lowest pair within reach that they +/// can't because it is too far apart for them. Circles go into a grid of cells as wide as the +/// farthest two centers within reach can be, so each circle is compared only with those in its own +/// cell and the eight around it. +fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec<Pair>, Option<Pair>), ManyError> { + let biggest = circles.iter().map(|c| c.radius).fold(0.0, f64::max); + let cell = 2.0 * biggest + reach; + if !(cell.is_finite() && cell > 0.0) { + return Err(ManyError::Bad); + } + // Saturating casts: a cell beyond i64 shares the last one, which only adds comparisons. + let key = |p: Point| ((p.x / cell).floor() as i64, (p.y / cell).floor() as i64); + let mut grid: HashMap<(i64, i64), Vec<usize>> = HashMap::new(); + for (i, c) in circles.iter().enumerate() { + grid.entry(key(c.center)).or_default().push(i); + } + let (mut pairs, mut too_far) = (vec![], None::<Pair>); + for (i, &c) in circles.iter().enumerate() { + let (x, y) = key(c.center); + for (dx, dy) in (-1..=1).flat_map(|dx| (-1..=1).map(move |dy| (dx, dy))) { + let Some(near) = grid.get(&(x.saturating_add(dx), y.saturating_add(dy))) else { continue }; + for &j in near.iter().filter(|&&j| j > i) { + let o = circles[j]; + if c.center.distance(o.center) - c.radius - o.radius > reach { + continue; + } + // Only the arcs' ends are worked out here; the bridge itself is made later. + match touches(c, o, arc.between(c, o)) { + Ok(_) => pairs.push((i, j)), + Err(BridgeError::TooFar) => too_far = Some(too_far.map_or((i, j), |t| t.min((i, j)))), + Err(e) => return Err(ManyError::Pair(i, j, e)), + } + } + } + // Saturated cells can list a pair twice, so the count is checked again after `dedup`. + if pairs.len() > 9 * MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + } + pairs.sort_unstable(); + pairs.dedup(); + if pairs.len() > MAX_BRIDGES { + return Err(ManyError::TooManyBridges); + } + Ok((pairs, too_far)) } /// Append to `out` the arc of the circle about `center` with radius `r` from `from` to `to` (both @@ -321,6 +553,188 @@ mod tests { assert_eq!(smooth_bridge(a, b, 0.0), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(a, b, f64::NAN), Err(BridgeError::Bad)); assert_eq!(smooth_bridge(circle(f64::INFINITY, 0.0, 10.0), b, 10.0), Err(BridgeError::Bad)); + // Finite sizes whose squares overflow. + assert_eq!(smooth_bridge(circle(0.0, 0.0, 1e154), circle(1e154, 0.0, 1e154), 1e154), Err(BridgeError::Bad)); + } + + /// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), top-left at the origin. + fn grid() -> Vec<Circle> { + (0..9).map(|k| circle(24.0 * (k % 3) as f64, 24.0 * (k / 3) as f64, 10.0)).collect() + } + + fn area(path: &PathData) -> f64 { + crate::area(path, FillRule::NonZero) + } + + fn inside(path: &PathData, x: f64, y: f64) -> bool { + path.to_bezpath().winding(Point::new(x, y)) != 0 + } + + #[test] + fn a_grid_joins_each_circle_to_its_neighbors_within_reach() { + // Reach 5: the side neighbors (4 apart) are joined, the diagonal ones (about 13.9 apart) not. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + assert_eq!(b.alone, Vec::<usize>::new()); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..9).collect::<Vec<_>>()); + for (x, y) in [(12.0, 0.0), (0.0, 12.0), (36.0, 48.0), (48.0, 36.0), (24.0, 24.0)] { + assert!(inside(&one.outline, x, y), "bridged at ({x}, {y})"); + } + // Between four circles the side bridges' arcs leave a hole: no diagonal bridge fills it. + for (x, y) in [(12.0, 12.0), (36.0, 36.0)] { + assert!(!inside(&one.outline, x, y), "a hole at ({x}, {y})"); + } + let hull = PathData::single(SubPath::polyline( + &[Point::new(-10.0, -10.0), Point::new(58.0, -10.0), Point::new(58.0, 58.0), Point::new(-10.0, 58.0)], + true, + )); + assert!(area(&one.outline) < area(&hull)); + assert_eq!(one.outline.subpaths.len(), 5, "the outline and a hole in each square"); + // Reach 15 takes in the diagonal neighbors too, and their bridges fill the middle of each + // square. The specks of holes (about 0.1 pt²) where side and diagonal arcs nearly meet are + // filled. + let b = bridge_many(&grid(), ArcRadius::Gap(4.0), 15.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert!(inside(&one.outline, 12.0, 12.0) && inside(&one.outline, 36.0, 36.0)); + assert_eq!(one.outline.subpaths.len(), 1); + } + + #[test] + fn a_circle_with_no_neighbor_in_reach_is_left_alone() { + let mut circles = grid(); + circles.truncate(2); + circles.push(circle(200.0, 0.0, 10.0)); + circles.push(circle(224.0, 0.0, 10.0)); + circles.push(circle(100.0, 100.0, 10.0)); + let b = bridge_many(&circles, ArcRadius::Share(1.0), 5.0).unwrap(); + assert_eq!(b.joined.iter().map(|j| j.members.clone()).collect::<Vec<_>>(), [vec![0, 1], vec![2, 3]]); + assert_eq!(b.alone, [4]); + // Each pair alone is the two-circle bridge. + let two = smooth_bridge(circles[0], circles[1], 10.0).unwrap(); + let (got, want) = (area(&b.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{got} {want}"); + } + + #[test] + fn a_ring_around_an_empty_place_leaves_a_round_hole_the_gap_wider_than_a_circle() { + // Six circles of radius 10 around an empty place at the origin, each 4 from its two + // neighbors and from where a seventh circle would be (centers 24 from the origin). + let ring: Vec<Circle> = (0..6).map(|k| f64::from(k) * PI / 3.0).map(|t| circle(24.0 * t.cos(), 24.0 * t.sin(), 10.0)).collect(); + let b = bridge_many(&ring, ArcRadius::Gap(4.0), 5.0).unwrap(); + let [one] = b.joined.as_slice() else { panic!("{} shapes", b.joined.len()) }; + assert_eq!(one.members, (0..6).collect::<Vec<_>>()); + assert_eq!(one.outline.subpaths.len(), 2, "the outline and the hole"); + // The hole's edge is 14 from the origin all the way round: a circle of radius 10 there + // would be 4 from the shape everywhere, the same as from each of the six. + let hole = one.outline.subpaths.iter().min_by(|p, q| { + let size = |sp: &SubPath| PathData::single(sp.clone()).to_bezpath().area().abs(); + size(p).total_cmp(&size(q)) + }); + let edge = outline(hole.unwrap()); + let (near, far) = edge.iter().map(|p| p.distance(Point::ZERO)).fold((f64::INFINITY, 0.0f64), |(n, f), d| (n.min(d), f.max(d))); + assert!((near - 14.0).abs() < 1e-2 && (far - 14.0).abs() < 1e-2, "{near} to {far}"); + } + + #[test] + fn many_circles_make_the_two_circle_outline_for_each_pair() { + // Overlapping, touching, unequal and unequal overlapping pairs, each with a far circle. + for (a, b, share) in [ + (circle(0.0, 0.0, 20.0), circle(30.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 20.0), circle(40.0, 0.0, 20.0), 0.5), + (circle(0.0, 0.0, 30.0), circle(70.0, 0.0, 10.0), 4.0), + (circle(0.0, 0.0, 10.0), circle(25.0, 0.0, 30.0), 10.0), + // Circles far smaller than the union's usual precision (0.01 pt). + (circle(0.0, 0.0, 0.004), circle(0.01, 0.0, 0.004), 1.0), + ] { + let made = bridge_many(&[a, b, circle(1000.0, 0.0, 5.0)], ArcRadius::Share(share), 40.0).unwrap(); + assert_eq!(made.alone, [2]); + let two = smooth_bridge(a, b, share * a.radius.min(b.radius)).unwrap(); + let (got, want) = (area(&made.joined[0].outline), area(&PathData::single(two))); + assert!((got - want).abs() < 1e-3 * want, "{a:?}: {got} {want}"); + } + } + + #[test] + fn a_pair_too_far_apart_for_the_arcs_gets_no_bridge() { + // b and c are within reach (6 apart) but arcs of radius 3 close before they reach both. + let (a, b, c) = (circle(0.0, 0.0, 3.0), circle(8.0, 0.0, 3.0), circle(20.0, 0.0, 3.0)); + assert_eq!(smooth_bridge(b, c, 3.0), Err(BridgeError::TooFar)); + let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 10.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::<Vec<_>>(), [vec![0, 1]]); + assert_eq!(made.alone, [2]); + // 260 touching circles in a row with a wide reach: 33,670 pairs within reach, far more than + // the bridge limit, but only the 259 touching pairs are near enough for the arcs. + let row: Vec<Circle> = (0..260).map(|i| circle(f64::from(i) * 20.0, 0.0, 10.0)).collect(); + let made = bridge_many(&row, ArcRadius::Share(1.0), 6000.0).unwrap(); + let [one] = made.joined.as_slice() else { panic!("{} shapes", made.joined.len()) }; + assert_eq!(one.members.len(), 260); + assert!(made.alone.is_empty()); + } + + #[test] + fn the_gap_form_keeps_the_gap_from_a_circle_at_each_arcs_center() { + // Two circles 4 apart; with a gap of 4 each arc's center is 24 from both centers, where a + // third circle of the same size is 4 from both (as in a triangular grid). + let (a, b) = (circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0)); + let r = ArcRadius::Gap(4.0).between(a, b); + assert_eq!(r, 14.0); + let sp = smooth_bridge(a, b, r).unwrap(); + for third in [circle(12.0, 432f64.sqrt(), 10.0), circle(12.0, -(432f64.sqrt()), 10.0)] { + let gaps: Vec<f64> = outline(&sp).iter().map(|p| p.distance(third.center) - third.radius).collect(); + // No part of the bridge comes nearer than the gap, and a stretch of it is that gap away. + assert!(gaps.iter().all(|&g| g > 4.0 - 1e-2), "{:?}", gaps.iter().copied().fold(f64::INFINITY, f64::min)); + let along = gaps.iter().filter(|&&g| (g - 4.0).abs() < 1e-2).count(); + assert!(along >= 32, "{along}"); + } + // The same for unequal circles: the gap is kept from a circle of the smaller one's size. + let (a, b) = (circle(0.0, 0.0, 15.0), circle(30.0, 5.0, 8.0)); + let r = ArcRadius::Gap(3.0).between(a, b); + let sp = smooth_bridge(a, b, r).unwrap(); + let d = (b.center - a.center).hypot(); + let (ra, rb) = (15.0 + r, 8.0 + r); + let along = (d * d + ra * ra - rb * rb) / (2.0 * d); + let u = (b.center - a.center) / d; + let center = a.center + u * along + Vec2::new(-u.y, u.x) * (ra * ra - along * along).sqrt(); + let gaps: Vec<f64> = outline(&sp).iter().map(|p| p.distance(center) - 8.0).collect(); + assert!(gaps.iter().all(|&g| g > 3.0 - 1e-2) && gaps.iter().filter(|&&g| (g - 3.0).abs() < 1e-2).count() >= 16); + } + + #[test] + fn the_gap_form_is_the_percentage_form_of_the_radius_plus_the_gap() { + for (a, b, gap) in [(circle(0.0, 0.0, 10.0), circle(24.0, 0.0, 10.0), 4.0), (circle(0.0, 0.0, 20.0), circle(40.0, 30.0, 10.0), 7.5)] { + let small = a.radius.min(b.radius); + let share = ArcRadius::Share((small + gap) / small); + assert!((ArcRadius::Gap(gap).between(a, b) - share.between(a, b)).abs() < 1e-12); + let (g, s) = (smooth_bridge(a, b, ArcRadius::Gap(gap).between(a, b)).unwrap(), smooth_bridge(a, b, share.between(a, b)).unwrap()); + for (p, q) in g.anchors.iter().zip(&s.anchors) { + assert!(p.p.distance(q.p) < 1e-9 && p.h_in.distance(q.h_in) < 1e-9 && p.h_out.distance(q.h_out) < 1e-9); + } + assert_eq!(g.anchors.len(), s.anchors.len()); + } + // Over a grid the two forms make the same shape too. + let by_gap = bridge_many(&grid(), ArcRadius::Gap(4.0), 5.0).unwrap(); + let by_share = bridge_many(&grid(), ArcRadius::Share(1.4), 5.0).unwrap(); + let (g, s) = (area(&by_gap.joined[0].outline), area(&by_share.joined[0].outline)); + assert!((g - s).abs() < 1e-6 * g, "{g} {s}"); + } + + #[test] + fn too_many_circles_or_bridges_and_bad_pairs_are_refused() { + let many = vec![circle(0.0, 0.0, 1.0); MAX_BRIDGED_CIRCLES + 1]; + assert_eq!(bridge_many(&many, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyCircles)); + // 200 circles in a tight row: 19,900 pairs within reach. + let row: Vec<Circle> = (0..200).map(|i| circle(i as f64 * 0.1, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&row, ArcRadius::Share(1.0), 1.0), Err(ManyError::TooManyBridges)); + let spread: Vec<Circle> = (0..3).map(|i| circle(i as f64 * 100.0, 0.0, 10.0)).collect(); + assert_eq!(bridge_many(&spread, ArcRadius::Share(1.0), 5.0), Err(ManyError::NoneInReach)); + let nested = [circle(0.0, 0.0, 30.0), circle(5.0, 0.0, 10.0), circle(200.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&nested, ArcRadius::Share(1.0), 5.0), Err(ManyError::Pair(0, 1, BridgeError::Inside))); + // Within reach (40 apart) but too far for arcs of radius 1. + let far = [circle(0.0, 0.0, 10.0), circle(60.0, 0.0, 10.0), circle(300.0, 0.0, 10.0)]; + assert_eq!(bridge_many(&far, ArcRadius::Share(0.1), 50.0), Err(ManyError::Pair(0, 1, BridgeError::TooFar))); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), f64::NAN), Err(ManyError::Bad)); + assert_eq!(bridge_many(&far, ArcRadius::Share(1.0), -1.0), Err(ManyError::Bad)); + assert_eq!(bridge_many(&[circle(f64::INFINITY, 0.0, 1.0), far[0]], ArcRadius::Share(1.0), 1.0), Err(ManyError::Bad)); } #[test] diff --git a/crates/ui-egui/src/addons/pathtools/bridge.rs b/crates/ui-egui/src/addons/pathtools/bridge.rs index 4b9926d616..5d6a18d282 100644 --- a/crates/ui-egui/src/addons/pathtools/bridge.rs +++ b/crates/ui-egui/src/addons/pathtools/bridge.rs @@ -1,6 +1,7 @@ //! Smooth Bridge in the interface: its dialog (the arcs' radius as a percentage of the smaller -//! circle's radius, Keep Originals), which previews on the canvas and runs `addon.pathtools.bridge` -//! on OK. +//! circle's radius, or with Constant Gap that radius plus a gap; the reach, unavailable with two +//! circles selected; Keep Originals), which previews on the canvas and runs +//! `addon.pathtools.bridge` on OK. use egui::Ui; use serde_json::{Value, json}; @@ -16,27 +17,61 @@ pub const KIND: &str = "smoothBridge"; /// The radius the command takes (%), and its default. const RADII: std::ops::RangeInclusive<f64> = 1.0..=1000.0; const RADIUS: f64 = 100.0; +/// The gap the command takes (pt), and the dialog's first one. +const GAPS: std::ops::RangeInclusive<f64> = 0.0..=1000.0; +const GAP: f64 = 4.0; +/// The reach the command takes (pt), and its default. +const REACHES: std::ops::RangeInclusive<f64> = 0.0..=10000.0; +const REACH: f64 = 10.0; const LABEL_W: f32 = 60.0; const FIELD_W: f32 = 90.0; /// The dialog's fields to start with: the command's defaults. pub(crate) fn fields() -> Value { - json!({ "radius": RADIUS, "keepOriginals": false }) + json!({ "radius": RADIUS, "constantGap": false, "gap": GAP, "reach": REACH, "keepOriginals": false }) } pub(crate) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("Smooth Bridge").to_string(), body, confirm, preview: true, min_width: 280.0, ..DialogSpec::FORM }; -/// The command's parameters from the dialog's fields. +/// The command's parameters from the dialog's fields: the radius, or with Constant Gap the gap. fn params(d: &Dialog) -> Value { - json!({ "radius": d.f64("radius", RADIUS), "keepOriginals": d.bool("keepOriginals") }) + let (reach, keep) = (d.f64("reach", REACH), d.bool("keepOriginals")); + if d.bool("constantGap") { + json!({ "gap": d.f64("gap", GAP), "reach": reach, "keepOriginals": keep }) + } else { + json!({ "radius": d.f64("radius", RADIUS), "reach": reach, "keepOriginals": keep }) + } } fn body(app: &mut VectorcraftApp, ui: &mut Ui, d: &mut Dialog) -> bool { - widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { - if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { - d.fields.insert("radius".into(), json!(v)); + let unit = app.session.general_unit(); + form::check(ui, d, "constantGap", tl!("Constant Gap")); + if d.bool("constantGap") { + widgets::label_row(ui, tl!("Gap:"), LABEL_W, |ui| { + form::length_within(ui, d, "gap", unit, FIELD_W, Some(GAPS)); + }); + } else { + widgets::label_row(ui, tl!("Radius:"), LABEL_W, |ui| { + if let Some(v) = widgets::range_field(ui, ("dlg-num", "radius"), d.f64("radius", RADIUS), RADII, "%", 0, FIELD_W) { + d.fields.insert("radius".into(), json!(v)); + } + }); + } + // The reach applies to three or more circles; two are bridged at any distance. Counted once, + // before a preview replaces the selection with its result. + let many = match d.fields.get("many").and_then(Value::as_bool) { + Some(many) => many, + None => { + let many = app.session.doc().map(|doc| doc.selection.objects.len() > 2).unwrap_or(true); + d.fields.insert("many".into(), json!(many)); + many } + }; + ui.add_enabled_ui(many, |ui| { + widgets::label_row(ui, tl!("Reach:"), LABEL_W, |ui| { + form::length_within(ui, d, "reach", unit, FIELD_W, Some(REACHES)); + }); }); form::check(ui, d, "keepOriginals", tl!("Keep Originals")); form::preview(app, ui, d, "Smooth Bridge", COMMAND, params(d)); @@ -72,9 +107,11 @@ mod tests { menus::invoke(&mut app, &cmd, p); assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(super::KIND)); let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); - for s in ["Smooth Bridge", "Radius:", "Keep Originals", "Preview"] { + for s in ["Smooth Bridge", "Constant Gap", "Radius:", "Reach:", "Keep Originals", "Preview"] { assert!(shown.contains(s), "{s} in {shown}"); } + assert!(!shown.contains("Gap:"), "{shown}"); + assert!(!app.ui.dialog.as_ref().unwrap().bool("many"), "Reach unavailable for two circles"); let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.layers[0].children().unwrap().len(); app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); @@ -89,4 +126,30 @@ mod tests { assert_eq!(app.session.doc().unwrap().history.undo.len(), n + 1); assert_eq!(count(&app), 3, "the circles and the outline above them"); } + + #[test] + fn constant_gap_shows_the_gap_and_bridges_many_circles_within_reach() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + // Three circles 4 apart in a row and one far off. + let ids: Vec<u64> = [100.0, 124.0, 148.0, 300.0].iter().map(|&x| circle(&mut app, x, 10.0)).collect(); + app.run("select.set", json!({ "ids": ids })).unwrap(); + menus::invoke(&mut app, super::COMMAND, serde_json::Value::Null); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("constantGap".into(), json!(true)); + let shown = painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert!(shown.contains("Gap:") && !shown.contains("Radius:"), "{shown}"); + // A preview leaves two objects selected (one shape and the far circle); Reach stays + // available for the four circles the command still bridges. + app.ui.dialog.as_mut().unwrap().fields.insert("preview".into(), json!(true)); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + painted_text(&mut app, |app, ui| crate::dialogs::show(app, ui.ctx())); + assert_eq!(app.session.doc().unwrap().selection.objects.len(), 2, "previewed"); + assert!(app.ui.dialog.as_ref().unwrap().bool("many"), "Reach available for four circles"); + let p = super::params(app.ui.dialog.as_ref().unwrap()); + assert_eq!(p, json!({"gap": 4.0, "reach": 10.0, "keepOriginals": false}), "the gap, not the radius"); + crate::dialogs::confirm(&mut app).unwrap(); + let top: Vec<u64> = app.session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id.0).collect(); + assert_eq!(top, [ids[2], ids[3]], "one shape in the topmost joined circle's place, and the far circle"); + } } diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c02d223cc5..47dcc1b925 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6730,10 +6730,18 @@ breakText Glyphs Глифи Smooth Bridge… Плавен мост… Smooth Bridge Плавен мост Keep Originals Запазване на оригиналите -@msg select two circles to bridge изберете два кръга за свързване +@msg select two or more circles to bridge изберете два или повече кръга за свързване @msg one circle is inside the other единият кръг е вътре в другия @msg the circles are too far apart for this radius: raise the radius кръговете са твърде далеч един от друг за този радиус: увеличете радиуса @msg the circles are too far apart for this radius кръговете са твърде далеч един от друг за този радиус + Constant Gap Постоянно разстояние + Reach: Обхват: +@msg the circles are too far apart for this gap: raise the gap кръговете са твърде далеч един от друг за това разстояние: увеличете разстоянието +@msg the circles are too far apart for this gap кръговете са твърде далеч един от друг за това разстояние +@msg no two circles are within reach: raise the reach няма два кръга в обхват: увеличете обхвата +@msg select at most 2000 circles to bridge изберете най-много 2000 кръга за свързване +@msg that makes too many bridges (at most 8000): lower the reach това дава твърде много мостове (най-много 8000): намалете обхвата +@msg the bridged circles are too complex to unite свързаните кръгове са твърде сложни за обединяване # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разширяване на тиретата в пътища @msg select paths with dashed strokes to expand изберете пътища с прекъснат щрих за разширяване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a12ad12217..ae6efda00e 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6782,10 +6782,18 @@ shape Open Otvoren Smooth Bridge… Glatki most… Smooth Bridge Glatki most Keep Originals Zadrži originale -@msg select two circles to bridge odaberite dva kruga za premošćavanje +@msg select two or more circles to bridge odaberite dva ili više krugova za premošćavanje @msg one circle is inside the other jedan krug je unutar drugog @msg the circles are too far apart for this radius: raise the radius krugovi su predaleko jedan od drugog za ovaj radijus: povećajte radijus @msg the circles are too far apart for this radius krugovi su predaleko jedan od drugog za ovaj radijus + Constant Gap Stalni razmak + Reach: Domet: +@msg the circles are too far apart for this gap: raise the gap krugovi su predaleko jedan od drugog za ovaj razmak: povećajte razmak +@msg the circles are too far apart for this gap krugovi su predaleko jedan od drugog za ovaj razmak +@msg no two circles are within reach: raise the reach nijedna dva kruga nisu u dometu: povećajte domet +@msg select at most 2000 circles to bridge odaberite najviše 2000 krugova za premošćavanje +@msg that makes too many bridges (at most 8000): lower the reach to daje previše mostova (najviše 8000): smanjite domet +@msg the bridged circles are too complex to unite premošteni krugovi su previše složeni za spajanje # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Proširi crtice u putanje @msg select paths with dashed strokes to expand odaberite putanje s isprekidanim potezom za proširivanje diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3331879355..f203d1c391 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7362,10 +7362,18 @@ breakText Glyphs Glifs Smooth Bridge… Pont suau… Smooth Bridge Pont suau Keep Originals Conserva els originals -@msg select two circles to bridge seleccioneu dos cercles per unir-los +@msg select two or more circles to bridge seleccioneu dos o més cercles per unir-los @msg one circle is inside the other un cercle és dins de l’altre @msg the circles are too far apart for this radius: raise the radius els cercles estan massa separats per a aquest radi: augmenteu el radi @msg the circles are too far apart for this radius els cercles estan massa separats per a aquest radi + Constant Gap Separació constant + Reach: Abast: +@msg the circles are too far apart for this gap: raise the gap els cercles estan massa separats per a aquesta separació: augmenteu la separació +@msg the circles are too far apart for this gap els cercles estan massa separats per a aquesta separació +@msg no two circles are within reach: raise the reach no hi ha dos cercles dins de l’abast: augmenteu l’abast +@msg select at most 2000 circles to bridge seleccioneu com a màxim 2000 cercles per unir-los +@msg that makes too many bridges (at most 8000): lower the reach això fa massa ponts (com a màxim 8000): reduïu l’abast +@msg the bridged circles are too complex to unite els cercles units són massa complexos per combinar-los # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandeix els guions en camins @msg select paths with dashed strokes to expand seleccioneu camins amb traç discontinu per expandir diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 2414401f14..93298b77d3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7366,10 +7366,18 @@ breakText Glyphs Glyfy Smooth Bridge… Hladký most… Smooth Bridge Hladký most Keep Originals Zachovat originály -@msg select two circles to bridge vyberte dva kruhy k propojení +@msg select two or more circles to bridge vyberte dva nebo více kruhů k propojení @msg one circle is inside the other jeden kruh je uvnitř druhého @msg the circles are too far apart for this radius: raise the radius kruhy jsou pro tento poloměr příliš daleko od sebe: zvětšete poloměr @msg the circles are too far apart for this radius kruhy jsou pro tento poloměr příliš daleko od sebe + Constant Gap Stálá mezera + Reach: Dosah: +@msg the circles are too far apart for this gap: raise the gap kruhy jsou pro tuto mezeru příliš daleko od sebe: zvětšete mezeru +@msg the circles are too far apart for this gap kruhy jsou pro tuto mezeru příliš daleko od sebe +@msg no two circles are within reach: raise the reach žádné dva kruhy nejsou v dosahu: zvětšete dosah +@msg select at most 2000 circles to bridge vyberte nejvýše 2000 kruhů k propojení +@msg that makes too many bridges (at most 8000): lower the reach to dává příliš mnoho mostů (nejvýše 8000): zmenšete dosah +@msg the bridged circles are too complex to unite propojené kruhy jsou příliš složité na sloučení # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozložit čárky na cesty @msg select paths with dashed strokes to expand vyberte cesty s čárkovaným tahem k rozložení diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 15937fb835..60b4e7ba73 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7415,10 +7415,18 @@ breakText Glyphs Glyffer Smooth Bridge… Blød bro… Smooth Bridge Blød bro Keep Originals Behold originaler -@msg select two circles to bridge vælg to cirkler, der skal forbindes +@msg select two or more circles to bridge vælg to eller flere cirkler, der skal forbindes @msg one circle is inside the other den ene cirkel er inden i den anden @msg the circles are too far apart for this radius: raise the radius cirklerne er for langt fra hinanden til denne radius: gør radius større @msg the circles are too far apart for this radius cirklerne er for langt fra hinanden til denne radius + Constant Gap Konstant afstand + Reach: Rækkevidde: +@msg the circles are too far apart for this gap: raise the gap cirklerne er for langt fra hinanden til denne afstand: gør afstanden større +@msg the circles are too far apart for this gap cirklerne er for langt fra hinanden til denne afstand +@msg no two circles are within reach: raise the reach ingen to cirkler er inden for rækkevidde: gør rækkevidden større +@msg select at most 2000 circles to bridge vælg højst 2000 cirkler, der skal forbindes +@msg that makes too many bridges (at most 8000): lower the reach det giver for mange broer (højst 8000): gør rækkevidden mindre +@msg the bridged circles are too complex to unite de forbundne cirkler er for komplekse til at blive samlet # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Udvid streger til stier @msg select paths with dashed strokes to expand vælg stier med stiplet streg, der skal udvides diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 03edf98a47..c96832b28d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs Glyphen Smooth Bridge… Weiche Brücke… Smooth Bridge Weiche Brücke Keep Originals Originale beibehalten -@msg select two circles to bridge wählen Sie zwei Kreise zum Verbinden aus +@msg select two or more circles to bridge wählen Sie zwei oder mehr Kreise zum Verbinden aus @msg one circle is inside the other ein Kreis liegt im anderen @msg the circles are too far apart for this radius: raise the radius die Kreise liegen für diesen Radius zu weit auseinander: vergrößern Sie den Radius @msg the circles are too far apart for this radius die Kreise liegen für diesen Radius zu weit auseinander + Constant Gap Konstanter Abstand + Reach: Reichweite: +@msg the circles are too far apart for this gap: raise the gap die Kreise liegen für diesen Abstand zu weit auseinander: vergrößern Sie den Abstand +@msg the circles are too far apart for this gap die Kreise liegen für diesen Abstand zu weit auseinander +@msg no two circles are within reach: raise the reach keine zwei Kreise liegen in Reichweite: vergrößern Sie die Reichweite +@msg select at most 2000 circles to bridge wählen Sie höchstens 2000 Kreise zum Verbinden aus +@msg that makes too many bridges (at most 8000): lower the reach das ergibt zu viele Brücken (höchstens 8000): verringern Sie die Reichweite +@msg the bridged circles are too complex to unite die verbundenen Kreise sind zu komplex zum Vereinen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Striche in Pfade umwandeln @msg select paths with dashed strokes to expand wählen Sie Pfade mit gestrichelter Kontur zum Umwandeln aus diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 95c95ebb07..37d7874dc4 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7335,10 +7335,18 @@ breakText Glyphs Γλύφοι Smooth Bridge… Ομαλή γέφυρα… Smooth Bridge Ομαλή γέφυρα Keep Originals Διατήρηση πρωτοτύπων -@msg select two circles to bridge επιλέξτε δύο κύκλους για γεφύρωση +@msg select two or more circles to bridge επιλέξτε δύο ή περισσότερους κύκλους για γεφύρωση @msg one circle is inside the other ο ένας κύκλος βρίσκεται μέσα στον άλλο @msg the circles are too far apart for this radius: raise the radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα: αυξήστε την ακτίνα @msg the circles are too far apart for this radius οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την ακτίνα + Constant Gap Σταθερή απόσταση + Reach: Εμβέλεια: +@msg the circles are too far apart for this gap: raise the gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση: αυξήστε την απόσταση +@msg the circles are too far apart for this gap οι κύκλοι απέχουν πολύ μεταξύ τους για αυτή την απόσταση +@msg no two circles are within reach: raise the reach δεν υπάρχουν δύο κύκλοι εντός εμβέλειας: αυξήστε την εμβέλεια +@msg select at most 2000 circles to bridge επιλέξτε έως 2000 κύκλους για γεφύρωση +@msg that makes too many bridges (at most 8000): lower the reach αυτό δημιουργεί πάρα πολλές γέφυρες (έως 8000): μειώστε την εμβέλεια +@msg the bridged circles are too complex to unite οι γεφυρωμένοι κύκλοι είναι πολύ σύνθετοι για ένωση # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Επέκταση παυλών σε διαδρομές @msg select paths with dashed strokes to expand επιλέξτε διαδρομές με διακεκομμένο περίγραμμα για επέκταση diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c8efe22c3f..19129e08c6 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7323,10 +7323,18 @@ breakText Glyphs Glifos Smooth Bridge… Puente suave… Smooth Bridge Puente suave Keep Originals Conservar originales -@msg select two circles to bridge seleccione dos círculos para unir +@msg select two or more circles to bridge seleccione dos o más círculos para unir @msg one circle is inside the other un círculo está dentro del otro @msg the circles are too far apart for this radius: raise the radius los círculos están demasiado separados para este radio: aumente el radio @msg the circles are too far apart for this radius los círculos están demasiado separados para este radio + Constant Gap Separación constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap los círculos están demasiado separados para esta separación: aumente la separación +@msg the circles are too far apart for this gap los círculos están demasiado separados para esta separación +@msg no two circles are within reach: raise the reach no hay dos círculos dentro del alcance: aumente el alcance +@msg select at most 2000 circles to bridge seleccione como máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach eso crea demasiados puentes (como máximo 8000): reduzca el alcance +@msg the bridged circles are too complex to unite los círculos unidos son demasiado complejos para combinarlos # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir guiones en trazados @msg select paths with dashed strokes to expand seleccione trazados con trazo discontinuo para expandir diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 2360844d2d..80bd584ac2 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7411,10 +7411,18 @@ breakText Glyphs Merkit Smooth Bridge… Pehmeä silta… Smooth Bridge Pehmeä silta Keep Originals Säilytä alkuperäiset -@msg select two circles to bridge valitse kaksi yhdistettävää ympyrää +@msg select two or more circles to bridge valitse vähintään kaksi yhdistettävää ympyrää @msg one circle is inside the other toinen ympyrä on toisen sisällä @msg the circles are too far apart for this radius: raise the radius ympyrät ovat liian kaukana toisistaan tälle säteelle: suurenna sädettä @msg the circles are too far apart for this radius ympyrät ovat liian kaukana toisistaan tälle säteelle + Constant Gap Vakioväli + Reach: Ulottuvuus: +@msg the circles are too far apart for this gap: raise the gap ympyrät ovat liian kaukana toisistaan tälle välille: suurenna väliä +@msg the circles are too far apart for this gap ympyrät ovat liian kaukana toisistaan tälle välille +@msg no two circles are within reach: raise the reach mitkään kaksi ympyrää eivät ole ulottuvilla: suurenna ulottuvuutta +@msg select at most 2000 circles to bridge valitse enintään 2000 yhdistettävää ympyrää +@msg that makes too many bridges (at most 8000): lower the reach siitä tulee liikaa siltoja (enintään 8000): pienennä ulottuvuutta +@msg the bridged circles are too complex to unite yhdistetyt ympyrät ovat liian monimutkaisia koottaviksi yhdeksi muodoksi # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Laajenna viivat poluiksi @msg select paths with dashed strokes to expand valitse laajennettavat polut, joissa on katkoviiva diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index fc5bdc4a41..e22e233840 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7361,10 +7361,18 @@ breakText Glyphs Glyphes Smooth Bridge… Pont lissé… Smooth Bridge Pont lissé Keep Originals Conserver les originaux -@msg select two circles to bridge sélectionnez deux cercles à relier +@msg select two or more circles to bridge sélectionnez au moins deux cercles à relier @msg one circle is inside the other un cercle est à l’intérieur de l’autre @msg the circles are too far apart for this radius: raise the radius les cercles sont trop éloignés pour ce rayon : augmentez le rayon @msg the circles are too far apart for this radius les cercles sont trop éloignés pour ce rayon + Constant Gap Écart constant + Reach: Portée : +@msg the circles are too far apart for this gap: raise the gap les cercles sont trop éloignés pour cet écart : augmentez l’écart +@msg the circles are too far apart for this gap les cercles sont trop éloignés pour cet écart +@msg no two circles are within reach: raise the reach aucun couple de cercles n’est à portée : augmentez la portée +@msg select at most 2000 circles to bridge sélectionnez au plus 2000 cercles à relier +@msg that makes too many bridges (at most 8000): lower the reach cela crée trop de ponts (au plus 8000) : réduisez la portée +@msg the bridged circles are too complex to unite les cercles reliés sont trop complexes pour être réunis # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Décomposer les tirets en tracés @msg select paths with dashed strokes to expand sélectionnez des tracés à contour pointillé à décomposer diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 972d2a2c50..efd5f80a48 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -702,6 +702,7 @@ Constrain મર્યાદિત કરો Constrain Angle ખૂણો મર્યાદિત કરો Constrain Width and Height Proportions પહોળાઈ અને ઊંચાઈનો પ્રમાણ મર્યાદિત કરો + Constant Gap સ્થિર ગેપ Construction Guides બાંધકામ ગાઇડ્સ Contextual Alternates સંદર્ભિત વૈકલ્પિક અક્ષરો Contextual Task Bar સંદર્ભિત ટાસ્ક બાર @@ -2857,6 +2858,7 @@ Rating: રેટિંગ: Ratio ગુણોત્તર Rays કિરણો + Reach: પહોંચ: Read Action Set File ક્રિયા સેટ ફાઇલ વાંચો Read Shortcut Set File શોર્ટકટ સેટ ફાઇલ વાંચો Read files you open in its format and make documents from them તમે ખોલો તે ફાઇલોને તેના ફોર્મેટમાં વાંચો અને તેમાંથી દસ્તાવેજ બનાવો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 544d82a416..7467d75acf 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1014,6 +1014,7 @@ antiAlias Sharp शार्प Connect Selected End Points सिलेक्टेड एंड पॉइंट्स कनेक्ट करें Consider Open Filled Paths as Closed बंद के रूप में ओपन भरा पाथ पर विचार करें Consolidate All Windows सभी विंडो एक साथ लाएँ + Constant Gap स्थिर गैप Constrain सीमित करें Constrain Angle कंस्ट्रेन एंगल Constrain Width and Height Proportions चौड़ाई और ऊंचाई का अनुपात बनाए रखें @@ -3838,6 +3839,7 @@ antiAlias Sharp शार्प Rating: रेटिंग: Ratio अनुपात Rays रे + Reach: पहुँच: Read Action Set File एक्शन सेट फ़ाइल पढ़ें Read Shortcut Set File शॉर्टकट सेट फ़ाइल पढ़ें Reads or sets environment variables एनवायरनमेंट वेरिएबल्स पढ़ता है या सेट करता है @@ -7757,6 +7759,7 @@ antiAlias Sharp शार्प @msg Offset Path: select paths ऑफसेट पाथ: सिलेक्शन पाथ @msg Offset Path: the offset leaves nothing of the selected paths (an inset larger than the shapes) ऑफसेट पाथ: ऑफ़सेट सिलेक्टेड पाथ की कुछ भी नहीं छोड़ता है (आकार की तुलना में एक निर्धारित बड़ा) @msg Offset Path: the path is too complex to offset ऑफसेट पाथ: पाथ ऑफसेट करने के लिए बहुत जटिल है +@msg no two circles are within reach: raise the reach कोई भी दो वृत्त पहुँच के भीतर नहीं हैं: पहुँच बढ़ाएँ @msg on must be true or false on को true या false होना चाहिए @msg one circle is inside the other एक वृत्त दूसरे के अंदर है @msg only a dock group above or below others collapses, not one beside another केवल दूसरों के ऊपर या नीचे एक डॉक समूह गिर जाता है, एक दूसरे के बगल में नहीं @@ -8019,6 +8022,7 @@ antiAlias Sharp शार्प @msg select artwork to make a group of its colours अपने रंगों का एक समूह बनाने के लिए आर्टवर्क सिलेक्ट करें @msg select artwork to recolour, or give a colour `group` रंग बदलने के लिए आर्टवर्क चुनें या रंग `group` दें @msg select at least two objects कम से कम दो ऑब्जेक्ट चुनें +@msg select at most 2000 circles to bridge जोड़ने के लिए अधिकतम 2000 वृत्त चुनें @msg Select dimensions to update अद्यतन करने के लिए आयाम सिलेक्ट करें @msg select exactly two objects वास्तव में दो ऑब्जेक्ट चुनें @msg select exactly two path ends to join जोड़ने के लिए ठीक दो पाथ एंड पॉइंट्स सिलेक्ट करें @@ -8067,7 +8071,7 @@ antiAlias Sharp शार्प @msg select the objects to attach to the path ऑब्जेक्ट्स का सिलेक्ट करने के लिए संलग्न करने के लिए पाथ @msg select the objects to bind ऑब्जेक्ट्स को बांधने के लिए चुनें @msg select the objects to transform in perspective ऑब्जेक्ट्स को पर्सपेक्टिव में बदलने के लिए चुनें -@msg select two circles to bridge जोड़ने के लिए दो वृत्त चुनें +@msg select two or more circles to bridge जोड़ने के लिए दो या अधिक वृत्त चुनें @msg select two open path ends, or two open paths, to average and join औसत निकालकर जोड़ने के लिए दो खुले पाथ एंड पॉइंट्स या दो खुले पाथ सिलेक्ट करें @msg select two or more graphic styles to merge दो या अधिक ग्राफिक स्टाइल्स का सिलेक्ट करने के लिए विलय @msg select two or more objects to distribute वितरित करने के लिए दो या दो से अधिक ऑब्जेक्ट चुनें @@ -8144,6 +8148,7 @@ antiAlias Sharp शार्प @msg the active document changed while the question was open; nothing was deleted प्रश्न खुला रहते हुए सक्रिय डॉक्यूमेंट बदल गया; कुछ भी नहीं हटाया गया @msg that document is no longer open यह डॉक्यूमेंट अब खुला नहीं है @msg that makes more than {MAX_PIECES} slices जो {MAX_PIECES} स्लाइस से अधिक बनाता है +@msg that makes too many bridges (at most 8000): lower the reach इससे बहुत अधिक ब्रिज बनते हैं (अधिकतम 8000): पहुँच घटाएँ @msg that makes too many pieces (at most 100000): make the dashes longer जो बहुत सारे टुकड़े बनाता है (अधिकांश 100000 में): डैश को लंबे समय तक बनाते हैं @msg that object is not in the overlap उस ऑब्जेक्ट को ओवरलैप में नहीं है @msg the {tool} tool has no options {tool} टूल में कोई ऑप्शन्स नहीं है @@ -8232,7 +8237,10 @@ antiAlias Sharp शार्प @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size आर्टबोर्ड कैनवास पर फिट नहीं हैं: कम आर्टबोर्ड, कम रिक्ति या छोटे आकार @msg the background worker stopped पृष्ठभूमि कार्यकर्ता बंद कर दिया @msg the blend has no spine मिश्रण में कोई रीढ़ नहीं है +@msg the bridged circles are too complex to unite जोड़े गए वृत्त मिलाने के लिए बहुत जटिल हैं @msg the character's size can't be measured कैरेक्टर का आकार मापा नहीं जा सकता है +@msg the circles are too far apart for this gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं +@msg the circles are too far apart for this gap: raise the gap इस गैप के लिए वृत्त एक-दूसरे से बहुत दूर हैं: गैप बढ़ाएँ @msg the circles are too far apart for this radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं @msg the circles are too far apart for this radius: raise the radius इस त्रिज्या के लिए वृत्त एक-दूसरे से बहुत दूर हैं: त्रिज्या बढ़ाएँ @msg the CMYK image couldn't be written CMYK इमेज को नहीं लिखा जा सकता diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 2e844865bc..d386463076 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7351,10 +7351,18 @@ breakText Glyphs Glifák Smooth Bridge… Sima híd… Smooth Bridge Sima híd Keep Originals Eredetik megtartása -@msg select two circles to bridge jelöljön ki két kört az összekötéshez +@msg select two or more circles to bridge jelöljön ki legalább két kört az összekötéshez @msg one circle is inside the other az egyik kör a másikon belül van @msg the circles are too far apart for this radius: raise the radius a körök túl messze vannak egymástól ehhez a sugárhoz: növelje a sugarat @msg the circles are too far apart for this radius a körök túl messze vannak egymástól ehhez a sugárhoz + Constant Gap Állandó hézag + Reach: Hatótávolság: +@msg the circles are too far apart for this gap: raise the gap a körök túl messze vannak egymástól ehhez a hézaghoz: növelje a hézagot +@msg the circles are too far apart for this gap a körök túl messze vannak egymástól ehhez a hézaghoz +@msg no two circles are within reach: raise the reach nincs két kör hatótávolságon belül: növelje a hatótávolságot +@msg select at most 2000 circles to bridge legfeljebb 2000 kört jelöljön ki az összekötéshez +@msg that makes too many bridges (at most 8000): lower the reach ez túl sok hidat eredményez (legfeljebb 8000): csökkentse a hatótávolságot +@msg the bridged circles are too complex to unite az összekötött körök túl összetettek az egyesítéshez # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Szaggatások kibontása útvonalakká @msg select paths with dashed strokes to expand jelöljön ki szaggatott körvonalú útvonalakat a kibontáshoz diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 1c1778af25..e1d304f9e8 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6745,10 +6745,18 @@ breakText Glyphs Glif Smooth Bridge… Jembatan Halus… Smooth Bridge Jembatan Halus Keep Originals Pertahankan Asli -@msg select two circles to bridge pilih dua lingkaran untuk dijembatani +@msg select two or more circles to bridge pilih dua lingkaran atau lebih untuk dijembatani @msg one circle is inside the other satu lingkaran berada di dalam lingkaran lainnya @msg the circles are too far apart for this radius: raise the radius lingkaran terlalu berjauhan untuk radius ini: perbesar radius @msg the circles are too far apart for this radius lingkaran terlalu berjauhan untuk radius ini + Constant Gap Celah Tetap + Reach: Jangkauan: +@msg the circles are too far apart for this gap: raise the gap lingkaran terlalu berjauhan untuk celah ini: perbesar celah +@msg the circles are too far apart for this gap lingkaran terlalu berjauhan untuk celah ini +@msg no two circles are within reach: raise the reach tidak ada dua lingkaran dalam jangkauan: perbesar jangkauan +@msg select at most 2000 circles to bridge pilih paling banyak 2000 lingkaran untuk dijembatani +@msg that makes too many bridges (at most 8000): lower the reach itu membuat terlalu banyak jembatan (paling banyak 8000): perkecil jangkauan +@msg the bridged circles are too complex to unite lingkaran yang dijembatani terlalu rumit untuk disatukan # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Perluas garis putus menjadi jalur @msg select paths with dashed strokes to expand pilih jalur dengan stroke putus-putus yang akan diperluas diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08149bf5b9..d662cc1bac 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6993,10 +6993,18 @@ breakText Glyphs Glifi Smooth Bridge… Ponte morbido… Smooth Bridge Ponte morbido Keep Originals Mantieni originali -@msg select two circles to bridge seleziona due cerchi da unire +@msg select two or more circles to bridge seleziona due o più cerchi da unire @msg one circle is inside the other un cerchio è dentro l’altro @msg the circles are too far apart for this radius: raise the radius i cerchi sono troppo distanti per questo raggio: aumenta il raggio @msg the circles are too far apart for this radius i cerchi sono troppo distanti per questo raggio + Constant Gap Distanza costante + Reach: Portata: +@msg the circles are too far apart for this gap: raise the gap i cerchi sono troppo lontani per questa distanza: aumenta la distanza +@msg the circles are too far apart for this gap i cerchi sono troppo lontani per questa distanza +@msg no two circles are within reach: raise the reach nessuna coppia di cerchi è entro la portata: aumenta la portata +@msg select at most 2000 circles to bridge seleziona al massimo 2000 cerchi da unire +@msg that makes too many bridges (at most 8000): lower the reach così si creano troppi ponti (al massimo 8000): riduci la portata +@msg the bridged circles are too complex to unite i cerchi uniti sono troppo complessi da fondere # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Espandi trattini in tracciati @msg select paths with dashed strokes to expand seleziona tracciati con traccia tratteggiata da espandere diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 63d4f273e2..f69bcf3bc9 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8870,10 +8870,18 @@ breakText Glyphs 字形 Smooth Bridge… スムーズブリッジ… Smooth Bridge スムーズブリッジ Keep Originals オリジナルを保持 -@msg select two circles to bridge ブリッジでつなぐ円を 2 つ選択してください +@msg select two or more circles to bridge ブリッジでつなぐ円を 2 つ以上選択してください @msg one circle is inside the other 一方の円がもう一方の円の内側にあります @msg the circles are too far apart for this radius: raise the radius この半径では円が離れすぎています:半径を大きくしてください @msg the circles are too far apart for this radius この半径では円が離れすぎています + Constant Gap 一定の間隔 + Reach: 到達距離: +@msg the circles are too far apart for this gap: raise the gap この間隔では円が離れすぎています:間隔を大きくしてください +@msg the circles are too far apart for this gap この間隔では円が離れすぎています +@msg no two circles are within reach: raise the reach 到達距離内にある円の組がありません:到達距離を大きくしてください +@msg select at most 2000 circles to bridge ブリッジでつなぐ円は 2000 個以下で選択してください +@msg that makes too many bridges (at most 8000): lower the reach ブリッジが多すぎます(最大 8000):到達距離を小さくしてください +@msg the bridged circles are too complex to unite ブリッジでつないだ円が複雑すぎて合体できません # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 破線をパスに拡張 @msg select paths with dashed strokes to expand 拡張する破線のパスを選択してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 754a5e5400..7f035abf30 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9482,10 +9482,18 @@ breakText Glyphs გლიფები Smooth Bridge… გლუვი ხიდი… Smooth Bridge გლუვი ხიდი Keep Originals ორიგინალების შენარჩუნება -@msg select two circles to bridge აირჩიეთ ორი წრე დასაკავშირებლად +@msg select two or more circles to bridge აირჩიეთ ორი ან მეტი წრე დასაკავშირებლად @msg one circle is inside the other ერთი წრე მეორის შიგნითაა @msg the circles are too far apart for this radius: raise the radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ რადიუსი @msg the circles are too far apart for this radius ამ რადიუსისთვის წრეები ერთმანეთისგან ძალიან შორსაა + Constant Gap მუდმივი ღრეჩო + Reach: მიწვდომა: +@msg the circles are too far apart for this gap: raise the gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა: გაზარდეთ ღრეჩო +@msg the circles are too far apart for this gap ამ ღრეჩოსთვის წრეები ერთმანეთისგან ძალიან შორსაა +@msg no two circles are within reach: raise the reach არცერთი ორი წრე არ არის მიწვდომის ფარგლებში: გაზარდეთ მიწვდომა +@msg select at most 2000 circles to bridge აირჩიეთ არაუმეტეს 2000 წრე დასაკავშირებლად +@msg that makes too many bridges (at most 8000): lower the reach ეს ძალიან ბევრ ხიდს ქმნის (არაუმეტეს 8000): შეამცირეთ მიწვდომა +@msg the bridged circles are too complex to unite დაკავშირებული წრეები ძალიან რთულია გასაერთიანებლად # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths ტირეების ტრაექტორიებად გაშლა @msg select paths with dashed strokes to expand აირჩიეთ გასაშლელი ტირეებიანი ხაზის კონტურები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6a87fcbba7..38db9b6000 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6957,10 +6957,18 @@ breakText Glyphs 글리프 Smooth Bridge… 부드러운 브리지… Smooth Bridge 부드러운 브리지 Keep Originals 원본 유지 -@msg select two circles to bridge 연결할 원 두 개를 선택하십시오 +@msg select two or more circles to bridge 연결할 원을 두 개 이상 선택하십시오 @msg one circle is inside the other 한 원이 다른 원 안에 있습니다 @msg the circles are too far apart for this radius: raise the radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다. 반경을 늘리십시오 @msg the circles are too far apart for this radius 이 반경에서는 원이 너무 멀리 떨어져 있습니다 + Constant Gap 일정한 간격 + Reach: 도달 거리: +@msg the circles are too far apart for this gap: raise the gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다. 간격을 늘리십시오 +@msg the circles are too far apart for this gap 이 간격에서는 원이 너무 멀리 떨어져 있습니다 +@msg no two circles are within reach: raise the reach 도달 거리 안에 있는 두 원이 없습니다. 도달 거리를 늘리십시오 +@msg select at most 2000 circles to bridge 연결할 원을 2000개 이하로 선택하십시오 +@msg that makes too many bridges (at most 8000): lower the reach 브리지가 너무 많아집니다(최대 8000개). 도달 거리를 줄이십시오 +@msg the bridged circles are too complex to unite 연결된 원이 너무 복잡하여 합칠 수 없습니다 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 대시를 패스로 확장 @msg select paths with dashed strokes to expand 확장할 점선 획의 패스를 선택하십시오 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 45a370bd76..f8526a466e 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9240,10 +9240,18 @@ breakText Glyphs Glyphs Smooth Bridge… Vloeiende brug… Smooth Bridge Vloeiende brug Keep Originals Originelen behouden -@msg select two circles to bridge selecteer twee cirkels om te verbinden +@msg select two or more circles to bridge selecteer twee of meer cirkels om te verbinden @msg one circle is inside the other de ene cirkel ligt binnen de andere @msg the circles are too far apart for this radius: raise the radius de cirkels liggen te ver uit elkaar voor deze straal: vergroot de straal @msg the circles are too far apart for this radius de cirkels liggen te ver uit elkaar voor deze straal + Constant Gap Constante tussenruimte + Reach: Bereik: +@msg the circles are too far apart for this gap: raise the gap de cirkels liggen te ver uit elkaar voor deze tussenruimte: vergroot de tussenruimte +@msg the circles are too far apart for this gap de cirkels liggen te ver uit elkaar voor deze tussenruimte +@msg no two circles are within reach: raise the reach geen twee cirkels liggen binnen bereik: vergroot het bereik +@msg select at most 2000 circles to bridge selecteer hoogstens 2000 cirkels om te verbinden +@msg that makes too many bridges (at most 8000): lower the reach dat geeft te veel bruggen (hoogstens 8000): verklein het bereik +@msg the bridged circles are too complex to unite de verbonden cirkels zijn te complex om samen te voegen # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Streepjes uitbreiden tot paden @msg select paths with dashed strokes to expand selecteer paden met een streepjeslijn om uit te breiden diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 6dd5772422..23c245e8b1 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -7222,10 +7222,18 @@ breakText Glyphs Glify Smooth Bridge… Gładki most… Smooth Bridge Gładki most Keep Originals Zachowaj oryginały -@msg select two circles to bridge zaznacz dwa okręgi do połączenia +@msg select two or more circles to bridge zaznacz co najmniej dwa okręgi do połączenia @msg one circle is inside the other jeden okrąg jest wewnątrz drugiego @msg the circles are too far apart for this radius: raise the radius okręgi są zbyt daleko od siebie dla tego promienia: zwiększ promień @msg the circles are too far apart for this radius okręgi są zbyt daleko od siebie dla tego promienia + Constant Gap Stały odstęp + Reach: Zasięg: +@msg the circles are too far apart for this gap: raise the gap okręgi są zbyt daleko od siebie dla tego odstępu: zwiększ odstęp +@msg the circles are too far apart for this gap okręgi są zbyt daleko od siebie dla tego odstępu +@msg no two circles are within reach: raise the reach żadne dwa okręgi nie są w zasięgu: zwiększ zasięg +@msg select at most 2000 circles to bridge zaznacz najwyżej 2000 okręgów do połączenia +@msg that makes too many bridges (at most 8000): lower the reach to daje zbyt wiele mostów (najwyżej 8000): zmniejsz zasięg +@msg the bridged circles are too complex to unite połączone okręgi są zbyt złożone, aby je scalić # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Rozszerz kreski na ścieżki @msg select paths with dashed strokes to expand zaznacz ścieżki z przerywanym konturem do rozszerzenia diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 952535aed2..325ff1570f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7397,10 +7397,18 @@ breakText Glyphs Glifos Smooth Bridge… Ponte suave… Smooth Bridge Ponte suave Keep Originals Manter originais -@msg select two circles to bridge selecione dois círculos para unir +@msg select two or more circles to bridge selecione dois ou mais círculos para unir @msg one circle is inside the other um círculo está dentro do outro @msg the circles are too far apart for this radius: raise the radius os círculos estão muito afastados para este raio: aumente o raio @msg the circles are too far apart for this radius os círculos estão muito afastados para este raio + Constant Gap Distância constante + Reach: Alcance: +@msg the circles are too far apart for this gap: raise the gap os círculos estão muito afastados para esta distância: aumente a distância +@msg the circles are too far apart for this gap os círculos estão muito afastados para esta distância +@msg no two circles are within reach: raise the reach nenhum par de círculos está dentro do alcance: aumente o alcance +@msg select at most 2000 circles to bridge selecione no máximo 2000 círculos para unir +@msg that makes too many bridges (at most 8000): lower the reach isso cria pontes demais (no máximo 8000): diminua o alcance +@msg the bridged circles are too complex to unite os círculos unidos são complexos demais para combinar # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandir traços em demarcadores @msg select paths with dashed strokes to expand selecione demarcadores com traçado tracejado para expandir diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 2a53122c4d..9469c1db83 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -7356,10 +7356,18 @@ breakText Glyphs Глифы Smooth Bridge… Плавный мост… Smooth Bridge Плавный мост Keep Originals Сохранить оригиналы -@msg select two circles to bridge выделите две окружности для соединения +@msg select two or more circles to bridge выделите две или более окружностей для соединения @msg one circle is inside the other одна окружность находится внутри другой @msg the circles are too far apart for this radius: raise the radius окружности слишком далеко друг от друга для этого радиуса: увеличьте радиус @msg the circles are too far apart for this radius окружности слишком далеко друг от друга для этого радиуса + Constant Gap Постоянный зазор + Reach: Охват: +@msg the circles are too far apart for this gap: raise the gap окружности слишком далеко друг от друга для этого зазора: увеличьте зазор +@msg the circles are too far apart for this gap окружности слишком далеко друг от друга для этого зазора +@msg no two circles are within reach: raise the reach нет двух окружностей в пределах охвата: увеличьте охват +@msg select at most 2000 circles to bridge выделите не более 2000 окружностей для соединения +@msg that makes too many bridges (at most 8000): lower the reach получается слишком много мостов (не более 8000): уменьшите охват +@msg the bridged circles are too complex to unite соединяемые окружности слишком сложны для объединения # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Разобрать штрихи на контуры @msg select paths with dashed strokes to expand выделите контуры со штриховой обводкой для разбора diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index a9f7159b01..9b5de2988f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7382,10 +7382,18 @@ breakText Glyphs Glyfer Smooth Bridge… Mjuk brygga… Smooth Bridge Mjuk brygga Keep Originals Behåll original -@msg select two circles to bridge markera två cirklar att förbinda +@msg select two or more circles to bridge markera två eller fler cirklar att förbinda @msg one circle is inside the other den ena cirkeln ligger inuti den andra @msg the circles are too far apart for this radius: raise the radius cirklarna ligger för långt ifrån varandra för den här radien: öka radien @msg the circles are too far apart for this radius cirklarna ligger för långt ifrån varandra för den här radien + Constant Gap Konstant mellanrum + Reach: Räckvidd: +@msg the circles are too far apart for this gap: raise the gap cirklarna ligger för långt ifrån varandra för det här mellanrummet: öka mellanrummet +@msg the circles are too far apart for this gap cirklarna ligger för långt ifrån varandra för det här mellanrummet +@msg no two circles are within reach: raise the reach inga två cirklar ligger inom räckvidd: öka räckvidden +@msg select at most 2000 circles to bridge markera högst 2000 cirklar att förbinda +@msg that makes too many bridges (at most 8000): lower the reach det ger för många bryggor (högst 8000): minska räckvidden +@msg the bridged circles are too complex to unite de förbundna cirklarna är för komplexa för att slås ihop # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Expandera streck till banor @msg select paths with dashed strokes to expand markera banor med streckad kontur att expandera diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 3527e14166..0abeed0e99 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9244,10 +9244,18 @@ breakText Glyphs Glifler Smooth Bridge… Yumuşak Köprü… Smooth Bridge Yumuşak Köprü Keep Originals Orijinalleri Koru -@msg select two circles to bridge köprüyle birleştirilecek iki daire seçin +@msg select two or more circles to bridge köprüyle birleştirilecek iki veya daha fazla daire seçin @msg one circle is inside the other bir daire diğerinin içinde @msg the circles are too far apart for this radius: raise the radius daireler bu yarıçap için birbirinden çok uzak: yarıçapı artırın @msg the circles are too far apart for this radius daireler bu yarıçap için birbirinden çok uzak + Constant Gap Sabit Boşluk + Reach: Erişim: +@msg the circles are too far apart for this gap: raise the gap daireler bu boşluk için birbirinden çok uzak: boşluğu artırın +@msg the circles are too far apart for this gap daireler bu boşluk için birbirinden çok uzak +@msg no two circles are within reach: raise the reach erişim içinde hiçbir iki daire yok: erişimi artırın +@msg select at most 2000 circles to bridge köprüyle birleştirmek için en fazla 2000 daire seçin +@msg that makes too many bridges (at most 8000): lower the reach bu çok fazla köprü oluşturur (en fazla 8000): erişimi azaltın +@msg the bridged circles are too complex to unite köprülenen daireler birleştirilemeyecek kadar karmaşık # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Tireleri Yollara Genişlet @msg select paths with dashed strokes to expand genişletilecek kesikli konturlu yolları seçin diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 6d828ad424..9debbdf5f8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6975,10 +6975,18 @@ breakText Glyphs Гліфи Smooth Bridge… Плавний міст… Smooth Bridge Плавний міст Keep Originals Зберегти оригінали -@msg select two circles to bridge виділіть два кола для з’єднання +@msg select two or more circles to bridge виділіть два або більше кіл для з’єднання @msg one circle is inside the other одне коло всередині іншого @msg the circles are too far apart for this radius: raise the radius кола надто далеко одне від одного для цього радіуса: збільште радіус @msg the circles are too far apart for this radius кола надто далеко одне від одного для цього радіуса + Constant Gap Сталий проміжок + Reach: Охоплення: +@msg the circles are too far apart for this gap: raise the gap кола надто далеко одне від одного для цього проміжку: збільште проміжок +@msg the circles are too far apart for this gap кола надто далеко одне від одного для цього проміжку +@msg no two circles are within reach: raise the reach жодні два кола не перебувають у межах охоплення: збільште охоплення +@msg select at most 2000 circles to bridge виділіть не більше 2000 кіл для з’єднання +@msg that makes too many bridges (at most 8000): lower the reach це дає забагато мостів (не більше 8000): зменште охоплення +@msg the bridged circles are too complex to unite з’єднані кола надто складні для об’єднання # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Розібрати штрихи на контури @msg select paths with dashed strokes to expand виділіть контури зі штриховим обведенням для розбору diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d9999727b7..78b6fc364d 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6992,10 +6992,18 @@ breakText Glyphs Glyph Smooth Bridge… Cầu nối mượt… Smooth Bridge Cầu nối mượt Keep Originals Giữ bản gốc -@msg select two circles to bridge chọn hai hình tròn để nối +@msg select two or more circles to bridge chọn hai hình tròn trở lên để nối @msg one circle is inside the other một hình tròn nằm bên trong hình tròn kia @msg the circles are too far apart for this radius: raise the radius các hình tròn cách nhau quá xa so với bán kính này: hãy tăng bán kính @msg the circles are too far apart for this radius các hình tròn cách nhau quá xa so với bán kính này + Constant Gap Khoảng hở cố định + Reach: Tầm với: +@msg the circles are too far apart for this gap: raise the gap các hình tròn cách nhau quá xa so với khoảng hở này: hãy tăng khoảng hở +@msg the circles are too far apart for this gap các hình tròn cách nhau quá xa so với khoảng hở này +@msg no two circles are within reach: raise the reach không có hai hình tròn nào trong tầm với: hãy tăng tầm với +@msg select at most 2000 circles to bridge chọn tối đa 2000 hình tròn để nối +@msg that makes too many bridges (at most 8000): lower the reach thao tác này tạo quá nhiều cầu nối (tối đa 8000): hãy giảm tầm với +@msg the bridged circles are too complex to unite các hình tròn được nối quá phức tạp để hợp nhất # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths Mở rộng nét đứt thành đường dẫn @msg select paths with dashed strokes to expand chọn các đường dẫn có nét đứt để mở rộng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 665b125122..da05670943 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -7207,10 +7207,18 @@ breakText Glyphs 字形 Smooth Bridge… 平滑桥接… Smooth Bridge 平滑桥接 Keep Originals 保留原稿 -@msg select two circles to bridge 请选择两个要桥接的圆 +@msg select two or more circles to bridge 请选择两个或更多要桥接的圆 @msg one circle is inside the other 一个圆位于另一个圆内部 @msg the circles are too far apart for this radius: raise the radius 对于此半径,两个圆相距太远:请增大半径 @msg the circles are too far apart for this radius 对于此半径,两个圆相距太远 + Constant Gap 固定间隙 + Reach: 范围: +@msg the circles are too far apart for this gap: raise the gap 对于此间隙,两个圆相距太远:请增大间隙 +@msg the circles are too far apart for this gap 对于此间隙,两个圆相距太远 +@msg no two circles are within reach: raise the reach 范围内没有任何两个圆:请增大范围 +@msg select at most 2000 circles to bridge 最多选择 2000 个圆进行桥接 +@msg that makes too many bridges (at most 8000): lower the reach 这会产生过多桥接(最多 8000 个):请减小范围 +@msg the bridged circles are too complex to unite 桥接的圆过于复杂,无法合并 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 将短划线扩展为路径 @msg select paths with dashed strokes to expand 请选择要扩展的虚线描边路径 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1616c01b65..f20e64b7d8 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -7016,10 +7016,18 @@ breakText Glyphs 字符 Smooth Bridge… 平滑橋接… Smooth Bridge 平滑橋接 Keep Originals 保留原始物件 -@msg select two circles to bridge 請選取兩個要橋接的圓形 +@msg select two or more circles to bridge 請選取兩個或更多要橋接的圓形 @msg one circle is inside the other 一個圓形位於另一個圓形內 @msg the circles are too far apart for this radius: raise the radius 就此半徑而言,兩個圓形相距太遠:請增加半徑 @msg the circles are too far apart for this radius 就此半徑而言,兩個圓形相距太遠 + Constant Gap 固定間隙 + Reach: 範圍: +@msg the circles are too far apart for this gap: raise the gap 就此間隙而言,兩個圓形相距太遠:請增加間隙 +@msg the circles are too far apart for this gap 就此間隙而言,兩個圓形相距太遠 +@msg no two circles are within reach: raise the reach 範圍內沒有任何兩個圓形:請增加範圍 +@msg select at most 2000 circles to bridge 最多選取 2000 個圓形進行橋接 +@msg that makes too many bridges (at most 8000): lower the reach 這會產生過多橋接(最多 8000 個):請減少範圍 +@msg the bridged circles are too complex to unite 橋接的圓形過於複雜,無法合併 # Path Precision Tools add-on: Expand Dashes into Paths. Expand Dashes into Paths 將短破折號展開為路徑 @msg select paths with dashed strokes to expand 請選取要展開的虛線筆畫路徑 diff --git a/docs/mcp.md b/docs/mcp.md index 7fdd7a1375..a1eb90ae8b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11845,18 +11845,33 @@ Commands: drawn, and the path's fills stay on it, below its dashes (a path without fills goes). A compound path's dashes are plain paths with its appearance. Paths without a dashed stroke stay as they are, and it is an error if none has one. The dashes are selected; more than 100,000 (or a pattern too fine to draw) is refused. → `{ids, dashes}`. -- `addon.pathtools.bridge {radius?, keepOriginals?, ids?}` joins two circles (`ids`, default: the selection; paths - whose outline is a circle, not hidden or locked) into one closed outline, as one undo step (Object › Plug-ins › Path - Precision Tools › Smooth Bridge…). The outline goes around each circle on its side away from the other and along two - concave arcs, one on each side of the line through the centers, each touching both circles from outside, so every - anchor is smooth. `radius` is the arcs' radius as a percentage of the smaller circle's radius (1 to 1,000, 100 by - default): a larger radius makes a wider, gentler bridge. Overlapping and touching circles are joined at every radius. - One circle inside the other is an error, and so are circles too far apart for the radius: the arcs would not reach - both circles, or would cross before they do. The error suggests a larger radius only when one up to 1,000 would - bridge the circles. The outline replaces the two circles, painted as the upper one (a plain - path), unless `keepOriginals` is true: then it goes directly above the upper circle, painted as it, and the circles - stay. The outline is selected. → `{id}`. Smooth Bridge… opens a dialog (`ui.menuDialog {command}`, kind - `smoothBridge`) with a Radius field in percent, Keep Originals and Preview. +- `addon.pathtools.bridge {radius?, gap?, reach?, keepOriginals?, ids?}` joins circles (`ids`, default: the selection; + paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes, as one undo step (Object › + Plug-ins › Path Precision Tools › Smooth Bridge…). Two circles become one closed outline that goes around each circle + on its side away from the other and along two concave arcs, one on each side of the line through the centers, each + touching both circles from outside, so every anchor is smooth. `radius` is the arcs' radius as a percentage of the + smaller circle's radius (1 to 1,000, 100 by default): a larger radius makes a wider, gentler bridge. `gap` (0 to 1,000 + pt) sets the arcs' radius instead to the smaller circle's radius plus the gap, so each arc stays that gap away from a + circle of the smaller circle's size about the arc's center. For equal circles that gap apart, that center is where a + third circle the gap from both would sit, as in a triangular grid, so the channels around an empty place in such a + grid are one width; in a square grid they are not. Giving both `radius` and `gap` is an error. Overlapping and + touching circles are joined at every radius. One circle inside the other is an error, and so are circles too far apart + for the radius or gap: the arcs would not reach both circles, or would cross before they do. The error suggests a + larger radius or gap only when the largest (1,000% or 1,000 pt) would bridge the circles. The outline replaces the two + circles, painted as the upper one (a plain path), unless `keepOriginals` is true: then it goes directly above the + upper circle, painted as it, and the circles stay. The outline is selected. Two circles are bridged however far apart + their outlines are; `reach` does not apply to them. + With three or more circles, every two whose outlines are at most `reach` apart (0 to 10,000 pt, 10 by default; + overlapping ones included) are bridged the same way, and the bridges that connect are united into one shape each, + which can have holes where bridges enclose space; holes smaller than 1% of the smallest circle's area are filled. A + pair within reach but too far apart for the radius or gap gets no bridge. Each shape replaces its circles, painted as + the topmost of them and in its place, or with `keepOriginals` goes directly above that circle. A circle bridged to no + other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within + reach has one circle inside the other, when no pair within reach can be bridged (with the same suggestion of a larger + radius or gap), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: + the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog + (`ui.menuDialog {command}`, kind `smoothBridge`) with Constant Gap (a Gap field in place of the Radius field in + percent), Reach (unavailable with two circles selected), Keep Originals and Preview. - `addon.pathtools.cornerSet {ids?, anchors?, items?, radius, kind?, every?, minAngle?, maxAngle?}` cuts live corners, the ones Direct Selection's corner widgets and the Corners dialog edit, as one undo step. `ids` (default: the selection) are the paths and `anchors` the anchor indices of each path's outline with no corners cut; without `anchors`, a path's direct-selected diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 9b7a3bf20b..4a824d38bd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2458,6 +2458,8 @@ A VectorCraft addition, not a feature of the reference app, so no area score mov A VectorCraft addition, so no area score moves. Object › Plug-ins › Path Precision Tools › Smooth Bridge… (`addon.pathtools.bridge`) joins two selected circles into one closed outline, like two drops of liquid pulling apart: the outline goes around each circle on its side away from the other and along two concave arcs, one on each side, each touching both circles from outside, so the outline runs on smoothly from each circle into the bridge and every anchor is smooth. The arcs' radius is a percentage of the smaller circle's radius (1 to 1000%, 100% by default); a larger radius makes a wider, gentler bridge, and circles farther apart make a narrower one. Overlapping and touching circles are joined at every radius; one circle inside the other, or circles too far apart for the radius (the arcs would not reach both circles, or would cross), is refused with a message, which suggests a larger radius only when one up to 1000% would bridge them. The outline replaces the two circles, painted as the upper one, or with Keep Originals goes directly above the upper circle and the circles stay. One undo step; the dialog previews on the canvas. Tests: `bridge::tests` in `vectorcraft-pathops` (equal and unequal circles, overlapping and touching ones, unequal ones at large radii, the neck's width, the arcs tangent to both circles at every anchor, far apart and nested circles refused, circles told from other paths), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the outline in place of the circles or above them, one undo step, the radius, unequal overlapping circles up to the largest radius, refused selections and parameters with and without a larger radius suggested, locked and hidden circles), `smooth_bridge_opens_its_dialog_previews_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Path Precision Tools add-on. +Constant Gap sets the arcs' radius to the smaller circle's radius plus a gap in points (`gap`), so each arc stays that gap from a circle of the smaller circle's size about the arc's center: in a triangular grid of equal circles that gap apart, the channels around an empty place are one width. With three or more circles selected, every two whose outlines are within Reach (`reach`, 10 pt by default) are bridged, the bridges that connect are united into one shape each (holes included, except those smaller than 1% of the smallest circle's area), a pair too far apart for the radius gets no bridge, and a circle bridged to no other stays as it is; at most 2000 circles and 8000 bridges, found through a grid of cells so each circle is compared only with its near neighbors. Reach is unavailable in the dialog with two circles selected, which are bridged at any distance. Tests: `bridge::tests` in `vectorcraft-pathops` (a 3 × 3 grid joined by side neighbors only or with the diagonal ones, a ring of six around an empty place leaving a round hole the gap wider than a circle, each pair's shape the two-circle outline for overlapping, touching and unequal circles, a circle out of reach left alone, a pair too far apart for the arcs left unbridged, the gap form against the percentage form, too many circles or bridges and pairs that can't be bridged refused), `bridge::tests` in `cmd::addons::pathtools` in `vectorcraft-engine` (the grid as one shape in the topmost circle's place with its holes, one undo step, a circle left alone, small circles at the default reach, an id given twice, Keep Originals for several shapes, the gap form, refusals and their messages) and `constant_gap_shows_the_gap_and_bridges_many_circles_within_reach` in `vectorcraft-ui-egui`. + ## Document Tools add-on: Save a Timestamped Copy (2026-11-01) A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Document Tools › Save a Timestamped Copy writes a copy of the document named `<name>_YYYY-MM-DD_HH-MM.<ext>` (the date and time in UTC, through chrono; `-2`, `-3`… added when that name is taken) next to the document, or into a folder picked (the folder picker) when it was never saved, in the document's own format or another save format. It writes through File › Save a Copy's save, so the document keeps its path, title and modified state, no undo step is made, and the write stays inside the automation roots in force. It is off on the web, which has no clock. Tests: `cmd::addons::document::tests` in `vectorcraft-engine` (the name and place, numbered names, the document unchanged and its content in the copy, an unsaved document needing a folder, other formats, bad params refused, automation roots), `addons::document::tests` in `vectorcraft-ui-egui` (the submenu, beside the document, the folder picked or cancelled) and `command_sweep`. Commands: `docs/mcp.md` › Document Tools add-on. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 86a4a10e8b..35e56b1b3a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -481,7 +481,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Set Corners… (also a button in the Anchor Inspector's Corners section: Radius in any unit, Corner kind, Anchors: All, Odd-Numbered or Even-Numbered, counted from each path's first anchor; Angle: from … to …°, only the corners whose sides meet at an angle in that range; Preview) cuts corners on the chosen anchors of every selected path, one undo step | done | #5546, #5545; `addon.pathtools.cornerSet` (`every`, `minAngle`, `maxAngle`), `crates/ui-egui/src/addons/pathtools/set_corners.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (in the All Tools drawer under the add-on's heading, in neither toolbar as shipped, no shortcut) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag every stretch its rectangle touches, an Alt-drag every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its tests; not a feature of the reference app, so it is not scored | -| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored | From dd8a50dbe350d1b860caa35345ab380e64fbd86c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 19:49:25 -0800 Subject: [PATCH 053/247] Path Precision Tools: Smooth Bridge leaves necks too thin to unite unbridged With three or more circles, a pair just inside the arcs' limit can have a neck far thinner than the precision the shapes are united at, and the union could drop it while the pair still counted as joined. Each set of connected circles is now united at a precision fine enough for its smallest circle, and a pair whose neck is narrower than twice that gets no bridge, the same as a pair too far apart for the arcs. --- crates/pathops/src/addons/pathtools/bridge.rs | 78 ++++++++++++++----- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index 89cee8977b..dd9bdba027 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -106,8 +106,10 @@ fn closed(segs: &[CubicBez], kind: AnchorKind) -> SubPath { /// Where the arcs of radius `radius` that bridge circles `a` and `b` lie: the unit vector from /// `a`'s center to `b`'s, and on each side the arc's center (`p1`, `p2`) and where it touches `a` -/// and `b`. +/// and `b`; and the neck's width where the arcs come nearest each other between the circles +/// (infinite when that is at the circles). struct Touches { + waist: f64, u: Vec2, p1: Point, a1: Point, @@ -157,7 +159,8 @@ fn touches(a: Circle, b: Circle, radius: f64) -> Result<Touches, BridgeError> { (p, a.center + (p - a.center) * (a.radius / ra), b.center + (p - b.center) * (b.radius / rb)) }; let ((p1, a1, b1), (p2, a2, b2)) = (side(1.0), side(-1.0)); - Ok(Touches { u, p1, a1, b1, p2, a2, b2 }) + let waist = if along > 0.0 && along < d { 2.0 * (across - radius) } else { f64::INFINITY }; + Ok(Touches { waist, u, p1, a1, b1, p2, a2, b2 }) } /// The most circles [`bridge_many`] takes. @@ -236,30 +239,50 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bri if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { return Err(ManyError::Bad); } - let (pairs, too_far) = pairs_within(circles, reach, arc)?; + let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; + // Each set of connected circles, under its lowest index, is united at a precision fine enough + // for its smallest circle. A neck narrower than twice that would not survive the union, so its + // pair gets no bridge; that can split a set and make its precision coarser, so the sets are + // found again until no neck is dropped. + let (roots, precision) = loop { + let mut parent: Vec<usize> = (0..circles.len()).collect(); + for &((i, j), _) in &pairs { + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let roots: Vec<usize> = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); + let mut precision = vec![DEFAULT_PRECISION; circles.len()]; + for (&r, c) in roots.iter().zip(circles) { + precision[r] = precision[r].min(c.radius * 1e-3); + } + let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; + if !pairs.iter().any(thin) { + break (roots, precision); + } + for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { + too_far = Some(too_far.map_or(pair, |t| t.min(pair))); + } + pairs.retain(|p| !thin(p)); + }; match (pairs.is_empty(), too_far) { (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), (true, None) => return Err(ManyError::NoneInReach), (false, _) => {} } - // Each set of connected circles, under its lowest index. - let mut parent: Vec<usize> = (0..circles.len()).collect(); let mut necks = Vec::with_capacity(pairs.len()); - for &(i, j) in &pairs { + for &((i, j), _) in &pairs { let (a, b) = (circles[i], circles[j]); let sp = neck(a, b, arc.between(a, b)).map_err(|e| ManyError::Pair(i, j, e))?; necks.push(((i, j), PathData::single(sp))); - let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); - parent[ri.max(rj)] = ri.min(rj); } let mut sets: BTreeMap<usize, (Vec<usize>, Vec<&PathData>)> = BTreeMap::new(); for &((i, j), ref neck) in &necks { - let (members, parts) = sets.entry(root(&mut parent, i)).or_default(); + let (members, parts) = sets.entry(roots[i]).or_default(); members.extend([i, j]); parts.push(neck); } let mut out = Bridged::default(); - for (_, (mut members, parts)) in sets { + for (set, (mut members, parts)) in sets { members.sort_unstable(); members.dedup(); // Each circle once, and the necks between them. @@ -270,9 +293,7 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bri .collect(); let fills: Vec<(&PathData, FillRule)> = rounds.iter().chain(parts).map(|p| (p, FillRule::NonZero)).collect(); let smallest = members.iter().filter_map(|&i| circles.get(i)).map(|c| c.radius).fold(f64::INFINITY, f64::min); - // Fine enough for the smallest circle, whose bridges are narrower than it. - let precision = DEFAULT_PRECISION.min(smallest * 1e-3); - let mut outline = try_unite_all_with(&fills, precision).map_err(|_| ManyError::TooComplex)?; + let mut outline = try_unite_all_with(&fills, precision[set]).map_err(|_| ManyError::TooComplex)?; // Where three bridges' arcs nearly meet, the union leaves a speck of a hole; a contour that // encloses a circle is far larger than this. let speck = SPECK * PI * smallest * smallest; @@ -286,6 +307,9 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bri /// Two circles' indices, the lower first. type Pair = (usize, usize); +/// What [`pairs_within`] finds: the pairs the arcs can bridge, each with its neck's width, and the +/// lowest pair too far apart for them. +type Within = (Vec<(Pair, f64)>, Option<Pair>); /// The set `i` is in: the lowest index in it, with the path to it shortened on the way. fn root(parent: &mut [usize], mut i: usize) -> usize { @@ -297,11 +321,11 @@ fn root(parent: &mut [usize], mut i: usize) -> usize { } /// Every pair of indices `(i, j)`, `i < j`, ascending, of `circles` whose outlines are at most -/// `reach` apart and that arcs of `arc` can bridge, and the lowest pair within reach that they -/// can't because it is too far apart for them. Circles go into a grid of cells as wide as the -/// farthest two centers within reach can be, so each circle is compared only with those in its own -/// cell and the eight around it. -fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec<Pair>, Option<Pair>), ManyError> { +/// `reach` apart and that arcs of `arc` can bridge, with the width of the neck between them, and +/// the lowest pair within reach that they can't because it is too far apart for them. Circles go +/// into a grid of cells as wide as the farthest two centers within reach can be, so each circle is +/// compared only with those in its own cell and the eight around it. +fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<Within, ManyError> { let biggest = circles.iter().map(|c| c.radius).fold(0.0, f64::max); let cell = 2.0 * biggest + reach; if !(cell.is_finite() && cell > 0.0) { @@ -325,7 +349,7 @@ fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec<P } // Only the arcs' ends are worked out here; the bridge itself is made later. match touches(c, o, arc.between(c, o)) { - Ok(_) => pairs.push((i, j)), + Ok(t) => pairs.push(((i, j), t.waist)), Err(BridgeError::TooFar) => too_far = Some(too_far.map_or((i, j), |t| t.min((i, j)))), Err(e) => return Err(ManyError::Pair(i, j, e)), } @@ -336,8 +360,8 @@ fn pairs_within(circles: &[Circle], reach: f64, arc: ArcRadius) -> Result<(Vec<P return Err(ManyError::TooManyBridges); } } - pairs.sort_unstable(); - pairs.dedup(); + pairs.sort_unstable_by_key(|&(pair, _)| pair); + pairs.dedup_by_key(|&mut (pair, _)| pair); if pairs.len() > MAX_BRIDGES { return Err(ManyError::TooManyBridges); } @@ -662,6 +686,18 @@ mod tests { let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 10.0).unwrap(); assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::<Vec<_>>(), [vec![0, 1]]); assert_eq!(made.alone, [2]); + // Arcs of radius 10 between circles of radius 10 just under 20√3 apart leave a neck about + // 0.00003 pt wide, too thin for the union: that pair is left unbridged too. + let (a, b, c) = (circle(0.0, 0.0, 10.0), circle(34.6409, 0.0, 10.0), circle(58.6409, 0.0, 10.0)); + assert!(smooth_bridge(a, b, 10.0).is_ok(), "two circles alone are bridged"); + let made = bridge_many(&[a, b, c], ArcRadius::Share(1.0), 20.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::<Vec<_>>(), [vec![1, 2]]); + assert_eq!(made.alone, [0]); + // Two tiny circles far off are united at a finer precision, which does not change that. + let tiny = [circle(500.0, 0.0, 0.01), circle(500.025, 0.0, 0.01)]; + let made = bridge_many(&[a, b, c, tiny[0], tiny[1]], ArcRadius::Share(1.0), 20.0).unwrap(); + assert_eq!(made.joined.iter().map(|j| j.members.clone()).collect::<Vec<_>>(), [vec![1, 2], vec![3, 4]]); + assert_eq!(made.alone, [0]); // 260 touching circles in a row with a wide reach: 33,670 pairs within reach, far more than // the bridge limit, but only the 259 touching pairs are near enough for the arcs. let row: Vec<Circle> = (0..260).map(|i| circle(f64::from(i) * 20.0, 0.0, 10.0)).collect(); From 4781fac16ec73801d53658747af9abe3e126241d Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 21:50:20 -0800 Subject: [PATCH 054/247] Path Precision Tools: Smooth Bridge suggests a larger radius only when it bridges among the other circles With three or more circles and no pair that can be bridged, the error suggested a larger radius or gap when the largest one bridged a single pair on its own, even when that pair's neck was still too thin to unite among the other circles. The suggestion now uses the same rules as the many-circle bridge (`bridges_any` in `vectorcraft-pathops`). The command's params text, `docs/mcp.md` and `docs/ui-parity.md` now say that a pair within reach also gets no bridge when its neck would be thinner than the precision its shape is united at. --- .../engine/src/cmd/addons/pathtools/bridge.rs | 19 ++--- .../src/cmd/addons/pathtools/bridge/tests.rs | 17 ++++ crates/pathops/src/addons/pathtools.rs | 2 +- crates/pathops/src/addons/pathtools/bridge.rs | 82 +++++++++++-------- docs/mcp.md | 7 +- docs/ui-parity.md | 2 +- 6 files changed, 82 insertions(+), 47 deletions(-) diff --git a/crates/engine/src/cmd/addons/pathtools/bridge.rs b/crates/engine/src/cmd/addons/pathtools/bridge.rs index 1c7181f43e..4d4eb9cdf8 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge.rs @@ -34,7 +34,7 @@ pub(super) fn specs() -> Vec<CommandSpec> { "Smooth Bridge", ["Object", "Plug-ins", "Path Precision Tools"], None, - "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", + "{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and so does one whose neck would be thinner than the precision its shape is united at, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles", has_selection, bridge )] @@ -80,7 +80,7 @@ fn bridge(s: &mut Session, p: &Value) -> Result<Value> { let (shapes, alone): (Vec<(Vec<NodeId>, PathData)>, Vec<NodeId>) = match only.as_slice() { [a, b] => match pt::smooth_bridge(*a, *b, arc.between(*a, *b)) { Ok(sp) => (vec![(roots_of(&circles, &[0, 1]), PathData::single(sp))], vec![]), - Err(e) => return Err(refusal(e, arc, *a, *b)), + Err(e) => return Err(refusal(e, arc, |largest| pt::smooth_bridge(*a, *b, largest.between(*a, *b)).is_ok())), }, _ => { let made = pt::bridge_many(&only, arc, reach).map_err(|e| match e { @@ -88,10 +88,9 @@ fn bridge(s: &mut Session, p: &Value) -> Result<Value> { pt::ManyError::TooManyBridges => bad(C, "that makes too many bridges (at most 8000): lower the reach"), pt::ManyError::NoneInReach => bad(C, "no two circles are within reach: raise the reach"), pt::ManyError::TooComplex => bad(C, "the bridged circles are too complex to unite"), - pt::ManyError::Pair(i, j, e) => match (only.get(i), only.get(j)) { - (Some(a), Some(b)) => refusal(e, arc, *a, *b), - _ => bad(C, "select two or more circles to bridge"), - }, + // Under the many-circle rules: a pair the largest radius or gap bridges on its own + // can still have a neck too thin to unite among the others. + pt::ManyError::Pair(_, _, e) => refusal(e, arc, |largest| pt::bridges_any(&only, largest, reach)), pt::ManyError::Bad => bad(C, "select two or more circles to bridge"), })?; let shapes = made.joined.into_iter().map(|j| (roots_of(&circles, &j.members), j.outline)).collect(); @@ -146,14 +145,14 @@ fn roots_of(circles: &[(NodeId, pt::Circle)], at: &[usize]) -> Vec<NodeId> { at.iter().filter_map(|&i| circles.get(i)).map(|(id, _)| *id).collect() } -/// The error for circles `a` and `b` that arcs of `arc` can't bridge. A larger radius or gap -/// bridges circles a smaller one cannot, so it suggests one only when the largest allowed would. -fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, a: pt::Circle, b: pt::Circle) -> EngineError { +/// The error for circles that arcs of `arc` can't bridge. A larger radius or gap bridges circles a +/// smaller one cannot, so it suggests one only when `bridges` says the largest allowed would. +fn refusal(e: pt::BridgeError, arc: pt::ArcRadius, bridges: impl FnOnce(pt::ArcRadius) -> bool) -> EngineError { let largest = match arc { pt::ArcRadius::Share(_) => pt::ArcRadius::Share(RADII.1 / 100.0), pt::ArcRadius::Gap(_) => pt::ArcRadius::Gap(GAPS.1), }; - let would = pt::smooth_bridge(a, b, largest.between(a, b)).is_ok(); + let would = e == pt::BridgeError::TooFar && bridges(largest); match (e, arc, would) { (pt::BridgeError::Inside, ..) => bad(C, "one circle is inside the other"), (pt::BridgeError::TooFar, pt::ArcRadius::Share(_), true) => bad(C, "the circles are too far apart for this radius: raise the radius"), diff --git a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs index 6c491904e6..745f216b68 100644 --- a/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs +++ b/crates/engine/src/cmd/addons/pathtools/bridge/tests.rs @@ -292,6 +292,23 @@ fn many_circle_and_gap_refusals() { assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step"); } +#[test] +fn a_larger_radius_is_suggested_only_when_it_bridges_among_the_other_circles() { + let mut s = session(); + // Centers 91.65 apart: the largest radius (1000%, 100 pt) bridges these two on their own, but + // with a neck about 0.0007 pt wide, too thin to unite among three or more circles. + let a = circle(&mut s, 20.0, 100.0, 10.0); + let b = circle(&mut s, 111.65, 100.0, 10.0); + let far = circle(&mut s, 380.0, 100.0, 10.0); + assert!(s.execute(BRIDGE, &json!({"ids": [a.0, b.0], "radius": 1000})).is_ok()); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(err(&mut s, json!({"ids": [a.0, b.0]})).ends_with("too far apart for this radius: raise the radius")); + for radius in [100, 1000] { + let e = err(&mut s, json!({"ids": [a.0, b.0, far.0], "radius": radius, "reach": 100})); + assert!(e.ends_with("the circles are too far apart for this radius"), "{e}"); + } +} + #[test] fn too_many_circles_or_bridges_are_refused() { let mut s = session(); diff --git a/crates/pathops/src/addons/pathtools.rs b/crates/pathops/src/addons/pathtools.rs index f937e61545..081924fac5 100644 --- a/crates/pathops/src/addons/pathtools.rs +++ b/crates/pathops/src/addons/pathtools.rs @@ -28,7 +28,7 @@ use kurbo::{CubicBez, ParamCurve, ParamCurveArclen, ParamCurveNearest, Point, Ve use vectorcraft_geom::{Anchor, AnchorKind, PathData, SubPath}; pub use bridge::{ - ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, circle_of, smooth_bridge, + ArcRadius, BridgeError, Bridged, Circle, Joined, MAX_BRIDGED_CIRCLES, MAX_BRIDGES, ManyError, bridge_many, bridges_any, circle_of, smooth_bridge, }; pub use crossings::{MAX_CROSSED_BY_SEGMENTS, MAX_CROSSING_SEGMENTS, Place, Work, crossings, crossings_on, crossings_on_within, insert_at}; pub use dashes::{DashSpec, Piece, divide_dashes}; diff --git a/crates/pathops/src/addons/pathtools/bridge.rs b/crates/pathops/src/addons/pathtools/bridge.rs index dd9bdba027..42a86dfb5d 100644 --- a/crates/pathops/src/addons/pathtools/bridge.rs +++ b/crates/pathops/src/addons/pathtools/bridge.rs @@ -232,38 +232,7 @@ pub enum ManyError { /// too far apart for the arcs gets no bridge; a circle bridged to no other is left alone. One /// circle inside another is an error, and so is no pair that the arcs can join. pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bridged, ManyError> { - if circles.len() > MAX_BRIDGED_CIRCLES { - return Err(ManyError::TooManyCircles); - } - let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; - if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { - return Err(ManyError::Bad); - } - let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; - // Each set of connected circles, under its lowest index, is united at a precision fine enough - // for its smallest circle. A neck narrower than twice that would not survive the union, so its - // pair gets no bridge; that can split a set and make its precision coarser, so the sets are - // found again until no neck is dropped. - let (roots, precision) = loop { - let mut parent: Vec<usize> = (0..circles.len()).collect(); - for &((i, j), _) in &pairs { - let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); - parent[ri.max(rj)] = ri.min(rj); - } - let roots: Vec<usize> = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); - let mut precision = vec![DEFAULT_PRECISION; circles.len()]; - for (&r, c) in roots.iter().zip(circles) { - precision[r] = precision[r].min(c.radius * 1e-3); - } - let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; - if !pairs.iter().any(thin) { - break (roots, precision); - } - for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { - too_far = Some(too_far.map_or(pair, |t| t.min(pair))); - } - pairs.retain(|p| !thin(p)); - }; + let (pairs, too_far, roots, precision) = bridgeable(circles, arc, reach)?; match (pairs.is_empty(), too_far) { (true, Some((i, j))) => return Err(ManyError::Pair(i, j, BridgeError::TooFar)), (true, None) => return Err(ManyError::NoneInReach), @@ -305,6 +274,55 @@ pub fn bridge_many(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bri Ok(out) } +/// Whether [`bridge_many`] would bridge at least one pair of `circles` with arcs of `arc` and +/// `reach`, under the same rules (a neck too thin for its shape's precision included), without +/// making the bridges or uniting them. +pub fn bridges_any(circles: &[Circle], arc: ArcRadius, reach: f64) -> bool { + bridgeable(circles, arc, reach).is_ok_and(|(pairs, ..)| !pairs.is_empty()) +} + +/// What [`bridgeable`] finds: the pairs [`bridge_many`] bridges with their necks' widths, the +/// lowest pair within reach that it can't bridge, each circle's set (its lowest index) and each +/// set's precision, under its lowest index. +type Bridgeable = (Vec<(Pair, f64)>, Option<Pair>, Vec<usize>, Vec<f64>); + +/// The pairs of `circles` that [`bridge_many`] bridges, and how it sorts them into sets. +fn bridgeable(circles: &[Circle], arc: ArcRadius, reach: f64) -> Result<Bridgeable, ManyError> { + if circles.len() > MAX_BRIDGED_CIRCLES { + return Err(ManyError::TooManyCircles); + } + let fine = |c: &Circle| c.center.x.is_finite() && c.center.y.is_finite() && c.radius.is_finite() && c.radius > 0.0; + if !(reach.is_finite() && reach >= 0.0) || !circles.iter().all(fine) { + return Err(ManyError::Bad); + } + let (mut pairs, mut too_far) = pairs_within(circles, reach, arc)?; + // Each set of connected circles, under its lowest index, is united at a precision fine enough + // for its smallest circle. A neck narrower than twice that would not survive the union, so its + // pair gets no bridge; that can split a set and make its precision coarser, so the sets are + // found again until no neck is dropped. + let (roots, precision) = loop { + let mut parent: Vec<usize> = (0..circles.len()).collect(); + for &((i, j), _) in &pairs { + let (ri, rj) = (root(&mut parent, i), root(&mut parent, j)); + parent[ri.max(rj)] = ri.min(rj); + } + let roots: Vec<usize> = (0..circles.len()).map(|i| root(&mut parent, i)).collect(); + let mut precision = vec![DEFAULT_PRECISION; circles.len()]; + for (&r, c) in roots.iter().zip(circles) { + precision[r] = precision[r].min(c.radius * 1e-3); + } + let thin = |&((i, _), waist): &(Pair, f64)| waist < 2.0 * precision[roots[i]]; + if !pairs.iter().any(thin) { + break (roots, precision); + } + for &(pair, _) in pairs.iter().filter(|&p| thin(p)) { + too_far = Some(too_far.map_or(pair, |t| t.min(pair))); + } + pairs.retain(|p| !thin(p)); + }; + Ok((pairs, too_far, roots, precision)) +} + /// Two circles' indices, the lower first. type Pair = (usize, usize); /// What [`pairs_within`] finds: the pairs the arcs can bridge, each with its neck's width, and the diff --git a/docs/mcp.md b/docs/mcp.md index 1005949aaa..4a74677326 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -12324,11 +12324,12 @@ Commands: With three or more circles, every two whose outlines are at most `reach` apart (0 to 10,000 pt, 10 by default; overlapping ones included) are bridged the same way, and the bridges that connect are united into one shape each, which can have holes where bridges enclose space; holes smaller than 1% of the smallest circle's area are filled. A - pair within reach but too far apart for the radius or gap gets no bridge. Each shape replaces its circles, painted as + pair within reach but too far apart for the radius or gap gets no bridge, and so does a pair whose neck would be + thinner than the precision its shape is united at. Each shape replaces its circles, painted as the topmost of them and in its place, or with `keepOriginals` goes directly above that circle. A circle bridged to no other stays as it is. The shapes and the circles left as they are are selected. It is an error when any pair within - reach has one circle inside the other, when no pair within reach can be bridged (with the same suggestion of a larger - radius or gap), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: + reach has one circle inside the other, when no pair within reach can be bridged (suggesting a larger radius or gap + only when the largest would bridge a pair of them under these rules), when no two circles are within reach, and above 2,000 circles or 8,000 bridges. → `{ids, alone}`: the shapes and the circles left as they are, with `id` as well for two circles. Smooth Bridge… opens a dialog (`ui.menuDialog {command}`, kind `smoothBridge`) with Constant Gap (a Gap field in place of the Radius field in percent), Reach (unavailable with two circles selected), Keep Originals and Preview. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index e7b74d89f5..9a39dd94e2 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -487,7 +487,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Set Corners… (also a button in the Anchor Inspector's Corners section: Radius in any unit, Corner kind, Anchors: All, Odd-Numbered or Even-Numbered, counted from each path's first anchor; Angle: from … to …°, only the corners whose sides meet at an angle in that range; Preview) cuts corners on the chosen anchors of every selected path, one undo step | done | #5546, #5545; `addon.pathtools.cornerSet` (`every`, `minAngle`, `maxAngle`), `crates/ui-egui/src/addons/pathtools/set_corners.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Trim at Crossings Tool (in the All Tools drawer under the add-on's heading, in neither toolbar as shipped, no shortcut) removes stretches of paths between the places where they are crossed, on any editable path, selected or not: a click removes the stretch under the pointer, a drag every stretch its rectangle touches, an Alt-drag every stretch its freehand line crosses; one undo step each; Escape during a drag removes nothing; hovering shows in red the stretch a click would remove, and a drag that reaches few paths shows what its release would remove | done | `addon.pathtools.trim` (in `crates/engine/src/cmd/addons/pathtools/trim.rs`), `crates/tools/src/addons/trim.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Expand Dashes into Paths turns each selected path's dashed stroke into separate open paths, one per dash, laid out as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off; one undo step | done | #4922; `addon.pathtools.expandDashes` (in `crates/engine/src/cmd/addons/pathtools.rs`, using the renderer's dash layout) and its tests; not a feature of the reference app, so it is not scored | -| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them; one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | +| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Smooth Bridge… (Radius as a percentage of the smaller circle's radius, or with Constant Gap that radius plus a gap; Reach; Keep Originals; Preview) joins two selected circles into one outline with two concave arcs that touch both circles, or three or more each to the others within reach, united where the bridges connect, in place of the circles or above them (a pair within reach gets no bridge when its arcs would not reach both circles or would cross, or when its neck would be thinner than the precision its shape is united at; a circle bridged to no other stays as it is); one undo step | done | `addon.pathtools.bridge`, `crates/pathops/src/addons/pathtools/bridge.rs`, `crates/ui-egui/src/addons/pathtools/bridge.rs` and their tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools › Tangent Circle… draws the circles that touch two selected paths or compound paths at a radius, or three of them, each touching the outlines without crossing them; Radius (two shapes), a Circle menu (All or one by number) and Preview; one undo step | done | `addon.pathtools.tangentCircle` (in `crates/engine/src/cmd/addons/pathtools/tangent_circle.rs`, geometry in `crates/pathops/src/addons/pathtools/tangent_circle.rs`) and its tests; a VectorCraft addition, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Effect › Path Effects lists its live effects (Dashes to Geometry, Add Anchors, Extend Path, Close Path, Smooth Anchors, Retract Handles, Reverse Direction, Simplify Anchors, Split at Anchors), each with the effect dialog's live Preview except Reverse Direction, which has no options, and listed in the Appearance panel like any effect | done | `addon.path.*`, `crates/effects/src/addons/path.rs`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored | | Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its four tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/shape.rs` and their tests; not a feature of the reference app, so it is not scored | From c6c6f7c90d576c8241040cbba3cc1fbad5263e7b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 22:59:31 -0800 Subject: [PATCH 055/247] Save: a background save shows in the progress window with Cancel and Continue in Background A save running in the background (Background Save) now shows in the progress window after 0.4 s, with the file name, a moving bar and how many more saves wait. Cancel (also Esc, file.cancelSave) stops the save before it replaces its file: the file stays as it was, and the document keeps its file and format and stays modified. Continue in Background (file.saveInBackground) leaves the save to the status bar. - The streamed native save stops writing into its temporary file once canceled, and the atomic writer checks once more after the temporary file is flushed, so a canceled write never replaces the file or enters the copy fallback. - A save of several files whose first file is in place writes the rest and is reported as saved. - Save and export jobs are told apart, so each window's Cancel acts only on its own jobs. --- crates/engine/src/cmd/fileio/access.rs | 20 ++++- crates/engine/src/cmd/fileio/save.rs | 50 ++++++++++-- crates/engine/src/cmd/fileio/tests.rs | 103 ++++++++++++++++++++++++ crates/format/src/atomic.rs | 50 +++++++++++- crates/mcp/src/ui_catalog.rs | 12 +++ crates/ui-egui/src/background.rs | 80 ++++++++++++++++-- crates/ui-egui/src/export_progress.rs | 74 +++++++++++++++-- crates/ui-egui/src/i18n/bg.tsv | 3 + crates/ui-egui/src/i18n/bs.tsv | 3 + crates/ui-egui/src/i18n/ca.tsv | 3 + crates/ui-egui/src/i18n/cs.tsv | 3 + crates/ui-egui/src/i18n/da.tsv | 3 + crates/ui-egui/src/i18n/de.tsv | 3 + crates/ui-egui/src/i18n/el.tsv | 3 + crates/ui-egui/src/i18n/es.tsv | 3 + crates/ui-egui/src/i18n/fi.tsv | 3 + crates/ui-egui/src/i18n/fr.tsv | 3 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 3 + crates/ui-egui/src/i18n/hu.tsv | 3 + crates/ui-egui/src/i18n/id.tsv | 3 + crates/ui-egui/src/i18n/it.tsv | 3 + crates/ui-egui/src/i18n/ja.tsv | 3 + crates/ui-egui/src/i18n/ka.tsv | 3 + crates/ui-egui/src/i18n/ko.tsv | 3 + crates/ui-egui/src/i18n/nl.tsv | 3 + crates/ui-egui/src/i18n/pl.tsv | 3 + crates/ui-egui/src/i18n/pt-br.tsv | 3 + crates/ui-egui/src/i18n/ru.tsv | 3 + crates/ui-egui/src/i18n/sv.tsv | 3 + crates/ui-egui/src/i18n/tr.tsv | 3 + crates/ui-egui/src/i18n/uk.tsv | 3 + crates/ui-egui/src/i18n/vi.tsv | 3 + crates/ui-egui/src/i18n/zh-hans.tsv | 3 + crates/ui-egui/src/i18n/zh-hant.tsv | 3 + crates/ui-egui/src/io.rs | 4 +- crates/ui-egui/src/io/save.rs | 63 +++++++++++---- crates/ui-egui/src/menus/run.rs | 2 + crates/ui-egui/src/menus/state.rs | 3 +- crates/ui-egui/src/menus/ui_commands.rs | 12 +++ crates/ui-egui/src/shortcut_editor.rs | 3 +- crates/ui-egui/src/tests/background.rs | 53 ++++++++++++ docs/gaps.md | 2 +- docs/mcp.md | 7 +- docs/target-app-parity.md | 1 + docs/ui-parity.md | 2 +- 46 files changed, 574 insertions(+), 49 deletions(-) diff --git a/crates/engine/src/cmd/fileio/access.rs b/crates/engine/src/cmd/fileio/access.rs index 9d2d9a4a33..f4cef9bec8 100644 --- a/crates/engine/src/cmd/fileio/access.rs +++ b/crates/engine/src/cmd/fileio/access.rs @@ -258,7 +258,17 @@ pub(crate) fn write_file(path: &str, bytes: &[u8]) -> Result<()> { vectorcraft_doc::cancel::check()?; may_write(path)?; // Never a half-written file: see [`write_atomic`]. - write_atomic(std::path::Path::new(path), bytes).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + write_atomic(std::path::Path::new(path), bytes).map_err(|e| write_error(path, e)) +} + +/// The error writing `path` failed with: [`EngineError::Cancelled`] for work canceled before the +/// file was put in place ([`vectorcraft_format::write_atomic_with`]), otherwise the path and the reason. +#[cfg(not(target_arch = "wasm32"))] +fn write_error(path: &str, error: std::io::Error) -> EngineError { + if error.get_ref().is_some_and(|e| e.is::<vectorcraft_doc::cancel::Cancelled>()) { + return EngineError::Cancelled; + } + EngineError::Other(format!("{path}: {error}")) } /// [`write_file`] with what `fill` writes into the file (a save streamed into it). @@ -266,7 +276,7 @@ pub(crate) fn write_file(path: &str, bytes: &[u8]) -> Result<()> { pub fn write_file_with(path: &str, fill: &mut dyn FnMut(&mut dyn std::io::Write) -> std::io::Result<()>) -> Result<()> { vectorcraft_doc::cancel::check()?; may_write(path)?; - vectorcraft_format::write_atomic_with(std::path::Path::new(path), |f| fill(f)).map_err(|e| EngineError::Other(format!("{path}: {e}"))) + vectorcraft_format::write_atomic_with(std::path::Path::new(path), |f| fill(f)).map_err(|e| write_error(path, e)) } /// The save commands' writer: preserves a filesystem location refusal as a typed error. Other @@ -285,8 +295,10 @@ pub fn write_save_file_with(path: &str, fill: &mut dyn FnMut(&mut dyn std::io::W #[cfg(not(target_arch = "wasm32"))] pub(super) fn save_write_error(path: &str, error: std::io::Error) -> EngineError { - let reason = format!("{path}: {error}"); - if vectorcraft_format::read_only_location(&error) { EngineError::ReadOnlyLocation(reason) } else { EngineError::Other(reason) } + if !vectorcraft_format::read_only_location(&error) { + return write_error(path, error); + } + EngineError::ReadOnlyLocation(format!("{path}: {error}")) } #[cfg(target_arch = "wasm32")] diff --git a/crates/engine/src/cmd/fileio/save.rs b/crates/engine/src/cmd/fileio/save.rs index 09b7924442..b603859ef1 100644 --- a/crates/engine/src/cmd/fileio/save.rs +++ b/crates/engine/src/cmd/fileio/save.rs @@ -629,6 +629,24 @@ impl<W: std::io::Write> std::io::Write for Counted<W> { } } +/// A writer that fails once the work running on this thread is canceled +/// ([`crate::cancel::is_cancelled`]), so a streamed save stops writing into its temporary file. +/// It sits under the stream's buffer: it is checked once per buffer written, not per write. +struct StopsWhenCancelled<W>(W); + +impl<W: std::io::Write> std::io::Write for StopsWhenCancelled<W> { + fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { + if crate::cancel::is_cancelled() { + return Err(std::io::Error::other(crate::cancel::Cancelled)); + } + self.0.write(buf) + } + + fn flush(&mut self) -> std::io::Result<()> { + self.0.flush() + } +} + /// The artboards a native or `.ai` save also writes to files of their own: with /// `separateArtboards`, those `range` names (default all). fn separate_boards(cmd: &str, f: &Format, doc: &Document, p: &Value) -> Result<Vec<usize>> { @@ -1022,10 +1040,15 @@ impl SaveJob { } /// [`SaveJob::write`], once `stop` has seen the paths of every file it writes to a path, in - /// order: when `stop` returns a value, nothing is written and that value is returned. + /// order: when `stop` returns a value, nothing is written and that value is returned. Work + /// canceled ([`crate::cancel`]) before the first file is written returns + /// [`crate::EngineError::Cancelled`] and writes nothing; once the first file is written, the + /// others are written too. pub fn write_unless(&self, stop: impl FnOnce(&[&str]) -> Option<Value>, mut write: impl FnMut(&str, &[u8]) -> Result<()>) -> Result<Value> { let (plan, doc) = (&self.plan, &*self.doc); + crate::cancel::check()?; let enc = self.encode()?; + crate::cancel::check()?; let extra = json!({ "format": plan.format.id, "warnings": enc.notes() }); let Some(path) = &plan.path else { let mut out = write_encoded(None, &plan.name, doc, &enc, extra)?; @@ -1042,8 +1065,13 @@ impl SaveJob { if let Some(stopped) = stop(&files.iter().map(|(p, _)| p.as_str()).collect::<Vec<_>>()) { return Ok(stopped); } - for (p, bytes) in &files { - write(p, bytes)?; + for (i, (p, bytes)) in files.iter().enumerate() { + if i == 0 { + write(p, bytes)?; + } else { + // Once a file is in place, a Cancel no longer stops the save: the set is written whole. + crate::cancel::scope(&crate::cancel::CancelToken::new(), None, || write(p, bytes))?; + } } let bytes = files.first().map_or(0, |f| f.1.len()); let mut out = super::merge(json!({ "path": path, "bytes": bytes }), extra); @@ -1066,11 +1094,15 @@ impl SaveJob { /// [`SaveJob::write`] through `stream`, which writes the file at a path with what the filler /// it is given writes (atomically, as [`vectorcraft_format::write_atomic_with`]). A native /// file goes into it as it is encoded ([`SaveJob::streams`]), never held whole in memory; - /// other files are encoded first, then written into it. + /// other files are encoded first, then written into it. Work canceled ([`crate::cancel`]) + /// while the native file is encoded, or before its filler returns, returns + /// [`crate::EngineError::Cancelled`]: the filler fails, so `stream` keeps the file as it was + /// (the atomic writer checks once more before it puts the file in place). pub fn write_streamed(&self, stream: StreamWrite) -> Result<Value> { let (Some(path), true) = (&self.plan.path, self.streams()) else { return self.write(|p, b| stream(p, &mut |w| w.write_all(b))); }; + crate::cancel::check()?; let (cmd, f) = (self.plan.mode.command(), self.plan.format); let doc = self.doc.without_edit_modes(); let doc = match f.id { @@ -1087,16 +1119,22 @@ impl SaveJob { let mut failed = None; let mut written = 0u64; let mut fill = |w: &mut dyn std::io::Write| { - let mut out = Counted { inner: std::io::BufWriter::with_capacity(STREAM_BUFFER, w), n: 0 }; + let mut out = Counted { inner: std::io::BufWriter::with_capacity(STREAM_BUFFER, StopsWhenCancelled(w)), n: 0 }; let r = super::native::encode_to(cmd, f, &doc, &self.params, &mut out); written = out.n; - match r { + let r = match r { Ok(()) => out.inner.flush(), Err(e) => { failed = Some(e); Err(std::io::Error::other("the file couldn't be encoded")) } + }; + // The last check before the file is replaced: a canceled save leaves it as it was. + if crate::cancel::is_cancelled() { + failed = Some(crate::EngineError::Cancelled); + return Err(std::io::Error::other(crate::cancel::Cancelled)); } + r }; let r = stream(path, &mut fill); r.map_err(|e| failed.take().unwrap_or(e))?; diff --git a/crates/engine/src/cmd/fileio/tests.rs b/crates/engine/src/cmd/fileio/tests.rs index bbf6883834..40a0159303 100644 --- a/crates/engine/src/cmd/fileio/tests.rs +++ b/crates/engine/src/cmd/fileio/tests.rs @@ -922,6 +922,109 @@ fn a_save_that_fails_while_streaming_leaves_the_file_as_it_was() { let _ = std::fs::remove_dir_all(&d); } +/// A save canceled (Background Save's Cancel) before it starts, while a native file streams into +/// its temporary file, or after the last byte went into it, fails with `Cancelled` and leaves the +/// file as it was, with no temporary file behind. A file encoded first is never written. +#[test] +fn a_canceled_save_leaves_the_file_as_it_was() { + /// Passes every write on, and cancels the save after the first one. + struct CancelAfterFirst<'a> { + inner: &'a mut dyn std::io::Write, + token: crate::cancel::CancelToken, + } + impl std::io::Write for CancelAfterFirst<'_> { + fn write(&mut self, b: &[u8]) -> std::io::Result<usize> { + let n = self.inner.write(b)?; + self.token.cancel(); + Ok(n) + } + fn flush(&mut self) -> std::io::Result<()> { + self.inner.flush() + } + } + let d = tmp_dir("stream-cancel"); + // A small document's file goes in one piece; a large one's in several. + for count in [1, 1500] { + let mut s = session(2000.0, 2000.0, 1); + for i in 0..count { + s.execute("shape.rectangle", &json!({"x": i % 100 * 20, "y": i / 100 * 20, "width": 10, "height": 10})).unwrap(); + } + let path = d.join("a.vectorcraft").to_string_lossy().to_string(); + s.execute("file.saveCopy", &json!({"path": path})).unwrap(); + let before = std::fs::read(&path).unwrap(); + s.execute("shape.ellipse", &json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": path})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + assert!(job.streams()); + let token = crate::cancel::CancelToken::new(); + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |p, fill| super::write_file_with(p, &mut |w| fill(&mut CancelAfterFirst { inner: w, token: token.clone() }))) + }); + assert!(matches!(r, Err(EngineError::Cancelled)), "{count}: {r:?}"); + assert_eq!(std::fs::read(&path).unwrap(), before, "{count} objects"); + assert_eq!(std::fs::read_dir(&d).unwrap().count(), 1, "no temporary file is left"); + // Canceled before it starts: the file isn't opened. + let mut opened = false; + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |_, _| { + opened = true; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)) && !opened, "{r:?}"); + } + // A file encoded first (SVG): nothing reaches the writer. + let mut s = session(200.0, 100.0, 1); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 50, "height": 20})).unwrap(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": d.join("a.svg").to_string_lossy()})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + let token = crate::cancel::CancelToken::new(); + token.cancel(); + let mut writes = 0; + let r = crate::cancel::scope(&token, None, || { + job.write_streamed(&mut |_, _| { + writes += 1; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)), "{r:?}"); + let r = crate::cancel::scope(&token, None, || { + job.write(|_, _| { + writes += 1; + Ok(()) + }) + }); + assert!(matches!(r, Err(EngineError::Cancelled)) && writes == 0, "{r:?}"); + assert!(!d.join("a.svg").exists()); + let _ = std::fs::remove_dir_all(&d); +} + +/// A save that writes several files (EPS with Use Artboards) and is canceled once its first file is +/// in place writes the others too and succeeds: the set is never left half written. +#[test] +fn a_save_canceled_after_its_first_file_writes_them_all() { + let d = tmp_dir("cancel-files"); + let mut s = session(100.0, 100.0, 2); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 30})).unwrap(); + let path = d.join("logo.eps").to_string_lossy().to_string(); + let plan = save_plan(&s, SaveMode::Copy, &json!({"path": path, "options": {"useArtboards": true}})).unwrap(); + let job = save_job(&mut s, plan).unwrap(); + let token = crate::cancel::CancelToken::new(); + let mut written = vec![]; + let r = crate::cancel::scope(&token, None, || { + job.write(|p, b| { + super::write_save_file(p, b)?; + written.push(p.to_string()); + token.cancel(); + Ok(()) + }) + }); + assert!(r.is_ok(), "{r:?}"); + assert_eq!(written.len(), 3, "{written:?}"); + assert!(written.iter().all(|p| std::path::Path::new(p).is_file()), "{written:?}"); + let _ = std::fs::remove_dir_all(&d); +} + /// A save that fails leaves File Info's dates and the saved state alone; one that works stamps them. #[test] fn a_failed_save_does_not_stamp_the_documents_dates() { diff --git a/crates/format/src/atomic.rs b/crates/format/src/atomic.rs index 8e7149cad2..e8f3c42b8e 100644 --- a/crates/format/src/atomic.rs +++ b/crates/format/src/atomic.rs @@ -9,6 +9,10 @@ //! are on disk, and the error names them. Where that copy of the old file can't be made, the file //! is left as it was and the save fails. //! +//! Work canceled ([`vectorcraft_doc::cancel`]) by the time the temporary file is written and flushed +//! puts nothing in place: the temporary file is removed, the file stays as it was (or absent), and +//! the error wraps [`vectorcraft_doc::cancel::Cancelled`]. +//! //! On macOS `File::sync_all` is a full flush (`F_FULLFSYNC`), which SMB shares refuse with //! `ENOTSUP` and virtiofs shares (folders shared into a macOS VM) with `ENOTTY`, while a plain //! `fsync` works: [`sync_file`] falls back to the plain one there (#1620). @@ -43,7 +47,8 @@ pub fn write_atomic(path: &Path, bytes: &[u8]) -> io::Result<()> { } /// Write `path` atomically with `fill`, which writes the content into the temporary file. When -/// `fill` or flushing fails the temporary file is removed and `path` is left untouched. When the +/// `fill` or flushing fails, or the work was canceled meanwhile ([`vectorcraft_doc::cancel`]), the +/// temporary file is removed and `path` is left untouched. When the /// folder refuses the temporary file or the rename, the content is copied into `path` instead (see /// the module docs). pub fn write_atomic_with(path: &Path, fill: impl FnOnce(&mut File) -> io::Result<()>) -> io::Result<()> { @@ -79,7 +84,7 @@ fn write_atomic_stepping( (tmp, f, Some(e)) } }; - let filled = fill(&mut f).and_then(|()| sync_file(&f)); + let filled = fill(&mut f).and_then(|()| sync_file(&f)).and_then(|()| not_cancelled()); drop(f); if let Err(e) = filled { // Best effort: the temporary file is all there is to clean up. @@ -176,7 +181,7 @@ fn write_new_linking( ) -> io::Result<()> { let tmp = temp_path(path)?; let mut f = OpenOptions::new().write(true).create_new(true).open(&tmp)?; - let filled = fill(&mut f).and_then(|()| sync_file(&f)); + let filled = fill(&mut f).and_then(|()| sync_file(&f)).and_then(|()| not_cancelled()); drop(f); let placed = filled.and_then(|()| match link(&tmp, path) { Err(e) if e.kind() != io::ErrorKind::AlreadyExists => copy_new(&tmp, path), @@ -187,6 +192,12 @@ fn write_new_linking( placed } +/// `Err` wrapping [`vectorcraft_doc::cancel::Cancelled`] when the work running on this thread has +/// been canceled: the last check before a written temporary file is put in place. +fn not_cancelled() -> io::Result<()> { + vectorcraft_doc::cancel::check().map_err(io::Error::other) +} + /// Create `path` (never replacing anything) with the content of the file `from`; a failed copy /// removes it again. fn copy_new(from: &Path, path: &Path) -> io::Result<()> { @@ -408,6 +419,39 @@ mod tests { let _ = std::fs::remove_dir_all(&d); } + /// Work canceled by the time the temporary file is written and flushed puts nothing in place: + /// the old file stays as it was, also where the folder refuses the rename (no copy over it), a + /// new file is not created, and no temporary file is left. + #[test] + fn canceled_work_puts_nothing_in_place() { + use vectorcraft_doc::cancel::{CancelToken, Cancelled, scope}; + fn cancelled(e: &io::Error) -> bool { + e.get_ref().is_some_and(|e| e.is::<Cancelled>()) + } + let d = dir("cancel"); + let path = d.join("doc.vectorcraft"); + std::fs::write(&path, b"original").unwrap(); + let token = CancelToken::new(); + let r = scope(&token, None, || { + write_atomic_with(&path, |f| { + f.write_all(b"new")?; + token.cancel(); + Ok(()) + }) + }); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + let refused = |_: &Path, _: &Path| -> io::Result<()> { Err(io::Error::from(io::ErrorKind::PermissionDenied)) }; + let r = scope(&token, None, || write_atomic_stepping(&path, |f| f.write_all(b"new"), create_new, refused)); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + assert_eq!(std::fs::read(&path).unwrap(), b"original"); + let new = d.join("new.vectorcraft"); + let r = scope(&token, None, || write_new_with(&new, |f| f.write_all(b"new"))); + assert!(r.as_ref().is_err_and(cancelled), "{r:?}"); + assert!(!new.exists()); + assert!(leftovers(&d, "doc.vectorcraft").is_empty(), "{:?}", leftovers(&d, "doc.vectorcraft")); + let _ = std::fs::remove_dir_all(&d); + } + #[test] fn the_original_file_survives_a_failed_write() { let d = dir("fail"); diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 0e3d6df203..aa0493f1ba 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1455,6 +1455,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} close the export progress dialog; the exports go on, shown in the status bar → {hidden: n}", ), + ( + "file.cancelSave", + "Cancel Save", + "", + "{} stop every save running in the background (Background Save) before it replaces its file: the file stays as it was and the document keeps its file and stays modified; a save whose file was already being replaced finishes and is reported as saved → {cancelled: n}", + ), + ( + "file.saveInBackground", + "Continue in Background", + "", + "{} close the save progress window; the saves go on, shown in the status bar → {hidden: n}", + ), ( "file.cancelOpen", "Cancel Opening", diff --git a/crates/ui-egui/src/background.rs b/crates/ui-egui/src/background.rs index b0bdcc6287..34e1071813 100644 --- a/crates/ui-egui/src/background.rs +++ b/crates/ui-egui/src/background.rs @@ -1,7 +1,9 @@ //! Background Save and Background Export (Preferences → File Handling): a save or an export encodes //! and writes a snapshot of the document on a worker thread while editing goes on. The status bar //! shows what is in progress; the result is applied on the UI thread when it arrives (a save marks -//! the document saved as of its snapshot, so edits made meanwhile keep it modified). +//! the document saved as of its snapshot, so edits made meanwhile keep it modified). Exports and +//! saves show in the progress window ([`crate::export_progress`]) with Cancel and Continue in +//! Background. //! //! It needs a thread-safe writer from the host ([`crate::Services::write_shared`], desktop); //! without one (the web, which downloads) the work runs at once, as with the preference off. @@ -44,15 +46,27 @@ struct Task { scope: ScopeHandle, } +/// What a job that shows in the progress window does: its Cancel and Continue in Background act on +/// the jobs of its kind. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Kind { + /// An export (Background Export): `file.cancelExport`, `file.exportInBackground`. + Export, + /// A save (Background Save): `file.cancelSave`, `file.saveInBackground`. + Save, +} + /// A job in progress. pub struct Job { id: u64, + /// What the job does, for the progress window and its commands. + pub kind: Kind, /// What the status bar and `ui.inspect` show ("Saving Poster.vectorcraft"); empty for work they /// don't show. pub label: String, /// The document the job reads (`DocState::uid`), if any. pub doc: Option<u64>, - /// How far an export has got, and its Cancel ([`crate::export_progress`] shows it). + /// How far an export or a save has got, and its Cancel ([`crate::export_progress`] shows it). pub progress: Option<Arc<Progress>>, /// Continue in Background: the progress dialog no longer shows this job. pub hidden: bool, @@ -119,18 +133,41 @@ impl Background { /// Cancel every export in progress → how many there were. pub fn cancel_exports(&mut self) -> usize { + self.cancel(Kind::Export) + } + + /// Hide the exports in progress from the progress dialog (they go on) → how many there were. + pub fn hide_exports(&mut self) -> usize { + self.hide(Kind::Export) + } + + /// Cancel every save in progress that the progress window can show → how many there were. + pub fn cancel_saves(&mut self) -> usize { + self.cancel(Kind::Save) + } + + /// Hide the saves in progress from the progress window (they go on) → how many there were. + pub fn hide_saves(&mut self) -> usize { + self.hide(Kind::Save) + } + + /// Is a job of `kind` in progress that can still be canceled? + pub fn running(&self, kind: Kind) -> bool { + self.jobs.iter().any(|j| j.kind == kind && j.progress.is_some() && !j.cancelled()) + } + + fn cancel(&mut self, kind: Kind) -> usize { let mut n = 0; - for p in self.jobs.iter().filter(|j| !j.cancelled()).filter_map(|j| j.progress.as_ref()) { + for p in self.jobs.iter().filter(|j| j.kind == kind && !j.cancelled()).filter_map(|j| j.progress.as_ref()) { p.cancel(); n += 1; } n } - /// Hide the exports in progress from the progress dialog (they go on) → how many there were. - pub fn hide_exports(&mut self) -> usize { + fn hide(&mut self, kind: Kind) -> usize { let mut n = 0; - for j in self.jobs.iter_mut().filter(|j| j.progress.is_some() && !j.hidden && !j.cancelled()) { + for j in self.jobs.iter_mut().filter(|j| j.kind == kind && j.progress.is_some() && !j.hidden && !j.cancelled()) { j.hidden = true; n += 1; } @@ -163,6 +200,34 @@ pub fn run_with_progress( progress: Option<Arc<Progress>>, work: impl FnOnce(Writer) -> Result<Value, String> + Send + 'static, then: impl FnOnce(&mut VectorcraftApp, Result<Value, String>) -> Result<Value, String> + 'static, +) -> Result<Value, String> { + start(app, enabled, label, doc, progress, Kind::Export, work, then) +} + +/// [`run_with_progress`] for a save of document `doc`: the progress window shows it as a save, and +/// its Cancel is `file.cancelSave`. +pub fn run_saving( + app: &mut VectorcraftApp, + enabled: bool, + label: String, + doc: u64, + progress: Arc<Progress>, + work: impl FnOnce(Writer) -> Result<Value, String> + Send + 'static, + then: impl FnOnce(&mut VectorcraftApp, Result<Value, String>) -> Result<Value, String> + 'static, +) -> Result<Value, String> { + start(app, enabled, label, Some(doc), Some(progress), Kind::Save, work, then) +} + +#[allow(clippy::too_many_arguments)] +fn start( + app: &mut VectorcraftApp, + enabled: bool, + label: String, + doc: Option<u64>, + progress: Option<Arc<Progress>>, + kind: Kind, + work: impl FnOnce(Writer) -> Result<Value, String> + Send + 'static, + then: impl FnOnce(&mut VectorcraftApp, Result<Value, String>) -> Result<Value, String> + 'static, ) -> Result<Value, String> { let mut work: Work = Box::new(work); let shared = app.services.write_shared.clone().filter(|_| enabled && !app.background.foreground && app.services.download.is_none()); @@ -174,7 +239,8 @@ pub fn run_with_progress( let (sets, status) = (app.ui.status_sets, if label.is_empty() { String::new() } else { format!("{label}…") }); let bg = &mut app.background; bg.next_id += 1; - bg.jobs.push(Job { id, label: label.clone(), doc, progress, hidden: false, sets, line: status.clone(), then: Box::new(then) }); + let line = status.clone(); + bg.jobs.push(Job { id, kind, label: label.clone(), doc, progress, hidden: false, sets, line, then: Box::new(then) }); if label.is_empty() { return Ok(json!({ "background": true })); } diff --git a/crates/ui-egui/src/export_progress.rs b/crates/ui-egui/src/export_progress.rs index 3d392c3a35..ebde2f8be2 100644 --- a/crates/ui-egui/src/export_progress.rs +++ b/crates/ui-egui/src/export_progress.rs @@ -7,11 +7,17 @@ //! Cancel), Continue in Background (`file.exportInBackground`) closes the //! dialog and leaves the export to the status bar. //! +//! A save running in the background (Background Save) shows in the same window, with a moving bar +//! (a save counts no steps) and how many more saves wait: Cancel (`file.cancelSave`, also Esc) +//! stops it before it replaces its file, and Continue in Background (`file.saveInBackground`) +//! leaves it to the status bar. +//! //! It opens after [`DELAY`] so a quick export doesn't flash it, and waits while another dialog is //! open (the overwrite question, an options dialog): never two modals at once. use serde_json::json; +use crate::background::Kind; use crate::dialogs::modal; use crate::theme::Tokens; use crate::{VectorcraftApp, widgets}; @@ -24,11 +30,12 @@ fn seen_id() -> egui::Id { egui::Id::unique("export-progress-seen") } -/// What the dialog shows: (label, steps done, steps in all, share done, exports after this one, -/// what the steps are). +/// What the dialog shows: (label, steps done, steps in all, share done, jobs of its kind after this +/// one, what the steps are). fn shown(app: &VectorcraftApp, now: f64, ctx: &egui::Context) -> Option<(String, u64, u64, f32, usize, Steps)> { let jobs: Vec<_> = app.background.jobs.iter().filter(|j| !j.hidden && !j.cancelled()).filter(|j| j.progress.is_some()).collect(); let first = jobs.first()?; + let more = jobs.iter().filter(|j| j.kind == first.kind).count() - 1; let since = ctx.data_mut(|m| { let seen = m.get_temp_mut_or_insert_with(seen_id(), || (first.id(), now)); if seen.0 != first.id() { @@ -42,11 +49,12 @@ fn shown(app: &VectorcraftApp, now: f64, ctx: &egui::Context) -> Option<(String, let (done, total) = first.progress.as_ref().map(|p| p.counts()).unwrap_or_default(); let frac = first.progress.as_ref().and_then(|p| p.fraction()).unwrap_or(0.0) as f32; let steps = match &first.progress { + _ if first.kind == Kind::Save => Steps::Save, Some(p) if p.counts_share() => Steps::Share, Some(p) if p.counts_files() => Steps::Files, _ => Steps::Artboards, }; - Some((first.label.clone(), done, total, frac, jobs.len() - 1, steps)) + Some((first.label.clone(), done, total, frac, more, steps)) } /// What an export's steps are. @@ -57,6 +65,8 @@ enum Steps { Files, /// An exporter plug-in's own steps, shown as a share of the work. Share, + /// A save, which counts no steps: a moving bar. + Save, } /// Draws the window for the first export running in the background that wasn't hidden or @@ -71,6 +81,15 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let t = Tokens::get(ctx); let heading = format!("{}…", crate::i18n::msg(&label)); let pressed = window(ctx, "export-progress", &heading, |ui| { + if steps == Steps::Save { + indeterminate(ui, tl!("Encoding and writing the file…")); + if more > 0 { + ui.add_space(6.0); + let queued = crate::i18n::tn(more as u64, "{n} more save waiting", "{n} more saves waiting"); + ui.label(egui::RichText::new(queued).size(11.5).color(t.text_dim)); + } + return; + } // One step says nothing a spinner doesn't: the bar would sit at 0 % until the file is written. if steps == Steps::Share && total > 0 { share(ui, tl!("Encoding and writing the file…"), frac); @@ -95,10 +114,12 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { ui.label(egui::RichText::new(queued).size(11.5).color(t.text_dim)); } }); - let id = match pressed { - Some(Pressed::Cancel) => "file.cancelExport", - Some(Pressed::Hide) => "file.exportInBackground", - None => return, + let id = match (pressed, steps == Steps::Save) { + (Some(Pressed::Cancel), false) => "file.cancelExport", + (Some(Pressed::Hide), false) => "file.exportInBackground", + (Some(Pressed::Cancel), true) => "file.cancelSave", + (Some(Pressed::Hide), true) => "file.saveInBackground", + (None, _) => return, }; if let Err(e) = app.run(id, json!({})) { app.status(e); @@ -298,6 +319,45 @@ mod tests { assert!(app.background.jobs.is_empty()); } + /// A Background Save shows in the window after the delay, with a moving bar and how many more + /// saves wait, never over another dialog; Continue in Background hides it and the saves go on. + /// With Background Save off the save is written at once and no window shows. + #[test] + fn a_background_save_shows_in_the_window_and_continue_hides_it() { + let go = Arc::new(std::sync::atomic::AtomicBool::new(false)); + let mut app = app(go.clone()); + for name in ["a", "b"] { + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let r = app.run("file.save", json!({"path": format!("/docs/{name}.vectorcraft")})).unwrap(); + assert_eq!(r["background"], true, "{r}"); + } + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + assert!(!frame(&mut app, &ctx, 0.0).contains("Saving a.vectorcraft"), "not before the delay"); + // Another dialog is open: the window waits. + app.ui.dialog = Some(crate::state::Dialog::new("about", json!({}))); + frame(&mut app, &ctx, 1.0); + assert!(!frame(&mut app, &ctx, 1.1).contains("Saving a.vectorcraft"), "never over another dialog"); + app.ui.dialog = None; + frame(&mut app, &ctx, 1.2); + let shown = frame(&mut app, &ctx, 1.3); + assert!(shown.contains("Saving a.vectorcraft…") && shown.contains("1 more save waiting"), "{shown}"); + assert!(shown.contains("Cancel") && shown.contains("Continue in Background") && !shown.contains("export"), "{shown}"); + assert_eq!(app.run("file.saveInBackground", json!({})).unwrap()["hidden"], 2); + assert!(!frame(&mut app, &ctx, 2.0).contains("Saving"), "hidden saves aren't shown"); + assert!(crate::menus::enabled(&app, "file.cancelSave"), "they can still be canceled"); + go.store(true, std::sync::atomic::Ordering::SeqCst); + background::wait_all(&mut app); + assert!(app.background.jobs.is_empty()); + assert_eq!(app.session.active().unwrap().path.as_deref(), Some("/docs/b.vectorcraft")); + app.session.execute("prefs.set", &json!({"values": {"backgroundSave": false}})).unwrap(); + app.services.write = Some(Box::new(|_: &str, _: &[u8]| Ok(()))); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let r = app.run("file.save", json!({"path": "/docs/c.vectorcraft"})); + assert!(r.as_ref().is_ok_and(|r| r.get("background").is_none()), "{r:?}"); + assert!(app.background.jobs.is_empty() && !frame(&mut app, &ctx, 3.0).contains("Saving")); + } + #[test] fn an_export_of_files_counts_files() { let go = Arc::new(std::sync::atomic::AtomicBool::new(false)); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 71e443a399..65501cb6cc 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6063,6 +6063,9 @@ theme Appearance Външен вид Continue in Background Продължаване във фонов режим Cancel Export Отказ от експортирането @msg Export cancelled Експортирането е отказано + Cancel Save Отказ от записването +@plural {n} more save waiting|{n} more saves waiting Още {n} записване в изчакване|Още {n} записвания в изчакване +@msg Save canceled Записването е отказано # Paragraph panel menu › Justification… Desired Желано Word Spacing: Разстояние между думите: diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 883d6dd387..10931ec65c 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6084,6 +6084,9 @@ mark-style Japanese Japanski Continue in Background Nastavi u pozadini Cancel Export Otkaži izvoz @msg Export cancelled Izvoz otkazan + Cancel Save Otkaži čuvanje +@plural {n} more save waiting|{n} more saves waiting Čeka još {n} čuvanje|Čekaju još {n} čuvanja|Čeka još {n} čuvanja +@msg Save canceled Čuvanje otkazano Desired Željeno Word Spacing: Razmak riječi: Letter Spacing: Razmak slova: diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a8a63cbf55..6c0cad2469 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -5887,6 +5887,9 @@ liquify-list-end {0}, {1} {0} i {1} @msg Expand: no gradient fills Expandeix: no hi ha farciments de degradat @msg Expand: nothing to expand Expandeix: no hi ha res per expandir @msg Export cancelled Exportació cancel·lada + Cancel Save Cancel·la el desament +@plural {n} more save waiting|{n} more saves waiting {n} desament més en espera|{n} desaments més en espera +@msg Save canceled Desament cancel·lat @msg Exported {path} S’ha exportat {path} @msg Exported {what} S’ha exportat {what} @msg Exporting {_1} S’està exportant {_1} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 569b1347ec..3d485958c9 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -6512,6 +6512,9 @@ mark-style Japanese Japonské Continue in Background Pokračovat na pozadí Cancel Export Zrušit export @msg Export cancelled Export byl zrušen + Cancel Save Zrušit ukládání +@plural {n} more save waiting|{n} more saves waiting Čeká ještě {n} uložení|Čekají ještě {n} uložení|Čeká ještě {n} uložení +@msg Save canceled Ukládání bylo zrušeno # Paragraph panel menu › Justification… Desired Požadované Word Spacing: Mezery mezi slovy: diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4578e4efc1..304fb63c29 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -8793,6 +8793,9 @@ swatch Bright Violet Kraftig violet Continue in Background Fortsæt i baggrunden Cancel Export Annullér eksport @msg Export cancelled Eksport annulleret + Cancel Save Annullér gemning +@plural {n} more save waiting|{n} more saves waiting {n} gemning mere venter|{n} gemninger mere venter +@msg Save canceled Gemning annulleret # Paragraph panel menu › Justification… Desired Ønsket Word Spacing: Ordafstand: diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index c943c89dd2..fd47295aad 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6094,6 +6094,9 @@ effect Soft Weich Continue in Background Im Hintergrund fortsetzen Cancel Export Export abbrechen @msg Export cancelled Export abgebrochen + Cancel Save Speichern abbrechen +@plural {n} more save waiting|{n} more saves waiting {n} weiterer Speichervorgang wartet|{n} weitere Speichervorgänge warten +@msg Save canceled Speichern abgebrochen # Paragraph panel menu › Justification… Desired Optimal Word Spacing: Wortabstand: diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 906640aa0a..b9c540f597 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -6492,6 +6492,9 @@ effect Points Σημεία Continue in Background Συνέχεια στο παρασκήνιο Cancel Export Ακύρωση εξαγωγής @msg Export cancelled Η εξαγωγή ακυρώθηκε + Cancel Save Ακύρωση αποθήκευσης +@plural {n} more save waiting|{n} more saves waiting {n} ακόμη αποθήκευση σε αναμονή|{n} ακόμη αποθηκεύσεις σε αναμονή +@msg Save canceled Η αποθήκευση ακυρώθηκε # Paragraph panel menu › Justification… Desired Επιθυμητό Word Spacing: Απόσταση λέξεων: diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9239c93a73..90e0ff2c62 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -6480,6 +6480,9 @@ mark-style Japanese Japonesas Continue in Background Continuar en segundo plano Cancel Export Cancelar exportación @msg Export cancelled Exportación cancelada + Cancel Save Cancelar guardado +@plural {n} more save waiting|{n} more saves waiting {n} guardado más en espera|{n} guardados más en espera +@msg Save canceled Guardado cancelado # Paragraph panel menu › Justification… Desired Deseado Word Spacing: Espaciado entre palabras: diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 423703e5c1..e553a223d0 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -6502,6 +6502,9 @@ mark-style Japanese Japanilainen Continue in Background Jatka taustalla Cancel Export Peruuta vienti @msg Export cancelled Vienti peruutettiin + Cancel Save Peruuta tallennus +@plural {n} more save waiting|{n} more saves waiting {n} tallennus odottaa|{n} tallennusta odottaa +@msg Save canceled Tallennus peruutettiin # Paragraph panel menu › Justification… Desired Haluttu Word Spacing: Sanaväli: diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8af602785b..33c646bb8b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -6507,6 +6507,9 @@ theme Appearance Apparence Continue in Background Continuer en arrière-plan Cancel Export Annuler l’exportation @msg Export cancelled Exportation annulée + Cancel Save Annuler l’enregistrement +@plural {n} more save waiting|{n} more saves waiting {n} autre enregistrement en attente|{n} autres enregistrements en attente +@msg Save canceled Enregistrement annulé # Paragraph panel menu › Justification… Desired Optimal Word Spacing: Espacement des mots : diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..b6bf3c68c8 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -487,6 +487,7 @@ Can't save “{name}”. “{name}” સાચવી શકાતી નથી. Cancel રદ કરો Cancel Export નિકાસ રદ કરો + Cancel Save સાચવવાનું રદ કરો Cancel Image Trace ઇમેજ ટ્રેસ રદ કરો Cancel Key Object કી ઑબ્જેક્ટ રદ કરો Cancel Opening ખોલવાનું રદ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index de33cdbd92..9e9c146bdb 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7085,6 +7085,9 @@ liquify-list-end {0}, {1} {0} और {1} @msg expected {{"objects": [...]}} अपेक्षित: {{"objects": [...]}} @msg export `{name}`: {e} निर्यात `{name}`: {e} @msg Export cancelled निर्यात रद्द + Cancel Save सेव रद्द करना +@plural {n} more save waiting|{n} more saves waiting {n} और सेव प्रतीक्षा में|{n} और सेव प्रतीक्षा में +@msg Save canceled सेव रद्द @msg Export for Screens writes png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai or vectorcraft स्क्रीन के लिए एक्सपोर्ट png, png8, jpg, webp, gif, tiff, bmp, tga, psd, svg, svgz, pdf, eps, ai या vectorcraft लिखता है @msg export presets file is larger than {MAX_PRESET_FILE_BYTES} bytes निर्यात प्रीसेट फ़ाइल {MAX_PRESET_FILE_BYTES} bytes से बड़ा है @msg Exported {path} {path} एक्सपोर्ट किया गया diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f869e7d07b..1150f91b88 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6496,6 +6496,9 @@ liquify-list-end {0}, {1} {0} és {1} Continue in Background Folytatás a háttérben Cancel Export Exportálás megszakítása @msg Export cancelled Az exportálás megszakítva + Cancel Save Mentés megszakítása +@plural {n} more save waiting|{n} more saves waiting Még {n} mentés várakozik +@msg Save canceled A mentés megszakítva # Paragraph panel menu › Justification… Desired Kívánt Word Spacing: Szóköz: diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c5f865e69b..7aebab75b7 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6062,6 +6062,9 @@ swatch Bright Violet Violet cerah Continue in Background Lanjutkan di latar belakang Cancel Export Batalkan ekspor @msg Export cancelled Ekspor dibatalkan + Cancel Save Batalkan penyimpanan +@plural {n} more save waiting|{n} more saves waiting {n} penyimpanan lagi menunggu +@msg Save canceled Penyimpanan dibatalkan # Paragraph panel menu › Justification… Desired Diinginkan Word Spacing: Spasi Kata: diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08cefdbed7..f4af60963b 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6130,6 +6130,9 @@ lighting Light Luce Continue in Background Continua in background Cancel Export Annulla esportazione @msg Export cancelled Esportazione annullata + Cancel Save Annulla salvataggio +@plural {n} more save waiting|{n} more saves waiting {n} altro salvataggio in attesa|{n} altri salvataggi in attesa +@msg Save canceled Salvataggio annullato # Paragraph panel menu › Justification… Desired Desiderato Word Spacing: Spaziatura parole: diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59c7628f40..2a6a61a252 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -6177,6 +6177,9 @@ lighting Light ライト Continue in Background バックグラウンドで続行 Cancel Export 書き出しをキャンセル @msg Export cancelled 書き出しをキャンセルしました + Cancel Save 保存をキャンセル +@plural {n} more save waiting|{n} more saves waiting 待機中の保存: あと {n} 件 +@msg Save canceled 保存をキャンセルしました # Paragraph panel menu › Justification… Desired 最適 Word Spacing: 単語間隔: diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 9393433cdb..e25c5778de 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -8497,6 +8497,9 @@ liquify-list-end {0}, {1} {0} და {1} Cancel Export ექსპორტირების გაუქმება @plural {n} more export waiting|{n} more exports waiting რიგში მომლოდინე სხვა ექსპორტირება: {n} @msg Export cancelled ექსპორტირება გაუქმდა + Cancel Save შენახვის გაუქმება +@plural {n} more save waiting|{n} more saves waiting რიგში მომლოდინე სხვა შენახვა: {n} +@msg Save canceled შენახვა გაუქმდა Clear History ისტორიის გასუფთავება New Document from State ახალი დოკუმენტი მდგომარეობიდან Continue in Background ფონურ რეჟიმში გაგრძელება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 49d5e10dc1..7a7c057b2e 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6094,6 +6094,9 @@ lighting Light 광원 Continue in Background 백그라운드에서 계속 Cancel Export 내보내기 취소 @msg Export cancelled 내보내기를 취소했습니다 + Cancel Save 저장 취소 +@plural {n} more save waiting|{n} more saves waiting 대기 중인 저장 {n}개 더 +@msg Save canceled 저장을 취소했습니다 # Paragraph panel menu › Justification… Desired 희망 Word Spacing: 단어 간격: diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f071ebd0e2..7b7bb07c33 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8618,6 +8618,9 @@ swatch Bright Violet Felviolet Continue in Background Doorgaan op achtergrond Cancel Export Export annuleren @msg Export cancelled Export geannuleerd + Cancel Save Opslaan annuleren +@plural {n} more save waiting|{n} more saves waiting Nog {n} opslagactie in de wachtrij|Nog {n} opslagacties in de wachtrij +@msg Save canceled Opslaan geannuleerd # Paragraph panel menu › Justification… Desired Gewenst Word Spacing: Woordafstand: diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2477c73abd..b77f23725c 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6366,6 +6366,9 @@ mark-style Japanese Japońskie Continue in Background Kontynuuj w tle Cancel Export Anuluj eksport @msg Export cancelled Eksport anulowany + Cancel Save Anuluj zapisywanie +@plural {n} more save waiting|{n} more saves waiting Czeka jeszcze {n} zapis|Czekają jeszcze {n} zapisy|Czeka jeszcze {n} zapisów +@msg Save canceled Zapisywanie anulowane # Paragraph panel menu › Justification… Desired Optymalne Word Spacing: Odstępy między wyrazami: diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 333351b9af..9eea52c773 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -6424,6 +6424,9 @@ mark-style Japanese Japonesas Continue in Background Continuar em Segundo Plano Cancel Export Cancelar Exportação @msg Export cancelled Exportação cancelada + Cancel Save Cancelar Salvamento +@plural {n} more save waiting|{n} more saves waiting Mais {n} salvamento aguardando|Mais {n} salvamentos aguardando +@msg Save canceled Salvamento cancelado # Paragraph panel menu › Justification… Desired Desejado Word Spacing: Espaçamento entre Palavras: diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ae33aa0d55..741bb5a641 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6130,6 +6130,9 @@ lighting Light Свет Continue in Background Продолжить в фоне Cancel Export Отменить экспорт @msg Export cancelled Экспорт отменён + Cancel Save Отменить сохранение +@plural {n} more save waiting|{n} more saves waiting Ещё {n} сохранение в очереди|Ещё {n} сохранения в очереди|Ещё {n} сохранений в очереди +@msg Save canceled Сохранение отменено # Paragraph panel menu › Justification… Desired Желательно Word Spacing: Интервал между словами: diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 1bd4fd0692..10c87e89d0 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -6552,6 +6552,9 @@ swatch Yellow Green Gulgrön Continue in Background Fortsätt i bakgrunden Cancel Export Avbryt export @msg Export cancelled Exporten avbröts + Cancel Save Avbryt sparande +@plural {n} more save waiting|{n} more saves waiting {n} sparande till väntar|{n} sparanden till väntar +@msg Save canceled Sparandet avbröts # Paragraph panel menu › Justification… Desired Önskat Word Spacing: Ordavstånd: diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a2a38c679a..e84fc15f2f 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6622,6 +6622,9 @@ theme Appearance Görünüm @msg Flat Logo traced the image at {_1} × {_2} pixels, averaged down from {_3} × {_4}. Düz Logo modu görüntüyü {_3} × {_4} boyutundan ortalama alarak küçültüp {_1} × {_2} pikselde izledi. @plural {n} more export waiting|{n} more exports waiting {n} dışa aktarma daha bekliyor|{n} dışa aktarma daha bekliyor @msg Export cancelled Dışa aktarma iptal edildi + Cancel Save Kaydetmeyi İptal Et +@plural {n} more save waiting|{n} more saves waiting {n} kaydetme daha bekliyor|{n} kaydetme daha bekliyor +@msg Save canceled Kaydetme iptal edildi Add filters from the list above Yukarıdaki listeden filtre ekleyin Add to Stack Yığına Ekle Applied Filters Uygulanan Filtreler diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 17c673885d..85e2fcc1a8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6112,6 +6112,9 @@ lighting Light Світло Continue in Background Продовжити у фоні Cancel Export Скасувати експорт @msg Export cancelled Експорт скасовано + Cancel Save Скасувати збереження +@plural {n} more save waiting|{n} more saves waiting Ще {n} збереження в очікуванні|Ще {n} збереження в очікуванні|Ще {n} збережень в очікуванні +@msg Save canceled Збереження скасовано # Paragraph panel menu › Justification… Desired Бажане Word Spacing: Інтервал між словами: diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index da89525314..7136d5cb96 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6141,6 +6141,9 @@ liquify-list-end {0}, {1} {0} và {1} Continue in Background Tiếp tục trong nền Cancel Export Hủy xuất @msg Export cancelled Đã hủy xuất + Cancel Save Hủy lưu +@plural {n} more save waiting|{n} more saves waiting Còn {n} lượt lưu đang chờ +@msg Save canceled Đã hủy lưu # Paragraph panel menu › Justification… Desired Mong muốn Word Spacing: Khoảng cách từ: diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5f612cb0d4..8af2fbeb47 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6348,6 +6348,9 @@ lighting Light 光源 Continue in Background 在后台继续 Cancel Export 取消导出 @msg Export cancelled 已取消导出 + Cancel Save 取消保存 +@plural {n} more save waiting|{n} more saves waiting 另有 {n} 个保存等待中 +@msg Save canceled 已取消保存 # Paragraph panel menu › Justification… Desired 所需 Word Spacing: 字间距: diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e0b5a13ee2..bf65eccdd4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6146,6 +6146,9 @@ lighting Light 光源 Continue in Background 在背景繼續 Cancel Export 取消匯出 @msg Export cancelled 已取消匯出 + Cancel Save 取消儲存 +@plural {n} more save waiting|{n} more saves waiting 另有 {n} 個儲存等待中 +@msg Save canceled 已取消儲存 # Paragraph panel menu › Justification… Desired 所需 Word Spacing: 字間距: diff --git a/crates/ui-egui/src/io.rs b/crates/ui-egui/src/io.rs index ea27320b52..462d903d55 100644 --- a/crates/ui-egui/src/io.rs +++ b/crates/ui-egui/src/io.rs @@ -35,7 +35,9 @@ pub use open::{ #[cfg(test)] pub(crate) use open::{open_file, opened_with_notes}; pub(crate) use save::save_current; -pub use save::{ask_format_options, ask_pdf_options, remember_active_artboard, remember_view, save, save_pdf}; +pub use save::{ + SAVE_CANCELED, ask_format_options, ask_pdf_options, cancel_saves, hide_saves, remember_active_artboard, remember_view, save, save_pdf, +}; pub(crate) use save::{export_path, is_web, notes_of, report_saved, show_with_notes, target_path, write_named, write_reporting, write_to}; #[cfg(test)] pub(crate) use save::{report_write_error, saved_status}; diff --git a/crates/ui-egui/src/io/save.rs b/crates/ui-egui/src/io/save.rs index e1f50fba45..47d83173af 100644 --- a/crates/ui-egui/src/io/save.rs +++ b/crates/ui-egui/src/io/save.rs @@ -1,10 +1,30 @@ use super::export::file_url; use super::open::{note_recent, open_options}; use super::{ - EngineError, FilePick, Format, SAVE_FORMATS, SaveMode, SavePlan, SavedView, Services, TEMPLATE_FORMATS, Value, VectorcraftApp, Writer, - background, dialogs, fileio, json, svg_options, + EngineError, FilePick, Format, Progress, SAVE_FORMATS, SaveMode, SavePlan, SavedView, Services, TEMPLATE_FORMATS, Value, VectorcraftApp, Writer, + background, dialogs, fileio, json, progress, svg_options, }; +/// The status once a save running in the background was canceled. +pub const SAVE_CANCELED: &str = "Save canceled"; + +/// File › Cancel Save (the progress window's Cancel): every save running in the background stops +/// before it replaces its file. The file stays as it was, and the document keeps its file, format +/// and modified state → `{cancelled: n}`. A save whose file was already written is reported as saved. +pub fn cancel_saves(app: &mut VectorcraftApp) -> Value { + let n = app.background.cancel_saves(); + if n > 0 { + app.status(SAVE_CANCELED); + } + json!({ "cancelled": n }) +} + +/// The progress window's Continue in Background for saves: they go on, shown in the status bar +/// only → `{hidden: n}`. +pub fn hide_saves(app: &mut VectorcraftApp) -> Value { + json!({ "hidden": app.background.hide_saves() }) +} + /// A save or an export that didn't write `path`: say so in a dialog that names the file and the /// reason and stays until it is closed, as an editor does (#1685). The status bar's line, which /// the caller's error becomes, is replaced by the next message, and a document that wasn't saved @@ -566,7 +586,10 @@ fn write_plan( let stream = app.services.stream_shared.clone().filter(|_| job.streams() && !is_web(app)); let (exists, allowed) = checks_replaced(app); let known: Vec<String> = allowed.iter().chain(app.picks.written_beside.get(&uid).into_iter().flatten()).cloned().collect(); - let work = move |write: Writer| { + // The progress window's Cancel: a save canceled before it replaces its file writes nothing. + let progress = Progress::new(); + let (reporting, asked) = (progress.clone(), progress.clone()); + let write_file = move |write: Writer| { let mut own_refused = false; let mut observed = |p: &str, r: vectorcraft_engine::Result<()>| { own_refused = own_path.as_deref() == Some(p) && matches!(&r, Err(EngineError::ReadOnlyLocation(_))); @@ -583,16 +606,21 @@ fn write_plan( (_, _, Some(stream)) => job.write_streamed(&mut |p, fill| stream(p, fill).map_err(EngineError::Other)), _ => job.write_unless(check, |p, b| write(p, b).map_err(EngineError::Other)), }; - r.map_err(|e| { - if let EngineError::ReadOnlyLocation(reason) = &e { - refused_by_work.store(own_refused, std::sync::atomic::Ordering::Relaxed); - if !by_control { - return reason.clone(); + match r { + // Nothing written: the file is as it was. + Err(EngineError::Cancelled) => Ok(json!({ "cancelled": true })), + r => r.map_err(|e| { + if let EngineError::ReadOnlyLocation(reason) = &e { + refused_by_work.store(own_refused, std::sync::atomic::Ordering::Relaxed); + if !by_control { + return reason.clone(); + } } - } - e.to_string() - }) + e.to_string() + }), + } }; + let work = move |write: Writer| progress::scope(&reporting, || write_file(write)); let failed = target.clone().unwrap_or_default(); // The status line before the save starts: on the worker, the save sets one line ("<label>…") // right after this; written right away, it sets none before `then` runs. @@ -611,6 +639,12 @@ fn write_plan( report_write_error(app, false, &failed, e); } })?; + // Canceled before the file was replaced: the document keeps its file, format and modified + // state. + if r.get("cancelled").and_then(Value::as_bool) == Some(true) { + app.status(SAVE_CANCELED); + return Ok(r); + } // Nothing written either: asked first. if let Some(files) = r.get("replaces").and_then(Value::as_array) { let files: Vec<String> = files.iter().filter_map(Value::as_str).map(str::to_string).collect(); @@ -626,13 +660,14 @@ fn write_plan( let beside: Vec<String> = beside.filter(|p| *p != path).map(str::to_string).collect(); app.picks.written_beside.insert(uid, beside); } - // A line set while the file was written (another command's, another job's) stays. - if background::status_unchanged(app, sets, &started_line) { + // A line set while the file was written (another command's, another job's) stays. A Cancel + // that came once the file was being replaced said it was canceled: the file is saved. + if background::status_unchanged(app, sets, &started_line) || asked.cancelled() { report_saved(app, &path, &r); } Ok(r) }; - let mut r = background::run(app, enabled, label, Some(uid), work, then)?; + let mut r = background::run_saving(app, enabled, label, uid, progress, work, then)?; if let Some(path) = target.filter(|_| r.get("path").is_none()) { r["path"] = json!(path); } diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 495e606d6c..9402c1a500 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -182,6 +182,8 @@ fn run_ui_part1(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result< "file.reveal" => io::reveal(app), "file.cancelExport" => Ok(io::cancel_exports(app)), "file.exportInBackground" => Ok(io::hide_exports(app)), + "file.cancelSave" => Ok(io::cancel_saves(app)), + "file.saveInBackground" => Ok(io::hide_saves(app)), "file.cancelOpen" => Ok(crate::opening::cancel_all(app)), "file.openInBackground" => Ok(crate::opening::hide_all(app)), id if id.starts_with("file.openRecent") => match recent_slot(app, id).filter(|path| recent_readable(path)).cloned() { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index d4dda4698b..7a65e5d3c4 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -226,7 +226,8 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { "type.applyBullets" | "type.applyNumbers" | "type.convertListToText" => crate::panels::character::text_style(app).is_some(), id if let Some(b) = crate::panels::align::button(id) => enabled(app, b.command_now(app)), "file.reveal" => app.services.reveal.is_some() && app.session.active().is_some_and(|d| d.path.is_some()), - "file.cancelExport" | "file.exportInBackground" => app.background.jobs.iter().any(|j| j.progress.is_some() && !j.cancelled()), + "file.cancelExport" | "file.exportInBackground" => app.background.running(crate::background::Kind::Export), + "file.cancelSave" | "file.saveInBackground" => app.background.running(crate::background::Kind::Save), "file.cancelOpen" => !app.opening.pending.is_empty(), "file.openInBackground" => crate::opening::any_shown(app), "plugin.cancelRuns" => crate::plugin_runs::any_running(app), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ced961e32c..bee4f88200 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1456,6 +1456,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} close the export progress dialog; the exports go on, shown in the status bar → {hidden: n}", ), + ( + "file.cancelSave", + "Cancel Save", + "", + "{} stop every save running in the background (Background Save) before it replaces its file: the file stays as it was and the document keeps its file and stays modified; a save whose file was already being replaced finishes and is reported as saved → {cancelled: n}", + ), + ( + "file.saveInBackground", + "Continue in Background", + "", + "{} close the save progress window; the saves go on, shown in the status bar → {hidden: n}", + ), ( "file.cancelOpen", "Cancel Opening", diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 348aed01fa..f3f291172e 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -3094,10 +3094,11 @@ mod tests { assert_eq!(shown("file.new"), Some(("File".into(), "New…".into(), true))); assert_eq!(shown("text.fitHeadline"), Some(("Type".into(), "Fit Headline".into(), false))); assert_eq!(shown("type.fitHeadline"), Some(("Type".into(), "Fit Headline".into(), true))); - for id in ["file.exportInBackground", "file.openInBackground"] { + for id in ["file.exportInBackground", "file.openInBackground", "file.saveInBackground"] { assert_eq!(shown(id), Some(("File".into(), "Continue in Background".into(), true)), "{id}"); } assert_eq!(shown("file.cancelExport"), Some(("File".into(), "Cancel Export".into(), false))); + assert_eq!(shown("file.cancelSave"), Some(("File".into(), "Cancel Save".into(), false))); let e = entry("type.fitHeadline").unwrap(); assert!(shown_name(&e).ends_with("Fit Headline (type.fitHeadline)"), "{}", shown_name(&e)); assert!(row_matches(&e, "type.fitheadline", None)); diff --git a/crates/ui-egui/src/tests/background.rs b/crates/ui-egui/src/tests/background.rs index 0bc4ae3b5e..3e7e610919 100644 --- a/crates/ui-egui/src/tests/background.rs +++ b/crates/ui-egui/src/tests/background.rs @@ -196,6 +196,59 @@ fn a_cancelled_export_writes_nothing() { assert_eq!(app.ui.status, io::EXPORT_CANCELLED); } +/// Background Save's Cancel (`file.cancelSave`): a save canceled before it replaces its file writes +/// nothing, and its document keeps its file, format and modified state, with no recent file noted +/// and no error shown. A save already writing its file when Cancel came finishes and counts as +/// saved. An export waiting with them goes on. +#[test] +fn a_canceled_save_writes_nothing_and_keeps_the_document_modified() { + let (gate, writing) = (Gate::default(), Gate::default()); + let files = Files::default(); + let (f, g, w) = (files.clone(), gate.clone(), writing.clone()); + let services = Services { + write_shared: Some(Arc::new(move |p: &str, b: &[u8]| { + w.open(); + g.wait(); + f.lock().unwrap().push((p.to_string(), b.to_vec())); + Ok(()) + })), + ..Default::default() + }; + let mut app = VectorcraftApp::new(Session::new(), services); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let first = app.session.active().unwrap().uid; + // The first save holds the worker at the gate, past its last check: it still writes. + app.run("file.save", json!({"path": "/docs/first.vectorcraft"})).unwrap(); + writing.wait(); + assert!(!crate::menus::enabled(&app, "file.cancelExport"), "a save is not an export"); + io::export(&mut app, Some("svg"), Some("/out/c.svg".into()), &json!({})).unwrap(); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let second = app.session.active().unwrap().uid; + let r = app.run("file.save", json!({"path": "/docs/second.svg"})).unwrap(); + assert_eq!(r["background"], true, "{r}"); + assert!(crate::menus::enabled(&app, "file.cancelSave") && crate::menus::enabled(&app, "file.saveInBackground")); + assert_eq!(app.run("file.cancelSave", json!({})).unwrap()["cancelled"], 2); + assert_eq!(app.ui.status, io::SAVE_CANCELED); + assert_eq!(app.run("file.cancelSave", json!({})).unwrap()["cancelled"], 0, "nothing left to cancel"); + assert!(!crate::menus::enabled(&app, "file.cancelSave")); + gate.open(); + background::wait_all(&mut app); + assert_eq!(written(&files), ["/docs/first.vectorcraft", "/out/c.svg"]); + fn doc(app: &VectorcraftApp, uid: u64) -> &vectorcraft_engine::DocState { + app.session.documents().iter().find(|d| d.uid == uid).unwrap() + } + let st = doc(&app, first); + assert_eq!(st.path.as_deref(), Some("/docs/first.vectorcraft"), "written before the Cancel took effect"); + let st = doc(&app, second); + assert!(st.is_dirty() && st.path.is_none(), "the canceled save left the document as it was"); + assert_eq!(st.format, "vectorcraft"); + assert!(io::recent_files(&app).iter().any(|p| p == "/docs/first.vectorcraft")); + assert!(!io::recent_files(&app).iter().any(|p| p == "/docs/second.svg")); + assert!(app.ui.dialog.is_none(), "no error is shown"); + assert_eq!(app.ui.status, io::SAVE_CANCELED); +} + #[test] fn quitting_waits_for_background_saves() { let gate = Gate::default(); diff --git a/docs/gaps.md b/docs/gaps.md index eda7bb21dd..7c243b05cb 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -490,7 +490,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi Estimate unchanged. - **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Arcs, spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged. - **Done (2026-10-21, #394):** General › Constrain Angle turns the arrow keys' axes (guides stay on the page's), holds Shift drags of the Selection, Direct Selection, Free Transform, Slice Selection, Reshape and Measure tools and the Pen's handles to the turned axes, and new rectangles, rounded rectangles, ellipses, grids, point and area type, Shift-drawn polygons and stars and the shape size dialogs are drawn along it with their bounding box turned; 0° and whole turns are exactly as before, quarter turns exact (<https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rotate-objects-by-specific-angles.html>). Arcs, spirals, flares and the Pen's new paths are not turned yet. Estimate unchanged. **2026-10-24:** General › Corner Radius is the Rounded Rectangle tool's radius: the tool takes the preference when chosen and when it changes while the tool is active (or lent a selection tool for a drag), and the radius ↑/↓ set while drawing one, or a Tool Options value, becomes the preference, clamped to its 0–1296 pt range (<https://helpx.adobe.com/illustrator/using/drawing-simple-lines-shapes.html>). Estimate unchanged. -- **Done (2026-10-17):** Background Export shows its progress in a dialog with Cancel and Continue in Background (#2564), on the shared cancel token (#2546); a cancelled export writes no file. Save As, Export for Screens and Export Selection don't show it yet. Estimate unchanged. **2026-11-06:** opening a file that takes longer than 0.4 s shows a progress window too, with a moving bar, Cancel and Continue in Background (part of #5930); Save and Place still show only the status bar's spinner. Estimate unchanged. +- **Done (2026-10-17):** Background Export shows its progress in a dialog with Cancel and Continue in Background (#2564), on the shared cancel token (#2546); a cancelled export writes no file. Save As, Export for Screens and Export Selection don't show it yet. Estimate unchanged. **2026-11-06:** opening a file that takes longer than 0.4 s shows a progress window too, with a moving bar, Cancel and Continue in Background (part of #5930); Save and Place still show only the status bar's spinner. Estimate unchanged. **2026-11-15:** a save that runs in the background shows in that window too, with a moving bar, Cancel (the file stays as it was and the document stays modified) and Continue in Background (`file.cancelSave`, `file.saveInBackground`); Place still shows only the spinner. Estimate unchanged. - **Done:** quick Image Trace presets trace at once and leave the panel as it was; the Image Trace button (Control bar, Properties) opens the controls with Threshold and Advanced (Paths, Corners, Noise), as the public documentation describes (<https://helpx.adobe.com/illustrator/using/image-trace-results-optimization.html>). Other context-specific Properties gaps remain. - **Done (2026-10-31, #394):** Units › East Asian Type is read, and Q and Ha are units. 1 Q and 1 Ha are each a quarter of a millimetre (0.709 pt), the Japanese typesetting units: the [Illustrator Scripting Guide's diff --git a/docs/mcp.md b/docs/mcp.md index c7aa202d3f..3adefdeeef 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -690,7 +690,7 @@ sampler. | `open_panel` | `{panel}` | Remote only. `panel` is a panel id (`layers`, `swatches`, `colorGuide`, …, as `window.panel` takes) or its display label (`"Color Guide"`), in any case. | | `screenshot` | `{path?, scale?, artboard?, window?, max_side?, traceViews?}` | Returns MCP image content (`image/png`, base64) plus a text block. Renders the artboard with the pixels of a PNG `export` with `background: "white"` at the same scale; `traceViews:true` draws Image Trace objects in the view set with `imageTrace.setView`, as in the app's window; `window:true` captures the app window (remote only), as `ui_screenshot` does, and `max_side` (1–4096, window captures only) scales the returned image down as described for `ui_screenshot`. With `path` the backend (the headless session or the app) writes the PNG there too; a window capture written there keeps its full size with `max_side`. An app that does not send the image back writes a window capture without `path` to a file in a new folder inside the system's temporary folder (on Unix only the user can open it); the server reads the file and then removes the folder, also when the capture or the read fails. | | `open_file` | `{path, importer?, params?}` | Opens any readable file as a new active document: `.vectorcraft`/`.drawcraft`, `.vctemplate`, `.svg`/`.svgz`, `.pdf`/`.ai`, `.ait`, `.eps`/`.epsf`, `.ps`, `.dxf`, `.emf`, `.wmf`, PICT (`.pct`/`.pic`/`.pict`, and a version 2 picture of any extension), HP-GL (`.plt`/`.hpgl`/`.hgl`/`.hpg`, and a file of an extension no other format reads that starts with plotter instructions), PNG (`.png`/`.pns`), JPEG, GIF, WebP, TIFF, BMP (`.bmp`/`.dib`/`.rle`), Targa (`.tga`/`.vda`/`.icb`/`.vst`), PCX, Pixar (`.pxr`), JPEG 2000 (`.jpf`/`.jpx`/`.jp2`/`.j2k`/`.j2c`/`.jpc`), HEIC/HEIF (`.heic`/`.heif`), JPEG XL (`.jxl`), PSD (`.psd`/`.pdd`)/PSB (an image opens as a document of its pixel size; a PSD or PSB file with its layers as layers, or as its merged image through `run_command document.open` with `layers: false`; a JPEG XL file as its first frame). Templates (`.vctemplate`, `.ait`) open as a new untitled document. PDF, `.ai` and SVG files saved with Preserve Editing reopen as the document they carry. The reply is `document.open`'s: its `warnings` say what didn't come in as it was (an EPS whose PostScript can't be read opens as its preview, and the warning names the PostScript error, the operator and the procedure). A file of an extension only an installed importer plug-in lists opens with that importer ([Plug-ins](#plug-ins)); `importer: "plugin.<id>"` opens the file with the importer it names, which must list the file's extension, also one a built-in format reads (in the app, as File › Open With does), and `params` gives that importer's parameters (their defaults when omitted). `run_command document.formats` lists the formats. | -| `save_file` | `{path?, compress?, version?, preview?, precision?, options?}` | Runs `document.save`: the document's own file in its own format (native `.vectorcraft` unless it was opened from or saved as SVG, PDF or a restorable `.ai`; then `warnings` say what that format loses). A path's extension picks the format (`.vectorcraft`, `.vctemplate`, `.pdf`, `.svg`, `.svgz`, `.ai`: a PDF carrying the native document, which reopens editable; `.eps`: by default one file whose bounding box fits the visible art, the first artboard when no art shows; `options.useArtboards: true` makes the chosen artboard the page and, with two or more chosen, the file at the path is the central file of the visible art and each artboard is also written to `<name>_<artboard>.eps` beside it, listed in the reply's `files`). For a native file, `compress: true` gzips it (default: the `useCompression` preference, Preferences › File Handling › Use Compression), `version` (1 to 4) writes it for an older VectorCraft (1 and 2 are never compressed, and `version: 2` with `compress: true` is an error), `preview: true` embeds a PNG of the first artboard, and `precision` (0 to 9) rounds path anchors and handles to that many decimal places for that save only (colors, transforms and type stay exact). `options` passes the format's save options as `run_command document.formats` lists them. When `compress`, `version`, `preview` or `precision` is given both at the top level and in `options` with different values, the call is an error (`` `compress: true` and `options.compress: false` disagree: give the option once ``) and nothing is written. A key in `options` that no save format takes is an error, and nothing is written (see Parameter keys). The save drops each option the written format doesn't read. The reply's `warnings` then name each such option given (for example `` `compress` was not used: SVG files don't read it `` for an `.svg` path, and `` `options.preview` was not used: … `` for a key in `options`; a PDF-compatible `.ai` file reads `compress` but not `version`, `preview`, `precision`, `outlineText`, `hiddenObjects`, `transparentImages` or `preserveEditing`, and a legacy `.ai` file reads only its own options). For a `.ai` file, these warnings name the kind of `.ai` written: a legacy .ai (version 7) for `aiVersion: "7"`, a non-PDF-compatible .ai for `pdfCompatible: false`, and a PDF-compatible .ai otherwise, including a save that reuses the options the document was last saved with. `run_command document.save` and the other save commands refuse any option given beside the path and in `options` with different values, and give the same warnings for each key given beside the path or in `options` that the file doesn't read. The headless session and the app receive the same `app.save` params, and the app is also sent `wait: true`: the call returns once the file is written, or with the error (such as a path outside the write root), even with Background Save on. When the save asks first (the question before replacing a file that opened with losses, or on macOS and Linux the file dialog for an untitled document without `path`), the reply is `{pending}` or `"cancelled"` as before, and the save that runs after the answer uses the Background Save preference. Location refusals return `READ_ONLY_LOCATION: <reason>` without a fallback panel for automation; see [Save location errors](#save-location-errors). | +| `save_file` | `{path?, compress?, version?, preview?, precision?, options?}` | Runs `document.save`: the document's own file in its own format (native `.vectorcraft` unless it was opened from or saved as SVG, PDF or a restorable `.ai`; then `warnings` say what that format loses). A path's extension picks the format (`.vectorcraft`, `.vctemplate`, `.pdf`, `.svg`, `.svgz`, `.ai`: a PDF carrying the native document, which reopens editable; `.eps`: by default one file whose bounding box fits the visible art, the first artboard when no art shows; `options.useArtboards: true` makes the chosen artboard the page and, with two or more chosen, the file at the path is the central file of the visible art and each artboard is also written to `<name>_<artboard>.eps` beside it, listed in the reply's `files`). For a native file, `compress: true` gzips it (default: the `useCompression` preference, Preferences › File Handling › Use Compression), `version` (1 to 4) writes it for an older VectorCraft (1 and 2 are never compressed, and `version: 2` with `compress: true` is an error), `preview: true` embeds a PNG of the first artboard, and `precision` (0 to 9) rounds path anchors and handles to that many decimal places for that save only (colors, transforms and type stay exact). `options` passes the format's save options as `run_command document.formats` lists them. When `compress`, `version`, `preview` or `precision` is given both at the top level and in `options` with different values, the call is an error (`` `compress: true` and `options.compress: false` disagree: give the option once ``) and nothing is written. A key in `options` that no save format takes is an error, and nothing is written (see Parameter keys). The save drops each option the written format doesn't read. The reply's `warnings` then name each such option given (for example `` `compress` was not used: SVG files don't read it `` for an `.svg` path, and `` `options.preview` was not used: … `` for a key in `options`; a PDF-compatible `.ai` file reads `compress` but not `version`, `preview`, `precision`, `outlineText`, `hiddenObjects`, `transparentImages` or `preserveEditing`, and a legacy `.ai` file reads only its own options). For a `.ai` file, these warnings name the kind of `.ai` written: a legacy .ai (version 7) for `aiVersion: "7"`, a non-PDF-compatible .ai for `pdfCompatible: false`, and a PDF-compatible .ai otherwise, including a save that reuses the options the document was last saved with. `run_command document.save` and the other save commands refuse any option given beside the path and in `options` with different values, and give the same warnings for each key given beside the path or in `options` that the file doesn't read. The headless session and the app receive the same `app.save` params, and the app is also sent `wait: true`: the call returns once the file is written, or with the error (such as a path outside the write root), even with Background Save on. When the save asks first (the question before replacing a file that opened with losses, or on macOS and Linux the file dialog for an untitled document without `path`), the reply is `{pending}` or `"cancelled"` as before, and the save that runs after the answer uses the Background Save preference. Location refusals return `READ_ONLY_LOCATION: <reason>` without a fallback panel for automation; see [Save location errors](#save-location-errors). In the desktop app, a save that runs in the background shows in the progress window after 0.4 s with a moving bar. `file.cancelSave` stops every such save before it replaces its file → `{cancelled: n}`: the file stays as it was, and the document keeps its file and format and stays modified. A save whose file was already being replaced finishes and is reported as saved. `file.saveInBackground` closes the window while the saves go on → `{hidden: n}`. | | `export` | `{path?, format?, scale?, artboard?, range?, selection?, outlineText?, options?}` | `svg`, `svgz`, `pdf`, `ai` (the PDF-compatible `.ai` that Save writes, which carries the document when every artboard is written in order), `eps`, `dxf`, `emf`, `wmf`, `hpgl` (a `.plt` plot file for plotters and cutters), `png`, `jpg`, `webp`, `gif`, `png8` (an indexed `.png`), `tiff`, `bmp`, `tga`, `psd` (layered), `txt` (the document's text), `vectorcraft` or `template` (a native template). The tool's `format` enum and `document.formats` list them, generated from the engine's format table. When `format` is omitted, it comes from the path's extension. PDF and `.ai` write one page per artboard: all of them, or `artboard` (0-based) / `range` (`"1-3, 5"`, 1-based). SVG and SVGZ write one file per chosen artboard. EPS writes one file of the visible art; with `artboard`, `range`, `options.artboards` or `options: {"useArtboards": true}` it writes one file per chosen artboard, after a central file of the visible art when there are two or more, and `useArtboards: false` keeps the one file. Rasters, DXF, EMF, WMF and HP-GL write one artboard, or one file per chosen artboard with `options: {"useArtboards": true}`. Rasters also take `options: {"rect": [x, y, width, height]}` (page points, y down): that area of the page at the given `ppi`/`scale`, without an artboard and without changing the document; it is refused with `artboard`, `artboards`, `range` or `useArtboards`, with a non-positive or non-finite size, and for non-raster formats. `options` carries more format options (e.g. `{"quality": 80}` for JPEG). `selection: true` exports the selected objects cropped to their bounds (the reply adds their `bounds`, and reports `format` and the encoder's `warnings` as a whole-document export does); `outlineText: true` writes SVG text as paths. Template layers are left out, live effects are kept, and exporting `vectorcraft` never changes the document's path. Without `path` the bytes come back as `dataBase64`. Both backends run the same `document.export` call. | | `add_text` | `{text, x?, y?, width?, height?, fit?, fitMinPercent?, path?, mode?, pathEffect?, size?, font?, color?, justify?, vertical?}` | Point type at (x, y) (`justify`: `left`, `center` or `right` starts, centres or ends each line on x); area type with `width`/`height` (`fit`: `none`, `autoHeight`, `shrinkText`, as `text.areaOptions`); or `path` + `mode` (`area`/`onPath`) to flow text in or along a path, with `pathEffect` (`rainbow`, `skew`, `3dRibbon`, `stairStep`, `gravity`; SVG export writes type on a path with any effect other than `rainbow` as outlines, with a warning); `justify` (also `auto`, `justifyAll`) aligns the paragraphs of every kind, as `text.setStyle` does later. `vertical: true` uses the existing vertical writing mode for every kind (default `false`, horizontal). Returns `{id}`, with `overflow: true` when the text doesn't fit its frame or path. | | `apply_effect` | `{effect?, params?, ids?}` | Appends a live effect. Without `effect`, returns the effect catalogue with parameters and defaults. | @@ -6523,8 +6523,9 @@ are named this way: - The other rows that still have the same name show their id in parentheses after it. The one row of them that an item of the menu bar runs keeps the name without its id: File › New… is `file.newDialog` and `file.new` is File › New… (file.new), and Type › Fit Headline is `text.fitHeadline` and `type.fitHeadline` is Type › Fit Headline - (type.fitHeadline). `file.exportInBackground` and `file.openInBackground` are File › Continue in Background - (file.exportInBackground) and File › Continue in Background (file.openInBackground). + (type.fitHeadline). `file.exportInBackground`, `file.openInBackground` and `file.saveInBackground` are File › + Continue in Background (file.exportInBackground), File › Continue in Background (file.openInBackground) and File › + Continue in Background (file.saveInBackground). `shortcuts.list` gives such a row's group in `group` and the command's own label in `label`, so the rows that show their id have the same `group` and `label` there, and `id` tells them apart. `shortcuts.exportText` writes these diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0782bacab9..035b1b348f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2016,6 +2016,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - On the desktop with Enable Background Export on (Preferences › File Handling), File › Package… collects the linked files and fonts and writes the package from the document as it was at OK on the thread that writes background saves and exports, with "Packaging" in the status bar and the busy spinner until it is written; a save of unsaved changes that Package starts is written first. `file.package` over MCP and scripts replies as before. - On the desktop with Enable Background Export on, Export for Screens and the Asset Export panel's Export encode and write their files (into the folder, or one ZIP in it) from the document as it was at OK on the thread that writes background saves and exports, with "Exporting" in the status bar and the export progress dialog, which counts the files and whose Cancel stops before the next file. `document.exportForScreens` and `assets.export` over MCP and scripts reply as before. - With Enable Background Export on, an Export for Screens with no folder of its own also writes in the background into the folder its `exportPreset` keeps, with the same progress dialog and Cancel, and the status bar names that folder. When that folder is outside an MCP client's read roots, the reply, its errors and the status bar name it by its own name, as for an export made at once (`dialogs::tests_screens::an_export_into_a_presets_folder_writes_in_the_background`, `fileio::tests_screens::a_prepared_export_into_a_presets_folder_outside_the_read_root_leaves_it_out`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/exporting-artwork.html (exports run in the background by default). + - On the desktop with Enable Background Save on (Preferences › File Handling), a save that is still being written after 0.4 s shows in the same progress window, with the file name, a moving bar (a save counts no steps), how many more saves wait, Cancel (also Esc) and Continue in Background; it never opens over another dialog or progress window. Cancel (`file.cancelSave`) stops the save before it replaces the file: the file stays as it was, the document keeps its file and format and stays modified, and the status bar says the save was canceled. A save whose file was already being replaced finishes and is reported as saved, and a save of several files (EPS with Use Artboards) whose first file is in place writes the rest. Continue in Background (`file.saveInBackground`) closes the window and leaves the save to the status bar (`export_progress::tests::a_background_save_shows_in_the_window_and_continue_hides_it`, `tests::background::a_canceled_save_writes_nothing_and_keeps_the_document_modified`, `fileio::tests::a_canceled_save_leaves_the_file_as_it_was`, `fileio::tests::a_save_canceled_after_its_first_file_writes_them_all`, `atomic::tests::canceled_work_puts_nothing_in_place`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/saving-artwork.html (each background save shows its progress and can be canceled). - Missing linked files can be looked for in a folder and its subfolders: Find in Folder… in the Linked File Not Found dialog and in the Links panel menu lists the files with each one's name, those with the size and contents saved with the link first, and relinks the files chosen, copying an image's file into the document's folder when asked, without replacing a file there (`links.findFiles`, `links.relink {copy}`). In the Links panel it looks for the selected linked files when any are selected. - The Links panel's Relink… opens a Relink dialog whose Replace menu picks which links take the new file: Selected Instances (the selected images, as before), All Instances (every image linked to the same file), Missing Links from This Folder (then every other missing link whose file name is in the new file's folder) and Each Link Separately (a file for each selected link in turn). Each relinks as one undo step (`links.relink {scope}`, `ui.relinkDialog`). Relink to Folder… stays as it is. - The Links panel menu's Copy Info ([Links panel](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/links-panel-in-illustrator.html)) copies the selected link's file name to the clipboard (`links.copyInfo`). VectorCraft's own rules: with several rows selected it copies one name per line in the order the panel shows them, an embedded image gives the name its row shows, and the item is off with no row selected. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 8e06948b33..5ab0b51b14 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -460,7 +460,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Gradient panel: delete a stop | done | Delete Stop at the right end of the ramp deletes the selected stop, and a stop dragged down off the ramp is deleted on release, never below two stops, one undo step each; [Gradient panel options](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/create-and-edit-gradients/gradient-tool-and-panel.html); `panels::gradient` test | | Gradient tool: the annotator's end handle changes the length; Alt-drag changes the length and angle together | done | A plain drag keeps the end on the bar's line, at least 10 px from the start (VectorCraft's own minimum); Alt-drag moves it freely, Shift with Alt at 45° steps; [Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html); `xform::gradient` tests | | Workspaces (save, reset, switch); each remembers the layout changes made in it across switches and restarts until Reset <name> | done | `UiState::workspace_changes` | -| Opening a file: after 0.4 s a progress window with the file name, a moving bar (reading counts no steps), how many more files wait, Cancel (Esc: the file doesn't open) and Continue in Background; never over another dialog or progress window | done | #5930; `opening::show`, `file.cancelOpen`, `file.openInBackground`. Save, Place and Close still show only the status bar's spinner (Place and Save run off the UI thread; Close is immediate) | +| Opening a file: after 0.4 s a progress window with the file name, a moving bar (reading counts no steps), how many more files wait, Cancel (Esc: the file doesn't open) and Continue in Background; never over another dialog or progress window | done | #5930; `opening::show`, `file.cancelOpen`, `file.openInBackground`. A save that runs in the background shows the same window, with how many more saves wait; its Cancel (`file.cancelSave`) stops the save before it replaces the file, which stays as it was, and its Continue in Background is `file.saveInBackground` (the help page lists each background save's progress with a Cancel button: https://helpx.adobe.com/illustrator/using/saving-artwork.html). Place and Close still show only the status bar's spinner (Place runs off the UI thread; Close is immediate) | | Window › Help Bar shows or hides the tool-help strip apart from the status bar; kept with the preferences and in saved workspaces; Presentation Mode hides both bars | done | `window.helpBar`; `help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar` | | Status bar: a click on the info field opens a Show menu that chooses its readout: Artboard Name, Current Tool (the default), Date and Time, Number of Undos (undo and redo counts) or Document Color Profile; kept with the UI state | done | `view.statusBarShow`; [public behavior reference](https://web.archive.org/web/2014/https://helpx.adobe.com/illustrator/using/workspace-basics.html); `the_status_bar_info_field_shows_the_chosen_readout`, `a_click_on_the_info_field_opens_the_show_menu`, `the_status_bar_show_choice_is_checked_and_saved`. The menu labels are VectorCraft's own | | Background Export: a progress dialog with the file name, the artboard count and a bar (busy for one artboard and for formats made in one go), Cancel (Esc) and Continue in Background; it opens after 0.4 s and never over another dialog. A cancelled export writes no file | done | #2564; on the shared `vectorcraft_doc::cancel` token (#2546), so a cancelled render keeps no half-drawn pattern tile or effect raster. The bar moves between artboards, not within one. Save As, Export for Screens and Export Selection don't show it yet | From 9de3938495a0b5e4746ee85cfddc051a1b84600b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Sun, 15 Nov 2026 23:59:47 -0800 Subject: [PATCH 056/247] Save: a status line set after Cancel Save stays when the saves finish A save that was already replacing its file when Cancel Save came, and a save that Cancel stopped, now set their line only while the status bar still shows Cancel Save's line or the line a save it reached set after it. A line another command or job set since the Cancel stays. The docs state the Cancel cutoff: a save whose file is already being replaced finishes and is reported as saved, and a save of several files whose first file is in place writes the rest. --- crates/ui-egui/src/background.rs | 3 +++ crates/ui-egui/src/io/save.rs | 25 +++++++++++++++--- crates/ui-egui/src/tests/background.rs | 36 ++++++++++++++++++++++++++ docs/target-app-parity.md | 2 +- docs/ui-parity.md | 2 +- 5 files changed, 63 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/background.rs b/crates/ui-egui/src/background.rs index 34e1071813..f1a3032cf0 100644 --- a/crates/ui-egui/src/background.rs +++ b/crates/ui-egui/src/background.rs @@ -97,6 +97,9 @@ pub struct Background { next_id: u64, /// Work started while this is set runs at once, whatever the preferences ([`in_foreground`]). foreground: bool, + /// [`crate::state::UiState::status_sets`] right after Cancel Save set its line, or after a save + /// it reached set the line that followed it; `None` before any Cancel Save. + pub(crate) save_cancel_line: Option<u64>, } impl Background { diff --git a/crates/ui-egui/src/io/save.rs b/crates/ui-egui/src/io/save.rs index 47d83173af..9d242427d1 100644 --- a/crates/ui-egui/src/io/save.rs +++ b/crates/ui-egui/src/io/save.rs @@ -15,10 +15,17 @@ pub fn cancel_saves(app: &mut VectorcraftApp) -> Value { let n = app.background.cancel_saves(); if n > 0 { app.status(SAVE_CANCELED); + app.background.save_cancel_line = Some(app.ui.status_sets); } json!({ "cancelled": n }) } +/// Does the status bar still show Cancel Save's line, or the line a save it reached set after it? +/// A line set since by another command or another job stays. +fn cancel_line_shown(app: &VectorcraftApp) -> bool { + app.background.save_cancel_line == Some(app.ui.status_sets) +} + /// The progress window's Continue in Background for saves: they go on, shown in the status bar /// only → `{hidden: n}`. pub fn hide_saves(app: &mut VectorcraftApp) -> Value { @@ -642,7 +649,14 @@ fn write_plan( // Canceled before the file was replaced: the document keeps its file, format and modified // state. if r.get("cancelled").and_then(Value::as_bool) == Some(true) { - app.status(SAVE_CANCELED); + // A line set since Cancel Save (another command's, another job's) stays. + let owned = cancel_line_shown(app); + if owned || background::status_unchanged(app, sets, &started_line) { + app.status(SAVE_CANCELED); + } + if owned { + app.background.save_cancel_line = Some(app.ui.status_sets); + } return Ok(r); } // Nothing written either: asked first. @@ -661,10 +675,15 @@ fn write_plan( app.picks.written_beside.insert(uid, beside); } // A line set while the file was written (another command's, another job's) stays. A Cancel - // that came once the file was being replaced said it was canceled: the file is saved. - if background::status_unchanged(app, sets, &started_line) || asked.cancelled() { + // that came once the file was being replaced said it was canceled: the file is saved, which + // replaces that line while it is still shown, and only then. + let owned = asked.cancelled() && cancel_line_shown(app); + if owned || background::status_unchanged(app, sets, &started_line) { report_saved(app, &path, &r); } + if owned { + app.background.save_cancel_line = Some(app.ui.status_sets); + } Ok(r) }; let mut r = background::run_saving(app, enabled, label, uid, progress, work, then)?; diff --git a/crates/ui-egui/src/tests/background.rs b/crates/ui-egui/src/tests/background.rs index 3e7e610919..ff26f7ff7c 100644 --- a/crates/ui-egui/src/tests/background.rs +++ b/crates/ui-egui/src/tests/background.rs @@ -246,7 +246,43 @@ fn a_canceled_save_writes_nothing_and_keeps_the_document_modified() { assert!(io::recent_files(&app).iter().any(|p| p == "/docs/first.vectorcraft")); assert!(!io::recent_files(&app).iter().any(|p| p == "/docs/second.svg")); assert!(app.ui.dialog.is_none(), "no error is shown"); + // The export's line came after the Cancel: the canceled save leaves it. + assert_eq!(app.ui.status, "Exported /out/c.svg"); +} + +/// A line set after Cancel Save (another command's) stays: neither the save that was already +/// replacing its file nor the one Cancel stopped writes over it once it finishes. +#[test] +fn a_line_set_after_cancel_save_stays() { + let (gate, writing) = (Gate::default(), Gate::default()); + let files = Files::default(); + let (f, g, w) = (files.clone(), gate.clone(), writing.clone()); + let services = Services { + write_shared: Some(Arc::new(move |p: &str, b: &[u8]| { + w.open(); + g.wait(); + f.lock().unwrap().push((p.to_string(), b.to_vec())); + Ok(()) + })), + ..Default::default() + }; + let mut app = VectorcraftApp::new(Session::new(), services); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let first = app.session.active().unwrap().uid; + // The first save holds the worker at the gate, past its last check: it still writes. + app.run("file.save", json!({"path": "/docs/first.vectorcraft"})).unwrap(); + writing.wait(); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + app.run("file.save", json!({"path": "/docs/second.vectorcraft"})).unwrap(); + assert_eq!(app.run("file.cancelSave", json!({})).unwrap()["cancelled"], 2); assert_eq!(app.ui.status, io::SAVE_CANCELED); + app.status("Another command's line"); + gate.open(); + background::wait_all(&mut app); + assert_eq!(written(&files), ["/docs/first.vectorcraft"]); + let st = app.session.documents().iter().find(|d| d.uid == first).unwrap(); + assert_eq!(st.path.as_deref(), Some("/docs/first.vectorcraft"), "the first save still finished"); + assert_eq!(app.ui.status, "Another command's line"); } #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 035b1b348f..80d94592bc 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2016,7 +2016,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - On the desktop with Enable Background Export on (Preferences › File Handling), File › Package… collects the linked files and fonts and writes the package from the document as it was at OK on the thread that writes background saves and exports, with "Packaging" in the status bar and the busy spinner until it is written; a save of unsaved changes that Package starts is written first. `file.package` over MCP and scripts replies as before. - On the desktop with Enable Background Export on, Export for Screens and the Asset Export panel's Export encode and write their files (into the folder, or one ZIP in it) from the document as it was at OK on the thread that writes background saves and exports, with "Exporting" in the status bar and the export progress dialog, which counts the files and whose Cancel stops before the next file. `document.exportForScreens` and `assets.export` over MCP and scripts reply as before. - With Enable Background Export on, an Export for Screens with no folder of its own also writes in the background into the folder its `exportPreset` keeps, with the same progress dialog and Cancel, and the status bar names that folder. When that folder is outside an MCP client's read roots, the reply, its errors and the status bar name it by its own name, as for an export made at once (`dialogs::tests_screens::an_export_into_a_presets_folder_writes_in_the_background`, `fileio::tests_screens::a_prepared_export_into_a_presets_folder_outside_the_read_root_leaves_it_out`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/exporting-artwork.html (exports run in the background by default). - - On the desktop with Enable Background Save on (Preferences › File Handling), a save that is still being written after 0.4 s shows in the same progress window, with the file name, a moving bar (a save counts no steps), how many more saves wait, Cancel (also Esc) and Continue in Background; it never opens over another dialog or progress window. Cancel (`file.cancelSave`) stops the save before it replaces the file: the file stays as it was, the document keeps its file and format and stays modified, and the status bar says the save was canceled. A save whose file was already being replaced finishes and is reported as saved, and a save of several files (EPS with Use Artboards) whose first file is in place writes the rest. Continue in Background (`file.saveInBackground`) closes the window and leaves the save to the status bar (`export_progress::tests::a_background_save_shows_in_the_window_and_continue_hides_it`, `tests::background::a_canceled_save_writes_nothing_and_keeps_the_document_modified`, `fileio::tests::a_canceled_save_leaves_the_file_as_it_was`, `fileio::tests::a_save_canceled_after_its_first_file_writes_them_all`, `atomic::tests::canceled_work_puts_nothing_in_place`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/saving-artwork.html (each background save shows its progress and can be canceled). + - On the desktop with Enable Background Save on (Preferences › File Handling), a save that is still being written after 0.4 s shows in the same progress window, with the file name, a moving bar (a save counts no steps), how many more saves wait, Cancel (also Esc) and Continue in Background; it never opens over another dialog or progress window. Cancel (`file.cancelSave`) stops the save before it replaces the file: the file stays as it was, the document keeps its file and format and stays modified, and the status bar says the save was canceled. A save whose file was already being replaced finishes and is reported as saved, unless another command or job has set a status line since the Cancel, and a save of several files (EPS with Use Artboards) whose first file is in place writes the rest. Continue in Background (`file.saveInBackground`) closes the window and leaves the save to the status bar (`export_progress::tests::a_background_save_shows_in_the_window_and_continue_hides_it`, `tests::background::a_canceled_save_writes_nothing_and_keeps_the_document_modified`, `tests::background::a_line_set_after_cancel_save_stays`, `fileio::tests::a_canceled_save_leaves_the_file_as_it_was`, `fileio::tests::a_save_canceled_after_its_first_file_writes_them_all`, `atomic::tests::canceled_work_puts_nothing_in_place`). Behavior reference: the help page, https://helpx.adobe.com/illustrator/using/saving-artwork.html (each background save shows its progress and can be canceled). - Missing linked files can be looked for in a folder and its subfolders: Find in Folder… in the Linked File Not Found dialog and in the Links panel menu lists the files with each one's name, those with the size and contents saved with the link first, and relinks the files chosen, copying an image's file into the document's folder when asked, without replacing a file there (`links.findFiles`, `links.relink {copy}`). In the Links panel it looks for the selected linked files when any are selected. - The Links panel's Relink… opens a Relink dialog whose Replace menu picks which links take the new file: Selected Instances (the selected images, as before), All Instances (every image linked to the same file), Missing Links from This Folder (then every other missing link whose file name is in the new file's folder) and Each Link Separately (a file for each selected link in turn). Each relinks as one undo step (`links.relink {scope}`, `ui.relinkDialog`). Relink to Folder… stays as it is. - The Links panel menu's Copy Info ([Links panel](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/links-panel-in-illustrator.html)) copies the selected link's file name to the clipboard (`links.copyInfo`). VectorCraft's own rules: with several rows selected it copies one name per line in the order the panel shows them, an embedded image gives the name its row shows, and the item is off with no row selected. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 5ab0b51b14..b0e08a962c 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -460,7 +460,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Gradient panel: delete a stop | done | Delete Stop at the right end of the ramp deletes the selected stop, and a stop dragged down off the ramp is deleted on release, never below two stops, one undo step each; [Gradient panel options](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/create-and-edit-gradients/gradient-tool-and-panel.html); `panels::gradient` test | | Gradient tool: the annotator's end handle changes the length; Alt-drag changes the length and angle together | done | A plain drag keeps the end on the bar's line, at least 10 px from the start (VectorCraft's own minimum); Alt-drag moves it freely, Shift with Alt at 45° steps; [Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html); `xform::gradient` tests | | Workspaces (save, reset, switch); each remembers the layout changes made in it across switches and restarts until Reset <name> | done | `UiState::workspace_changes` | -| Opening a file: after 0.4 s a progress window with the file name, a moving bar (reading counts no steps), how many more files wait, Cancel (Esc: the file doesn't open) and Continue in Background; never over another dialog or progress window | done | #5930; `opening::show`, `file.cancelOpen`, `file.openInBackground`. A save that runs in the background shows the same window, with how many more saves wait; its Cancel (`file.cancelSave`) stops the save before it replaces the file, which stays as it was, and its Continue in Background is `file.saveInBackground` (the help page lists each background save's progress with a Cancel button: https://helpx.adobe.com/illustrator/using/saving-artwork.html). Place and Close still show only the status bar's spinner (Place runs off the UI thread; Close is immediate) | +| Opening a file: after 0.4 s a progress window with the file name, a moving bar (reading counts no steps), how many more files wait, Cancel (Esc: the file doesn't open) and Continue in Background; never over another dialog or progress window | done | #5930; `opening::show`, `file.cancelOpen`, `file.openInBackground`. A save that runs in the background shows the same window, with how many more saves wait; its Cancel (`file.cancelSave`) stops the save before it replaces the file, which stays as it was. A save whose file is already being replaced finishes and is reported as saved, and a save of several files (EPS with Use Artboards) whose first file is in place writes the rest. Its Continue in Background is `file.saveInBackground` (the help page lists each background save's progress with a Cancel button: https://helpx.adobe.com/illustrator/using/saving-artwork.html). Place and Close still show only the status bar's spinner (Place runs off the UI thread; Close is immediate) | | Window › Help Bar shows or hides the tool-help strip apart from the status bar; kept with the preferences and in saved workspaces; Presentation Mode hides both bars | done | `window.helpBar`; `help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar` | | Status bar: a click on the info field opens a Show menu that chooses its readout: Artboard Name, Current Tool (the default), Date and Time, Number of Undos (undo and redo counts) or Document Color Profile; kept with the UI state | done | `view.statusBarShow`; [public behavior reference](https://web.archive.org/web/2014/https://helpx.adobe.com/illustrator/using/workspace-basics.html); `the_status_bar_info_field_shows_the_chosen_readout`, `a_click_on_the_info_field_opens_the_show_menu`, `the_status_bar_show_choice_is_checked_and_saved`. The menu labels are VectorCraft's own | | Background Export: a progress dialog with the file name, the artboard count and a bar (busy for one artboard and for formats made in one go), Cancel (Esc) and Continue in Background; it opens after 0.4 s and never over another dialog. A cancelled export writes no file | done | #2564; on the shared `vectorcraft_doc::cancel` token (#2546), so a cancelled render keeps no half-drawn pattern tile or effect raster. The bar moves between artboards, not within one. Save As, Export for Screens and Export Selection don't show it yet | From 10f7206bbe3b8a1115445e39a345708ccde11753 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 00:26:27 -0800 Subject: [PATCH 057/247] Attributes: Panel Options sets how many recent URLs the URL menu lists The Attributes panel menu gets Panel Options..., whose dialog sets how many of the recent URLs the URL menu lists, a whole number from 1 to 30 (10 by default). ui.attributesPanelOptions {count} sets it without the dialog; a count out of range is an error and changes nothing. The count is kept with the UI state. The recent URL list now keeps the 30 newest distinct URLs of the session, so a lower count hides older URLs without removing them. --- crates/engine/src/cmd.rs | 3 +- crates/engine/src/cmd/attributes.rs | 7 +- crates/engine/src/cmd/overprint.rs | 2 +- crates/engine/src/lib.rs | 3 +- crates/engine/src/tests/attributes.rs | 17 +++ crates/mcp/src/ui_catalog.rs | 6 + crates/ui-egui/src/dialogs.rs | 2 + .../src/dialogs/attributes_panel_options.rs | 82 ++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 3 + crates/ui-egui/src/i18n/bs.tsv | 3 + crates/ui-egui/src/i18n/ca.tsv | 3 + crates/ui-egui/src/i18n/cs.tsv | 3 + crates/ui-egui/src/i18n/da.tsv | 3 + crates/ui-egui/src/i18n/de.tsv | 3 + crates/ui-egui/src/i18n/el.tsv | 3 + crates/ui-egui/src/i18n/es.tsv | 3 + crates/ui-egui/src/i18n/fi.tsv | 3 + crates/ui-egui/src/i18n/fr.tsv | 3 + crates/ui-egui/src/i18n/gu.tsv | 3 + crates/ui-egui/src/i18n/hi.tsv | 3 + crates/ui-egui/src/i18n/hu.tsv | 3 + crates/ui-egui/src/i18n/id.tsv | 3 + crates/ui-egui/src/i18n/it.tsv | 3 + crates/ui-egui/src/i18n/ja.tsv | 3 + crates/ui-egui/src/i18n/ka.tsv | 3 + crates/ui-egui/src/i18n/ko.tsv | 3 + crates/ui-egui/src/i18n/nl.tsv | 3 + crates/ui-egui/src/i18n/pl.tsv | 3 + crates/ui-egui/src/i18n/pt-br.tsv | 3 + crates/ui-egui/src/i18n/ru.tsv | 3 + crates/ui-egui/src/i18n/sv.tsv | 3 + crates/ui-egui/src/i18n/tests.rs | 16 +++ crates/ui-egui/src/i18n/tr.tsv | 3 + crates/ui-egui/src/i18n/uk.tsv | 3 + crates/ui-egui/src/i18n/vi.tsv | 3 + crates/ui-egui/src/i18n/zh-hans.tsv | 3 + crates/ui-egui/src/i18n/zh-hant.tsv | 3 + crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 6 + crates/ui-egui/src/panels/attributes.rs | 107 +++++++++++++++++- crates/ui-egui/src/state.rs | 4 + docs/mcp.md | 9 ++ docs/target-app-parity.md | 1 + 43 files changed, 339 insertions(+), 11 deletions(-) create mode 100644 crates/ui-egui/src/dialogs/attributes_panel_options.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index e2bc50cdc5..b8ceae3116 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -862,7 +862,8 @@ pub use compoundshape::selected_member_modes; /// Pathfinder Options (`Prefs::pathfinder`). pub use pathops::{PATHFINDER_PRECISION_RANGE, PathfinderOptions}; -/// The Attributes panel's state ([`Session::attributes_info`]). +/// The Attributes panel's state ([`Session::attributes_info`]) and how many recent URLs it keeps. +pub use attributes::RECENT_URLS; pub use overprint::AttributesInfo; /// Object → Flatten Transparency settings (`object.flattenTransparency`). diff --git a/crates/engine/src/cmd/attributes.rs b/crates/engine/src/cmd/attributes.rs index 684d33a53d..b257a978db 100644 --- a/crates/engine/src/cmd/attributes.rs +++ b/crates/engine/src/cmd/attributes.rs @@ -12,8 +12,9 @@ use super::overprint::{AttributesInfo, apply_overprint, edit_counted, overprint_ use super::path::paths_in; use super::{CommandSpec, NodeId, Result, Session, bad, cmd, has_doc, str_param, targets}; -/// How many URLs the Attributes panel's recent list keeps. -const RECENT_URLS: usize = 10; +/// How many URLs the Attributes panel's recent list keeps: the most its Panel Options lets the +/// URL menu list. +pub const RECENT_URLS: usize = 30; pub fn specs() -> Vec<CommandSpec> { vec![ @@ -22,7 +23,7 @@ pub fn specs() -> Vec<CommandSpec> { "Attributes", [], None, - "{overprintFill?: bool, overprintStroke?: bool (aimed as object.setOverprint's fill and stroke, item? too), showCenter?: bool (the canvas shows the selected object's centre point), imageMap?: \"none\"|\"rectangle\"|\"polygon\", url?: string (\"\" removes it; SVG, PDF and .ai export link the object), note?: string, ids?|id?, item?: appearance item index|null, target?: \"object\"|\"contents\"} set the Attributes panel's values on ids or the selection, as one undo step; a URL given joins the recent URLs (attributes.info) → {changed: objects}", + "{overprintFill?: bool, overprintStroke?: bool (aimed as object.setOverprint's fill and stroke, item? too), showCenter?: bool (the canvas shows the selected object's centre point), imageMap?: \"none\"|\"rectangle\"|\"polygon\", url?: string (\"\" removes it; SVG, PDF and .ai export link the object), note?: string, ids?|id?, item?: appearance item index|null, target?: \"object\"|\"contents\"} set the Attributes panel's values on ids or the selection, as one undo step; a URL given joins the recent URLs (attributes.info, newest first, at most 30) → {changed: objects}", has_doc, set ), diff --git a/crates/engine/src/cmd/overprint.rs b/crates/engine/src/cmd/overprint.rs index e8957691ec..7435f04a3a 100644 --- a/crates/engine/src/cmd/overprint.rs +++ b/crates/engine/src/cmd/overprint.rs @@ -30,7 +30,7 @@ pub fn specs() -> Vec<CommandSpec> { "Attributes", [], None, - "{ids?|id?, item?, target?: \"object\"|\"contents\"} → {ids, overprintFill, overprintStroke, showCenter, imageMap: \"none\"|\"rectangle\"|\"polygon\", url, note, fillRule: \"nonZero\"|\"evenOdd\" (of the paths and compound paths in them), reversed (their subpaths run counter-clockwise on screen: Reverse Path Direction On), recentUrls: [newest first]} the Attributes panel's values for `ids` or the selection, overprint aimed as object.setOverprint aims; a value is null where they differ (or nothing has a fill, stroke or path)", + "{ids?|id?, item?, target?: \"object\"|\"contents\"} → {ids, overprintFill, overprintStroke, showCenter, imageMap: \"none\"|\"rectangle\"|\"polygon\", url, note, fillRule: \"nonZero\"|\"evenOdd\" (of the paths and compound paths in them), reversed (their subpaths run counter-clockwise on screen: Reverse Path Direction On), recentUrls: [newest first, at most 30]} the Attributes panel's values for `ids` or the selection, overprint aimed as object.setOverprint aims; a value is null where they differ (or nothing has a fill, stroke or path)", has_doc, |s, p| Ok(attributes(s, p)?.to_json()) ), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 4f7532108d..eb339b8cda 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -194,7 +194,8 @@ pub struct Session { /// `plugin.install` takes `grant` and `allowHeavy` from any request /// ([`Session::allow_plugin_grants_from_requests`]). plugin_grants_from_requests: bool, - /// URLs recently given in the Attributes panel (`attributes.set {url}`), newest first; not saved. + /// URLs recently given in the Attributes panel (`attributes.set {url}`), newest first, at most + /// [`cmd::RECENT_URLS`]; not saved. pub recent_urls: Vec<String>, /// The saved tracing presets' revision and latest changes ([`Session::trace_presets_revision`]). pub(crate) trace_preset_changes: cmd::TracePresetChanges, diff --git a/crates/engine/src/tests/attributes.rs b/crates/engine/src/tests/attributes.rs index b6d00111e2..35dda8656b 100644 --- a/crates/engine/src/tests/attributes.rs +++ b/crates/engine/src/tests/attributes.rs @@ -90,6 +90,23 @@ fn values_that_differ_read_null_and_recent_urls_keep_the_newest_first() { assert_eq!(info(&mut s, json!({"ids": [p.0, a.0]}))["showCenter"], Value::Null); } +/// The recent URLs keep the 30 newest distinct URLs, the most the panel's URL menu can list, and +/// a URL given again moves to the front without taking a second place. +#[test] +fn recent_urls_keep_the_thirty_newest() { + let mut s = session(); + rect(&mut s, 0.0); + for i in 0..35 { + run(&mut s, "attributes.set", json!({"url": format!("https://example.com/{i}")})); + } + let want: Vec<String> = (5..35).rev().map(|i| format!("https://example.com/{i}")).collect(); + assert_eq!(info(&mut s, json!({}))["recentUrls"], json!(want)); + run(&mut s, "attributes.set", json!({"url": "https://example.com/20"})); + let urls = info(&mut s, json!({}))["recentUrls"].as_array().unwrap().clone(); + assert_eq!((urls.len(), urls[0].as_str(), urls[1].as_str()), (30, Some("https://example.com/20"), Some("https://example.com/34"))); + assert_eq!(urls.iter().filter(|u| *u == "https://example.com/20").count(), 1); +} + /// A five-pointed star drawn as one self-intersecting path (its centre is wound twice). fn star(s: &mut Session) -> NodeId { let (c, r) = (50.0f64, 45.0f64); diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 0e3d6df203..829206e156 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1099,6 +1099,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{color?: #rrggbb or a preset name (Light Red, the default, then the layer colors such as \"Light Blue\"), solidDashes?: bool (Draw Dashed Lines as Solid Lines, off by default: the Navigator's thumbnail draws dashed strokes without their dashes; the canvas, printing and exports keep them)} set the Navigator panel's options, the color its view box is drawn in and solid dashes (kept with the UI state) → {color, solidDashes}; with neither, open its Panel Options (dialog `navigatorPanelOptions`, fields color, solidDashes; OK sets them); an error for a value that is not a color or not true or false, which changes nothing", ), + ( + "ui.attributesPanelOptions", + "Panel Options…", + "", + "{count?: 1–30 (10 by default)} set how many of the recent URLs (attributes.info › recentUrls, which keeps 30) the Attributes panel's URL menu lists, newest first (kept with the UI state) → {count}; without count, open its Panel Options (dialog `attributesPanelOptions`, field count; OK sets it); an error for a count that is not a whole number from 1 to 30, which changes nothing", + ), ( "ui.layersExpand", "Expand Layers Panel Rows", diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index da1062838f..79cb24cba3 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -15,6 +15,7 @@ pub mod action_select_object; pub mod action_set_options; pub mod action_stop; pub mod artboard_options; +pub mod attributes_panel_options; pub mod blend_options; mod brush_art_options; pub mod brush_delete; @@ -466,6 +467,7 @@ registry! { LayerOptions: [layer_options::KIND] => layer_options::SPEC, LayersPanelOptions: [layers_panel_options::KIND] => layers_panel_options::SPEC, NavigatorPanelOptions: [navigator_panel_options::KIND] => navigator_panel_options::SPEC, + AttributesPanelOptions: [attributes_panel_options::KIND] => attributes_panel_options::SPEC, PathfinderOptions: [pathfinder_options::KIND] => pathfinder_options::SPEC, PixelSnapOptions: [pixel_snap_options::KIND] => pixel_snap_options::SPEC, RearrangeArtboards: [rearrange_artboards::KIND] => rearrange_artboards::SPEC, diff --git a/crates/ui-egui/src/dialogs/attributes_panel_options.rs b/crates/ui-egui/src/dialogs/attributes_panel_options.rs new file mode 100644 index 0000000000..2a5a7356ff --- /dev/null +++ b/crates/ui-egui/src/dialogs/attributes_panel_options.rs @@ -0,0 +1,82 @@ +//! Attributes panel › Panel Options…: how many recent URLs the panel's URL menu lists. +//! +//! Field: `count` (1–30). OK runs `ui.attributesPanelOptions` with it (kept with the UI state). + +use serde_json::{Value, json}; + +use super::DialogSpec; +use super::swatch_options::{grid, label}; +use crate::panels::attributes::DEFAULT_RECENT_URLS; +use crate::state::Dialog; +use crate::{VectorcraftApp, widgets}; + +/// The dialog kind of the Attributes Panel Options. +pub const KIND: &str = "attributesPanelOptions"; + +pub(super) const SPEC: DialogSpec = + DialogSpec { heading: |_| tl!("Attributes Panel Options").into(), body, confirm, min_width: 280.0, ..DialogSpec::FORM }; + +/// `ui.attributesPanelOptions` without options: open the dialog on the panel's options. +pub fn open(app: &mut VectorcraftApp) -> Result<Value, String> { + let count = app.ui.attributes_panel.shown(); + app.ui.dialog = Some(Dialog::new(KIND, json!({ "count": count }))); + Ok(Value::Null) +} + +fn body(_: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { + grid(ui, |ui| { + label(ui, tl!("Number of Recent URLs:")); + let v = d.f64("count", f64::from(DEFAULT_RECENT_URLS)); + let max = vectorcraft_engine::cmd::RECENT_URLS as f64; + if let Some(v) = widgets::range_field(ui, "attributes-recent-urls", v, 1.0..=max, "", 0, 60.0) { + d.fields.insert("count".into(), json!(v)); + } + ui.end_row(); + }); + false +} + +/// OK: set the count; a count that is refused leaves the dialog open. +fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { + let params = json!({ "count": d.fields.get("count").cloned().unwrap_or(Value::Null) }); + let r = app.run("ui.attributesPanelOptions", params)?; + app.ui.dialog = None; + Ok(r) +} + +#[cfg(test)] +mod tests { + use super::*; + use vectorcraft_engine::Session; + + /// The dialog opens on the panel's count (10 by default), OK sets it, kept with the UI state, + /// and a count out of range is refused, leaving the dialog open and the count as it was. + #[test] + fn panel_options_set_the_recent_url_count() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("ui.attributesPanelOptions", json!({})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.kind.as_str(), d.f64("count", 0.0)), (KIND, 10.0)); + // Drawn headlessly in the shared frame. + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let mut out = ctx.run_ui(Default::default(), |ui| super::super::show(&mut app, ui.ctx())); + out.textures_delta.clear(); + let set = |app: &mut VectorcraftApp, count: Value| { + app.ui.dialog.as_mut().unwrap().fields.insert("count".into(), count); + super::super::confirm(app) + }; + assert_eq!(set(&mut app, json!(25.0)).unwrap(), json!({"count": 25})); + assert!(app.ui.dialog.is_none()); + assert_eq!(app.ui.attributes_panel.recent_urls, 25); + app.run("ui.attributesPanelOptions", json!({})).unwrap(); + assert_eq!(app.ui.dialog.as_ref().unwrap().f64("count", 0.0), 25.0, "opens on the current count"); + assert!(set(&mut app, json!(31)).is_err()); + assert!(app.ui.dialog.is_some() && app.ui.attributes_panel.recent_urls == 25, "a refused count changes nothing"); + // Cancel closes the dialog without applying what was typed. + app.ui.dialog.as_mut().unwrap().fields.insert("count".into(), json!(3)); + super::super::cancel(&mut app); + assert!(app.ui.dialog.is_none()); + assert_eq!(app.ui.attributes_panel.recent_urls, 25); + } +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 71e443a399..a4ab22438b 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2113,6 +2113,9 @@ font-technology Variable Променливи Navigate Навигация Navigator Навигатор Navigator Panel Options Опции за панела „Навигатор“ + Attributes Panel Options Опции за панела „Атрибути“ + Number of Recent URLs: Брой скорошни URL адреси: +@msg `count` must be a whole number from 1 to 30 `count` трябва да е цяло число от 1 до 30 Draw Dashed Lines as Solid Lines Изчертаване на прекъснатите линии като плътни Needs the desktop app Изисква десктоп приложение Neutral Gradients Неутрални градиенти diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 883d6dd387..6fc2c9ebef 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -766,6 +766,9 @@ Magic Wand Čarobni štapić Navigator Navigator Navigator Panel Options Opcije panela navigatora + Attributes Panel Options Opcije panela atributa + Number of Recent URLs: Broj nedavnih URL-ova: +@msg `count` must be a whole number from 1 to 30 `count` mora biti cijeli broj od 1 do 30 Draw Dashed Lines as Solid Lines Crtaj isprekidane linije kao pune Pattern Options Opcije uzorka Properties Svojstva diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index a8a63cbf55..1356db240b 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -2776,6 +2776,9 @@ digits Malayalam Malaiàlam Navigate Navega Navigator Navegador Navigator Panel Options Opcions del panell Navegador + Attributes Panel Options Opcions del panell Atributs + Number of Recent URLs: Nombre d’URL recents: +@msg `count` must be a whole number from 1 to 30 `count` ha de ser un nombre enter d’1 a 30 Draw Dashed Lines as Solid Lines Dibuixa les línies discontínues com a contínues Needs a choice Necessita una tria Needs a key Necessita una clau diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 569b1347ec..fdb2b53988 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -779,6 +779,9 @@ Magic Wand Kouzelná hůlka Navigator Navigátor Navigator Panel Options Možnosti panelu Navigátor + Attributes Panel Options Možnosti panelu Atributy + Number of Recent URLs: Počet nedávných URL: +@msg `count` must be a whole number from 1 to 30 `count` musí být celé číslo od 1 do 30 Draw Dashed Lines as Solid Lines Kreslit čárkované čáry jako plné Pattern Options Možnosti vzorku Properties Vlastnosti diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4578e4efc1..94eb01b545 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3398,6 +3398,9 @@ liquify-list-end {0}, {1} {0} og {1} Magic Wand Magisk tryllestav Navigator Navigator Navigator Panel Options Indstillinger for navigatorpanelet + Attributes Panel Options Indstillinger for attributpanelet + Number of Recent URLs: Antal seneste URL'er: +@msg `count` must be a whole number from 1 to 30 `count` skal være et heltal fra 1 til 30 Draw Dashed Lines as Solid Lines Tegn stiplede linjer som hele linjer Pattern Options Mønsterindstillinger Properties Egenskaber diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index c943c89dd2..f15f34919b 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2193,6 +2193,9 @@ file-filter Templates Vorlagen Navigate Navigieren Navigator Navigator Navigator Panel Options Optionen für das Navigatorbedienfeld + Attributes Panel Options Optionen für das Attributebedienfeld + Number of Recent URLs: Anzahl zuletzt verwendeter URLs: +@msg `count` must be a whole number from 1 to 30 `count` muss eine ganze Zahl von 1 bis 30 sein Draw Dashed Lines as Solid Lines Gestrichelte Linien als durchgezogene Linien zeichnen Needs the desktop app Erfordert die Desktop-App Neutral Gradients Neutrale Verläufe diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 906640aa0a..0620ebb7e2 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1888,6 +1888,9 @@ font-technology Variable Μεταβλητές Name: Όνομα: Navigator Πλοήγηση Navigator Panel Options Επιλογές πίνακα πλοήγησης + Attributes Panel Options Επιλογές πίνακα χαρακτηριστικών + Number of Recent URLs: Αριθμός πρόσφατων διευθύνσεων URL: +@msg `count` must be a whole number from 1 to 30 Το `count` πρέπει να είναι ακέραιος από 1 έως 30 Draw Dashed Lines as Solid Lines Σχεδίαση διακεκομμένων γραμμών ως συνεχών New Νέο Scatter: Διασπορά: diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9239c93a73..9d7023ec9f 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2194,6 +2194,9 @@ font-technology Variable Variables Navigate Navegar Navigator Navegador Navigator Panel Options Opciones del panel Navegador + Attributes Panel Options Opciones del panel Atributos + Number of Recent URLs: Número de URL recientes: +@msg `count` must be a whole number from 1 to 30 `count` debe ser un número entero entre 1 y 30 Draw Dashed Lines as Solid Lines Dibujar líneas discontinuas como continuas Needs the desktop app Requiere la aplicación de escritorio Neutral Gradients Degradados neutros diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 423703e5c1..622dc1e7d6 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -770,6 +770,9 @@ Magic Wand Taikasauva Navigator Navigaattori Navigator Panel Options Navigaattori-paneelin asetukset + Attributes Panel Options Määritteet-paneelin asetukset + Number of Recent URLs: Viimeisimpien URL-osoitteiden määrä: +@msg `count` must be a whole number from 1 to 30 `count` on oltava kokonaisluku 1–30 Draw Dashed Lines as Solid Lines Piirrä katkoviivat yhtenäisinä viivoina Pattern Options Kuvion asetukset Properties Ominaisuudet diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8af602785b..315099dae6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2184,6 +2184,9 @@ font-technology Variable Variables Navigate Naviguer Navigator Navigation Navigator Panel Options Options du panneau Navigation + Attributes Panel Options Options du panneau Options d’objet + Number of Recent URLs: Nombre d’URL récentes : +@msg `count` must be a whole number from 1 to 30 `count` doit être un nombre entier compris entre 1 et 30 Draw Dashed Lines as Solid Lines Dessiner les pointillés en traits pleins Needs the desktop app Nécessite l’application de bureau Neutral Gradients Dégradés neutres diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..65800aaac4 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2278,6 +2278,9 @@ Navigate નેવિગેટ કરો Navigator નેવિગેટર Navigator Panel Options નેવિગેટર પૅનલ વિકલ્પો + Attributes Panel Options ગુણધર્મો પૅનલ વિકલ્પો + Number of Recent URLs: તાજેતરના URLની સંખ્યા: +@msg `count` must be a whole number from 1 to 30 `count` 1 થી 30 સુધીની પૂર્ણ સંખ્યા હોવી જોઈએ Needs Attention Only માત્ર ધ્યાન માગતા Needs a choice પસંદગી જરૂરી Needs a key કીની જરૂર છે diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index de33cdbd92..1447ae7e01 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -3032,6 +3032,9 @@ antiAlias Sharp शार्प Navigate नेविगेट करें Navigator नेविगेटर Navigator Panel Options नेविगेटर पैनल ऑप्शन्स + Attributes Panel Options एट्रिब्यूट्स पैनल ऑप्शन्स + Number of Recent URLs: हाल के URL की संख्या: +@msg `count` must be a whole number from 1 to 30 `count` 1 से 30 तक पूरी संख्या होना चाहिए Nearly Closed Paths लगभग बंद पाथ Nearly Coincident Anchors लगभग Coincident एंकर Needless Clipping Groups अनावश्यक क्लिपिंग समूह diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index f869e7d07b..886fc759f0 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -2737,6 +2737,9 @@ file-filter Templates Sablonok Navigate Navigálás Navigator Navigátor Navigator Panel Options Navigátor panel beállításai + Attributes Panel Options Attribútumok panel beállításai + Number of Recent URLs: Legutóbbi URL-ek száma: +@msg `count` must be a whole number from 1 to 30 `count`: 1 és 30 közötti egész szám kell Draw Dashed Lines as Solid Lines Szaggatott vonalak rajzolása folytonosként Needs the desktop app Az asztali alkalmazás kell hozzá Negative Negatív diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c5f865e69b..1d7632f34c 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -724,6 +724,9 @@ Magic Wand Tongkat ajaib Navigator Navigator Navigator Panel Options Opsi panel navigator + Attributes Panel Options Opsi panel atribut + Number of Recent URLs: Jumlah URL terbaru: +@msg `count` must be a whole number from 1 to 30 `count` harus bilangan bulat dari 1 sampai 30 Draw Dashed Lines as Solid Lines Gambar garis putus-putus sebagai garis utuh Pattern Options Opsi pola Properties Properti diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 08cefdbed7..14c4d1c6cf 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2230,6 +2230,9 @@ file-filter Templates Modelli Navigate Naviga Navigator Navigatore Navigator Panel Options Opzioni pannello Navigatore + Attributes Panel Options Opzioni pannello Attributi + Number of Recent URLs: Numero di URL recenti: +@msg `count` must be a whole number from 1 to 30 `count` deve essere un numero intero compreso tra 1 e 30 Draw Dashed Lines as Solid Lines Disegna le linee tratteggiate come linee continue Needs the desktop app Richiede l'app desktop Neutral Gradients Sfumature neutre diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 59c7628f40..3562378244 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -798,6 +798,9 @@ digits Malayalam マラヤーラム数字 Magic Wand 自動選択 Navigator ナビゲーター Navigator Panel Options ナビゲーターパネルオプション + Attributes Panel Options 属性パネルオプション + Number of Recent URLs: 最近使った URL の数: +@msg `count` must be a whole number from 1 to 30 `count` には 1 から 30 までの整数を指定してください Draw Dashed Lines as Solid Lines 破線を実線で表示 Pattern Options パターンオプション Properties プロパティ diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 9393433cdb..57e63f701f 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2773,6 +2773,9 @@ Magic Wand ჯადოსნური ჯოხი Navigator ნავიგატორი Navigator Panel Options ნავიგატორის პანელის პარამეტრები + Attributes Panel Options ატრიბუტების პანელის პარამეტრები + Number of Recent URLs: ბოლოდროინდელი URL-ების რაოდენობა: +@msg `count` must be a whole number from 1 to 30 `count` უნდა იყოს მთელი რიცხვი 1-დან 30-მდე Draw Dashed Lines as Solid Lines ტირეებიანი ხაზების უწყვეტ ხაზებად დახატვა Pattern Options პატერნის პარამეტრები Properties თვისებები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 49d5e10dc1..a951bca253 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -791,6 +791,9 @@ digits Malayalam 말라얄람어 Magic Wand 마술봉 Navigator 내비게이터 Navigator Panel Options 내비게이터 패널 옵션 + Attributes Panel Options 속성 패널 옵션 + Number of Recent URLs: 최근 URL 수: +@msg `count` must be a whole number from 1 to 30 `count`은(는) 1에서 30 사이의 정수여야 합니다 Draw Dashed Lines as Solid Lines 점선을 실선으로 그리기 Pattern Options 패턴 옵션 Properties 속성 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f071ebd0e2..2df6b36831 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1292,6 +1292,9 @@ liquify-list-end {0}, {1} {0} en {1} Magic Wand Magische toverstaf Navigator Navigator Navigator Panel Options Opties voor het paneel Navigator + Attributes Panel Options Opties voor het paneel Kenmerken + Number of Recent URLs: Aantal recente URL's: +@msg `count` must be a whole number from 1 to 30 `count` moet een geheel getal van 1 tot 30 zijn Draw Dashed Lines as Solid Lines Streepjeslijnen als doorgetrokken lijnen tekenen Pattern Options Patroonopties Properties Eigenschappen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 2477c73abd..8cdfdb29d1 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -726,6 +726,9 @@ Magic Wand Różdżka Navigator Nawigator Navigator Panel Options Opcje panelu Nawigator + Attributes Panel Options Opcje panelu Atrybuty + Number of Recent URLs: Liczba ostatnich adresów URL: +@msg `count` must be a whole number from 1 to 30 `count` musi być liczbą całkowitą od 1 do 30 Draw Dashed Lines as Solid Lines Rysuj linie przerywane jako ciągłe Pattern Options Opcje wzorka Properties Właściwości diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 333351b9af..fac99b0fc7 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1829,6 +1829,9 @@ antiAlias Sharp Nítido Navigate Navegar Navigator Navegador Navigator Panel Options Opções do painel Navegador + Attributes Panel Options Opções do painel Atributos + Number of Recent URLs: Número de URLs Recentes: +@msg `count` must be a whole number from 1 to 30 `count` deve ser um número inteiro de 1 a 30 Draw Dashed Lines as Solid Lines Desenhar linhas tracejadas como linhas sólidas Needs the desktop app Requer o aplicativo de desktop Neutral Gradients Gradientes Neutros diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ae33aa0d55..931c8768d2 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2221,6 +2221,9 @@ file-filter Templates Шаблоны Navigate Навигация Navigator Навигатор Navigator Panel Options Параметры панели «Навигатор» + Attributes Panel Options Параметры панели «Атрибуты» + Number of Recent URLs: Число последних URL: +@msg `count` must be a whole number from 1 to 30 `count` должно быть целым числом от 1 до 30 Draw Dashed Lines as Solid Lines Рисовать штриховые линии сплошными Needs the desktop app Требуется настольное приложение Neutral Gradients Нейтральные градиенты diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 1bd4fd0692..debf440d55 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2129,6 +2129,9 @@ font-technology Variable Variabla Navigate Navigera Navigator Navigator Navigator Panel Options Alternativ för panelen Navigator + Attributes Panel Options Alternativ för panelen Attribut + Number of Recent URLs: Antal senaste URL:er: +@msg `count` must be a whole number from 1 to 30 `count` måste vara ett heltal från 1 till 30 Draw Dashed Lines as Solid Lines Rita streckade linjer som heldragna linjer Needs the desktop app Kräver skrivbordsappen Neutral Gradients Neutrala gradienter diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index d21a146585..c54a75c05c 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -434,6 +434,22 @@ fn font_height_reference_labels_are_in_complete_catalogs() { } } +/// The Attributes Panel Options dialog's heading and field, and the error for a count out of range. +#[test] +fn attributes_panel_options_strings_are_in_complete_catalogs() { + for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { + for label in ["Attributes Panel Options", "Number of Recent URLs:"] { + assert!(lang.catalog().plain(label).is_some(), "{} is missing {label}", lang.code); + } + } + let range = "`count` must be a whole number from 1 to 30"; + assert!(message_literals().contains(range)); + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + assert_ne!(message(lang, range), range, "{code}"); + } +} + /// The Objects on Path Options section's Detach button, its undo step and the message for a /// Detach with no object chosen. #[test] diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a2a38c679a..7443463ef5 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2009,6 +2009,9 @@ font-technology Variable Değişken Navigate Gezin Navigator Gezgin Navigator Panel Options Gezgin Paneli Seçenekleri + Attributes Panel Options Nitelikler Paneli Seçenekleri + Number of Recent URLs: Son URL Sayısı: +@msg `count` must be a whole number from 1 to 30 `count` 1 ile 30 arasında bir tam sayı olmalıdır Draw Dashed Lines as Solid Lines Kesikli Çizgileri Düz Çizgi Olarak Çiz Needs the desktop app Masaüstü uygulaması gerekiyor Neutral Gradients Nötr Degradeler diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 17c673885d..be86bef9ee 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2224,6 +2224,9 @@ file-filter Templates Шаблони Navigate Навігація Navigator Навігатор Navigator Panel Options Параметри панелі «Навігатор» + Attributes Panel Options Параметри панелі «Атрибути» + Number of Recent URLs: Кількість останніх URL: +@msg `count` must be a whole number from 1 to 30 `count` має бути цілим числом від 1 до 30 Draw Dashed Lines as Solid Lines Малювати штрихові лінії суцільними Needs the desktop app Потрібен настільний додаток Neutral Gradients Нейтральні градієнти diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index da89525314..721f77b009 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -2555,6 +2555,9 @@ digits Hindi Hindi Navigate Dẫn hướng Navigator Bộ dẫn hướng Navigator Panel Options Tùy chọn bảng bộ dẫn hướng + Attributes Panel Options Tùy chọn bảng thuộc tính + Number of Recent URLs: Số URL gần đây: +@msg `count` must be a whole number from 1 to 30 `count` phải là số nguyên từ 1 đến 30 Draw Dashed Lines as Solid Lines Vẽ đường nét đứt thành đường liền Needs the desktop app Cần ứng dụng máy tính để bàn Neutral Gradients Chuyển sắc trung tính diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 5f612cb0d4..98534a2b07 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2096,6 +2096,9 @@ file-filter Templates 模板 Navigate 导航 Navigator 导航器 Navigator Panel Options 导航器面板选项 + Attributes Panel Options 属性面板选项 + Number of Recent URLs: 最近使用的网址数量: +@msg `count` must be a whole number from 1 to 30 `count` 必须是 1 到 30 之间的整数 Draw Dashed Lines as Solid Lines 将虚线绘制为实线 Needs the desktop app 需要桌面应用 Neutral Gradients 中性渐变 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e0b5a13ee2..560de59b0a 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3352,6 +3352,9 @@ liquify-list-end {0}, {1} {0}和{1} Navigate 導覽 Navigator 導覽器 Navigator Panel Options 導覽器面板選項 + Attributes Panel Options 屬性面板選項 + Number of Recent URLs: 最近使用的網址數量: +@msg `count` must be a whole number from 1 to 30 `count` 必須是 1 到 30 之間的整數 Draw Dashed Lines as Solid Lines 將虛線繪製為實線 Needs the desktop app 需要桌面版應用程式 Neutral Gradients 中性漸層 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 495e606d6c..13bec6b050 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -838,6 +838,7 @@ fn run_ui_part8(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result< "artboard.selectAll" => crate::panels::artboards::select_all_command(app), "ui.layersPanelOptions" => crate::dialogs::layers_panel_options::open(app), "ui.navigatorPanelOptions" => crate::panels::navigator::set_options(app, p), + "ui.attributesPanelOptions" => crate::panels::attributes::set_options(app, p), "ui.layersExpand" => crate::panels::layers::expand(app, p), "ui.layersFilter" => crate::panels::layers::set_filter(app, p), "ui.panelView" => crate::panels::set_view(app, p), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ced961e32c..a8ccf5a908 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1100,6 +1100,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{color?: #rrggbb or a preset name (Light Red, the default, then the layer colors such as \"Light Blue\"), solidDashes?: bool (Draw Dashed Lines as Solid Lines, off by default: the Navigator's thumbnail draws dashed strokes without their dashes; the canvas, printing and exports keep them)} set the Navigator panel's options, the color its view box is drawn in and solid dashes (kept with the UI state) → {color, solidDashes}; with neither, open its Panel Options (dialog `navigatorPanelOptions`, fields color, solidDashes; OK sets them); an error for a value that is not a color or not true or false, which changes nothing", ), + ( + "ui.attributesPanelOptions", + "Panel Options…", + "", + "{count?: 1–30 (10 by default)} set how many of the recent URLs (attributes.info › recentUrls, which keeps 30) the Attributes panel's URL menu lists, newest first (kept with the UI state) → {count}; without count, open its Panel Options (dialog `attributesPanelOptions`, field count; OK sets it); an error for a count that is not a whole number from 1 to 30, which changes nothing", + ), ( "ui.layersExpand", "Expand Layers Panel Rows", diff --git a/crates/ui-egui/src/panels/attributes.rs b/crates/ui-egui/src/panels/attributes.rs index d387735de9..19efb7055a 100644 --- a/crates/ui-egui/src/panels/attributes.rs +++ b/crates/ui-egui/src/panels/attributes.rs @@ -1,13 +1,15 @@ //! Attributes panel: Overprint Fill / Overprint Stroke, Show / Don't Show Center, Reverse Path //! Direction Off / On, the fill rule (non-zero winding or even-odd), Image Map, URL (with the -//! recent URLs and a Browser button) and the note. The menu hides the options and shows the note. +//! recent URLs and a Browser button) and the note. The menu hides the options and shows the note, +//! and its Panel Options… sets how many recent URLs the URL menu lists ([`PanelOptions`]). //! Everything reads `attributes.info` ([`vectorcraft_engine::Session::attributes_info`]) and acts //! through `attributes.set`, `path.reverse` and `path.setFillRule`. use egui::Ui; +use serde::{Deserialize, Deserializer, Serialize}; use serde_json::{Value, json}; use vectorcraft_doc::{ImageMap, NodeId, NodeKind}; -use vectorcraft_engine::cmd::AttributesInfo; +use vectorcraft_engine::cmd::{AttributesInfo, RECENT_URLS}; use vectorcraft_geom::FillRule; use super::{pstate, selection_len, set_pstate}; @@ -20,6 +22,63 @@ const HIDE_OPTIONS: &str = "attr-hide-options"; const HIDE_NOTE: &str = "attr-hide-note"; const LABEL_W: f32 = 70.0; +/// How many recent URLs the URL menu lists by default (VectorCraft's own value). +pub const DEFAULT_RECENT_URLS: u8 = 10; + +/// Attributes panel options (≡ › Panel Options…), kept with the UI state. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default, rename_all = "camelCase")] +pub struct PanelOptions { + /// How many of the recent URLs the URL menu lists, 1 to [`RECENT_URLS`]. A saved value that is + /// not a whole number in that range reads as [`DEFAULT_RECENT_URLS`]. + #[serde(deserialize_with = "saved_count")] + pub recent_urls: u8, +} + +impl Default for PanelOptions { + fn default() -> Self { + Self { recent_urls: DEFAULT_RECENT_URLS } + } +} + +impl PanelOptions { + /// How many recent URLs the URL menu lists: [`Self::recent_urls`], or the default when it is + /// out of range. + pub fn shown(&self) -> usize { + Some(usize::from(self.recent_urls)).filter(|n| (1..=RECENT_URLS).contains(n)).unwrap_or(usize::from(DEFAULT_RECENT_URLS)) + } +} + +/// A saved count of recent URLs: a whole number from 1 to [`RECENT_URLS`], anything else the default. +fn saved_count<'de, D: Deserializer<'de>>(d: D) -> Result<u8, D::Error> { + let v = Value::deserialize(d)?; + Ok(count(&v).unwrap_or(DEFAULT_RECENT_URLS)) +} + +/// `v` as a count of recent URLs, when it is a whole number from 1 to [`RECENT_URLS`]. +fn count(v: &Value) -> Option<u8> { + let n = v.as_f64().filter(|n| n.fract() == 0.0 && (1.0..=RECENT_URLS as f64).contains(n))?; + u8::try_from(n as u64).ok() +} + +/// `ui.attributesPanelOptions {count?}`: without `count`, open Panel Options on the panel's +/// options; otherwise set how many recent URLs the URL menu lists and answer the options. A count +/// that is not a whole number from 1 to 30 is an error, and nothing changes. +pub fn set_options(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> { + let Some(c) = p.get("count") else { + return crate::dialogs::attributes_panel_options::open(app); + }; + let n = count(c).ok_or("`count` must be a whole number from 1 to 30")?; + app.ui.attributes_panel.recent_urls = n; + Ok(json!({ "count": n })) +} + +/// The recent URLs the URL menu lists, newest first: as many as Panel Options sets. +fn menu_urls(app: &VectorcraftApp) -> &[String] { + let urls = &app.session.recent_urls; + &urls[..urls.len().min(app.ui.attributes_panel.shown())] +} + /// The panel's values and whether the targets hold paths (direction and fill rule apply), /// recomputed only when the document or the selection changes. fn state(app: &VectorcraftApp, ctx: &egui::Context) -> (AttributesInfo, bool) { @@ -133,13 +192,13 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } } -/// The recent URLs button: a menu of the URLs given lately; picking one sets it. +/// The recent URLs button: a menu of the URLs given lately ([`menu_urls`]); picking one sets it. fn recent_urls(app: &mut VectorcraftApp, ui: &mut Ui) { let resp = widgets::icon_button_enabled(ui, "chevron-down", tl!("Recent URLs"), false, !app.session.recent_urls.is_empty(), 20.0); let mut chosen = None; egui::Popup::menu(&resp).show(|ui| { ui.set_min_width(220.0); - for u in &app.session.recent_urls { + for u in menu_urls(app) { if widgets::menu_item_name(ui, u, true, false) { chosen = Some(u.clone()); } @@ -150,13 +209,16 @@ fn recent_urls(app: &mut VectorcraftApp, ui: &mut Ui) { } } -pub fn menu(_app: &mut VectorcraftApp, ui: &mut Ui) { +pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { for (key, hide, show) in [(HIDE_OPTIONS, tl!("Hide Options"), tl!("Show Options")), (HIDE_NOTE, tl!("Hide Note"), tl!("Show Note"))] { let hidden: bool = pstate(ui.ctx(), key); if menu_item(ui, if hidden { show } else { hide }, true, false) { set_pstate(ui.ctx(), key, !hidden); } } + if menu_item(ui, tl!("Panel Options…"), true, false) { + app.run("ui.attributesPanelOptions", json!({})).ok(); + } } /// `attributes.openUrl {url?}`: open `url`, else the selection's URL, in the web browser. @@ -257,4 +319,39 @@ mod tests { open_url(&mut app, &json!({"url": "https://example.com/b"})).unwrap(); assert_eq!(*opened.borrow(), ["https://example.com/b"]); } + + /// The URL menu lists the newest 10 recent URLs by default, and `ui.attributesPanelOptions` + /// sets how many it lists, from 1 to 30, kept with the UI state. A lower count hides the older + /// URLs without forgetting them, and a count that is not a whole number from 1 to 30 is an + /// error that changes nothing. + #[test] + fn panel_options_set_how_many_recent_urls_the_menu_lists() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + run(&mut app, "file.new", json!({"width": 100, "height": 100})); + run(&mut app, "shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})); + for i in 0..32 { + run(&mut app, "attributes.set", json!({"url": format!("https://example.com/{i}")})); + } + assert!(frame(&mut app).iter().any(|t| t == " Panel Options…")); + assert_eq!((menu_urls(&app).len(), menu_urls(&app)[0].as_str()), (10, "https://example.com/31")); + assert_eq!(app.run("ui.attributesPanelOptions", json!({"count": 1})).unwrap(), json!({"count": 1})); + assert_eq!(menu_urls(&app), ["https://example.com/31"]); + app.run("ui.attributesPanelOptions", json!({"count": 30.0})).unwrap(); + assert_eq!((menu_urls(&app).len(), menu_urls(&app)[29].as_str()), (30, "https://example.com/2")); + for bad in [json!(0), json!(31), json!(2.5), json!(-1), json!("5"), Value::Null] { + assert!(app.run("ui.attributesPanelOptions", json!({"count": bad})).is_err(), "{bad}"); + } + assert_eq!(app.ui.attributes_panel.recent_urls, 30, "a refused count changes nothing"); + assert_eq!(app.session.recent_urls.len(), 30); + // Kept with the UI state; UI state saved without it, or with a count out of range, lists 10. + let back: crate::UiState = serde_json::from_value(serde_json::to_value(&app.ui).unwrap()).unwrap(); + assert_eq!(back.attributes_panel.recent_urls, 30); + let old: crate::UiState = serde_json::from_value(json!({})).unwrap(); + assert_eq!(old.attributes_panel, PanelOptions::default()); + for saved in [json!(0), json!(99), json!(1000), json!(4.5), json!("12"), Value::Null] { + let s: crate::UiState = serde_json::from_value(json!({"attributes_panel": {"recentUrls": saved}})).unwrap(); + assert_eq!(s.attributes_panel.shown(), 10, "{saved}"); + } + assert_eq!(PanelOptions { recent_urls: 200 }.shown(), 10); + } } diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index d3698aaeef..6d4c1f6585 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -853,6 +853,9 @@ pub struct UiState { /// Navigator panel › Panel Options… (the view box color, Draw Dashed Lines as Solid Lines). #[serde(default)] pub navigator_panel: crate::panels::navigator::PanelOptions, + /// Attributes panel › Panel Options… (how many recent URLs the URL menu lists). + #[serde(default)] + pub attributes_panel: crate::panels::attributes::PanelOptions, /// The Layers panel's Filter (`ui.layersFilter`). It is not saved and lasts the session, as the /// Search All text does. #[serde(skip)] @@ -1273,6 +1276,7 @@ impl Default for UiState { trace_hold_source: None, layers_panel: Default::default(), navigator_panel: Default::default(), + attributes_panel: Default::default(), layers_filter: Default::default(), swatches_view: Default::default(), graphic_styles_view: Default::default(), diff --git a/docs/mcp.md b/docs/mcp.md index c7aa202d3f..7c80eae06a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5692,9 +5692,18 @@ paths and compound paths, and `path.reverse {reversed?}` makes subpaths run coun (false). When every subpath of a path or compound path turns alike, its strokes' width profiles (left and right swapped) and pen pressure, tilt, bearing and rotation turn with it, so the strokes draw as before. SVG export wraps an object with a URL in `<a xlink:href>`, and SVG import reads `<a href>` links back. +`recentUrls` keeps the 30 newest distinct URLs given in the session, newest first. The panel's URL menu lists the +first 10 of them by default; the panel menu's Panel Options… opens the `attributesPanelOptions` dialog (field `count`), +and `ui.attributesPanelOptions {count}` sets the number without it, a whole number from 1 to 30 → `{count}`. A lower +count hides the older URLs without removing them from `recentUrls`. The count is kept with the UI state; a count out of +range is an error and changes nothing. The help page +[Create image maps for web graphics](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/create-image-maps-for-web-graphics.html) +describes the same 1 to 30 range; the default of 10 is VectorCraft's own value. + ```json {"name":"run_command","arguments":{"command":"attributes.set","params":{"ids":[12],"url":"https://example.com","imageMap":"rectangle"}}} {"name":"run_command","arguments":{"command":"path.setFillRule","params":{"rule":"evenOdd"}}} +{"name":"invoke_menu","arguments":{"command":"ui.attributesPanelOptions","params":{"count":20}}} ``` ## SVG interactivity diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0782bacab9..b3e2de6d72 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1332,6 +1332,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Artboard click-to-fit (#1227):** a plain click fits the topmost editable object or group to a new artboard, including its stroke like Fit to Selected Art, and makes the new artboard active. Art and its selection stay unchanged; creation is one undo step. Handles, modified clicks, drags, Escape and tool changes retain their meaning. Tested inside an artboard and on the pasteboard (`crates/engine/tests/it/artboard_click.rs`); the public [CS6 Printing Guide](https://helpx.adobe.com/content/dam/help/en/indesign/pdf/CS6_PrintGuide.pdf) documents the object-click gesture. This legacy gesture adds evidence without regrading the 2026 canvas controls. - **Rotated views:** with the view rotated, Fit Artboard in Window, Fit All in Window and the status bar's artboard navigator fit the artboard or the art as the view turns it, and a Zoom tool marquee (Animated Zoom or GPU Performance off) zooms to the area dragged across. Ruler guides on no artboard turn with the view. The canvas draws the selection marquee where the tools select, Show Hidden Characters draws the marks of type partly inside the canvas, the Contextual Task Bar stays under the selection, and the Navigator's red box outlines what the window shows. - **Navigator panel options:** the Navigator panel menu's Panel Options… sets the color the view box is drawn in, from a preset list (VectorCraft's own: Light Red, the default, then the layer colors) or a custom color, and Draw Dashed Lines as Solid Lines, off by default, which draws dashed strokes without their dashes in the panel's thumbnail only (`ui.navigatorPanelOptions`; kept with the UI state; behavior reference: [View artwork](https://helpx.adobe.com/illustrator/using/viewing-artwork.html)). +- **Attributes panel options:** the Attributes panel menu's Panel Options… sets how many recent URLs the URL menu lists, a whole number from 1 to 30 (10 by default, VectorCraft's own value); the panel keeps the 30 newest URLs of the session, so a lower count hides older URLs without removing them (`ui.attributesPanelOptions`; kept with the UI state; behavior reference: [Create image maps for web graphics](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/create-image-maps-for-web-graphics.html); test `panel_options_set_how_many_recent_urls_the_menu_lists`). - **Views:** the status bar's artboard navigator (first, previous, next, last; `view.goToArtboard`) goes to an artboard, fits it and synchronizes the Artboard tool selection when that tool is active; ordinary object selection is preserved. Its four buttons are also commands of their own (`view.firstArtboard`, `view.previousArtboard`, `view.nextArtboard`, `view.lastArtboard`), listed in Edit › Keyboard Shortcuts without a default key, so a user can give them keys such as Page Up and Page Down (#5218). Actual Next-button regressions cover keyboard/Properties deletion and Undo in `chrome.rs`. Fit Artboard in Window and Actual Size show the navigator's artboard. The Artboards panel highlights that active artboard: clicking a row makes it active (the Artboard tool's too, while it is chosen) as does clicking an artboard with the Artboard tool, double-clicking its number also fits it in the window and double-clicking its name renames it. Duplicate Artboards, or a row dragged onto New Artboard, copies the artboard with its art (#446). Escape leaves Presentation Mode, `view.screenMode` from it goes back to Normal Screen Mode, and the screen mode isn't saved with the preferences: the app always starts in Normal Screen Mode with its menus and panels (#472). View › Pixel Preview shows the art as the document pixels it rasterizes to, one per point and hard-edged when magnified, turning with a rotated view (it used to draw the smooth vectors, with only the pixel grid over them). In Outline view a template layer keeps drawing in Preview, dimmed, so a picture placed to be traced stays visible under the outlines (#1505, fixes #1486). Outline view draws on a white canvas in every interface brightness and Canvas Color, pasteboard included, with the artboards as their edges and no paper (VectorCraft's own rule), so the black outlines of art on the pasteboard show. In Presentation Mode, → and ← go to the next and the previous artboard, and a click anywhere goes to the next one, as the status bar navigator's Next and Previous do (`view.goToArtboard`): on the last artboard → and a click leave the view as it is, and so does ← on the first. The arrow keys do not move the selection there, and the tool does not receive a click, so a click selects and draws nothing (behavior reference: [View artwork](https://helpx.adobe.com/illustrator/using/viewing-artwork.html)). Full Screen Mode and Presentation Mode put the window full screen, covering the taskbar and the window's frame, and Normal Screen Mode or Full Screen Mode with Menu Bar puts it back (#4365); a window the user made full screen stays so. From 17d0d77a428c860aaf15f7193ac7ecfe1f2df8d6 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 05:38:19 -0800 Subject: [PATCH 058/247] Type: Cmd/Ctrl+Shift+= toggles Superscript and Cmd/Ctrl+Alt+Shift+= toggles Subscript Two new UI commands have these keys. type.superscript (Superscript) and type.subscript (Subscript) do what the Character panel's Superscript and Subscript buttons do on the Type tool's selected text or the selected type objects: they set that position through text.setFormat, or set it back to normal when every character already has it, and return the position the text now has. Both are dimmed without selected type, and Keyboard Shortcuts lists them in the Type group. With no type selected, Cmd/Ctrl+Shift+= still zooms in, as Cmd/Ctrl+= does: when the command a Shift+= chord is bound to is dimmed, the press runs what the same chord without Shift is bound to. The Turkish label for Subscript now reads "Alt simge". Docs: docs/mcp.md, docs/target-app-parity.md. --- crates/mcp/src/ui_catalog.rs | 12 +++++ crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/menus/run.rs | 2 + crates/ui-egui/src/menus/state.rs | 11 +++-- crates/ui-egui/src/menus/ui_commands.rs | 12 +++++ crates/ui-egui/src/panels/character.rs | 12 +++++ crates/ui-egui/src/shortcuts.rs | 24 ++++++++- crates/ui-egui/src/shortcuts/tests.rs | 65 +++++++++++++++++++++++++ docs/mcp.md | 6 +++ docs/target-app-parity.md | 1 + 10 files changed, 141 insertions(+), 6 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index e3b924a9a6..eba9274f73 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -400,6 +400,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+Shift+U", "{} the Character panel's Underline button: underline the selected type (or the Type tool's selection), or remove the underline when the text the Character panel shows is underlined (text.setFormat {underline}) → underlined", ), + ( + "type.superscript", + "Superscript", + "Cmd+Shift+=", + "{} the Character panel's Superscript button: the selected type (or the Type tool's selection) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", + ), + ( + "type.subscript", + "Subscript", + "Cmd+Alt+Shift+=", + "{} the Character panel's Subscript button: the selected type (or the Type tool's selection) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", + ), ( "type.lineComposer", "Toggle Line Composer", diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 4c680f92b9..d88f0124be 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3458,7 +3458,7 @@ digits Malayalam Malayalam Styling: Şekillendirme: Stylize Stilize Et Subdivisions Alt bölümler - Subscript Abonelik + Subscript Alt simge Subscript (on the roadmap) Abonelik (yol haritasında) Subscript: Abonelik: Subset fonts below: Aşağıdaki yazı tiplerinin alt kümesi: diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 0b3d86f57a..3c0873568b 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -326,6 +326,8 @@ fn run_ui_part3(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result< "type.highlightKerning" => crate::panels::character::highlight(app, crate::panels::character::Field::Kerning), "type.highlightTracking" => crate::panels::character::highlight(app, crate::panels::character::Field::Tracking), "type.underline" => crate::panels::character::toggle_underline(app), + "type.superscript" => crate::panels::character::toggle_position(app, "superscript"), + "type.subscript" => crate::panels::character::toggle_position(app, "subscript"), "type.lineComposer" => crate::panels::paragraph::toggle_composer(app), "type.hyphenate" => crate::panels::paragraph::toggle_hyphenate(app), id if let Some((_, justify)) = crate::panels::paragraph::ALIGN_COMMANDS.iter().find(|c| c.0 == id) => { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 7a4b195ae1..2a40c66ec0 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -219,9 +219,14 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { match id { // Save is off for a clean document that already has its own file. "file.save" => app.session.active().is_some_and(|d| d.path.is_none() || d.converted || d.is_dirty()), - "type.bold" | "type.italic" | "type.underline" | "type.lineComposer" | "type.hyphenate" | "type.highlightFontSize" => { - crate::panels::character::text_style(app).is_some() - } + "type.bold" + | "type.italic" + | "type.underline" + | "type.superscript" + | "type.subscript" + | "type.lineComposer" + | "type.hyphenate" + | "type.highlightFontSize" => crate::panels::character::text_style(app).is_some(), id if crate::panels::paragraph::ALIGN_COMMANDS.iter().any(|c| c.0 == id) => crate::panels::character::text_style(app).is_some(), "type.applyBullets" | "type.applyNumbers" | "type.convertListToText" => crate::panels::character::text_style(app).is_some(), id if let Some(b) = crate::panels::align::button(id) => enabled(app, b.command_now(app)), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 2ff580f22c..66c3609392 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -401,6 +401,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "Cmd+Shift+U", "{} the Character panel's Underline button: underline the selected type (or the Type tool's selection), or remove the underline when the text the Character panel shows is underlined (text.setFormat {underline}) → underlined", ), + ( + "type.superscript", + "Superscript", + "Cmd+Shift+=", + "{} the Character panel's Superscript button: the selected type (or the Type tool's selection) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", + ), + ( + "type.subscript", + "Subscript", + "Cmd+Alt+Shift+=", + "{} the Character panel's Subscript button: the selected type (or the Type tool's selection) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", + ), ( "type.lineComposer", "Toggle Line Composer", diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 1ddb45b11b..947b842771 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -544,6 +544,18 @@ pub(crate) fn toggle_underline(app: &mut VectorcraftApp) -> Result<Value, String Ok(json!(on)) } +/// `type.superscript` (Cmd+Shift+=) and `type.subscript` (Cmd+Alt+Shift+=): what the Superscript +/// or Subscript button does, on the text the panels act on. Returns the position the text now +/// has: `"normal"` only when every character had `position`, else `position`. +pub(crate) fn toggle_position(app: &mut VectorcraftApp, position: &str) -> Result<Value, String> { + text_style(app).ok_or("select some type first")?; + let now = shared(app, |s| s.position).map(|p| p.id()).unwrap_or(""); + let change = position_toggle(now, position); + let to = change["position"].clone(); + run_format(app, change)?; + Ok(to) +} + /// `text.setRangeStyle` with `p` on the range the Type tool has selected (the whole text when /// nothing is selected). Does nothing unless the Type tool edits text. pub(crate) fn range_style(app: &mut VectorcraftApp, p: Value) { diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 6329f489b1..3887182c14 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1008,7 +1008,7 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&H } } // Shift+`=` types `+`: as the Plus key it also reaches a `=` chord held with Shift - // (Cmd+Shift+= zooms in as Cmd+= does). + // (Cmd+Shift+= zooms in as Cmd+= does while Superscript is dimmed: [`unshifted_when_dimmed`]). for e in &mut i.events { if let egui::Event::Key { key, modifiers, .. } = e && *key == Key::Equals @@ -1017,8 +1017,28 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&H *key = Key::Plus; } } - dispatcher.dispatch_filtered(i, &mirror.keymap, &Active::NONE, accept).into_iter().map(|h| h.command).collect() + dispatcher.dispatch_filtered(i, &mirror.keymap, &Active::NONE, accept) }) + .into_iter() + .map(|h| unshifted_when_dimmed(app, &mirror.keymap, h)) + .collect() +} + +/// The command a hit runs. A Shift+`=` chord whose command is dimmed runs what the same chord +/// without Shift runs, when that is bound: Cmd+Shift+= (Superscript) zooms in, as Cmd+= does, +/// while no type is selected. +fn unshifted_when_dimmed(app: &VectorcraftApp, keymap: &craft_keymap::Keymap, hit: Hit) -> CommandRef { + let chord = hit.trigger.chord; + if chord.key == craft_keymap::Key::Equals + && chord.mods.shift + && !hit.trigger.double + && !crate::menus::enabled(app, &hit.command.id) + && let Some(unshifted) = + crate::keymap::lookup(keymap, &craft_keymap::Chord::new(craft_keymap::Mods { shift: false, ..chord.mods }, chord.key)) + { + return unshifted; + } + hit.command } /// What a shortcut without params runs when its command's menu bar item gives params diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index a24e598ecc..6105943887 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -936,6 +936,71 @@ fn cmd_shift_u_and_cmd_alt_shift_c_and_h_toggle_type_formats() { } } +/// Cmd+Shift+= and Cmd+Alt+Shift+= do what the Character panel's Superscript and Subscript +/// buttons do; with no type selected, Cmd+Shift+= still zooms in, as Cmd+= does. +#[test] +fn cmd_shift_equals_and_cmd_alt_shift_equals_toggle_superscript_and_subscript() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap(); + let id = app.session.execute("text.create", &json!({"x": 20, "y": 50, "text": "One\nTwo"})).unwrap()["id"].as_u64().unwrap(); + let positions = |app: &mut VectorcraftApp| { + let r = app.session.execute("text.getRange", &json!({"id": id})).unwrap(); + // A superscript or subscript run reports its kind with its size and offset; a normal one + // reports no position. + let kind = |p: &serde_json::Value| if p.is_null() { json!("normal") } else { p.get("kind").unwrap_or(p).clone() }; + r["runs"].as_array().unwrap().iter().map(|run| (run["text"].clone(), kind(&run["style"]["position"]))).collect::<Vec<_>>() + }; + let zoom = |app: &mut VectorcraftApp| app.view_mut().unwrap().zoom; + let press = + |key, m: Modifiers| vec![egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::COMMAND | m }]; + let (shift, alt_shift) = (Modifiers::SHIFT, Modifiers::ALT | Modifiers::SHIFT); + let all = |p: &str| [(json!("One\nTwo"), json!(p))]; + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let before = zoom(&mut app); + // Shift+`=` is reported as `=` or as `+`. + frame(&mut app, press(Key::Equals, shift)); + assert_eq!(positions(&mut app), all("superscript")); + frame(&mut app, press(Key::Plus, shift)); + assert_eq!(positions(&mut app), all("normal"), "a second press turns it off"); + frame(&mut app, press(Key::Equals, alt_shift)); + assert_eq!(positions(&mut app), all("subscript")); + frame(&mut app, press(Key::Equals, shift)); + assert_eq!(positions(&mut app), all("superscript"), "superscript replaces subscript"); + frame(&mut app, press(Key::Plus, alt_shift)); + assert_eq!(positions(&mut app), all("subscript")); + frame(&mut app, press(Key::Equals, alt_shift)); + assert_eq!(positions(&mut app), all("normal")); + assert_eq!(zoom(&mut app), before, "no press zoomed while type is selected"); + frame(&mut app, press(Key::Equals, Modifiers::NONE)); + assert!(zoom(&mut app) > before, "Cmd+= zooms in with type selected"); + // While the Type tool edits: its selected text. + app.select_tool("type"); + app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap(); + app.session.set_tool_option("select", &json!({"start": 4, "end": 7})); + assert!(app.session.tool_wants_text()); + frame(&mut app, press(Key::Equals, alt_shift)); + assert_eq!(positions(&mut app), [(json!("One\n"), json!("normal")), (json!("Two"), json!("subscript"))]); + // A mixed selection takes the position on every character. + app.select_tool("selection"); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + frame(&mut app, press(Key::Equals, alt_shift)); + let subscript = |app: &mut VectorcraftApp| positions(app).iter().all(|(_, p)| *p == json!("subscript")); + assert!(subscript(&mut app), "{:?}", positions(&mut app)); + // Nothing selected: Cmd+Shift+= zooms in, and Cmd+Alt+Shift+= changes nothing. + app.session.execute("select.none", &json!({})).unwrap(); + for id in ["type.superscript", "type.subscript"] { + assert!(!crate::menus::enabled(&app, id), "{id}"); + } + for key in [Key::Equals, Key::Plus] { + let before = zoom(&mut app); + frame(&mut app, press(key, alt_shift)); + assert_eq!(zoom(&mut app), before, "{key:?} with Cmd+Alt+Shift"); + frame(&mut app, press(key, shift)); + assert!(zoom(&mut app) > before, "{key:?} with Cmd+Shift zooms in"); + } + assert!(subscript(&mut app), "{:?}", positions(&mut app)); +} + /// Tab shows and hides the panels, and in the Type tool it types a tab, without moving the /// keyboard focus on to a field: the keys after it (a tool letter, the next letter typed) still /// work. diff --git a/docs/mcp.md b/docs/mcp.md index 43884793f2..4092df0e7f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7042,6 +7042,12 @@ Pen's second anchor at (150, 431), in line with the square's centre. in remote mode `press_key {key: "U", mods: {cmd: true, shift: true}}` or `invoke_menu`) does what the Character panel's Underline button does: it underlines the Type tool's selected text or the selected type objects, or removes the underline when the text the panel shows is underlined, and returns whether the text is now underlined. + `type.superscript` (Cmd+Shift+=, `press_key {key: "=", mods: {cmd: true, shift: true}}`) and `type.subscript` + (Cmd+Alt+Shift+=) do what the Character panel's Superscript and Subscript buttons do on the same text: they set its + position through `text.setFormat {position}`, or set it back to `"normal"` when every character already has that + position, and return the position the text now has. Without selected type or text the Type tool edits, both fail + and are dimmed, and Cmd+Shift+= zooms in, as Cmd+= does. In general, when the command a Shift+= chord is bound to is + dimmed, the press runs what the same chord without Shift is bound to. - `missingGlyphProtection` (on by default): `text.setStyle` and `text.setRangeStyle` changing the font leave the characters the new font has no glyph for in the font that had one. - `typeSelectionByPathOnly` (off by default): on, the Selection tools (`pointer_gesture` with `selection`, and the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 06a002aef9..30cb0284d4 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1126,6 +1126,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - F8 (`ui.symbolOptions`) opens Symbol Options for a new symbol made from the selection, as the Symbols panel's New Symbol button does, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for making a new symbol. OK makes the symbol and puts an instance of it in place of the art, and Cancel makes none. With nothing selected, F8 opens no dialog, and the status bar says that nothing is selected. Shift+F8 and Cmd/Ctrl+F8 still show the Transform and Info panels. - Cmd/Ctrl+Shift+X (`type.resetHorizontalScale`) sets the horizontal scale of the selected type, or of the text the Type tool has selected, to 100% as the Character panel shows it (the object's own stretch included), in one undo step; at a caret it leaves the text as it is. - Cmd/Ctrl+Shift+U (`type.underline`) underlines the selected type, or the text the Type tool has selected, and removes the underline again, as the Character panel's Underline button does. Cmd/Ctrl+Alt+Shift+C (`type.lineComposer`) switches the paragraphs between the Single-line and the Every-line Composer, and Cmd/Ctrl+Alt+Shift+H (`type.hyphenate`) turns their hyphenation on and off, as the Hyphenate checkbox does. These are the keys the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for underlining and for toggling auto-hyphenation, and on Windows for toggling the line composer. The page's macOS key for the line composer ends after Command, and VectorCraft uses C there as well. + - Cmd/Ctrl+Shift+= (`type.superscript`) and Cmd/Ctrl+Alt+Shift+= (`type.subscript`) make the selected type, or the text the Type tool has selected, superscript or subscript, and set it back to normal when all of it already has that position, as the Character panel's Superscript and Subscript buttons do. [The help page](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) gives Shift with Ctrl or Command and `=` for Superscript and adds Alt for Subscript; its macOS cell for Subscript repeats the Windows modifier names, and VectorCraft uses Command there. With no type selected, Cmd/Ctrl+Shift+= still zooms in as Cmd/Ctrl+= does; that rule, the second press restoring normal, and a mixed selection taking the position throughout are VectorCraft's own. - Cmd/Ctrl+Alt+N (`file.newWithoutDialog`) makes a document without opening the New Document dialog, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page assigns to creating a document directly. The page does not say which settings the document gets. VectorCraft gives it the settings the dialog opens on (the first Recent entry, or the Print category's Letter while Recent is empty) and the next untitled name. - Cmd/Ctrl+F6 (`window.nextDocument`) and Cmd/Ctrl+Shift+F6 (`window.previousDocument`) make the next and the previous open document the current one, in tab order and as a click on its tab does, on the keys the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for navigating to the next and the previous document. After the last document comes the first, and before the first document comes the last. From the Home screen the keys go to the first and the last document. Keyboard Shortcuts lists both under Window. - Cmd/Ctrl+Alt+Shift+U (`document.switchUnits`) switches the document to the next unit of measurement, in one undo step, on the key the reference app's [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for switching units of measurement. The page does not give an order. VectorCraft steps through the units in the order a right-click on a ruler lists them (Points, Picas, Inches, Millimeters, Centimeters, Pixels, Feet & Inches, Meters, Yards, Feet) and goes from Feet back to Points. From f2bbcdacaa91fe83a0b7ee34e1e977031d546e7f Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 06:00:36 -0800 Subject: [PATCH 059/247] i18n: Turkish Subscript: and Subscript (on the roadmap) say Alt simge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two rows translated Subscript as Abonelik (subscription). They now match the Subscript row and the Superscript rows (Üst simge). --- crates/ui-egui/src/i18n/tr.tsv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d88f0124be..fa39f5b196 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3459,8 +3459,8 @@ digits Malayalam Malayalam Stylize Stilize Et Subdivisions Alt bölümler Subscript Alt simge - Subscript (on the roadmap) Abonelik (yol haritasında) - Subscript: Abonelik: + Subscript (on the roadmap) Alt simge (yol haritasında) + Subscript: Alt simge: Subset fonts below: Aşağıdaki yazı tiplerinin alt kümesi: Subtract Çıkar Suffix son ek From 80b30485c2f8256cff5b85a69b8143b30f48d4cc Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 07:25:12 -0800 Subject: [PATCH 060/247] Type: Superscript and Subscript check the characters they change At a Type tool caret with no characters selected, the Superscript and Subscript buttons, menu items and commands change every character of the text, but decided from the caret's style alone. Text that was only partly superscript then lost its superscript everywhere when the caret sat after a superscript character. They now read every character of the text there. The position compare now looks at the kind only, so superscripts in different proportions (from an opened file) count as superscript and a press turns them back to normal. --- crates/mcp/src/ui_catalog.rs | 4 +- crates/ui-egui/src/menus/ui_commands.rs | 4 +- crates/ui-egui/src/panels/character.rs | 26 +++++++++-- crates/ui-egui/src/panels/character/tests.rs | 45 ++++++++++++++++++++ docs/mcp.md | 4 +- 5 files changed, 74 insertions(+), 9 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index eba9274f73..12a51cc448 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -404,13 +404,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "type.superscript", "Superscript", "Cmd+Shift+=", - "{} the Character panel's Superscript button: the selected type (or the Type tool's selection) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", + "{} the Character panel's Superscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", ), ( "type.subscript", "Subscript", "Cmd+Alt+Shift+=", - "{} the Character panel's Subscript button: the selected type (or the Type tool's selection) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", + "{} the Character panel's Subscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", ), ( "type.lineComposer", diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 66c3609392..0e6c471c62 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -405,13 +405,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "type.superscript", "Superscript", "Cmd+Shift+=", - "{} the Character panel's Superscript button: the selected type (or the Type tool's selection) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", + "{} the Character panel's Superscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes superscript, or Normal when all of it is superscript already (text.setFormat {position}). Without selected type the keys zoom in, as Cmd+= does → \"superscript\" | \"normal\"", ), ( "type.subscript", "Subscript", "Cmd+Alt+Shift+=", - "{} the Character panel's Subscript button: the selected type (or the Type tool's selection) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", + "{} the Character panel's Subscript button: the selected type (or the Type tool's selection, all of its text at a caret) becomes subscript, or Normal when all of it is subscript already (text.setFormat {position}) → \"subscript\" | \"normal\"", ), ( "type.lineComposer", diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 947b842771..f990d09093 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -549,8 +549,7 @@ pub(crate) fn toggle_underline(app: &mut VectorcraftApp) -> Result<Value, String /// has: `"normal"` only when every character had `position`, else `position`. pub(crate) fn toggle_position(app: &mut VectorcraftApp, position: &str) -> Result<Value, String> { text_style(app).ok_or("select some type first")?; - let now = shared(app, |s| s.position).map(|p| p.id()).unwrap_or(""); - let change = position_toggle(now, position); + let change = position_toggle(shared_position(app), position); let to = change["position"].clone(); run_format(app, change)?; Ok(to) @@ -1451,7 +1450,7 @@ fn attributes(app: &mut VectorcraftApp, ui: &mut Ui, owner: crate::font_menu::Wh // On only when every character the panel acts on has it; a mixed selection turns it on. let all_caps = shared(app, |s| s.all_caps) == Some(true); let small = shared(app, |s| s.small_caps.is_some()) == Some(true); - let position = shared(app, |s| s.position).map(|p| p.id()).unwrap_or(""); + let position = shared_position(app); let underline = shared(app, |s| s.underline) == Some(true); let strike = shared(app, |s| s.strikethrough) == Some(true); for (kind, tip, on, change) in [ @@ -1480,6 +1479,25 @@ fn attributes(app: &mut VectorcraftApp, ui: &mut Ui, owner: crate::font_menu::Wh }); } +/// The position kind (`normal`, `superscript` or `subscript`) that every character a Superscript +/// or Subscript toggle changes has, else `""`: at a Type tool caret with no characters selected +/// every character of the text (of each frame of a threaded story), as the toggle changes all of +/// it there ([`run_format`], [`range_style`]), else the characters [`shared`] reads. Superscripts +/// in different proportions count as superscript. +fn shared_position(app: &VectorcraftApp) -> &'static str { + let Some((id, _, _)) = text_editing(app).filter(|&(_, a, b)| b <= a) else { + return shared(app, |s| s.position.id()).unwrap_or(""); + }; + let Some(st) = app.session.active() else { return "" }; + let mut acc = Shared::None; + for frame in text_story(app).unwrap_or_else(|| vec![id]) { + if let Some(NodeKind::Text(t)) = st.doc.node(frame).map(|n| &n.kind) { + each_paragraph_run(t, None, |_, style, _| acc.add(style.position.id())); + } + } + acc.value().unwrap_or("") +} + /// The `text.setFormat` params of the Superscript or Subscript toggle `p` for text whose /// position is `position`: `normal` when `p` is on, else `p`, which turns the other one off. fn position_toggle(position: &str, p: &str) -> Value { @@ -1627,7 +1645,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } } let small = shared(app, |s| s.small_caps.is_some()) == Some(true); - let position = shared(app, |s| s.position).map(|p| p.id()).unwrap_or(""); + let position = shared_position(app); for (label, on, change) in [ (tl!("Small Caps"), small, json!({"smallCaps": !small})), (tl!("Superscript"), position == "superscript", position_toggle(position, "superscript")), diff --git a/crates/ui-egui/src/panels/character/tests.rs b/crates/ui-egui/src/panels/character/tests.rs index 6ff3eeb51e..5e11497521 100644 --- a/crates/ui-egui/src/panels/character/tests.rs +++ b/crates/ui-egui/src/panels/character/tests.rs @@ -583,6 +583,51 @@ fn small_caps_superscript_and_subscript_buttons_set_and_show_the_text() { assert_eq!(script_buttons(&ctx, &mut app).1, [false; 3]); } +/// Superscript and Subscript decide from the characters they change. At a Type tool caret they +/// change every character of the text, so text that is only partly superscript turns superscript +/// everywhere, with the caret after a superscript character too, and the button there shows off. +/// Superscripts in different proportions count as superscript, so a press turns them off. +#[test] +fn superscript_and_subscript_decide_from_the_characters_they_change() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "x2", "size": 12})).unwrap()["id"].clone(); + app.run("text.setRangeStyle", json!({"id": id, "start": 1, "end": 2, "position": "superscript"})).unwrap(); + app.run("select.set", json!({"ids": [id.clone()]})).unwrap(); + app.select_tool("type"); + app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap(); + app.session.set_tool_option("select", &json!({"start": 2, "end": 2})); + assert_eq!(text_editing(&app).map(|(_, a, b)| (a, b)), Some((2, 2))); + let ctx = egui::Context::default(); + assert_eq!(script_buttons(&ctx, &mut app).1, [false; 3], "the text is not all superscript"); + assert_eq!(app.run("type.superscript", json!({})).unwrap(), json!("superscript")); + assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "superscript"), "{:?}", scripts(&app, &id)); + app.run("type.superscript", json!({})).unwrap(); + assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "normal"), "{:?}", scripts(&app, &id)); + + // A file whose two superscript runs have different proportions. + app.select_tool("selection"); + app.run("text.setRangeStyle", json!({"id": id, "position": "superscript"})).unwrap(); + app.run("text.setRangeStyle", json!({"id": id, "start": 1, "end": 2, "underline": true})).unwrap(); + let mut d = (*app.session.active().unwrap().doc).clone(); + if let Some(NodeKind::Text(t)) = d.node_mut(NodeId(id.as_u64().unwrap())).map(|n| &mut n.kind) { + assert_eq!(t.runs.len(), 2); + t.runs[0].style.position = vectorcraft_doc::CharPosition::Superscript(vectorcraft_doc::ScriptMetrics { size: 50.0, position: 40.0 }); + } + let data = vectorcraft_format::base64_encode(&vectorcraft_format::save_file(&d)); + app.run("document.open", json!({"name": "scripts.vectorcraft", "dataBase64": data})).unwrap(); + app.run("select.set", json!({"ids": [id.clone()]})).unwrap(); + let runs = |app: &VectorcraftApp| match &app.session.active().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().kind { + NodeKind::Text(t) => t.runs.iter().map(|r| r.style.position).collect::<Vec<_>>(), + _ => panic!("text"), + }; + let before = runs(&app); + assert!(before.len() == 2 && before[0] != before[1] && before.iter().all(|p| p.id() == "superscript"), "{before:?}"); + assert_eq!(script_buttons(&ctx, &mut app).1, [false, true, false], "the button shows superscript"); + assert_eq!(app.run("type.superscript", json!({})).unwrap(), json!("normal")); + assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "normal"), "{:?}", scripts(&app, &id)); +} + /// The panel menu's Small Caps, Superscript and Subscript set the selected type's small caps /// and position and show a check mark when on; Superscript and Subscript turn each other off. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 4092df0e7f..93555977d3 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7045,7 +7045,9 @@ Pen's second anchor at (150, 431), in line with the square's centre. `type.superscript` (Cmd+Shift+=, `press_key {key: "=", mods: {cmd: true, shift: true}}`) and `type.subscript` (Cmd+Alt+Shift+=) do what the Character panel's Superscript and Subscript buttons do on the same text: they set its position through `text.setFormat {position}`, or set it back to `"normal"` when every character already has that - position, and return the position the text now has. Without selected type or text the Type tool edits, both fail + position, and return the position the text now has. At a Type tool caret with no characters selected, the buttons and + both commands act on, and check, every character of the text; superscripts in different proportions count as + superscript. Without selected type or text the Type tool edits, both fail and are dimmed, and Cmd+Shift+= zooms in, as Cmd+= does. In general, when the command a Shift+= chord is bound to is dimmed, the press runs what the same chord without Shift is bound to. - `missingGlyphProtection` (on by default): `text.setStyle` and `text.setRangeStyle` changing the font leave the From 7f3656a58d7c30552251432b5ce599f6fd2d4346 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 09:19:53 -0800 Subject: [PATCH 061/247] Fix build after merging main category_fields now returns the rows that carry a description, so the Hold Shortcut Delay test's UI closure discards the value, as the other prefs_dialog tests do. --- crates/ui-egui/src/prefs_dialog/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 019468f4ae..973a0111f7 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1117,7 +1117,9 @@ fn hold_shortcut_delay_dims_without_hold_shortcuts() { events, ..Default::default() }; - let mut out = ctx.run_ui(raw, |ui| category_fields(ui, &mut a, d, "General")); + let mut out = ctx.run_ui(raw, |ui| { + category_fields(ui, &mut a, d, "General"); + }); out.textures_delta.clear(); let label = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("Hold Shortcut Delay"))); let field = out.shapes.iter().find_map(|c| text(&c.shape, &|t| t.starts_with("0.35"))); From e89a346f005936df425f0c3d9502a9e50e203c23 Mon Sep 17 00:00:00 2001 From: bflatastic <bombayapirat@gmail.com> Date: Tue, 17 Nov 2026 00:51:24 +0700 Subject: [PATCH 062/247] i18n: French Command Palette match count keeps a no-break space before its colon --- crates/ui-egui/src/i18n/fr.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 66d3c23c01..b8667775fa 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3281,7 +3281,7 @@ digits Malayalam Malayalam Search commands, tools, panels and effects Chercher commandes, outils, panneaux et effets Search commands, tools, panels and effects… Chercher commandes, outils, panneaux et effets… No commands match Aucune commande ne correspond - {pos} of {total}: {name} {pos} sur {total} : {name} + {pos} of {total}: {name} {pos} sur {total} : {name} @plural {n} result|{n} results {n} résultat|{n} résultats @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} sur {n} résultat. Continuez à taper pour les affiner.|{shown} sur {n} résultats. Continuez à taper pour les affiner. Recent Commands Commandes récentes From d8529f111d0b9b0115b2c35a89bb1bbc33cb334c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 10:55:29 -0800 Subject: [PATCH 063/247] Shortcuts: hold keys keep their order in a frame, and the sheet and CSV list hold shortcuts - When a key with a hold shortcut is pressed and its wait ends in the same frame, the single-key shortcuts typed before it in that frame run first, so the keys act in the order they went down. - The repeats of a key in the frame that starts its wait, and the text they type, are dropped like its later repeats. - Import Shortcut Set started from the VectorCraft defaults clears the working hold shortcuts; Add to the Current Shortcuts keeps them. - Export Text's shortcut sheet and CSV file list a row's hold shortcut after its shortcuts while Hold Shortcuts is on, as the text file does. --- crates/ui-egui/src/dialogs/shortcut_import.rs | 4 + .../src/dialogs/tests_shortcut_import.rs | 18 ++++ crates/ui-egui/src/shortcut_editor.rs | 53 +++++++-- crates/ui-egui/src/shortcuts/hold_keys.rs | 86 +++++++++++++-- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 102 ++++++++++++++++-- 5 files changed, 241 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/dialogs/shortcut_import.rs b/crates/ui-egui/src/dialogs/shortcut_import.rs index 0516695233..e3ca87762a 100644 --- a/crates/ui-egui/src/dialogs/shortcut_import.rs +++ b/crates/ui-egui/src/dialogs/shortcut_import.rs @@ -518,6 +518,10 @@ pub fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { } if let Some(k) = app.ui.dialog.as_mut() { k.fields.insert("overrides".into(), crate::keymap::stored::to_value(&shortcut_editor::saved_overrides(km.overrides(), &ov))); + // VectorCraft's defaults have no hold shortcuts; Add to the Current Shortcuts keeps them. + if !current { + k.fields.insert("holds".into(), json!({})); + } k.fields.insert("set".into(), json!(set)); k.fields.insert("__message".into(), json!(tl!("Imported. Press OK to keep the imported set."))); } diff --git a/crates/ui-egui/src/dialogs/tests_shortcut_import.rs b/crates/ui-egui/src/dialogs/tests_shortcut_import.rs index 066f7f4682..a4f8ba9d4b 100644 --- a/crates/ui-egui/src/dialogs/tests_shortcut_import.rs +++ b/crates/ui-egui/src/dialogs/tests_shortcut_import.rs @@ -234,6 +234,24 @@ fn cancel_and_apply_go_back_to_keyboard_shortcuts() { assert_eq!((app.ui.shortcut_set.as_str(), app.ui.shortcut_overrides.len()), ("Acme Keys", 3)); } +/// Started from VectorCraft's defaults, an import leaves no hold shortcut in the working set; added +/// to the current shortcuts, it keeps them. OK keeps what the working set shows. +#[test] +fn an_import_from_the_defaults_clears_the_hold_shortcuts() { + let mut app = app(); + earlier_answers(&mut app); + for (start, kept) in [("defaults", json!({})), ("current", json!({"paint.swap": "X"}))] { + app.ui.shortcut_holds = [("paint.swap".to_string(), "X".to_string())].into(); + shortcut_editor::open(&mut app); + super::shortcut_import::open(&mut app, "/sets/Acme Keys.kys", SET.as_bytes()).unwrap(); + set(&mut app, "start", json!(start)); + confirm(&mut app).unwrap(); + assert_eq!(dialog(&app).fields["holds"], kept, "{start}"); + confirm(&mut app).unwrap(); + assert_eq!(json!(app.ui.shortcut_holds), kept, "{start}: OK keeps it"); + } +} + /// A document's Missing Fonts dialog that Keyboard Shortcuts replaced waits while Cancel goes back /// from Import Shortcut Set to Keyboard Shortcuts, and opens again once Keyboard Shortcuts closes. #[test] diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 8ba8bda125..a1cb43d874 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1375,8 +1375,9 @@ const MENU_COMMANDS: &str = "Menu Commands"; /// Export Text's rows in sections, for the shortcut sheet and the CSV file: Tools, then one section /// per top-level menu in the order the dialog first lists a command of it, with the names and /// shortcuts as the dialog shows them, each name without its top-level menu. Every row the dialog -/// lists is there, with an empty shortcut when it has none. -pub fn export_sections(overrides: &Overrides) -> Vec<crate::shortcut_sheet::Section> { +/// lists is there, with an empty shortcut when it has none. A row with a hold shortcut in `holds` +/// ends its shortcuts with `Hold X`, joined as the dialog joins them. +pub fn export_sections(overrides: &Overrides, holds: &Holds) -> Vec<crate::shortcut_sheet::Section> { use crate::shortcut_sheet::{Row, Section}; let snapshot = snapshot(); let km = crate::keymap::keymap_in(&snapshot, overrides); @@ -1385,6 +1386,11 @@ pub fn export_sections(overrides: &Overrides) -> Vec<crate::shortcut_sheet::Sect let mut menus: Vec<Section> = vec![]; for e in snapshot.entries.iter().filter(|e| listed(km.overrides(), e)) { let shortcut = dialog_shortcuts_with(&km, &e.key, backtick.as_deref()).unwrap_or_default(); + let shortcut = match hold_of(holds, &e.key) { + Some(h) if shortcut.is_empty() => format!("{} {}", tl!("Hold"), menus::pretty_shortcut(&h)), + Some(h) => format!("{shortcut} · {} {}", tl!("Hold"), menus::pretty_shortcut(&h)), + None => shortcut, + }; if e.is_tool { tools.rows.push(Row { name: shown_name(e), shortcut }); continue; @@ -1415,9 +1421,9 @@ fn export_text_file( TextFormat::Text => Ok(export_text_with(set, overrides, holds).into_bytes()), TextFormat::Sheet => { let title = format!("{} · {}", tl!("Keyboard Shortcuts"), shown_set_name(set)); - crate::shortcut_sheet::sheet_pdf(&title, &export_sections(overrides), page) + crate::shortcut_sheet::sheet_pdf(&title, &export_sections(overrides, holds), page) } - TextFormat::Csv => Ok(crate::shortcut_sheet::csv(&export_sections(overrides), ["Group", "Command", "Shortcut"]).into_bytes()), + TextFormat::Csv => Ok(crate::shortcut_sheet::csv(&export_sections(overrides, holds), ["Group", "Command", "Shortcut"]).into_bytes()), } } @@ -2712,7 +2718,7 @@ mod tests { tops.push(top); } } - (export_sections(&ov), listed.len(), tops) + (export_sections(&ov, &Holds::new()), listed.len(), tops) }); let titles: Vec<&str> = sections.iter().map(|s| s.title.as_str()).collect(); assert_eq!(titles[0], "Tools"); @@ -2787,7 +2793,7 @@ mod tests { Ok(()) })); app.run("shortcuts.exportText", json!({"path": "/a/list.csv", "format": "csv"})).unwrap(); - (returned, written.borrow().clone(), export_sections(&app.ui.shortcut_overrides)) + (returned, written.borrow().clone(), export_sections(&app.ui.shortcut_overrides, &Holds::new())) }); let [(path, bytes)] = files.as_slice() else { panic!("{} files", files.len()) }; assert_eq!(path, "/a/list.csv"); @@ -3637,6 +3643,41 @@ mod tests { assert_eq!(on.split('\t').nth(2), Some(format!("Hold {}", menus::pretty_shortcut("X")).as_str()), "{on}"); } + /// Export Text…'s shortcut sheet and CSV file also list a hold shortcut while Hold Shortcuts is + /// on, after the row's shortcuts. + #[test] + fn the_sheet_and_csv_list_hold_shortcuts_while_they_act() { + type Files = std::rc::Rc<std::cell::RefCell<Vec<Vec<u8>>>>; + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let written: Files = Default::default(); + let w = written.clone(); + app.services.write = Some(Box::new(move |_: &str, b: &[u8]| { + w.borrow_mut().push(b.to_vec()); + Ok(()) + })); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + let hold = format!("Hold {}", menus::pretty_shortcut("X")); + let sections = with_steady_plugins(|| { + written.borrow_mut().clear(); + for on in [false, false, true] { + app.run("prefs.set", json!({"key": "holdShortcuts", "value": on})).unwrap(); + app.run("shortcuts.exportText", json!({"path": "/a.csv", "format": "csv"})).unwrap(); + app.run("shortcuts.exportText", json!({"path": "/a.pdf", "format": "sheet"})).unwrap(); + } + app.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + export_sections(&app.ui.shortcut_overrides, &app.ui.shortcut_holds) + }); + let files = written.borrow(); + let [csv_off, sheet_off, _, sheet_off_again, csv_on, sheet_on] = files.as_slice() else { panic!("{} files", files.len()) }; + let swap = sections.iter().flat_map(|s| &s.rows).filter(|r| r.shortcut.ends_with(&hold)).collect::<Vec<_>>(); + assert_eq!(swap.len(), 1, "one row has the hold: {swap:?}"); + let (csv_off, csv_on) = (String::from_utf8_lossy(csv_off), String::from_utf8_lossy(csv_on)); + assert!(!csv_off.contains(&hold), "off, the CSV file lists no hold"); + assert!(csv_on.contains(&swap[0].shortcut), "on, the CSV file lists it: {}", swap[0].shortcut); + assert_eq!(sheet_off, sheet_off_again, "the sheet is the same each time"); + assert_ne!(sheet_off, sheet_on, "on, the sheet lists the hold"); + } + /// The text the Keyboard Shortcuts dialog draws in its second frame. fn dialog_texts(app: &mut VectorcraftApp) -> Vec<String> { let ctx = egui::Context::default(); diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index eb7c92ab04..b494050bd2 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -208,13 +208,59 @@ fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { tool_key.is_some_and(|k| app.session.tool_claims_key(k, view)) } +/// Runs the single-key shortcuts of the texts typed before the event at `start` that no wait took, +/// in order, as the frame's shortcuts would run them, and takes them and their presses from the +/// frame. A text typed with Cmd, Ctrl or Alt, by a key the active tool takes, or with no shortcut, +/// is left to the frame. True when one opened a dialog or the palette. +fn run_typed_before( + app: &mut VectorcraftApp, + ctx: &egui::Context, + events: &[egui::Event], + typed_by: &[Option<usize>], + start: usize, + taken: &mut Vec<usize>, +) -> bool { + for (k, e) in events.iter().enumerate().take(start) { + let egui::Event::Text(text) = e else { continue }; + let by = typed_by.get(k).copied().flatten(); + if taken.contains(&k) || by.is_some_and(|b| taken.contains(&b)) { + continue; + } + let (key, physical, repeat, m) = match by.and_then(|b| events.get(b)) { + Some(egui::Event::Key { key, physical_key, repeat, modifiers, .. }) => (Some(*key), *physical_key, *repeat, *modifiers), + _ => (None, None, false, ctx.input(|i| i.modifiers)), + }; + if m.command || m.ctrl || m.alt || m.mac_cmd || key.is_some_and(|key| tool_takes(app, key, text)) { + continue; + } + let typed = super::latin(text, physical); + let chords = match key { + Some(key) => tap_chords(&typed, key, m), + None => super::text_chords(&typed, m, None), + }; + // A key with no shortcut stays in the frame for what reads it later (Space for the canvas). + let keymap = crate::shortcut_editor::current(); + if !chords.iter().any(|c| crate::keymap::lookup(&keymap.keymap, c).is_some()) { + continue; + } + taken.push(k); + taken.extend(by); + if super::run_single_key(app, ctx, &chords, key, repeat) { + return true; + } + } + false +} + /// Before the frame's shortcuts run: goes through the frame's events in order. A release of the /// waiting key ends the wait (the hold when the delay has passed, otherwise the tap); a press of /// another key, or a change of Cmd, Ctrl or Alt, ends it first, so the keys act in the order they /// went down; and a new press of a key with a hold shortcut starts a wait, taking the press and -/// its text from the frame. Then a wait whose delay has passed with the key down runs the hold -/// shortcut. True when a result opened a dialog or the palette: the rest of the frame's keys are -/// dropped and no other shortcut runs. +/// its text from the frame, with the key's repeats that follow in the frame and their text. When a +/// wait that started in this frame also ends in it, the keys typed before its key run first +/// ([`run_typed_before`]), so they act in the order they went down. Then a wait +/// whose delay has passed with the key down runs the hold shortcut. True when a result opened a +/// dialog or the palette: the rest of the frame's keys are dropped and no other shortcut runs. pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { // Off (Keyboard Shortcuts › Hold Shortcuts), every key runs on its press. if !app.session.prefs.hold_shortcuts || blocked(app, ctx) { @@ -226,6 +272,9 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { let text_of = |k: usize| typed_by.iter().position(|by| *by == Some(k)).and_then(|j| events.get(j).map(|e| (j, e))); let mut taken: Vec<usize> = vec![]; let mut stop_at = None; + // The press of a wait that started in this frame: when the wait also ends in this frame, the + // keys typed before it run first. + let mut started: Option<usize> = None; for (j, e) in events.iter().enumerate() { if let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) { let overdue = now - p.since >= p.delay; @@ -248,11 +297,20 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { _ => None, } }; - if let Some((hold, down)) = ended - && settle(app, ctx, hold, down) - { - stop_at = Some(j); - break; + if let Some((hold, down)) = ended { + // A key typed before it that opened a dialog or the palette ends the wait without + // running it. + if let Some(start) = started.take() + && run_typed_before(app, ctx, &events, &typed_by, start, &mut taken) + { + cancel(app, ctx); + stop_at = Some(j); + break; + } + if settle(app, ctx, hold, down) { + stop_at = Some(j); + break; + } } } let egui::Event::Key { key, physical_key, pressed: true, repeat: false, modifiers: m } = e else { continue }; @@ -271,7 +329,19 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { if tool_takes(app, *key, text) { continue; } + started = Some(j); taken.extend([j, t]); + // The key's repeats in this frame, and the text they type, stay out of the frame too. + for (r, later) in events.iter().enumerate().skip(j + 1) { + if releases(later, *key, *physical_key) { + break; + } + if matches!(later, egui::Event::Key { key: k, physical_key: p, pressed: true, repeat: true, .. } if same_key(*k, *p, *key, *physical_key)) + { + taken.push(r); + taken.extend(text_of(r).map(|(rt, _)| rt)); + } + } // A wait left in another viewport ends without running: that window lost the keyboard to // this one. Its key's repeats stay held back there until it is let go. if let Some(old) = app.hold_keys.pending.take_if(|p| p.viewport != viewport) { diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index be7765f8f3..4e745510fe 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -307,22 +307,108 @@ fn another_key_ends_the_wait_and_runs_after_it() { assert_eq!(app.session.tool_id(), "selection", "the release of X runs nothing more"); } -/// Two keys pressed in one frame act in the order they went down. +/// The labels of the document's undo steps after the first `from`. +fn steps(app: &VectorcraftApp, from: usize) -> Vec<String> { + app.session.doc().unwrap().history.undo.iter().skip(from).map(|e| e.label.clone()).collect() +} + +/// The label of the undo step `command` records on [`app_with`]'s document. +fn label(command: &str) -> String { + let mut app = app_with(true); + let n = steps(&app, 0).len(); + app.run(command, json!({})).unwrap(); + steps(&app, n).pop().unwrap() +} + +/// A quick press of X swaps fill and stroke, and holding X deselects; D sets the default fill and +/// stroke, as by default. +fn swap_on_x() -> VectorcraftApp { + let mut app = app_with(true); + assert_eq!(crate::shortcut_editor::default_of("paint.default"), Some("D")); + app.run("shortcuts.set", json!({"id": "paint.swap", "shortcut": "X", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "select.none", "hold": "X"})).unwrap(); + app +} + +/// Two keys pressed in one frame act in the order they went down, each once. #[test] fn keys_in_one_frame_act_in_order() { - let mut app = erolka_x(true); + let (swap, default) = (label("paint.swap"), label("paint.default")); + assert_ne!(swap, default); + let mut app = swap_on_x(); let keys = Keyboard::new(); + let n = steps(&app, 0).len(); let mut events = press(Key::X, "x", Modifiers::NONE); - events.extend(press(Key::V, "v", Modifiers::NONE)); + events.extend(press(Key::D, "d", Modifiers::NONE)); keys.frame(&mut app, 0.0, events); - assert_eq!(app.session.tool_id(), "selection", "X's tap first, then V"); - let mut events = press(Key::V, "v", Modifiers::NONE); + assert_eq!(steps(&app, n), [swap.clone(), default.clone()], "X's tap first, then D"); + keys.frame(&mut app, 1.0, vec![release(Key::X), release(Key::D)]); + // Paint that D changes again. + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + let n = steps(&app, 0).len(); + let mut events = press(Key::D, "d", Modifiers::NONE); events.extend(press(Key::X, "x", Modifiers::NONE)); - app.select_tool("pen"); - keys.frame(&mut app, 1.0, vec![release(Key::X), release(Key::V)]); keys.frame(&mut app, 2.0, events); keys.frame(&mut app, 2.1, vec![release(Key::X)]); - assert_eq!(app.session.tool_id(), "eyedropper", "V first, then X's tap at its release"); + assert_eq!(steps(&app, n), [default, swap], "D first, then X's tap at its release"); + assert_eq!(selected(&app), 1, "and no hold"); +} + +/// A wait that starts in a frame after another key, and that a release or another key ends in the +/// same frame, runs its tap after that key. +#[test] +fn a_wait_ended_in_its_frame_runs_after_the_keys_before_it() { + let (swap, default) = (label("paint.swap"), label("paint.default")); + let mut app = swap_on_x(); + let keys = Keyboard::new(); + let n = steps(&app, 0).len(); + let mut events = press(Key::D, "d", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.push(release(Key::X)); + keys.frame(&mut app, 0.0, events); + assert_eq!(steps(&app, n), [default.clone(), swap.clone()], "D first, then X's tap"); + assert!(app.hold_keys.pending.is_none()); + keys.frame(&mut app, 1.0, vec![release(Key::D)]); + assert_eq!(selected(&app), 1, "nothing waits after it"); + // Ended by V while X is still down: D, X's tap, then V. + let n = steps(&app, 0).len(); + let mut events = press(Key::D, "d", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.extend(press(Key::V, "v", Modifiers::NONE)); + keys.frame(&mut app, 2.0, events); + assert_eq!(steps(&app, n), [default, swap], "D first, then X's tap"); + assert_eq!(app.session.tool_id(), "selection", "then V"); + keys.press(&mut app, 2.5, Key::X, "x"); + keys.frame(&mut app, 2.6, vec![release(Key::X), release(Key::D), release(Key::V)]); + assert_eq!(steps(&app, n).len(), 2, "X's repeats run nothing"); + assert_eq!(selected(&app), 1, "and no hold"); + // Ended by a command chord (Deselect): D, X's tap, then the chord. + assert_eq!(crate::shortcut_editor::default_of("select.none"), Some("Cmd+Shift+A")); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + let n = steps(&app, 0).len(); + let mut events = press(Key::D, "d", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + let modifiers = Modifiers::COMMAND | Modifiers::SHIFT; + events.push(egui::Event::Key { key: Key::A, physical_key: Some(Key::A), pressed: true, repeat: false, modifiers }); + keys.frame(&mut app, 3.0, events); + assert_eq!(steps(&app, n), [label("paint.default"), label("paint.swap")], "D first, then X's tap"); + assert_eq!(selected(&app), 0, "then the chord"); +} + +/// The repeats of a key in the frame that starts its wait, and the text they type, stay out of the +/// frame. +#[test] +fn repeats_in_the_frame_that_starts_a_wait_stay_out_of_it() { + let mut app = swap_on_x(); + let keys = Keyboard::new(); + let n = steps(&app, 0).len(); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.extend(press(Key::X, "x", Modifiers::NONE)); + let left = keys.frame_left(&mut app, 0.0, events); + assert!(app.hold_keys.pending.is_some(), "X waits"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); + assert!(steps(&app, n).is_empty(), "the repeats run nothing"); } /// A press and its release in one frame are a tap, run in that frame. From f5afbf0acc3af5660ee8cc9f5923cf9576576010 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 11:07:17 -0800 Subject: [PATCH 064/247] Preferences: a restored Hold Shortcut Delay outside its range opens as the delay in use A settings file can hold a Hold Shortcut Delay outside 0.2 to 1 s. The dialog showed the value brought into range but kept the saved one, so OK sent it to prefs.set and failed. The dialog now opens with the delay in use, and OK keeps it. --- crates/ui-egui/src/prefs_dialog.rs | 5 +++++ crates/ui-egui/src/prefs_dialog/tests.rs | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/crates/ui-egui/src/prefs_dialog.rs b/crates/ui-egui/src/prefs_dialog.rs index c448754567..3794da2399 100644 --- a/crates/ui-egui/src/prefs_dialog.rs +++ b/crates/ui-egui/src/prefs_dialog.rs @@ -32,6 +32,11 @@ pub fn open(app: &mut VectorcraftApp, category: Option<&str>) { // One field per preference key or group (the flattener presets have commands of their own). let mut fields: Map<String, Value> = app.session.prefs.to_json().as_object().cloned().unwrap_or_default(); fields.retain(|k, _| vectorcraft_engine::cmd::prefscmds::spec(k).is_some() || PREF_GROUPS.contains(&k.as_str())); + // A restored settings file can hold a Hold Shortcut Delay outside its range: the dialog shows, + // and OK sets, the delay in use. + if fields.contains_key("keyHoldDelay") { + fields.insert("keyHoldDelay".into(), json!(app.session.prefs.key_hold_delay())); + } // Units ▸ General shows (and OK sets) the open document's units. if let Some(st) = app.session.active() { fields.insert("unitsGeneral".into(), json!(st.doc.units.key())); diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 973a0111f7..2240ddedd2 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1136,6 +1136,19 @@ fn hold_shortcut_delay_dims_without_hold_shortcuts() { } } +/// A restored Hold Shortcut Delay outside its range opens as the delay in use, and OK keeps it. +#[test] +fn a_restored_hold_shortcut_delay_outside_its_range_opens_as_the_delay_in_use() { + for (saved, used) in [(5.0, 1.0), (0.05, 0.2)] { + let mut a = app(); + a.session.prefs.key_hold_delay = saved; + open(&mut a, Some("General")); + assert_eq!(a.ui.dialog.as_ref().unwrap().fields["keyHoldDelay"], json!(used), "{saved}"); + confirm(&mut a).unwrap(); + assert_eq!(a.session.prefs.key_hold_delay, used, "{saved}"); + } +} + /// Type › Show samples on white: its checkbox is dimmed while Enable in-menu font previews is /// unchecked in the dialog, and a click on it then leaves the setting as it was. #[test] From 3900a6b9894e7a67e5d7f3173e3adae0765dfe7c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 12:07:33 -0800 Subject: [PATCH 065/247] Actions: Clear Actions deletes every set in the panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Actions panel menu gets Clear Actions, after Replace Actions… and before Reset Actions, and the new command ui.actionSet.clear. It asks first; OK deletes every set with its actions, the built-in Default Actions set included, and Cancel changes nothing. Afterwards no set, action or step is selected, and an open Set Options, New Action, Batch or step dialog that names a set closes. The question passes the ids of the sets it asked about, so OK deletes nothing when the sets changed in the meantime. The item is off with no sets and while an action records or plays. No undo step is recorded, and an empty panel stays empty after a restart. --- crates/mcp/src/ui_catalog.rs | 6 + crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 6 + crates/ui-egui/src/panels/actions.rs | 236 ++++++++++++++++++++++++ docs/mcp.md | 10 + docs/target-app-parity.md | 1 + docs/ui-parity.md | 3 +- 35 files changed, 317 insertions(+), 1 deletion(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 81d26ee13f..8dfa65e2f1 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1659,6 +1659,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{mode?: \"replace\" | \"append\"} Reset Actions. replace (the default) replaces every set in the Actions panel with a new copy of the built-in Default Actions set, makes it current and selected, clears the panel's selected action and step and its expanded actions, and closes an open Set Options, New Action, Batch or step dialog that names a set; when the panel already shows only the built-in set as it comes in that state, nothing changes, the sets keep their ids and changed is false. append adds a new copy of the built-in set after the sets there are, with the next free number when its name is in use (Default Actions 2), and keeps the current set and the selection. Omitted params count as {}. Params of another type, another key, another mode, or a reset while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Reset Actions asks first (dialog `resetActions`): OK runs this with replace, Append with append → {changed, mode, set: the first built-in set's index}", ), + ( + "ui.actionSet.clear", + "Clear Actions", + "", + "{ids?: [id]} Clear Actions: delete every set in the Actions panel with its actions, the built-in Default Actions set included, so no set is current or selected; the panel's selected action and step and its expanded actions are cleared, and an open Set Options, New Action, Batch or step dialog that names a set closes. ids holds the panel's own set ids in panel order, which the menu's question passes: when the sets are no longer exactly those, nothing is deleted. With no sets, nothing changes and cleared is 0. Omitted params count as {}. Params of another type, another key, ids that is not a list of ids, or a clear while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Clear Actions (disabled with no sets and while an action records or plays) asks first, and OK runs this → {cleared: the number of sets deleted}", + ), ("file.showPackage", "Show Package", "", "{folder} show a package folder (file.package's folder) in the file manager → {folder}"), ( "docInfo.save", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 7aa9798fb4..6fa27d1778 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -800,6 +800,7 @@ font-technology Variable Променливи Duplicate Action or Action Set Дублиране на действие или набор от действия Delete the action set “{name}” and its actions? Изтриване на набора от действия „{name}“ и неговите действия? Delete the selected action sets and their actions? Изтриване на избраните набори от действия и техните действия? + Delete all action sets and their actions? Изтриване на всички набори от действия и техните действия? Delete Theme Изтриване на тема Delete theme Изтриване на тема Delete these {n} graphic styles? Изтриване на тези {n} графични стила? @@ -2574,6 +2575,7 @@ font-technology Variable Променливи Save Actions… Запазване на действия… Load Actions… Зареждане на действия… Replace Actions… Замяна на действия… + Clear Actions Изчистване на действия Reset Actions Нулиране на действия Replace the current actions with the default set? Да се заменят ли текущите действия с набора по подразбиране? Append adds the default set after the current sets instead. С „Добавяне“ наборът по подразбиране се добавя след текущите набори. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 5081ff0f69..33386b93a3 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1504,6 +1504,7 @@ lighting Light Svjetlo Save Actions… Sačuvaj akcije… Load Actions… Učitaj akcije… Replace Actions… Zamijeni akcije… + Clear Actions Očisti akcije Reset Actions Vrati akcije na početno Replace the current actions with the default set? Zamijeniti trenutne akcije zadanim skupom? Append adds the default set after the current sets instead. Dugme Dodaj umjesto toga dodaje zadani skup iza trenutnih skupova. @@ -1806,6 +1807,7 @@ digits Malayalam Malajalam Duplicate Action or Action Set Dupliciraj akciju ili skup akcija Delete the action set “{name}” and its actions? Izbrisati skup akcija „{name}” i njegove akcije? Delete the selected action sets and their actions? Izbrisati odabrane skupove akcija i njihove akcije? + Delete all action sets and their actions? Izbrisati sve skupove akcija i njihove akcije? Delete these {n} graphic styles? Izbrisati ove grafičke stilove ({n})? Delete this {n} graphic style? Izbrisati ovaj grafički stil ({n})? Graphic Style Libraries Menu Meni biblioteka grafičkih stilova diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 75b661bc90..12d56ac92a 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -1174,6 +1174,7 @@ antiAlias Sharp Nítid Duplicate Action or Action Set Duplica l’acció o el conjunt d’accions Delete the action set “{name}” and its actions? Voleu suprimir el conjunt d’accions “{name}” i les seves accions? Delete the selected action sets and their actions? Voleu suprimir els conjunts d’accions seleccionats i les seves accions? + Delete all action sets and their actions? Voleu suprimir tots els conjunts d’accions i les seves accions? Delete the library “{name}”? Voleu suprimir la biblioteca “{name}”? Delete Theme Suprimeix el tema Delete theme Suprimeix el tema @@ -3333,6 +3334,7 @@ digits Malayalam Malaiàlam Save Actions… Desa les accions… Load Actions… Carrega accions… Replace Actions… Reemplaça les accions… + Clear Actions Esborra les accions Reset Actions Restableix les accions Replace the current actions with the default set? Voleu reemplaçar les accions actuals pel conjunt predeterminat? Append adds the default set after the current sets instead. Amb Afegeix, el conjunt predeterminat s’afegeix després dels conjunts actuals. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 86700330a5..5e7c7f5089 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1532,6 +1532,7 @@ lighting Light Světlo Save Actions… Uložit akce… Load Actions… Načíst akce… Replace Actions… Nahradit akce… + Clear Actions Vymazat akce Reset Actions Obnovit akce Replace the current actions with the default set? Nahradit aktuální akce výchozí sadou? Append adds the default set after the current sets instead. Tlačítko Připojit místo toho přidá výchozí sadu za aktuální sady. @@ -1877,6 +1878,7 @@ digits Malayalam Malajálamské Duplicate Action or Action Set Duplikovat akci nebo sadu akcí Delete the action set “{name}” and its actions? Odstranit sadu akcí „{name}“ a její akce? Delete the selected action sets and their actions? Odstranit vybrané sady akcí a jejich akce? + Delete all action sets and their actions? Odstranit všechny sady akcí a jejich akce? Delete these {n} graphic styles? Odstranit tyto grafické styly ({n})? Delete this {n} graphic style? Odstranit tento grafický styl ({n})? Graphic Style Libraries Menu Nabídka knihoven grafických stylů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 7b15bf5e58..adff05dcb0 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -4105,6 +4105,7 @@ lighting Light Lys Save Actions… Gem handlinger… Load Actions… Indlæs handlinger… Replace Actions… Erstat handlinger… + Clear Actions Ryd handlinger Reset Actions Nulstil handlinger Replace the current actions with the default set? Vil du erstatte de aktuelle handlinger med standardsættet? Append adds the default set after the current sets instead. Tilføj tilføjer i stedet standardsættet efter de aktuelle sæt. @@ -4449,6 +4450,7 @@ digits Malayalam Malayalam Duplicate Action or Action Set Duplikér handling eller handlingssæt Delete the action set “{name}” and its actions? Slet handlingssættet »{name}« og dets handlinger? Delete the selected action sets and their actions? Slet de markerede handlingssæt og deres handlinger? + Delete all action sets and their actions? Slet alle handlingssæt og deres handlinger? Delete these {n} graphic styles? Slet disse {n} grafiske typografier? Delete this {n} graphic style? Slet denne {n} grafiske typografi? Graphic Style Libraries Menu Menu med biblioteker af grafiske typografier diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index f6d1e43413..2337ef3e2f 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -801,6 +801,7 @@ font-technology Variable Variabel Duplicate Action or Action Set Aktion oder Aktionssatz duplizieren Delete the action set “{name}” and its actions? Aktionssatz „{name}“ und seine Aktionen löschen? Delete the selected action sets and their actions? Ausgewählte Aktionssätze und ihre Aktionen löschen? + Delete all action sets and their actions? Alle Aktionssätze und ihre Aktionen löschen? Delete Theme Thema löschen Delete theme Thema löschen Delete these {n} graphic styles? Diese {n} Grafikstile löschen? @@ -2620,6 +2621,7 @@ diagnostics ui Oberfläche Save Actions… Aktionen speichern… Load Actions… Aktionen laden… Replace Actions… Aktionen ersetzen… + Clear Actions Aktionen löschen Reset Actions Aktionen zurücksetzen Replace the current actions with the default set? Aktuelle Aktionen durch den Standardsatz ersetzen? Append adds the default set after the current sets instead. Mit „Anhängen“ wird der Standardsatz stattdessen nach den aktuellen Sätzen hinzugefügt. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 2e4ddec12f..439dc383e1 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -781,6 +781,7 @@ font-technology Variable Μεταβλητές Duplicate Action or Action Set Δημιουργία αντιγράφου ενέργειας ή συνόλου ενεργειών Delete the action set “{name}” and its actions? Να διαγραφεί το σύνολο ενεργειών «{name}» και οι ενέργειές του; Delete the selected action sets and their actions? Να διαγραφούν τα επιλεγμένα σύνολα ενεργειών και οι ενέργειές τους; + Delete all action sets and their actions? Να διαγραφούν όλα τα σύνολα ενεργειών και οι ενέργειές τους; Delete Theme Διαγραφή θέματος Delete theme Διαγραφή θέματος Delete these {n} graphic styles? Να διαγραφούν αυτά τα {n} στυλ γραφικών; @@ -3528,6 +3529,7 @@ theme Appearance Εμφάνιση Save Actions… Αποθήκευση ενεργειών… Load Actions… Φόρτωση ενεργειών… Replace Actions… Αντικατάσταση ενεργειών… + Clear Actions Απαλοιφή ενεργειών Reset Actions Επαναφορά ενεργειών Replace the current actions with the default set? Να αντικατασταθούν οι τρέχουσες ενέργειες με το προεπιλεγμένο σύνολο; Append adds the default set after the current sets instead. Η Προσάρτηση προσθέτει αντί γι’ αυτό το προεπιλεγμένο σύνολο μετά τα τρέχοντα σύνολα. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 83e7d53c49..64e37f1e8e 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -822,6 +822,7 @@ font-technology Variable Variables Duplicate Action or Action Set Duplicar acción o conjunto de acciones Delete the action set “{name}” and its actions? ¿Eliminar el conjunto de acciones “{name}” y sus acciones? Delete the selected action sets and their actions? ¿Eliminar los conjuntos de acciones seleccionados y sus acciones? + Delete all action sets and their actions? ¿Eliminar todos los conjuntos de acciones y sus acciones? Delete Theme Eliminar tema Delete theme Eliminar tema Delete these {n} graphic styles? ¿Eliminar estos {n} estilos gráficos? @@ -2663,6 +2664,7 @@ font-technology Variable Variables Save Actions… Guardar acciones… Load Actions… Cargar acciones… Replace Actions… Reemplazar acciones… + Clear Actions Borrar acciones Reset Actions Restablecer acciones Replace the current actions with the default set? ¿Reemplazar las acciones actuales por el conjunto predeterminado? Append adds the default set after the current sets instead. Añadir agrega en su lugar el conjunto predeterminado después de los conjuntos actuales. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 4069cb04b9..cf8c5e236d 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1506,6 +1506,7 @@ lighting Light Valo Save Actions… Tallenna toiminnot… Load Actions… Lataa toiminnot… Replace Actions… Korvaa toiminnot… + Clear Actions Tyhjennä toiminnot Reset Actions Palauta toiminnot Replace the current actions with the default set? Korvataanko nykyiset toiminnot oletussarjalla? Append adds the default set after the current sets instead. Lisää-painike lisää sen sijaan oletussarjan nykyisten sarjojen perään. @@ -1850,6 +1851,7 @@ digits Malayalam Malajalam Duplicate Action or Action Set Monista toiminto tai toimintosarja Delete the action set “{name}” and its actions? Poistetaanko toimintosarja ”{name}” ja sen toiminnot? Delete the selected action sets and their actions? Poistetaanko valitut toimintosarjat ja niiden toiminnot? + Delete all action sets and their actions? Poistetaanko kaikki toimintosarjat ja niiden toiminnot? Delete these {n} graphic styles? Poistetaanko nämä {n} grafiikkatyyliä? Delete this {n} graphic style? Poistetaanko tämä {n} grafiikkatyyli? Graphic Style Libraries Menu Grafiikkatyylikirjastojen valikko diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index ed6aa4bd26..0ae72a1d58 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -808,6 +808,7 @@ font-technology Variable Variables Duplicate Action or Action Set Dupliquer le script ou le jeu de scripts Delete the action set “{name}” and its actions? Supprimer le jeu de scripts « {name} » et ses scripts ? Delete the selected action sets and their actions? Supprimer les jeux de scripts sélectionnés et leurs scripts ? + Delete all action sets and their actions? Supprimer tous les jeux de scripts et leurs scripts ? Delete Slices Supprimer les tranches Delete Spine Point Supprimer le point de la dorsale Delete Stop Supprimer l’étape de dégradé @@ -2651,6 +2652,7 @@ font-technology Variable Variables Save Actions… Enregistrer les scripts… Load Actions… Charger des scripts… Replace Actions… Remplacer les scripts… + Clear Actions Effacer les scripts Reset Actions Réinitialiser les scripts Replace the current actions with the default set? Remplacer les scripts actuels par le jeu par défaut ? Append adds the default set after the current sets instead. Le bouton Ajouter ajoute plutôt le jeu par défaut après les jeux actuels. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index a164526e6c..b0c809734c 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2053,6 +2053,7 @@ Live preview લાઇવ પૂર્વાવલોકન Load Actions… ઍક્શન લોડ કરો… Replace Actions… ઍક્શન બદલો… + Clear Actions ઍક્શન સાફ કરો Reset Actions ઍક્શન રીસેટ કરો Replace the current actions with the default set? વર્તમાન ઍક્શનને ડિફૉલ્ટ સેટથી બદલવા છે? Append adds the default set after the current sets instead. ઉમેરો તેના બદલે ડિફૉલ્ટ સેટને વર્તમાન સેટ પછી ઉમેરે છે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 73c22a6b6d..a61e193bff 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1330,6 +1330,7 @@ antiAlias Sharp शार्प Delete the graphic style “{name}”? ग्राफिक स्टाइल "{name}" को हटा दें? Delete the library “{name}”? लाइब्रेरी "{name}" को हटा दें? Delete the selected action sets and their actions? सिलेक्टेड कार्रवाई सेट और उनके कार्यों को हटा दें? + Delete all action sets and their actions? सभी कार्रवाई सेट और उनके कार्यों को हटा दें? Delete the selected brushes? सिलेक्टेड ब्रश को हटा दें? Delete the selected symbol? सिलेक्टेड सिंबल हटाएँ? Delete the selected symbols? सिलेक्टेड सिंबल्स हटाएँ? @@ -2758,6 +2759,7 @@ antiAlias Sharp शार्प Live Shape Properties लाइव शेप प्रॉपर्टीज़ Load Actions… एक्शन्स लोड करें… Replace Actions… एक्शन्स रिप्लेस करें… + Clear Actions एक्शन्स क्लियर करें Reset Actions एक्शन्स रीसेट करें Replace the current actions with the default set? मौजूदा एक्शन्स को डिफ़ॉल्ट सेट से बदलें? Append adds the default set after the current sets instead. जोड़ें इसके बजाय डिफ़ॉल्ट सेट को मौजूदा सेट के बाद जोड़ता है। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a6525abe22..cd627becf0 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -1055,6 +1055,7 @@ font-technology Variable Változó Duplicate Action or Action Set Művelet vagy műveletkészlet kettőzése Delete the action set “{name}” and its actions? Törlöd ezt a műveletkészletet és a műveleteit: „{name}”? Delete the selected action sets and their actions? Törlöd a kijelölt műveletkészleteket és a műveleteiket? + Delete all action sets and their actions? Törlöd az összes műveletkészletet és a műveleteiket? Delete the library “{name}”? Törlöd ezt a könyvtárat: „{name}”? Delete Theme Téma törlése Delete theme Téma törlése @@ -3210,6 +3211,7 @@ diagnostics ui felület Save Actions… Műveletek mentése… Load Actions… Műveletek betöltése… Replace Actions… Műveletek cseréje… + Clear Actions Műveletek törlése Reset Actions Műveletek visszaállítása Replace the current actions with the default set? Lecseréled az aktuális műveleteket az alapértelmezett készletre? Append adds the default set after the current sets instead. A Hozzáfűzés ehelyett az aktuális készletek után adja hozzá az alapértelmezett készletet. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 3be6619e26..54dc94644f 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1431,6 +1431,7 @@ lighting Light Cahaya Save Actions… Simpan tindakan… Load Actions… Muat tindakan… Replace Actions… Ganti tindakan… + Clear Actions Bersihkan tindakan Reset Actions Atur ulang tindakan Replace the current actions with the default set? Ganti tindakan saat ini dengan set default? Append adds the default set after the current sets instead. Tambahkan justru menambahkan set default setelah set saat ini. @@ -1733,6 +1734,7 @@ digits Malayalam Malayalam Duplicate Action or Action Set Duplikatkan tindakan atau set tindakan Delete the action set “{name}” and its actions? Hapus set tindakan “{name}” beserta tindakannya? Delete the selected action sets and their actions? Hapus set tindakan yang dipilih beserta tindakannya? + Delete all action sets and their actions? Hapus semua set tindakan beserta tindakannya? Delete these {n} graphic styles? Hapus {n} gaya grafis ini? Delete this {n} graphic style? Hapus {n} gaya grafis ini? Graphic Style Libraries Menu Menu pustaka gaya grafis diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 0210a81598..791158dabe 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -822,6 +822,7 @@ font-technology Variable Variabili Duplicate Action or Action Set Duplica azione o set di azioni Delete the action set “{name}” and its actions? Eliminare il set di azioni “{name}” e le sue azioni? Delete the selected action sets and their actions? Eliminare i set di azioni selezionati e le loro azioni? + Delete all action sets and their actions? Eliminare tutti i set di azioni e le loro azioni? Delete Theme Elimina tema Delete theme Elimina tema Delete these {n} graphic styles? Eliminare questi {n} stili grafici? @@ -2701,6 +2702,7 @@ diagnostics ui interfaccia Save Actions… Salva azioni… Load Actions… Carica azioni… Replace Actions… Sostituisci azioni… + Clear Actions Cancella azioni Reset Actions Ripristina azioni Replace the current actions with the default set? Sostituire le azioni correnti con il set predefinito? Append adds the default set after the current sets instead. Aggiungi aggiunge invece il set predefinito dopo i set correnti. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 17c1907a75..e85aeb0633 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -1513,6 +1513,7 @@ antiAlias Sharp シャープ Duplicate Action or Action Set アクションまたはアクションセットを複製 Delete the action set “{name}” and its actions? アクションセット「{name}」とそのアクションを削除しますか? Delete the selected action sets and their actions? 選択したアクションセットとそのアクションを削除しますか? + Delete all action sets and their actions? すべてのアクションセットとそのアクションを削除しますか? Delete theme テーマを削除 Delete this saved preset この保存済みプリセットを削除 Delete {kind} Style {kind}スタイルを削除 @@ -2788,6 +2789,7 @@ diagnostics ui UI Save Actions… アクションを保存… Load Actions… アクションを読み込み… Replace Actions… アクションを置き換え… + Clear Actions アクションを消去 Reset Actions アクションをリセット Replace the current actions with the default set? 現在のアクションを初期設定のセットで置き換えますか? Append adds the default set after the current sets instead. 「追加」を選ぶと、初期設定のセットを現在のセットの後に追加します。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 2f61daa80b..95fd9d3d4e 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3455,6 +3455,7 @@ lighting Light სინათლე Save Actions… მოქმედებების შენახვა… Load Actions… მოქმედებების ჩატვირთვა… Replace Actions… მოქმედებების ჩანაცვლება… + Clear Actions მოქმედებების გასუფთავება Reset Actions მოქმედებების ჩამოყრა Replace the current actions with the default set? ჩანაცვლდეს მიმდინარე მოქმედებები ნაგულისხმევი ნაკრებით? Append adds the default set after the current sets instead. დამატება ამის ნაცვლად ნაგულისხმევ ნაკრებს მიმდინარე ნაკრებების შემდეგ ამატებს. @@ -3805,6 +3806,7 @@ digits Malayalam მალაიალამური Duplicate Action or Action Set მოქმედების ან მოქმედებების ნაკრების დუბლირება Delete the action set “{name}” and its actions? წაიშალოს მოქმედებების ნაკრები „{name}“ და მისი მოქმედებები? Delete the selected action sets and their actions? წაიშალოს მონიშნული მოქმედებების ნაკრებები და მათი მოქმედებები? + Delete all action sets and their actions? წაიშალოს ყველა მოქმედებების ნაკრები და მათი მოქმედებები? Delete these {n} graphic styles? წაიშალოს ეს გრაფიკული სტილები ({n})? Delete this {n} graphic style? წაიშალოს ეს გრაფიკული სტილი ({n})? Graphic Style Libraries Menu გრაფიკული სტილების ბიბლიოთეკების მენიუ diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 8359b360ce..054d913bfc 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1503,6 +1503,7 @@ antiAlias Sharp 날카롭게 Duplicate Action or Action Set 액션 또는 액션 세트 복제 Delete the action set “{name}” and its actions? 액션 세트 “{name}”과(와) 해당 액션을 삭제하시겠습니까? Delete the selected action sets and their actions? 선택한 액션 세트와 해당 액션을 삭제하시겠습니까? + Delete all action sets and their actions? 모든 액션 세트와 해당 액션을 삭제하시겠습니까? Delete theme 테마 삭제 Delete this saved preset 저장된 이 프리셋 삭제 Delete {kind} Style {kind} 스타일 삭제 @@ -2778,6 +2779,7 @@ diagnostics ui UI Save Actions… 액션 저장… Load Actions… 액션 불러오기… Replace Actions… 액션 바꾸기… + Clear Actions 액션 지우기 Reset Actions 액션 재설정 Replace the current actions with the default set? 현재 액션을 기본 세트로 바꾸시겠습니까? Append adds the default set after the current sets instead. 추가를 누르면 대신 기본 세트를 현재 세트 뒤에 추가합니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 16957afaef..2d07cd41e6 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1999,6 +1999,7 @@ lighting Light Licht Save Actions… Acties opslaan… Load Actions… Acties laden… Replace Actions… Acties vervangen… + Clear Actions Acties wissen Reset Actions Acties opnieuw instellen Replace the current actions with the default set? De huidige acties vervangen door de standaardset? Append adds the default set after the current sets instead. Toevoegen voegt in plaats daarvan de standaardset toe na de huidige sets. @@ -2343,6 +2344,7 @@ digits Malayalam Malayalam Duplicate Action or Action Set Actie of actieset dupliceren Delete the action set “{name}” and its actions? De actieset „{name}” en de acties erin verwijderen? Delete the selected action sets and their actions? De geselecteerde actiesets en de acties erin verwijderen? + Delete all action sets and their actions? Alle actiesets en de acties erin verwijderen? Delete these {n} graphic styles? Deze {n} grafische stijlen verwijderen? Delete this {n} graphic style? Deze {n} grafische stijl verwijderen? Graphic Style Libraries Menu Menu grafische stijlbibliotheken diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index fcb2ba71a0..444d537e38 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1445,6 +1445,7 @@ lighting Light Światło Save Actions… Zapisz operacje… Load Actions… Wczytaj operacje… Replace Actions… Zastąp operacje… + Clear Actions Wyczyść operacje Reset Actions Resetuj operacje Replace the current actions with the default set? Zastąpić bieżące operacje zestawem domyślnym? Append adds the default set after the current sets instead. Dołącz dodaje zamiast tego zestaw domyślny po bieżących zestawach. @@ -1789,6 +1790,7 @@ digits Malayalam Malajalam Duplicate Action or Action Set Powiel operację lub zestaw operacji Delete the action set “{name}” and its actions? Usunąć zestaw operacji „{name}” i jego operacje? Delete the selected action sets and their actions? Usunąć zaznaczone zestawy operacji i ich operacje? + Delete all action sets and their actions? Usunąć wszystkie zestawy operacji i ich operacje? Delete these {n} graphic styles? Usunąć te style graficzne ({n})? Delete this {n} graphic style? Usunąć ten styl graficzny ({n})? Graphic Style Libraries Menu Menu bibliotek stylów graficznych diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index d851d3659d..d15d2fcc37 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -739,6 +739,7 @@ antiAlias Sharp Nítido Duplicate Action or Action Set Duplicar Ação ou Conjunto de Ações Delete the action set “{name}” and its actions? Excluir o conjunto de ações “{name}” e suas ações? Delete the selected action sets and their actions? Excluir os conjuntos de ações selecionados e suas ações? + Delete all action sets and their actions? Excluir todos os conjuntos de ações e suas ações? Delete theme Excluir tema Delete this saved preset Excluir este predefinido salvo Delete {kind} Style Excluir Estilo de {kind} @@ -2198,6 +2199,7 @@ antiAlias Sharp Nítido Save Actions… Salvar Ações… Load Actions… Carregar Ações… Replace Actions… Substituir Ações… + Clear Actions Limpar Ações Reset Actions Redefinir Ações Replace the current actions with the default set? Substituir as ações atuais pelo conjunto padrão? Append adds the default set after the current sets instead. Anexar adiciona o conjunto padrão depois dos conjuntos atuais. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 710a1989d4..22dfe507df 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -820,6 +820,7 @@ font-technology Variable Вариативные Duplicate Action or Action Set Дублировать действие или набор действий Delete the action set “{name}” and its actions? Удалить набор действий «{name}» и его действия? Delete the selected action sets and their actions? Удалить выбранные наборы действий и их действия? + Delete all action sets and their actions? Удалить все наборы действий и их действия? Delete Theme Удалить тему Delete theme Удалить тему Delete these {n} graphic styles? Удалить эти графические стили ({n})? @@ -2690,6 +2691,7 @@ diagnostics ui интерфейс Save Actions… Сохранить действия… Load Actions… Загрузить действия… Replace Actions… Заменить действия… + Clear Actions Очистить действия Reset Actions Сбросить действия Replace the current actions with the default set? Заменить текущие действия набором по умолчанию? Append adds the default set after the current sets instead. Кнопка «Добавить» вместо этого добавляет набор по умолчанию после текущих наборов. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index be44bfdecd..7ecc2616dc 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -809,6 +809,7 @@ font-technology Variable Variabla Duplicate Action or Action Set Duplicera åtgärd eller åtgärdsuppsättning Delete the action set “{name}” and its actions? Radera åtgärdsuppsättningen ”{name}” och dess åtgärder? Delete the selected action sets and their actions? Radera de markerade åtgärdsuppsättningarna och deras åtgärder? + Delete all action sets and their actions? Radera alla åtgärdsuppsättningar och deras åtgärder? Delete Theme Radera tema Delete theme Radera tema Delete these {n} graphic styles? Radera dessa {n} grafikstilar? @@ -2594,6 +2595,7 @@ font-technology Variable Variabla Save Actions… Spara åtgärder… Load Actions… Läs in åtgärder… Replace Actions… Ersätt åtgärder… + Clear Actions Rensa åtgärder Reset Actions Återställ åtgärder Replace the current actions with the default set? Vill du ersätta de aktuella åtgärderna med standarduppsättningen? Append adds the default set after the current sets instead. Lägg till lägger i stället till standarduppsättningen efter de aktuella uppsättningarna. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index f1f33c55b2..8a43a71bf7 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -801,6 +801,7 @@ font-technology Variable Değişken Duplicate Action or Action Set Eylemi veya Eylem Setini Çoğalt Delete the action set “{name}” and its actions? “{name}” eylem seti ve eylemleri silinsin mi? Delete the selected action sets and their actions? Seçili eylem setleri ve eylemleri silinsin mi? + Delete all action sets and their actions? Tüm eylem setleri ve eylemleri silinsin mi? Delete Theme Temayı Sil Delete theme Temayı sil Delete these {n} graphic styles? Bu {n} grafik stilleri silinsin mi? @@ -2435,6 +2436,7 @@ shape Open Açık Save Actions… Eylemleri Kaydet… Load Actions… Eylemleri Yükle… Replace Actions… Eylemleri Değiştir… + Clear Actions Eylemleri Temizle Reset Actions Eylemleri Sıfırla Replace the current actions with the default set? Geçerli eylemler varsayılan setle değiştirilsin mi? Append adds the default set after the current sets instead. Ekle bunun yerine varsayılan seti geçerli setlerin sonuna ekler. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index c81a56e6cb..5589a8095e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -816,6 +816,7 @@ font-technology Variable Варіативні Duplicate Action or Action Set Дублювати дію або набір дій Delete the action set “{name}” and its actions? Видалити набір дій «{name}» і його дії? Delete the selected action sets and their actions? Видалити вибрані набори дій і їхні дії? + Delete all action sets and their actions? Видалити всі набори дій і їхні дії? Delete Theme Видалити тему Delete theme Видалити тему Delete these {n} graphic styles? Видалити ці графічні стилі ({n})? @@ -2693,6 +2694,7 @@ diagnostics ui інтерфейс Save Actions… Зберегти дії… Load Actions… Завантажити дії… Replace Actions… Замінити дії… + Clear Actions Очистити дії Reset Actions Скинути дії Replace the current actions with the default set? Замінити поточні дії набором за умовчанням? Append adds the default set after the current sets instead. Кнопка «Додати» натомість додає набір за умовчанням після поточних наборів. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 690002ccf6..b4afdcc5c5 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -951,6 +951,7 @@ font-technology Variable Biến thiên Duplicate Action or Action Set Nhân bản hành động hoặc bộ hành động Delete the action set “{name}” and its actions? Xóa bộ hành động “{name}” và các hành động của nó? Delete the selected action sets and their actions? Xóa các bộ hành động đã chọn và các hành động của chúng? + Delete all action sets and their actions? Xóa tất cả các bộ hành động và các hành động của chúng? Delete the library “{name}”? Xóa thư viện “{name}”? Delete Theme Xóa bộ màu Delete theme Xóa bộ màu @@ -3010,6 +3011,7 @@ diagnostics ui giao diện Save Actions… Lưu hành động… Load Actions… Tải hành động… Replace Actions… Thay thế hành động… + Clear Actions Xóa hết hành động Reset Actions Đặt lại hành động Replace the current actions with the default set? Thay thế các hành động hiện tại bằng bộ mặc định? Append adds the default set after the current sets instead. Nối thêm sẽ thêm bộ mặc định vào sau các bộ hiện tại. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 4dc3a9bc24..70817f4dd4 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -764,6 +764,7 @@ antiAlias Sharp 锐利 Duplicate Action or Action Set 复制动作或动作组 Delete the action set “{name}” and its actions? 要删除动作组“{name}”及其中的动作吗? Delete the selected action sets and their actions? 要删除所选动作组及其中的动作吗? + Delete all action sets and their actions? 要删除所有动作组及其中的动作吗? Delete Theme 删除主题 Delete theme 删除主题 Delete these {n} graphic styles? 要删除这 {n} 个图形样式吗? @@ -2554,6 +2555,7 @@ diagnostics ui 界面 Save Actions… 存储动作… Load Actions… 载入动作… Replace Actions… 替换动作… + Clear Actions 清除动作 Reset Actions 重置动作 Replace the current actions with the default set? 要用默认动作组替换当前动作吗? Append adds the default set after the current sets instead. “追加”会改为将默认动作组添加到当前动作组之后。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index aa926bc592..8365925ed8 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -784,6 +784,7 @@ font-technology Variable 可變 Duplicate Action or Action Set 製作動作或動作組複本 Delete the action set “{name}” and its actions? 要刪除動作組「{name}」及其中的動作嗎? Delete the selected action sets and their actions? 要刪除所選動作組及其中的動作嗎? + Delete all action sets and their actions? 要刪除所有動作組及其中的動作嗎? Delete Theme 刪除主題 Delete theme 刪除主題 Delete these {n} graphic styles? 要刪除這 {n} 個繪圖樣式嗎? @@ -3825,6 +3826,7 @@ diagnostics ui 介面 Save Actions… 儲存動作… Load Actions… 載入動作… Replace Actions… 取代動作… + Clear Actions 清除動作 Reset Actions 重設動作 Replace the current actions with the default set? 要用預設動作組取代目前的動作嗎? Append adds the default set after the current sets instead. 「附加」會改為將預設動作組加到目前動作組之後。 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 5e8702e6af..c30d004dd8 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -1006,6 +1006,7 @@ fn run_ui_part11(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result crate::panels::actions::DELETE_SETS => crate::panels::actions::delete_sets(app, p), crate::panels::actions::DUPLICATE => crate::panels::actions::duplicate(app, p), crate::panels::actions::RESET => crate::panels::actions::reset(app, p), + crate::panels::actions::CLEAR => crate::panels::actions::clear(app, p), "ui.shortcutImportDialog" => crate::dialogs::shortcut_import::command(app, p), _ => return None, }; diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 76e0d45900..75ec5753ac 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1660,6 +1660,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{mode?: \"replace\" | \"append\"} Reset Actions. replace (the default) replaces every set in the Actions panel with a new copy of the built-in Default Actions set, makes it current and selected, clears the panel's selected action and step and its expanded actions, and closes an open Set Options, New Action, Batch or step dialog that names a set; when the panel already shows only the built-in set as it comes in that state, nothing changes, the sets keep their ids and changed is false. append adds a new copy of the built-in set after the sets there are, with the next free number when its name is in use (Default Actions 2), and keeps the current set and the selection. Omitted params count as {}. Params of another type, another key, another mode, or a reset while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Reset Actions asks first (dialog `resetActions`): OK runs this with replace, Append with append → {changed, mode, set: the first built-in set's index}", ), + ( + crate::panels::actions::CLEAR, + "Clear Actions", + "", + "{ids?: [id]} Clear Actions: delete every set in the Actions panel with its actions, the built-in Default Actions set included, so no set is current or selected; the panel's selected action and step and its expanded actions are cleared, and an open Set Options, New Action, Batch or step dialog that names a set closes. ids holds the panel's own set ids in panel order, which the menu's question passes: when the sets are no longer exactly those, nothing is deleted. With no sets, nothing changes and cleared is 0. Omitted params count as {}. Params of another type, another key, ids that is not a list of ids, or a clear while an action records or plays (also while it waits at a stop) is an error and changes nothing. No undo step is recorded. The panel menu's Clear Actions (disabled with no sets and while an action records or plays) asks first, and OK runs this → {cleared: the number of sets deleted}", + ), ("file.showPackage", "Show Package", "", "{folder} show a package folder (file.package's folder) in the file manager → {folder}"), ( "docInfo.save", diff --git a/crates/ui-egui/src/panels/actions.rs b/crates/ui-egui/src/panels/actions.rs index ccf7665359..48afbf6486 100644 --- a/crates/ui-egui/src/panels/actions.rs +++ b/crates/ui-egui/src/panels/actions.rs @@ -2230,6 +2230,76 @@ fn replace_sets(app: &mut VectorcraftApp, sets: Vec<ActionSet>) -> bool { true } +/// The command that deletes every action set in the panel ([`clear`]). +pub const CLEAR: &str = "ui.actionSet.clear"; + +/// The panel menu's Clear Actions: asks whether to delete every set, naming them by their ids +/// ([`ActionSet::id`]), so OK deletes only the sets that were there when the question opened. +fn ask_clear(app: &mut VectorcraftApp) { + let ids: Vec<u64> = app.ui.action_sets.iter().map(|s| s.id).collect(); + crate::dialogs::confirm::ask(app, tl!("Delete all action sets and their actions?"), "", CLEAR, json!({ "ids": ids })); +} + +/// `ui.actionSet.clear {ids?: [id]}`: Clear Actions. Deletes every set in the panel with its +/// actions, the built-in Default Actions set included, so no set is current or selected; the +/// panel's selected action and step, its expanded actions and a step being dragged are cleared, and +/// an open Set Options, New Action, Batch or step dialog that names a set closes. `ids` holds the +/// panel's own set ids in panel order, which the menu's question passes: when the sets are no +/// longer exactly those, nothing is deleted. With no sets, nothing changes. Omitted params (`null`) +/// count as `{}`. Params of another type, another key, `ids` that is not a list of ids, or a clear +/// while an action records or plays (also while it waits at a stop) is an error, and then nothing +/// changes. No undo step is recorded. → {cleared: the number of sets deleted} +pub fn clear(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> { + const SELECTED: &str = "actions-selected"; + const EXPANDED: &str = "actions-expanded"; + let ids = match p { + Value::Null => None, + Value::Object(m) => { + if let Some(key) = m.keys().find(|k| *k != "ids") { + let keys = "ids"; + return Err(format!("unknown parameter `{key}`; the command takes: {keys}")); + } + match m.get("ids") { + None => None, + Some(v) => Some( + v.as_array() + .ok_or("the action set ids are not a list")? + .iter() + .map(|id| id.as_u64().ok_or("the action set ids are not a list")) + .collect::<Result<Vec<u64>, _>>()?, + ), + } + } + got => return Err(format!("the params must be an object, not {got}")), + }; + if app.ui.recording.is_some() { + return Err("an action is already recording".into()); + } + if app.ui.action_playing.is_some() { + return Err("an action is already playing".into()); + } + if ids.is_some_and(|ids| !ids.iter().copied().eq(app.ui.action_sets.iter().map(|s| s.id))) { + return Err("the action sets changed; nothing was deleted".into()); + } + let cleared = app.ui.action_sets.len(); + if cleared == 0 { + return Ok(json!({ "cleared": 0 })); + } + app.ui.action_sets.clear(); + app.ui.action_set = None; + app.ui.action_sets_selected.clear(); + if app.ui.dialog.as_ref().is_some_and(holds_set) { + app.ui.dialog = None; + } + if let Some(ctx) = app.ui_ctx.clone() { + set_pstate::<Option<(usize, usize)>>(&ctx, SELECTED, None); + set_pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP, None); + set_pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP, None); + set_pstate(&ctx, EXPANDED, BTreeSet::<u64>::new()); + } + Ok(json!({ "cleared": cleared })) +} + /// The panel's (≡) menu. pub fn menu(app: &mut VectorcraftApp, ui: &mut egui::Ui) { // Button Mode is off while an action records, so the Stop button the list shows stays in reach. @@ -2328,6 +2398,10 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut egui::Ui) { app.status(e); } } + // Asks first: OK deletes every set. Off with no sets and while an action records or plays. + if widgets::menu_item(ui, tl!("Clear Actions"), idle && !app.ui.action_sets.is_empty(), false) { + ask_clear(app); + } // Asks first: OK replaces the sets with the built-in set, Append adds it after them. if widgets::menu_item(ui, tl!("Reset Actions"), idle, false) { crate::dialogs::confirm::ask_reset_actions(app); @@ -4001,6 +4075,168 @@ mod tests { assert_eq!(saved_sets(&app.ui.action_sets), before, "the playing set stays"); } + /// The panel menu's Clear Actions asks before it deletes anything, naming the sets by their ids: + /// Cancel keeps every set, and OK deletes every set, the built-in one included, and the selected + /// action with them, so Batch… and Play Current Selection are off afterwards. The item is off + /// with no sets and while an action records or plays, waiting at a stop included. + #[test] + fn the_panel_menus_clear_actions_asks_first_and_ok_deletes_every_set() { + let ctx = egui::Context::default(); + let mut app = app_with_sets(); + app.ui.action_set = Some(1); + let before = saved_sets(&app.ui.action_sets); + let ids: Vec<u64> = app.ui.action_sets.iter().map(|s| s.id).collect(); + menu_click(&ctx, &mut app, "Clear Actions"); + let d = app.ui.dialog.as_ref().expect("Clear Actions asks first"); + assert_eq!((d.kind.as_str(), d.str("__command")), (crate::dialogs::confirm::KIND, CLEAR.to_string())); + assert_eq!(d.str("message"), "Delete all action sets and their actions?"); + assert_eq!(d.fields["__params"], json!({ "ids": ids })); + assert_eq!(saved_sets(&app.ui.action_sets), before, "asking changes no set"); + crate::dialogs::cancel(&mut app); + assert!(app.ui.dialog.is_none()); + assert_eq!(saved_sets(&app.ui.action_sets), before, "Cancel keeps every set"); + assert_eq!(app.ui.action_set, Some(1)); + + app.ui_ctx = Some(ctx.clone()); + set_pstate::<Option<(usize, usize)>>(&ctx, "actions-selected", Some((1, 0))); + menu_click(&ctx, &mut app, "Clear Actions"); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(app.ui.action_sets.is_empty(), "OK deletes every set, the built-in one included"); + assert_eq!(app.ui.action_set, None); + assert!(app.ui.dialog.is_none()); + for label in ["Clear Actions", "Batch…", "Play Current Selection", "Duplicate", "Set Options…"] { + menu_click(&ctx, &mut app, label); + let idle = app.ui.dialog.is_none() && app.ui.action_playing.is_none() && app.ui.action_sets.is_empty(); + assert!(idle, "{label} is off with no sets"); + } + + let mut app = app_with_sets(); + app.run("file.new", json!({"width": 200, "height": 100})).unwrap(); + app.run(START_RECORDING, json!({})).unwrap(); + menu_click(&ctx, &mut app, "Clear Actions"); + assert!(app.ui.dialog.is_none(), "off while an action records"); + app.run(STOP_RECORDING, json!({})).unwrap(); + + let (mut app, _) = app_with_a_stop(true); + play(&mut app, 0, 0).unwrap(); + assert!(waiting_at_stop(&app)); + app.ui.dialog = None; + menu_click(&ctx, &mut app, "Clear Actions"); + assert!(app.ui.dialog.is_none(), "off while playback waits at a stop"); + } + + /// `ui.actionSet.clear` deletes every set (the built-in one edited, the others and a loaded + /// one), leaves no set current or selected, clears the panel's selected action and step, + /// expanded actions and a dragged step, closes a dialog that holds a set index and records no + /// undo step. A clear with no sets changes nothing, the empty list stays empty after a save + /// and a restart, a dialog that names no set stays open, and Load Actions… and Reset Actions + /// add sets again. Thousands of sets go in one clear. + #[test] + fn clear_deletes_every_set_and_clears_what_named_them() { + let mut app = app_with_sets(); + app.run("file.new", json!({"width": 200, "height": 100})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap(); + let undo = undo_steps(&app); + app.ui.action_sets[0].name = "Renamed".into(); + let loaded = files::write_set(&app.ui.action_sets[1]); + app.run(LOAD_SET, json!({ "data": loaded })).unwrap(); + assert_eq!(app.ui.action_sets.len(), 4); + app.ui.action_set = Some(2); + app.ui.action_sets_selected = vec![1, 2]; + let ctx = egui::Context::default(); + app.ui_ctx = Some(ctx.clone()); + let nudge = app.ui.action_sets[1].actions[1].id; + set_pstate::<Option<(usize, usize)>>(&ctx, "actions-selected", Some((1, 1))); + set_pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP, Some((nudge, 0))); + set_pstate(&ctx, "actions-expanded", BTreeSet::from([nudge])); + let dragged: DraggedStep = (nudge, 0, std::sync::Arc::new((vec![], BTreeSet::new()))); + set_pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP, Some(dragged)); + crate::dialogs::action_batch::open(&mut app, 1, 1).unwrap(); + + assert_eq!(app.run(CLEAR, json!({})).unwrap(), json!({"cleared": 4})); + assert!(app.ui.action_sets.is_empty()); + assert_eq!((app.ui.action_set, app.ui.action_sets_selected.clone()), (None, vec![]), "no set is current or selected"); + assert_eq!(pstate::<Option<(usize, usize)>>(&ctx, "actions-selected"), None); + assert_eq!(pstate::<Option<(u64, usize)>>(&ctx, SELECTED_STEP), None); + assert!(pstate::<BTreeSet<u64>>(&ctx, "actions-expanded").is_empty()); + assert!(pstate::<Option<DraggedStep>>(&ctx, DRAGGED_STEP).is_none()); + assert!(app.ui.dialog.is_none(), "the Batch dialog of a deleted set closes"); + assert_eq!(undo_steps(&app), undo, "no undo step"); + + assert_eq!(app.run(CLEAR, Value::Null).unwrap(), json!({"cleared": 0}), "nothing left to clear"); + assert_eq!(app.run(CLEAR, json!({"ids": []})).unwrap(), json!({"cleared": 0})); + assert!(app.ui.action_sets.is_empty()); + let restarted: crate::UiState = serde_json::from_value(serde_json::to_value(&app.ui).unwrap()).unwrap(); + assert!(restarted.action_sets.is_empty(), "no sets after a restart either"); + assert_eq!(restarted.action_set, None); + + app.run(LOAD_SET, json!({ "data": loaded })).unwrap(); + assert_eq!(set_names(&app), ["Mine"], "Load Actions… adds a set again"); + crate::dialogs::action_set_options::open_new(&mut app); + assert_eq!(app.run(CLEAR, json!({})).unwrap(), json!({"cleared": 1})); + assert!(app.ui.dialog.is_some(), "a New Set dialog names no set and stays open"); + app.ui.dialog = None; + assert_eq!(app.run(RESET, json!({"mode": "append"})).unwrap()["set"], 0); + assert_eq!(saved_sets(&app.ui.action_sets), saved_sets(&default_sets()), "Reset Actions adds the built-in set again"); + + app.ui.action_sets.extend((0..5000).map(|i| ActionSet::new(format!("Set {i}"), vec![]))); + assert_eq!(app.run(CLEAR, json!({})).unwrap(), json!({"cleared": 5001})); + assert!(app.ui.action_sets.is_empty()); + } + + /// `ui.actionSet.clear` refuses params that are not an object, another key, `ids` that is not a + /// list of ids (`null` included), `ids` that are not exactly the panel's sets in order (a set added after the + /// question opened included), and a clear while an action records or plays, waiting at a stop + /// included, and then deletes no set and keeps the current set. + #[test] + fn clear_refuses_bad_params_changed_sets_and_a_running_action() { + let mut app = app_with_sets(); + app.ui.action_set = Some(1); + let ids: Vec<u64> = app.ui.action_sets.iter().map(|s| s.id).collect(); + let before = saved_sets(&app.ui.action_sets); + let changed = "the action sets changed; nothing was deleted"; + let not_ids = "the action set ids are not a list"; + for (p, error) in [ + (json!(1), "the params must be an object, not 1"), + (json!("all"), "the params must be an object, not \"all\""), + (json!([]), "the params must be an object, not []"), + (json!({"sets": [0]}), "unknown parameter `sets`; the command takes: ids"), + (json!({"ids": 5}), not_ids), + (json!({"ids": null}), not_ids), + (json!({"ids": [ids[0], "x"]}), not_ids), + (json!({"ids": [-1]}), not_ids), + (json!({"ids": []}), changed), + (json!({"ids": [ids[0], ids[1]]}), changed), + (json!({"ids": [ids[2], ids[1], ids[0]]}), changed), + (json!({"ids": [ids[0], ids[1], ids[2], ids[2]]}), changed), + ] { + assert_eq!(app.run(CLEAR, p.clone()).unwrap_err(), error, "{p}"); + assert_eq!(saved_sets(&app.ui.action_sets), before, "{p} changes nothing"); + assert_eq!(app.ui.action_set, Some(1)); + } + let asked = json!({ "ids": ids }); + app.ui.action_sets.push(ActionSet::new("Later", vec![])); + assert_eq!(app.run(CLEAR, asked.clone()).unwrap_err(), changed); + assert_eq!(set_names(&app), ["Default Actions", "Mine", "Other", "Later"], "a set added after the question keeps every set"); + app.ui.action_sets.pop(); + assert_eq!(app.run(CLEAR, asked).unwrap(), json!({"cleared": 3}), "the sets the question named"); + + let mut app = app_with_sets(); + let before = saved_sets(&app.ui.action_sets); + app.run("file.new", json!({"width": 200, "height": 100})).unwrap(); + app.run(START_RECORDING, json!({})).unwrap(); + assert_eq!(app.run(CLEAR, json!({})).unwrap_err(), "an action is already recording"); + assert_eq!(saved_sets(&app.ui.action_sets), before, "a recording keeps its set"); + app.run(STOP_RECORDING, json!({})).unwrap(); + + let (mut app, _) = app_with_a_stop(true); + let before = saved_sets(&app.ui.action_sets); + play(&mut app, 0, 0).unwrap(); + assert!(waiting_at_stop(&app)); + assert_eq!(app.run(CLEAR, json!({})).unwrap_err(), "an action is already playing"); + assert_eq!(saved_sets(&app.ui.action_sets), before, "the playing set stays"); + } + /// A click on the panel menu's item `label`; an item that is off takes no click. fn menu_click(ctx: &egui::Context, app: &mut VectorcraftApp, label: &str) { use super::super::tests_appearance::{click, frame_events}; diff --git a/docs/mcp.md b/docs/mcp.md index 1030b03ab0..0196b2e663 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -4006,6 +4006,16 @@ already walks Image Trace. Short agent entry points: records or plays (also while it waits at a stop) is an error and changes nothing. Reset records no undo step. The panel menu's Reset Actions is disabled while an action records or plays; it opens a `resetActions` question (fields `message`, `detail`, `append`): OK runs this with `replace`, Append with `append`, and `ui.dialog.cancel` changes nothing. + `ui.actionSet.clear {ids?: [id]}` is Clear Actions, and returns `{cleared}`, the number of sets deleted. It deletes + every set in the panel with its actions, the built-in Default Actions set included, so no set is current or + selected; the panel's selected action and step and its expanded actions are cleared, and an open Set Options, New + Action, Batch or step dialog that names a set closes. `ids` holds the panel's own set ids in panel order, which the + menu's question passes: when the sets are no longer exactly those, the command returns an error and deletes no set. + With no sets, nothing changes and `cleared` is 0. Omitted params count as `{}`. Params of another type, another key, + `ids` that is not a list of ids, or a clear while an action records or plays (also while it waits at a stop) is an + error and changes nothing. Clear records no undo step, and an empty panel stays empty after a restart. The panel + menu's Clear Actions is disabled with no sets and while an action records or plays; it opens a `confirm` question, + OK runs this, and `ui.dialog.cancel` changes nothing. These are VectorCraft's own rules. - Image Trace: `imageTrace.presets`, `imageTrace.make {id?, preset?, params?, view?}` (or `imageTrace.makeAndExpand`), `imageTrace.setView`, `imageTrace.expand`, `imageTrace.release`. A key inside `params` that is not one of the trace settings, such as `colours`, is an error that names it and the nearest setting (`colors`), as for a command's own keys. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f00a5a5181..5ff65ca479 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -855,6 +855,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Actions panel: the panel menu's Duplicate copies the selected action, else the current action set with all its actions ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.duplicate`). VectorCraft's own rules, which the overview does not cover: the copy goes right after the original, is named after it with " copy" added and is selected. - Actions panel: the panel menu's Reset Actions asks first; OK replaces the sets in the panel with the default set, and Append adds the default set after them ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html); `ui.actionSet.reset`). VectorCraft's own rules, which the page does not cover: the default set is VectorCraft's own Default Actions set; after OK it is current and selected, and no action or step is selected; Append names its copy with the next free number (`Default Actions 2`) and keeps the current set; Cancel changes nothing; the item is off while an action records or plays, waiting at a stop included; Undo does not bring the old sets back. Tests `panels::actions::tests::{the_panel_menus_reset_actions_asks_first_and_is_off_while_an_action_runs, reset_replaces_every_set_with_the_built_in_set_and_clears_what_named_the_old_ones, reset_on_the_built_in_set_makes_it_current_then_changes_nothing, reset_append_adds_the_built_in_set_with_a_free_number_and_keeps_the_rest, reset_refuses_bad_params_and_a_running_action_and_changes_nothing}`, `dialogs::tests::reset_actions_ok_replaces_append_adds_and_cancel_keeps_the_sets`. - Actions panel: the panel menu's Replace Actions… opens a file and puts the set it holds in place of every set in the panel ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.replace`). VectorCraft's own rules, which the page does not cover: the file is read as Load Actions… reads it (`.vcactions` and `.aia`, with the same limits and reports); the built-in Default Actions set goes too; the file's set keeps its name and becomes current and selected, and no action or step is selected; a canceled pick, a file that can't be read or is refused (an empty one too) changes nothing; the item asks no question first and is off while an action records or plays, waiting at a stop included; Undo does not bring the old sets back. Tests `panels::actions::tests::{the_panel_menus_replace_actions_puts_the_files_set_in_place_of_every_set, replace_actions_clears_what_named_the_old_sets_and_reads_aia_files, replace_actions_refuses_bad_params_bad_files_and_a_running_action}`. + - Actions panel: the panel menu's Clear Actions deletes every set loaded in the panel with its actions ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.clear`). VectorCraft's own rules, which the page does not cover: the item asks first, and Cancel changes nothing; the built-in Default Actions set goes too, and no set, action or step is selected afterwards; OK deletes nothing when the sets changed after the question opened; the item is off with no sets and while an action records or plays, waiting at a stop included; an empty panel stays empty after a restart; Undo does not bring the sets back, and Reset Actions, Load Actions… or New Set… adds sets again. Tests `panels::actions::tests::{the_panel_menus_clear_actions_asks_first_and_ok_deletes_every_set, clear_deletes_every_set_and_clears_what_named_them, clear_refuses_bad_params_changed_sets_and_a_running_action}`. - Batch… over data sets names each file after the document and the data set (`action.batch`). It writes `/`, `\`, `:`, `<`, `>`, `"`, `|`, `?`, `*` and control characters in the data set's name as `-`, and adds `-2`, `-3`… to a name an earlier data set used. - Batch… offers File + Number, File + Data Set Name, and Data Set Name for a Data Sets source. The dialog defaults to File + Number; `action.batch` without `datasetFileNaming` keeps File + Data Set Name. An output already in a destination folder the batch may read and write gets the next free `-2`, `-3` suffix. [Batch options](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/batch-options.html). - The Batch dialog shows its data set File Name row only when Destination is Folder, and keeps the choice while another destination is picked. With None or Save and Close it does not send `datasetFileNaming`. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 7e0df4c651..910cb30546 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -419,8 +419,9 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Live trace result bounds and selection highlights exclude the retained bitmap; source-image views retain it | done | All TraceView modes and rotated result bounds regression-covered; ordinary hidden group behavior retained | | Image Trace panel: the Preview checkbox before Trace chooses whether a setting change traces the selected Image Trace object again at once | done | Per the public documentation, Preview shows the result of the current settings and Trace traces with them (<https://web.archive.org/web/20250831090623/https://helpx.adobe.com/illustrator/using/image-trace.html>). Preview is on by default and kept with the UI preferences; Reset to Default leaves it. Off, changes wait in the panel until Trace applies them as one undo step, or until Preview is turned on again. Changes stay with the object they were made for while another object is selected, and come back when it is selected again. `imageTrace.preview {on?}`, `ui.set {imageTracePreview}`; `panels/image_trace.rs` headless tests (`with_preview_off_a_slider_change_waits_for_trace`, `turning_preview_on_traces_the_changes_that_waited`, `preview_turned_on_with_nothing_selected_traces_when_the_object_is_selected_again`, `settings_that_wait_stay_with_their_object`, `settings_that_wait_come_back_when_their_object_is_selected_again`, `settings_that_wait_are_dropped_when_their_object_changed_since`, `preview_is_kept_with_the_preferences_and_reset_to_default_leaves_it`) | | Toolbar without group labels by default, one or two columns; All Tools drawer by flyout group with shortcuts, its menu (Reset, Basic, Advanced) and Show section | done | #1751; a preference brings the labels back; `toolbar.show` sets the Fill/Stroke, Coloring, Draw Mode and Screen Mode controls | -| Actions panel: ≡ › Save Actions… saves the current set with all its actions to a file and ≡ › Load Actions… adds a saved set ([Manage a set of actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | partial | `ui.actionSet.save`, `ui.actionSet.load`; `panels/actions.rs` tests. The file is VectorCraft's own `.vcactions` JSON; Clear Actions remains | +| Actions panel: ≡ › Save Actions… saves the current set with all its actions to a file and ≡ › Load Actions… adds a saved set ([Manage a set of actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | done | `ui.actionSet.save`, `ui.actionSet.load`; `panels/actions.rs` tests. The file is VectorCraft's own `.vcactions` JSON | | Actions panel: ≡ › Replace Actions… puts the set of a saved file in place of every set in the panel ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | done | `ui.actionSet.replace`; `panels/actions.rs` tests. The file is read as Load Actions… reads it; the item asks no question first | +| Actions panel: ≡ › Clear Actions deletes every set loaded in the panel ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | done | `ui.actionSet.clear`; `panels/actions.rs` tests. The item asks first, and the built-in Default Actions set goes too | | Actions panel: ≡ › Reset Actions asks first; OK replaces the sets in the panel with the default set and Append adds the default set after them ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | done | `ui.actionSet.reset`; `panels/actions.rs` and `dialogs/tests.rs` tests. The default set is VectorCraft's own Default Actions set | | Actions panel: ≡ › Load Actions… also reads action sets saved as `.aia` files ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `actionSet.read`, `ui.actionSet.load`; `tests/actionset.rs`, `panels/actions.rs` tests, `import_fuzz`. Steps with a label and no recorded values come in as menu commands that run with no values and open no dialog, matched by label, and Set Selection steps come in as Select Object steps; the other steps, recorded menu items included, are left out and counted | | Actions panel: ≡ › Action Options… renames the selected action and sets its function key and color ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | partial | `ui.action.options`; `panels/actions.rs` tests (part of #1629). Button Mode shows the color | From ef3df8f8075e7b64acd6bda6a7887720d11d12bd Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 12:20:27 -0800 Subject: [PATCH 066/247] Shortcuts: a key typed before a wait that opens a dialog keeps later keys from it When a wait starts and ends in one frame and a key typed before it opens a dialog, the frame's key events and texts are taken from the position of that key's first event (its press, or its text when the text came first), not from the event that ended the wait. An Enter pressed between the two no longer reaches the dialog. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 16 +++++++++------- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index b494050bd2..fd8f8842fd 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -211,7 +211,8 @@ fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { /// Runs the single-key shortcuts of the texts typed before the event at `start` that no wait took, /// in order, as the frame's shortcuts would run them, and takes them and their presses from the /// frame. A text typed with Cmd, Ctrl or Alt, by a key the active tool takes, or with no shortcut, -/// is left to the frame. True when one opened a dialog or the palette. +/// is left to the frame. When one opened a dialog or the palette, the position of its first event +/// in the frame: its press, or its text where the text came first (the web build). fn run_typed_before( app: &mut VectorcraftApp, ctx: &egui::Context, @@ -219,7 +220,7 @@ fn run_typed_before( typed_by: &[Option<usize>], start: usize, taken: &mut Vec<usize>, -) -> bool { +) -> Option<usize> { for (k, e) in events.iter().enumerate().take(start) { let egui::Event::Text(text) = e else { continue }; let by = typed_by.get(k).copied().flatten(); @@ -246,10 +247,10 @@ fn run_typed_before( taken.push(k); taken.extend(by); if super::run_single_key(app, ctx, &chords, key, repeat) { - return true; + return Some(by.map_or(k, |b| b.min(k))); } } - false + None } /// Before the frame's shortcuts run: goes through the frame's events in order. A release of the @@ -301,10 +302,10 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { // A key typed before it that opened a dialog or the palette ends the wait without // running it. if let Some(start) = started.take() - && run_typed_before(app, ctx, &events, &typed_by, start, &mut taken) + && let Some(opened) = run_typed_before(app, ctx, &events, &typed_by, start, &mut taken) { cancel(app, ctx); - stop_at = Some(j); + stop_at = Some(opened); break; } if settle(app, ctx, hold, down) { @@ -351,7 +352,8 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { app.hold_keys.pending = Some(Pending { entry, chords, key: *key, physical: *physical_key, mods: *m, since: now, delay, viewport }); } // Take the waiting presses and their texts, and after a result that opened a dialog, the key - // event that ended the wait and every later key event and text of the frame, with the text a + // event that ended the wait (or the typed key that opened the dialog, when that came earlier) + // and every later key event and text of the frame, with the text a // press typed before it (the web build sends a press's text first): none of them reaches the // dialog. ctx.input_mut(|i| { diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 4e745510fe..1413e80e97 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -587,6 +587,24 @@ fn the_key_that_ends_a_wait_does_not_reach_the_dialog_it_opened() { assert_eq!(fill(&app), "#ff0000"); } +/// A key typed before a wait that starts and ends in one frame, and that opens a dialog, keeps the +/// frame's later keys from the dialog, the ones before the waiting key included. +#[test] +fn a_key_typed_before_a_wait_does_not_let_later_keys_reach_its_dialog() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "D", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + let keys = Keyboard::new(); + let mut events = press(Key::D, "d", Modifiers::NONE); + events.push(egui::Event::Key { key: Key::Enter, physical_key: Some(Key::Enter), pressed: true, repeat: false, modifiers: Modifiers::NONE }); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.push(release(Key::X)); + let left = keys.frame_left(&mut app, 0.0, events); + assert!(app.ui.dialog.is_some(), "D opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Key { key: Key::Enter, .. })), "{left:?}"); + assert_eq!(fill(&app), "#ff0000"); +} + /// On the web build a press's text comes before it: the text of the key that ends such a wait /// does not reach the dialog either. #[test] From a098cb8c532da5849fc8ae079853670a0b429387 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 12:25:26 -0800 Subject: [PATCH 067/247] i18n: Gujarati translates the Clear Actions prompt The Clear Actions confirmation, "Delete all action sets and their actions?", gets a Gujarati row next to the Clear Actions and Reset Actions rows, using the catalog's words for action set and delete. --- crates/ui-egui/src/i18n/gu.tsv | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 8eb02303e3..ad02fc78f7 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2054,6 +2054,7 @@ Load Actions… ઍક્શન લોડ કરો… Replace Actions… ઍક્શન બદલો… Clear Actions ઍક્શન સાફ કરો + Delete all action sets and their actions? બધા ઍક્શન સેટ અને તેમની ઍક્શન કાઢી નાખવી છે? Reset Actions ઍક્શન રીસેટ કરો Replace the current actions with the default set? વર્તમાન ઍક્શનને ડિફૉલ્ટ સેટથી બદલવા છે? Append adds the default set after the current sets instead. ઉમેરો તેના બદલે ડિફૉલ્ટ સેટને વર્તમાન સેટ પછી ઉમેરે છે. From 2caaabbc8fc62edf611b0869f1380e9db4c67d2e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 12:47:02 -0800 Subject: [PATCH 068/247] Shortcuts: a chord before a key with a hold shortcut keeps its order in a frame When a key with a hold shortcut is pressed and released in the same frame after a chord with Cmd, Ctrl or Alt, the key no longer waits: it goes back to the frame, which handles it as it does with Hold Shortcuts off. Its tap no longer runs before the chord, so Cmd+Z followed by X in one frame no longer undoes X's change instead of the earlier edit. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 31 +++++++++++++++---- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 24 ++++++++++++++ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index fd8f8842fd..8bec32c8bd 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -208,6 +208,15 @@ fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { tool_key.is_some_and(|k| app.session.tool_claims_key(k, view)) } +/// Is there a press with Cmd, Ctrl or Alt before the event at `start` that no wait took? +fn chord_before(events: &[egui::Event], start: usize, taken: &[usize]) -> bool { + events.iter().enumerate().take(start).any(|(k, e)| { + !taken.contains(&k) + && matches!(e, egui::Event::Key { key, pressed: true, modifiers: m, .. } + if !super::is_modifier(*key) && (m.command || m.ctrl || m.alt || m.mac_cmd)) + }) +} + /// Runs the single-key shortcuts of the texts typed before the event at `start` that no wait took, /// in order, as the frame's shortcuts would run them, and takes them and their presses from the /// frame. A text typed with Cmd, Ctrl or Alt, by a key the active tool takes, or with no shortcut, @@ -259,7 +268,8 @@ fn run_typed_before( /// went down; and a new press of a key with a hold shortcut starts a wait, taking the press and /// its text from the frame, with the key's repeats that follow in the frame and their text. When a /// wait that started in this frame also ends in it, the keys typed before its key run first -/// ([`run_typed_before`]), so they act in the order they went down. Then a wait +/// ([`run_typed_before`]), so they act in the order they went down; after a chord with Cmd, Ctrl +/// or Alt before its key, the key goes back to the frame instead ([`chord_before`]). Then a wait /// whose delay has passed with the key down runs the hold shortcut. True when a result opened a /// dialog or the palette: the rest of the frame's keys are dropped and no other shortcut runs. pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { @@ -299,16 +309,25 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { } }; if let Some((hold, down)) = ended { - // A key typed before it that opened a dialog or the palette ends the wait without - // running it. - if let Some(start) = started.take() + let start = started.take(); + // After a chord with Cmd, Ctrl or Alt pressed before it, which the frame's shortcuts + // run, the key goes back to the frame without waiting, so the frame handles it as it + // does with Hold Shortcuts off and its tap does not run before the chord. + if let Some(start) = start + && chord_before(&events, start, &taken) + { + cancel(app, ctx); + let text = text_of(start).map(|(t, _)| t); + taken.retain(|&k| k != start && Some(k) != text); + } else if let Some(start) = start && let Some(opened) = run_typed_before(app, ctx, &events, &typed_by, start, &mut taken) { + // A key typed before it that opened a dialog or the palette ends the wait + // without running it. cancel(app, ctx); stop_at = Some(opened); break; - } - if settle(app, ctx, hold, down) { + } else if settle(app, ctx, hold, down) { stop_at = Some(j); break; } diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 1413e80e97..13255e273c 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -395,6 +395,30 @@ fn a_wait_ended_in_its_frame_runs_after_the_keys_before_it() { assert_eq!(selected(&app), 0, "then the chord"); } +/// A command chord (Undo) pressed before a wait that starts and ends in one frame runs first: the +/// key's tap does not run before it, and the frame acts as it does with Hold Shortcuts off. +#[test] +fn a_chord_before_a_wait_ended_in_its_frame_runs_first() { + assert_eq!(crate::shortcut_editor::default_of("edit.undo"), Some("Cmd+Z")); + let frame = |app: &mut VectorcraftApp| { + app.run("paint.setFill", json!({"color": "#00ff00"})).unwrap(); + let mut events = + vec![egui::Event::Key { key: Key::Z, physical_key: Some(Key::Z), pressed: true, repeat: false, modifiers: Modifiers::COMMAND }]; + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.push(release(Key::X)); + Keyboard::new().frame(app, 0.0, events); + (fill(app), selected(app)) + }; + let mut off = swap_on_x(); + off.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + let off = frame(&mut off); + let mut app = swap_on_x(); + let on = frame(&mut app); + assert_eq!(on.0, "#ff0000", "Undo restores the red fill and does not undo X's swap"); + assert_eq!(on, off); + assert!(app.hold_keys.pending.is_none()); +} + /// The repeats of a key in the frame that starts its wait, and the text they type, stay out of the /// frame. #[test] From 87c5278d032115b95520069aa9a20b46dcce7111 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 13:31:32 -0800 Subject: [PATCH 069/247] Shortcuts: a command listed only with a shortcut keeps a hold shortcut only with one A command that needs a value, such as Transparency, is listed in the editor only while it has a shortcut. shortcuts.set now refuses a hold shortcut for such a command without a shortcut, and the command loses its hold shortcut when its shortcut is cleared or given to another entry, through shortcuts.set, the Keyboard Shortcuts dialog or an imported set. Its key no longer runs a command the editor does not show, and it is free for another entry without a conflict. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/shortcut_editor.rs | 50 +++++++++++++++++++++++-- docs/mcp.md | 4 +- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 2974846982..543026c385 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -177,7 +177,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.set", "Set Keyboard Shortcut", "", - "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a command listed only with a shortcut takes a hold only with one and loses it with the shortcut; a hold shortcut acts while the holdShortcuts preference is on", ), ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 6d6fb85307..b2647ed3eb 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -178,7 +178,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "shortcuts.set", "Set Keyboard Shortcut", "", - "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a hold shortcut acts while the holdShortcuts preference is on", + "{id: command id or tool:<id>, shortcut?: \"Cmd+Shift+K\" | \"\" (none) | null (default), hold?: a character key alone or with Shift (\"X\", \"Shift+X\", \".\") | \"\" | null (none), force?} → {id, shortcut, hold, removedFrom}; `hold` alone leaves the shortcut as it is; a command listed only with a shortcut takes a hold only with one and loses it with the shortcut; a hold shortcut acts while the holdShortcuts preference is on", ), ("shortcuts.list", "List Keyboard Shortcuts", "", "{query?} → [{id, label, group, shortcut, hold, default, overridden}]"), ("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "", "{} → [{shortcut, ids}]"), diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index a1cb43d874..106c04405b 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1165,9 +1165,20 @@ pub fn hold_of(holds: &Holds, key: &str) -> Option<String> { } /// The entry whose usable hold shortcut is `chord`: the first in `holds`' order when several are. -/// An entry no longer listed (a removed plug-in's) keeps its text but does not hold. +/// An entry no longer listed (a removed plug-in's, or one that [`needs_a_value`] whose shortcut +/// was taken away) keeps its text but does not hold. pub(crate) fn hold_for<'a>(holds: &'a Holds, chord: &craft_keymap::Chord) -> Option<&'a str> { - holds.iter().find(|(k, t)| hold_chord(t).is_ok_and(|c| c == *chord) && entry(k).is_some()).map(|(k, _)| k.as_str()) + let mirror = current(); + holds + .iter() + .find(|(k, t)| hold_chord(t).is_ok_and(|c| c == *chord) && entry(k).is_some_and(|e| listed(mirror.keymap.overrides(), &e))) + .map(|(k, _)| k.as_str()) +} + +/// Removes the hold shortcuts of the entries the editor does not list under `overrides`: one that +/// [`needs_a_value`] loses its hold with its shortcut. A removed plug-in's entry keeps its hold. +fn drop_unlisted_holds(holds: &mut Holds, overrides: &Overrides) { + holds.retain(|k, _| entry(k).is_none_or(|e| listed(overrides, &e))); } /// Sets (`Some`) or removes (`None` or `""`) the hold shortcut of `key`. Another entry that holds @@ -1540,6 +1551,10 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu assign(&mut ov, &key, shortcut.as_deref(), force) }; let r = r.and_then(|mut removed| { + // An entry the editor lists only with a shortcut takes a hold shortcut only with one. + if hold.as_deref().is_some_and(|h| !h.is_empty()) && entry(&key).is_some_and(|e| !listed(&ov, &e)) { + return Err(format!("`{key}` needs a shortcut before it can have a hold shortcut")); + } if has_hold { for k in assign_hold(&mut holds, &key, hold.as_deref(), force)? { if !removed.contains(&k) { @@ -1547,6 +1562,7 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu } } } + drop_unlisted_holds(&mut holds, &ov); Ok(removed) }); r.map(|removed| { @@ -1742,8 +1758,9 @@ pub fn run_command(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resu (_, None) => Err("no file reader".into()), } }; - data.and_then(|v| Ok((import_json(&v)?, import_holds(&v)?))).map(|((set, ov), holds)| { + data.and_then(|v| Ok((import_json(&v)?, import_holds(&v)?))).map(|((set, ov), mut holds)| { let n = ov.len(); + drop_unlisted_holds(&mut holds, &ov); app.ui.shortcut_overrides = ov; app.ui.shortcut_holds = holds; app.ui.shortcut_set = set; @@ -2066,6 +2083,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if let Cow::Owned(km) = &km { d.fields.insert("overrides".into(), stored::to_value(&saved_overrides(km.overrides(), &saved))); } + drop_unlisted_holds(&mut holds, km.overrides()); d.fields.insert("holds".into(), json!(holds)); if d.str("__recording").is_empty() { d.fields.insert("__recordingHold".into(), json!(false)); @@ -3580,6 +3598,32 @@ mod tests { assert_eq!(app.ui.shortcut_holds.keys().collect::<Vec<_>>(), ["select.none"]); } + /// A command the editor lists only with a shortcut (Transparency needs a value) takes a hold + /// shortcut only with one, and loses its hold, as it stops being listed, when the shortcut is + /// taken away: by clearing it or by giving it to another command. + #[test] + fn a_hold_shortcut_needs_a_listed_entry() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + assert!(needs_a_value("transparency.set")); + let r = app.run("shortcuts.set", json!({"id": "transparency.set", "hold": "Q"})); + assert!(r.is_err(), "{r:?}"); + assert!(app.ui.shortcut_holds.is_empty() && app.ui.shortcut_overrides.is_empty()); + let q = vc_chord("Q").unwrap(); + app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Q"})).unwrap(); + assert_eq!(hold_for(&app.ui.shortcut_holds, &q), Some("transparency.set")); + let rows = with_steady_plugins(|| app.run("shortcuts.list", json!({"query": "transparency.set"})).unwrap()); + assert!(rows.as_array().unwrap().iter().any(|r| r["id"] == "transparency.set" && r["hold"] == "Q"), "{rows}"); + app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": ""})).unwrap(); + assert_eq!(hold_for(&app.ui.shortcut_holds, &q), None); + assert!(app.ui.shortcut_holds.is_empty(), "{:?}", app.ui.shortcut_holds); + // The key is free for another command, with no conflict left behind. + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Q"})).unwrap(); + assert_eq!(app.run("shortcuts.conflicts", json!({})).unwrap(), json!([])); + app.run("shortcuts.set", json!({"id": "transparency.set", "shortcut": "Cmd+Alt+Shift+F9", "hold": "Shift+Q"})).unwrap(); + app.run("shortcuts.set", json!({"id": "edit.duplicate", "shortcut": "Cmd+Alt+Shift+F9", "force": true})).unwrap(); + assert_eq!(app.ui.shortcut_holds.keys().collect::<Vec<_>>(), ["paint.swap"]); + } + /// Reset All and a preset clear the hold shortcuts; two entries holding one key are a conflict. #[test] fn hold_shortcut_conflicts_reset_and_presets() { diff --git a/docs/mcp.md b/docs/mcp.md index 6b5e55116c..ea0ce74230 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6649,7 +6649,9 @@ has a hold shortcut, or a key the active tool uses itself (E with the Extend Pat `shortcuts.set {id, hold}` sets a hold shortcut, and `hold: ""` or `null` removes it; `hold` alone leaves the entry's shortcut as it is, and a key that another entry already holds is refused unless `force` is true. Hold shortcuts are kept apart from shortcuts: Use Default, Clear and `shortcut: null` leave them, and `overridden` in `shortcuts.list` is -about the shortcut only. `shortcuts.list` rows give the hold shortcut as `hold`, `shortcuts.conflicts` lists a key two +about the shortcut only. A command the editor lists only while it has a shortcut (one that needs a value, such as +`transparency.set`) takes a hold shortcut only with a shortcut, and loses its hold shortcut when its shortcut is cleared +or given to another entry. `shortcuts.list` rows give the hold shortcut as `hold`, `shortcuts.conflicts` lists a key two entries hold as `"Hold X"`, and Reset to Defaults and a preset remove every hold shortcut. `shortcuts.export` writes them as a `holds` object (entry id to key) when there are any, and `shortcuts.import` reads it; a file without `holds` has none, and a `holds` value that is not a usable hold shortcut fails the import, which then changes nothing. From 3addb0940fc608bcaafd1e4e66c4ae0533cf7127 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 14:06:47 -0800 Subject: [PATCH 070/247] Shapes: dragging a live polygon's side widget changes its number of sides A selected live polygon shows a small diamond beside the middle of the right side of its bounding box, with the Selection tool and with the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools, while the bounding box and edges are shown. Dragging it sets the side count from 3 to 11: down adds a side and up removes one for every 12 screen pixels along the box's own vertical axis, and the pointer shows the count while measurement labels are on. A polygon of more than 11 sides keeps its count until the drag goes up, which gives it 11. The drag sends object.setLiveShape {sides} in one undo step, none when the count ends where it began, and Escape puts the count back. Typed counts keep their 3 to 1000 range. The widget is drawn only while the box is drawn, so it hides during a move, a turn and its own drag. The help page describes the widget and its 3 to 11 range: https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html The widget's look and place, the drag direction, the step and the rule for more than 11 sides are VectorCraft's own. Docs: docs/target-app-parity.md and docs/ui-parity.md. --- crates/mcp/src/tests/shapewidgets.rs | 43 +++- crates/tools/src/lib.rs | 1 + crates/tools/src/select.rs | 33 ++- crates/tools/src/shape.rs | 23 +- crates/tools/src/shape/tests.rs | 45 ++++ crates/tools/src/sidewidget.rs | 348 ++++++++++++++++++++++++++ crates/ui-egui/src/canvas/overlays.rs | 7 + crates/ui-egui/src/canvas/tests.rs | 42 ++++ docs/target-app-parity.md | 1 + docs/ui-parity.md | 1 + 10 files changed, 533 insertions(+), 11 deletions(-) create mode 100644 crates/tools/src/sidewidget.rs diff --git a/crates/mcp/src/tests/shapewidgets.rs b/crates/mcp/src/tests/shapewidgets.rs index 3ef209efab..ce8eaea001 100644 --- a/crates/mcp/src/tests/shapewidgets.rs +++ b/crates/mcp/src/tests/shapewidgets.rs @@ -1,5 +1,6 @@ -//! A shape tool's double-click on a selected live shape's corner widget through MCP: the -//! gesture's `requests` carry the Transform panel. +//! Live shape widgets through MCP: a shape tool's double-click on a selected live shape's corner +//! widget, whose gesture's `requests` carry the Transform panel, and a drag on a live polygon's +//! side widget. use serde_json::{Value, json}; use vectorcraft_tools::corners::CornerWidgets; @@ -28,3 +29,41 @@ fn a_corner_widget_double_click_with_a_shape_tool_requests_the_transform_panel() let off = ok(&mut h, "pointer_gesture", json!({"events": [{"kind": "doubleclick", "x": 280, "y": 280}]})); assert_eq!(off["requests"], json!([]), "{off}"); } + +/// The selected live polygon's sides, radius and transform. +fn polygon(h: &mut Headless) -> (u32, f64, vectorcraft_geom::Affine) { + let st = h.session.doc().unwrap(); + let id = st.selection.objects[0]; + let vectorcraft_doc::NodeKind::Path { live, .. } = &st.doc.node(id).unwrap().kind else { panic!("not a path") }; + let Some(vectorcraft_doc::LiveShape::Polygon { sides, radius, xf, .. }) = live.as_deref() else { panic!("not a live polygon: {live:?}") }; + (*sides, *radius, *xf) +} + +/// A drag down on a live polygon's side widget with the Selection tool gives it more sides in one +/// undo step, keeping its radius and transform; undo puts the count back. +#[test] +fn a_side_widget_drag_changes_a_polygons_sides_in_one_undo_step() { + let mut h = Headless::new(); + h.call("engine.execute", json!({"command": "file.new", "params": {"width": 300, "height": 300}})).unwrap(); + h.call("engine.execute", json!({"command": "shape.polygon", "params": {"cx": 150, "cy": 150, "radius": 60, "sides": 5}})).unwrap(); + let st = h.session.doc().unwrap(); + let id = st.selection.objects[0]; + let b = st.doc.node(id).unwrap().geometric_bounds_with(&st.doc.symbol_boxes()).expect("bounds"); + let bx = vectorcraft_doc::OrientedBox::aligned(b); + let w = vectorcraft_tools::sidewidget::SideWidget::of(&st.doc, &st.selection, &bx, h.view.zoom).expect("a side widget"); + let steps = st.history.undo.len(); + let before = polygon(&mut h); + assert_eq!(before.0, 5); + let zoom = h.view.zoom; + let ev = |kind: &str, dy: f64| json!({"kind": kind, "x": w.at.x, "y": w.at.y + dy / zoom}); + ok(&mut h, "pointer_gesture", json!({"tool": "selection", "events": [ev("down", 0.0), ev("drag", 13.0), ev("drag", 25.0), ev("up", 25.0)]})); + let after = polygon(&mut h); + assert_eq!((after.0, after.1, after.2), (7, before.1, before.2)); + assert_eq!(h.session.doc().unwrap().history.undo.len(), steps + 1, "one undo step"); + h.call("engine.execute", json!({"command": "edit.undo", "params": {}})).unwrap(); + assert_eq!(polygon(&mut h), before); + // A drag that comes back to the start leaves no undo step. + ok(&mut h, "pointer_gesture", json!({"tool": "selection", "events": [ev("down", 0.0), ev("drag", 25.0), ev("drag", 0.0), ev("up", 0.0)]})); + assert_eq!(polygon(&mut h), before); + assert_eq!(h.session.doc().unwrap().history.undo.len(), steps); +} diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 07579cd456..5cd110b989 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -40,6 +40,7 @@ pub mod select; pub mod settings; pub mod shape; pub mod shaperwidget; +pub mod sidewidget; pub mod slice; pub mod symbolism; pub mod text; diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 543f9c7bb1..6735674487 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -53,6 +53,7 @@ use crate::pathtype::{self, BracketDrag, over_bracket}; use crate::pie::{self, PieDrag}; use crate::rulerguide::GuideEdit; use crate::shaperwidget; +use crate::sidewidget::{self, SideDrag}; use crate::typewidget; use crate::{Action, Cursor, Mods, Overlay, PixelOp, PointerEvent, PointerKind, Tool, ToolContext, ToolKey, json_ids}; @@ -133,6 +134,8 @@ enum State { Corner(CornerDrag), /// Dragging a live ellipse's pie widget. Pie(PieDrag), + /// Dragging a live polygon's side widget. + Sides(SideDrag), /// Dragging a selected blend's Appearance or Easing widget. BlendWidget(BlendWidgetDrag), /// Dragging an Objects on Path group's Rotate All widget. @@ -797,7 +800,7 @@ impl Tool for SelectionTool { /// E during a marquee drag switches the marquee between the objects it touches and only the /// objects inside it. Escape during a drag (a move or an Alt-drag copy, a bounding-box scale or - /// rotation, a marquee, a corner widget, a pie widget, a blend widget, the Rotate All, Space, Move All or Select/Move widget, the brackets of type on a path, a mirror + /// rotation, a marquee, a corner widget, a pie widget, a polygon's side widget, a blend widget, the Rotate All, Space, Move All or Select/Move widget, the brackets of type on a path, a mirror /// axis, a grid repeat's handles, a ruler guide) cancels it: what it changed goes back, no copy /// is left, and the tool waits for the next press. With the pointer loaded with text, Escape /// drops the text. @@ -834,6 +837,12 @@ impl Tool for SelectionTool { { return d.cancel(); } + if key == ToolKey::Escape + && matches!(self.state, State::Sides(_)) + && let State::Sides(d) = std::mem::take(&mut self.state) + { + return d.cancel(); + } if key == ToolKey::Escape && matches!(self.state, State::NineSlice(_)) && let State::NineSlice(d) = std::mem::take(&mut self.state) @@ -917,6 +926,7 @@ impl Tool for SelectionTool { State::Moving { began: true, .. } | State::Scaling { .. } | State::Rotating { .. } => true, State::Corner(c) => c.adjusting(), State::Pie(d) => d.adjusting(), + State::Sides(d) => d.adjusting(), State::BlendWidget(d) => d.adjusting(), State::RotateAll(d) => d.adjusting(), State::Space(d) => d.adjusting(), @@ -1094,6 +1104,15 @@ impl Tool for SelectionTool { self.state = State::Idle; d.finish() } + (PointerKind::Drag, State::Sides(mut d)) => { + let out = d.drag(cx, p); + self.state = State::Sides(d); + out + } + (PointerKind::Up, State::Sides(d)) => { + self.state = State::Idle; + d.finish() + } (PointerKind::Drag, State::BlendWidget(mut d)) => { let out = d.drag(cx, p); self.state = State::BlendWidget(d); @@ -1201,6 +1220,7 @@ impl Tool for SelectionTool { }), State::Corner(c) => o.extend(c.overlays(cx)), State::Pie(d) => o.extend(d.overlays(cx)), + State::Sides(d) => o.extend(d.overlays(cx)), State::BlendWidget(d) => o.extend(d.overlays(cx)), State::RotateAll(d) => o.extend(d.overlays(cx)), State::Space(d) => o.extend(d.overlays(cx)), @@ -1260,7 +1280,7 @@ impl Tool for SelectionTool { State::Moving { began: true, .. } if m.alt => return Cursor::SelectionCopy, State::Moving { began: true, .. } => return if self.snapped { Cursor::ArrowHollow } else { Cursor::Arrow }, State::Corner(_) => return Cursor::CornerRadius, - State::Pie(_) | State::BlendWidget(_) => return Cursor::ArrowHollow, + State::Pie(_) | State::Sides(_) | State::BlendWidget(_) => return Cursor::ArrowHollow, State::RotateAll(_) => return Cursor::Rotate, State::Space(_) => return Cursor::ArrowHollow, State::MoveAll(_) | State::Member(_) => return Cursor::Move, @@ -1283,6 +1303,9 @@ impl Tool for SelectionTool { if near_selected && pie::over_widget(cx, p) { return Cursor::ArrowHollow; } + if sidewidget::over_widget(cx, p) { + return Cursor::ArrowHollow; + } if blendwidget::over_widget(cx, p) { return Cursor::ArrowHollow; } @@ -1674,7 +1697,7 @@ impl SelectionTool { self.state = State::Loaded { from, before: port == crate::text::Port::In, press: None }; return Some(vec![]); } - // 1. Live Corners widgets, pie widgets, blend widgets, the Rotate All, Space, Move All and Select/Move widgets and type on a path's brackets, then the + // 1. Live Corners widgets, pie widgets, a polygon's side widget, blend widgets, the Rotate All, Space, Move All and Select/Move widgets and type on a path's brackets, then the // bounding-box handles of the current selection. if let Some(c) = CornerDrag::hit(cx, ev, false) { self.state = State::Corner(c); @@ -1684,6 +1707,10 @@ impl SelectionTool { self.state = State::Pie(d); return Some(vec![]); } + if let Some(d) = SideDrag::hit(cx, ev) { + self.state = State::Sides(d); + return Some(vec![]); + } if let Some(d) = BlendWidgetDrag::hit(cx, ev) { self.state = State::BlendWidget(d); return Some(vec![]); diff --git a/crates/tools/src/shape.rs b/crates/tools/src/shape.rs index d783a1fede..76c7c9f2bd 100644 --- a/crates/tools/src/shape.rs +++ b/crates/tools/src/shape.rs @@ -17,7 +17,8 @@ //! The selection keeps its bounding box and its Live Shape widgets on show with the Rectangle, //! Rounded Rectangle, Ellipse, Polygon and Star tools, so a shape just drawn can be adjusted at //! once: a drag on a live rectangle's or polygon's corner widget rounds its corners and a drag on -//! a live ellipse's pie widget sets its pie angle, as with the Selection tool; a drag on one of the +//! a live ellipse's pie widget sets its pie angle and a drag on a live polygon's side widget sets +//! its number of sides, as with the Selection tool; a drag on one of the //! box's eight handles scales the selection, a press on the selection's centre point (Show Center) //! moves it, and one just outside a corner of its box turns it about that centre, as the Selection //! tool's handles, centre point and rotate zone do; a press anywhere else draws a new shape (#5477). @@ -35,6 +36,7 @@ use crate::corners::{self, CornerDrag}; use crate::guides::{DrawSnap, Leave, PointSnap, TangentLine, Targets, square}; use crate::pie::{self, PieDrag}; use crate::select::{MoveSnap, handle_cursor, hit_center, is_area_type, matrix_json, rotate_zone, shown_box}; +use crate::sidewidget::{self, SideDrag}; use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, ToolContext, ToolKey}; /// The largest corner radius the Rounded Rectangle tool draws, points: the range of General › @@ -76,6 +78,7 @@ pub fn shows_shape_widgets(id: &str) -> bool { enum WidgetDrag { Corner(CornerDrag), Pie(PieDrag), + Sides(SideDrag), } /// A drag of the selection itself, taken by a shape tool: a handle of its box scales it, the centre @@ -257,18 +260,21 @@ impl ShapeTool { self.star_ratio = o.star_ratio; } - /// A press on a corner or pie widget of the selection: the drag adjusts it. + /// A press on a corner, pie or side widget of the selection: the drag adjusts it. fn press_widget(&mut self, cx: &ToolContext, ev: &PointerEvent) -> bool { if !shows_shape_widgets(self.id) { return false; } - self.widget = CornerDrag::hit(cx, ev, false).map(WidgetDrag::Corner).or_else(|| PieDrag::hit(cx, ev).map(WidgetDrag::Pie)); + self.widget = CornerDrag::hit(cx, ev, false) + .map(WidgetDrag::Corner) + .or_else(|| PieDrag::hit(cx, ev).map(WidgetDrag::Pie)) + .or_else(|| SideDrag::hit(cx, ev).map(WidgetDrag::Sides)); self.widget.is_some() } - /// Is `p` over a corner or pie widget of the selection that a press would drag? + /// Is `p` over a corner, pie or side widget of the selection that a press would drag? fn over_widget(&self, cx: &ToolContext, p: Point) -> bool { - shows_shape_widgets(self.id) && (corners::over_widget(cx, p, false) || pie::over_widget(cx, p)) + shows_shape_widgets(self.id) && (corners::over_widget(cx, p, false) || pie::over_widget(cx, p) || sidewidget::over_widget(cx, p)) } /// The selection's box, while this tool shows it (the tools that draw a box, with a selection @@ -444,10 +450,12 @@ impl ShapeTool { PointerKind::Drag => match w { WidgetDrag::Corner(c) => c.drag(cx, ev.pos), WidgetDrag::Pie(d) => d.drag(cx, ev.pos), + WidgetDrag::Sides(d) => d.drag(cx, ev.pos), }, PointerKind::Up => match self.widget.take() { Some(WidgetDrag::Corner(c)) => c.finish(), Some(WidgetDrag::Pie(d)) => d.finish(), + Some(WidgetDrag::Sides(d)) => d.finish(), None => vec![], }, _ => vec![], @@ -779,6 +787,7 @@ impl Tool for ShapeTool { (ToolKey::Escape, _) => match self.widget.take() { Some(WidgetDrag::Corner(c)) if c.adjusting() => vec![Action::Cancel], Some(WidgetDrag::Pie(d)) if d.adjusting() => vec![Action::Cancel], + Some(WidgetDrag::Sides(d)) => d.cancel(), _ => vec![], }, _ => vec![], @@ -849,6 +858,7 @@ impl Tool for ShapeTool { match &self.widget { Some(WidgetDrag::Corner(c)) => c.adjusting(), Some(WidgetDrag::Pie(d)) => d.adjusting(), + Some(WidgetDrag::Sides(d)) => d.adjusting(), None => match &self.selection { Some(SelectionDrag::Move { began, .. }) => *began, Some(SelectionDrag::Rotate { .. } | SelectionDrag::Scale { .. }) => true, @@ -871,6 +881,7 @@ impl Tool for ShapeTool { match &self.widget { Some(WidgetDrag::Corner(c)) => return c.overlays(cx), Some(WidgetDrag::Pie(d)) => return d.overlays(cx), + Some(WidgetDrag::Sides(d)) => return d.overlays(cx), None => {} } // A line on a common tangent shows that snap's guides, and its length and angle. @@ -921,7 +932,7 @@ impl Tool for ShapeTool { let idle = self.start.is_none(); match &self.widget { Some(WidgetDrag::Corner(_)) => return Cursor::CornerRadius, - Some(WidgetDrag::Pie(_)) => return Cursor::ArrowHollow, + Some(WidgetDrag::Pie(_) | WidgetDrag::Sides(_)) => return Cursor::ArrowHollow, None => {} } // Alt-dragging the selection leaves a copy behind; otherwise the arrow, hollow while the diff --git a/crates/tools/src/shape/tests.rs b/crates/tools/src/shape/tests.rs index 274a00bdbf..2252b8bd67 100644 --- a/crates/tools/src/shape/tests.rs +++ b/crates/tools/src/shape/tests.rs @@ -1103,6 +1103,51 @@ fn a_shape_tool_drags_the_selected_shapes_widgets() { assert_eq!(t.pointer(&c, &PointerEvent::new(PointerKind::Up, 200.0, 20.0)), vec![Action::Commit]); } +/// With a shape tool, a drag down on a selected live polygon's side widget adds sides instead of +/// drawing, and Escape puts the count back; Line Segment draws from the widget. +#[test] +fn a_shape_tool_drags_a_polygons_side_widget() { + use vectorcraft_doc::{Appearance, LiveShape, Node, NodeKind}; + let shape = + LiveShape::Polygon { radius: 80.0, sides: 5, xf: Affine::translate((250.0, 250.0)), radii: vec![], kinds: vec![], radii_relative: false }; + let mut d = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, id) = (d.layers[0].id, d.alloc_id()); + let mut n = Node::path(id, shape.to_path(), Appearance::default_art()); + if let NodeKind::Path { live: slot, .. } = &mut n.kind { + *slot = Some(Box::new(shape)); + } + d.insert(Some(l), 0, n).unwrap(); + let mut s = Selection::default(); + s.add(id); + let p = paint(); + let c = cx(&d, &s, &p); + let (w, _) = crate::sidewidget::SideWidget::for_tool(&c).expect("a side widget"); + let down = |px: f64| PointerEvent::new(PointerKind::Drag, w.at.x, w.at.y + px); + for tool in ["rectangle", "roundedRectangle", "ellipse", "polygon", "star"] { + let mut t = ShapeTool::new(tool); + assert_eq!(t.cursor(&c, w.at, Mods::default()), Cursor::ArrowHollow, "{tool}"); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Down, w.at.x, w.at.y)).is_empty(), "{tool}"); + let a = t.pointer(&c, &down(25.0)); + assert_eq!( + a, + vec![Action::Begin("Live Shape".into()), Action::Preview("object.setLiveShape".into(), json!({ "id": id.0, "sides": 7 }))], + "{tool}" + ); + assert!(t.transforming() && !t.drawing_boxed(), "{tool}"); + assert_eq!(t.pointer(&c, &PointerEvent::new(PointerKind::Up, w.at.x, w.at.y + 25.0)), vec![Action::Commit], "{tool}"); + assert!(!t.busy(), "{tool}"); + t.pointer(&c, &PointerEvent::new(PointerKind::Down, w.at.x, w.at.y)); + t.pointer(&c, &down(-13.0)); + assert_eq!(t.key(&c, ToolKey::Escape, Mods::default()), vec![Action::Cancel], "{tool}"); + assert!(!t.busy(), "{tool}"); + } + let mut t = ShapeTool::new("lineSegment"); + assert_eq!(t.cursor(&c, w.at, Mods::default()), Cursor::Crosshair); + t.pointer(&c, &PointerEvent::new(PointerKind::Down, w.at.x, w.at.y)); + let a = t.pointer(&c, &down(25.0)); + assert!(matches!(a.last(), Some(Action::Preview(cmd, _)) if cmd == "shape.line"), "{a:?}"); +} + /// A double-click on a corner widget of a selected live shape, with a shape tool that shows the /// widgets, asks for the Transform panel and nothing else: neither click draws, edits or begins an /// undo step, and the tool stays idle. Line Segment, a plain path, a pie widget, a hidden or diff --git a/crates/tools/src/sidewidget.rs b/crates/tools/src/sidewidget.rs new file mode 100644 index 0000000000..5d338856a7 --- /dev/null +++ b/crates/tools/src/sidewidget.rs @@ -0,0 +1,348 @@ +//! The side widget: a small diamond beside the right side of a selected live polygon's bounding +//! box (<https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html>). +//! Dragging it down adds sides and dragging it up removes them, one side per [`STEP_PX`] screen +//! pixels along the box's own vertical axis, from 3 to 11 sides. A polygon with more than 11 +//! sides keeps its count until the drag goes up a step, which gives it 11. The drag sends +//! `object.setLiveShape`'s `sides` in one undo step, and none when the count ends where it began. +//! The Selection tool and the shape tools that show the box hit the widget, and the canvas draws it +//! from the same geometry. + +use serde_json::json; +use vectorcraft_doc::{Document, LiveShape, NodeId, NodeKind, OrientedBox, Selection}; +use vectorcraft_geom::Point; + +use crate::select::shown_box; +use crate::{Action, Overlay, PointerEvent, ToolContext}; + +/// The widget's center sits this far (screen px) outside the middle of the box's right side, clear +/// of its handle. +const OFFSET_PX: f64 = 16.0; +/// Half the widget's diagonal (screen px), as the canvas draws it. +pub const RADIUS_PX: f32 = 4.0; +/// How near (screen px) the pointer must be to hit it. +const HIT_PX: f64 = 5.0; +/// How far (screen px) the pointer moves along the box's vertical axis per side. +pub const STEP_PX: f64 = 12.0; +/// The fewest sides a drag gives. +pub const MIN_SIDES: u32 = 3; +/// The most sides a drag gives. +pub const MAX_SIDES: u32 = 11; + +/// The side widget of a selection that is exactly one editable live polygon. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct SideWidget { + pub id: NodeId, + /// Center in document coordinates. + pub at: Point, + /// The polygon's side count. + pub sides: u32, +} + +impl SideWidget { + /// The widget beside `bx`, the selection's bounding box, at `zoom` (screen px per document + /// point). None unless the selection is one whole editable live polygon, with no anchors or + /// segments of it selected. + pub fn of(doc: &Document, selection: &Selection, bx: &OrientedBox, zoom: f64) -> Option<Self> { + let [id] = selection.objects[..] else { return None }; + if !selection.anchors.is_empty() || selection.segments.contains_key(&id) || !doc.is_editable(id) || !zoom.is_finite() || zoom <= 0.0 { + return None; + } + let NodeKind::Path { live, .. } = &doc.node(id)?.kind else { return None }; + let Some(LiveShape::Polygon { sides, .. }) = live.as_deref() else { return None }; + let r = bx.rect; + let at = bx.to_doc() * Point::new(r.x1 + OFFSET_PX / zoom, r.center().y); + (at.x.is_finite() && at.y.is_finite()).then_some(Self { id, at, sides: *sides }) + } + + /// The widget the tool can drag (its bounding box showing). + pub fn for_tool(cx: &ToolContext) -> Option<(Self, OrientedBox)> { + // One object or none: a larger selection's box is not measured. + if cx.selection.objects.len() != 1 { + return None; + } + let bx = shown_box(cx)?; + Some((Self::of(cx.doc, cx.selection, &bx, cx.zoom)?, bx)) + } + + /// The widget of `cx` and its box if the widget is under `p`. + fn at(cx: &ToolContext, p: Point) -> Option<(Self, OrientedBox)> { + Self::for_tool(cx).filter(|(w, _)| w.at.distance(p) <= cx.tol(HIT_PX)) + } +} + +/// Is `p` over the side widget? +pub fn over_widget(cx: &ToolContext, p: Point) -> bool { + SideWidget::at(cx, p).is_some() +} + +/// The side count a drag of `steps` (down positive) gives a polygon of `from` sides: within 3 to 11, +/// and `from` itself while a polygon of more than 11 sides has not been dragged up. +pub fn sides_after(from: u32, steps: i64) -> u32 { + let (min, max) = (i64::from(MIN_SIDES), i64::from(MAX_SIDES)); + let to = if from <= MAX_SIDES { + i64::from(from) + steps + } else if steps >= 0 { + return from; + } else { + max + 1 + steps + }; + to.clamp(min, max) as u32 +} + +/// Dragging the side widget. +#[derive(Clone, Debug)] +pub struct SideDrag { + widget: SideWidget, + bx: OrientedBox, + start: Point, + /// The pointer has left the click. + moved: bool, + /// The undo step has begun: the count has differed from the polygon's. + began: bool, + /// The count last sent (the polygon's until the drag changes it). + sides: u32, + at: Point, +} + +impl SideDrag { + /// The drag has left the click. + pub fn adjusting(&self) -> bool { + self.moved + } + + /// Start a drag when the press `ev` is on the side widget of the selection. + pub fn hit(cx: &ToolContext, ev: &PointerEvent) -> Option<Self> { + let (widget, bx) = SideWidget::at(cx, ev.pos)?; + Some(Self { widget, bx, start: ev.pos, moved: false, began: false, sides: widget.sides, at: ev.pos }) + } + + pub fn drag(&mut self, cx: &ToolContext, p: Point) -> Vec<Action> { + self.at = p; + if !self.moved { + if p.distance(self.start) < cx.tol(3.0) { + return vec![]; + } + self.moved = true; + } + let down = (self.bx.to_local(p).y - self.bx.to_local(self.start).y) * cx.zoom; + let steps = (down / STEP_PX).trunc(); + let sides = sides_after(self.widget.sides, if steps.is_finite() { steps as i64 } else { 0 }); + if sides == self.sides { + return vec![]; + } + let mut out = vec![]; + if !self.began { + self.began = true; + out.push(Action::Begin("Live Shape".into())); + } + self.sides = sides; + out.push(Action::Preview("object.setLiveShape".into(), json!({ "id": self.widget.id.0, "sides": sides }))); + out + } + + /// The release: one undo step when the count changed, and nothing kept when it came back. + pub fn finish(self) -> Vec<Action> { + match (self.began, self.sides == self.widget.sides) { + (false, _) => vec![], + (true, true) => vec![Action::Cancel], + (true, false) => vec![Action::Commit], + } + } + + /// Escape: the polygon keeps the count it had. + pub fn cancel(self) -> Vec<Action> { + if self.began { vec![Action::Cancel] } else { vec![] } + } + + /// The side count next to the pointer. + pub fn overlays(&self, cx: &ToolContext) -> Vec<Overlay> { + if !self.moved || !cx.measurement_labels { + return vec![]; + } + vec![Overlay::Measure { p: self.at, text: format!("Sides: {}", self.sides) }] + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::select::SelectionTool; + use crate::testutil::*; + use crate::{Cursor, Mods, PointerKind, Tool, ToolKey}; + use vectorcraft_doc::{Appearance, Node}; + use vectorcraft_geom::Affine; + + /// A document holding a live polygon of `sides` sides and radius 100 placed by `xf`, and a + /// selection of it. + fn polygon_doc(sides: u32, xf: Affine) -> (Document, NodeId, Selection) { + let live = LiveShape::Polygon { radius: 100.0, sides, xf, radii: vec![], kinds: vec![], radii_relative: false }; + let mut d = Document::new(800.0, 800.0); + let l = d.layers[0].id; + let id = d.alloc_id(); + let mut n = Node::path(id, live.to_path(), Appearance::default_art()); + if let NodeKind::Path { live: slot, .. } = &mut n.kind { + *slot = Some(Box::new(live)); + } + d.insert(Some(l), 0, n).unwrap(); + let mut s = Selection::default(); + s.add(id); + (d, id, s) + } + + fn ev(kind: PointerKind, p: Point) -> PointerEvent { + PointerEvent::new(kind, p.x, p.y) + } + + fn sides_of(a: &[Action]) -> Vec<u64> { + a.iter().filter_map(|a| if let Action::Preview(_, v) = a { v["sides"].as_u64() } else { None }).collect() + } + + #[test] + fn the_counts_stay_within_three_and_eleven() { + assert_eq!(sides_after(5, 1), 6); + assert_eq!(sides_after(5, -1), 4); + assert_eq!(sides_after(5, 100), 11); + assert_eq!(sides_after(5, -100), 3); + assert_eq!(sides_after(3, -1), 3); + assert_eq!(sides_after(11, 1), 11); + // Over 11: unchanged until the drag goes up, which gives 11, then 10. + assert_eq!(sides_after(40, 0), 40); + assert_eq!(sides_after(40, 5), 40); + assert_eq!(sides_after(40, -1), 11); + assert_eq!(sides_after(40, -2), 10); + assert_eq!(sides_after(1000, -100), 3); + } + + /// The widget sits 16 px right of the middle of the box's right side, at any zoom; only one + /// whole editable live polygon shows it. + #[test] + fn one_whole_live_polygon_shows_the_widget() { + let (d, id, s) = polygon_doc(6, Affine::translate((300.0, 300.0))); + let p = paint(); + let c = cx(&d, &s, &p); + let (w, bx) = SideWidget::for_tool(&c).expect("a widget"); + assert_eq!((w.id, w.sides), (id, 6)); + let want = |zoom: f64| Point::new(bx.rect.x1 + 16.0 / zoom, bx.rect.center().y); + assert!(w.at.distance(want(1.0)) < 1e-9, "{w:?} {bx:?}"); + assert!(SideWidget::of(&d, &s, &bx, 4.0).unwrap().at.distance(want(4.0)) < 1e-9); + assert!(over_widget(&c, w.at) && !over_widget(&c, w.at + vectorcraft_geom::Vec2::new(0.0, 8.0))); + // Hidden with the bounding box hidden, with an anchor or segment selected, or with no zoom. + assert!(SideWidget::for_tool(&ToolContext { show_bbox: false, ..cx(&d, &s, &p) }).is_none()); + let mut part = s.clone(); + part.segments.insert(id, Default::default()); + assert!(SideWidget::of(&d, &part, &bx, 1.0).is_none()); + assert!(SideWidget::of(&d, &s, &bx, 0.0).is_none() && SideWidget::of(&d, &s, &bx, f64::NAN).is_none()); + // A locked polygon, two polygons, nothing or a plain path: none. + let mut locked = d.clone(); + locked.node_mut(id).unwrap().locked = true; + assert!(SideWidget::of(&locked, &s, &bx, 1.0).is_none()); + let mut two = d.clone(); + let other = two.alloc_id(); + let mut n = two.node(id).unwrap().clone(); + n.id = other; + let l = two.layers[0].id; + two.insert(Some(l), 0, n).unwrap(); + let mut both = s.clone(); + both.add(other); + assert!(SideWidget::of(&two, &both, &bx, 1.0).is_none()); + assert!(SideWidget::of(&d, &Selection::default(), &bx, 1.0).is_none()); + let (d, rect) = doc_with_rect(); + let mut s = Selection::default(); + s.add(rect); + let bx = OrientedBox::aligned(vectorcraft_geom::Rect::new(0.0, 0.0, 10.0, 10.0)); + assert!(SideWidget::of(&d, &s, &bx, 1.0).is_none()); + } + + /// With the Selection tool, dragging the widget down adds a side per 12 screen px and up removes + /// them, within 3 to 11, in one undo step with the count shown next to the pointer. + #[test] + fn dragging_the_widget_changes_the_sides() { + let (d, id, s) = polygon_doc(5, Affine::translate((300.0, 300.0))); + let p = paint(); + for zoom in [1.0, 2.0] { + let c = ToolContext { zoom, ..cx(&d, &s, &p) }; + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let at = |px: f64| w.at + vectorcraft_geom::Vec2::new(0.0, px / zoom); + let mut t = SelectionTool::default(); + assert_eq!(t.cursor(&c, w.at, Mods::default()), Cursor::ArrowHollow); + assert!(t.pointer(&c, &ev(PointerKind::Down, w.at)).is_empty()); + // Past the click but short of a step: nothing yet. + assert!(t.pointer(&c, &ev(PointerKind::Drag, at(6.0))).is_empty()); + assert!(t.transforming()); + let a = t.pointer(&c, &ev(PointerKind::Drag, at(12.0))); + assert_eq!(a[0], Action::Begin("Live Shape".into())); + assert_eq!(a[1], Action::Preview("object.setLiveShape".into(), json!({ "id": id.0, "sides": 6 }))); + assert!(t.overlays(&c).iter().any(|o| matches!(o, Overlay::Measure { text, .. } if text == "Sides: 6"))); + // The same count again sends nothing; far down stops at 11, far up at 3. + assert!(t.pointer(&c, &ev(PointerKind::Drag, at(20.0))).is_empty()); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, at(500.0)))), [11]); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, at(-500.0)))), [3]); + assert_eq!(t.pointer(&c, &ev(PointerKind::Up, at(-500.0))), vec![Action::Commit]); + assert!(!t.busy() && !t.transforming()); + } + // A click sends nothing, and the readout follows Measurement Labels. + let c = cx(&d, &s, &p); + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let mut t = SelectionTool::default(); + assert!(t.pointer(&c, &ev(PointerKind::Down, w.at)).is_empty()); + assert!(t.pointer(&c, &ev(PointerKind::Up, w.at)).is_empty()); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + t.pointer(&c, &ev(PointerKind::Drag, w.at + vectorcraft_geom::Vec2::new(0.0, 13.0))); + let quiet = ToolContext { measurement_labels: false, ..cx(&d, &s, &p) }; + assert!(!t.overlays(&quiet).iter().any(|o| matches!(o, Overlay::Measure { .. }))); + // Back at the start: the release keeps nothing. + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, w.at))), [5]); + assert_eq!(t.pointer(&c, &ev(PointerKind::Up, w.at)), vec![Action::Cancel]); + } + + /// On a turned polygon the drag is read along the box's own vertical axis. + #[test] + fn a_turned_polygon_reads_the_drag_along_its_box() { + let xf = Affine::translate((400.0, 400.0)) * Affine::rotate(std::f64::consts::FRAC_PI_2); + let (d, _, s) = polygon_doc(5, xf); + let p = paint(); + let c = cx(&d, &s, &p); + let (w, bx) = SideWidget::for_tool(&c).unwrap(); + let down = bx.to_doc() * Point::new(0.0, 1.0) - bx.to_doc() * Point::ZERO; + let mut t = SelectionTool::default(); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, w.at + down * 25.0))), [7], "{bx:?}"); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, w.at - down * 13.0))), [4]); + } + + /// A polygon of more than 11 sides keeps its count on a press and a drag down; the first step + /// up gives 11. + #[test] + fn a_polygon_over_eleven_sides_does_not_jump() { + let (d, _, s) = polygon_doc(40, Affine::translate((300.0, 300.0))); + let p = paint(); + let c = cx(&d, &s, &p); + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let mut t = SelectionTool::default(); + assert!(t.pointer(&c, &ev(PointerKind::Down, w.at)).is_empty()); + assert!(t.pointer(&c, &ev(PointerKind::Drag, w.at + vectorcraft_geom::Vec2::new(0.0, 40.0))).is_empty()); + assert!(t.pointer(&c, &ev(PointerKind::Up, w.at + vectorcraft_geom::Vec2::new(0.0, 40.0))).is_empty()); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + let a = t.pointer(&c, &ev(PointerKind::Drag, w.at - vectorcraft_geom::Vec2::new(0.0, 12.0))); + assert_eq!(a[0], Action::Begin("Live Shape".into())); + assert_eq!(sides_of(&a), [11]); + assert!(t.overlays(&c).iter().any(|o| matches!(o, Overlay::Measure { text, .. } if text == "Sides: 11"))); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, w.at - vectorcraft_geom::Vec2::new(0.0, 24.0)))), [10]); + } + + /// Escape during a drag puts the count back; the release after it sends nothing. + #[test] + fn escape_cancels_a_side_widget_drag() { + let (d, _, s) = polygon_doc(5, Affine::translate((300.0, 300.0))); + let p = paint(); + let c = cx(&d, &s, &p); + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let mut t = SelectionTool::default(); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + t.pointer(&c, &ev(PointerKind::Drag, w.at + vectorcraft_geom::Vec2::new(0.0, 30.0))); + assert_eq!(t.key(&c, ToolKey::Escape, Mods::default()), vec![Action::Cancel]); + assert!(!t.busy() && !t.transforming()); + assert!(!t.overlays(&c).iter().any(|o| matches!(o, Overlay::Measure { .. }))); + assert!(t.pointer(&c, &ev(PointerKind::Up, w.at)).is_empty()); + } +} diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index 613b0fae9c..cc73f0d25b 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -255,6 +255,13 @@ pub(super) fn selection_overlay(app: &mut VectorcraftApp, p: &egui::Painter, xf: p.circle_filled(c, r, if w.area { color } else { Color32::WHITE }); p.circle_stroke(c, r, Stroke::new(1.0, color)); } + // A live polygon's side widget: a diamond beside the middle of the box's right side, drawn + // only while the box is drawn (the box hides during a turn and during a drag of the widget). + if !drawing_boxed && let Some(w) = vectorcraft_tools::sidewidget::SideWidget::of(&st.doc, &st.selection, &b, xf.zoom) { + let (c, r) = (xf.to_screen(w.at), vectorcraft_tools::sidewidget::RADIUS_PX); + let diamond = vec![c + vec2(0.0, -r), c + vec2(r, 0.0), c + vec2(0.0, r), c + vec2(-r, 0.0)]; + p.add(Shape::convex_polygon(diamond, Color32::WHITE, Stroke::new(1.0, color))); + } } // Pie widgets (Selection tool, with View › Show Bounding Box, on live ellipses): each joined // by a line to the outline's point at its angle. They stay while one is dragged. diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index cc65044dfb..53f0070109 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -6551,6 +6551,48 @@ fn a_selected_ellipse_shows_its_pie_widgets() { assert_eq!(widgets(&mut app), 0, "no bounding box, no widgets"); } +/// A selected live polygon shows its side widget, a white diamond beside its box, with the +/// Selection tool and the shape tools while the bounding box shows, and hides with the box while +/// the polygon is moved. +#[test] +fn a_selected_polygon_shows_its_side_widget() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + app.session.execute("shape.polygon", &json!({"cx": 200, "cy": 150, "radius": 60, "sides": 5})).unwrap(); + let ctx = egui::Context::default(); + // A white diamond as wide and tall as the widget. + let size = 2.0 * vectorcraft_tools::sidewidget::RADIUS_PX; + let diamond = |ps: &egui::epaint::PathShape| { + let span = |f: fn(&egui::Pos2) -> f32| { + let v: Vec<f32> = ps.points.iter().map(f).collect(); + v.iter().copied().fold(f32::MIN, f32::max) - v.iter().copied().fold(f32::MAX, f32::min) + }; + ps.closed && ps.points.len() == 4 && ps.fill == Color32::WHITE && (span(|p| p.x) - size).abs() < 0.01 && (span(|p| p.y) - size).abs() < 0.01 + }; + let widgets = |app: &mut VectorcraftApp| shapes(app, &ctx).iter().filter(|s| matches!(s, Shape::Path(ps) if diamond(ps))).count(); + app.select_tool("selection"); + assert_eq!(widgets(&mut app), 1); + app.select_tool("polygon"); + assert_eq!(widgets(&mut app), 1); + app.select_tool("directSelection"); + assert_eq!(widgets(&mut app), 0); + app.select_tool("lineSegment"); + assert_eq!(widgets(&mut app), 0); + app.select_tool("selection"); + app.run("view.boundingBox", json!({})).unwrap(); + assert_eq!(widgets(&mut app), 0, "no bounding box, no widget"); + app.run("view.boundingBox", json!({})).unwrap(); + // A move of the polygon hides the box, and the widget with it, until the release. + let view = app.view_info(); + app.session.pointer(&PointerEvent::new(PointerKind::Down, 200.0, 150.0), view).unwrap(); + app.session.pointer(&PointerEvent::new(PointerKind::Drag, 260.0, 150.0), view).unwrap(); + assert_eq!(widgets(&mut app), 0, "hidden while the polygon moves"); + app.session.pointer(&PointerEvent::new(PointerKind::Up, 260.0, 150.0), view).unwrap(); + assert_eq!(widgets(&mut app), 1, "back after the release"); + app.session.execute("shape.ellipse", &json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + assert_eq!(widgets(&mut app), 0, "an ellipse has none"); +} + /// A selected Objects on Path group shows its Rotate All widget with the Selection and Objects on /// Path tools. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b4b36e1c39..c8a6aafe17 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1260,6 +1260,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur With Direct Selection, Shift pressed during the drag of a curved segment keeps both of its handles at right angles to the line between its anchors, on the same side and at the same length (`path.reshapeSegment {perpendicular}`). Shift held while any segment is dragged with the Anchor Point tool or the Pen with Alt does the same. With the Anchor Point tool, Shift held at the press on an anchor (or a selected blend's spine point) moves it, handles and all, instead of pulling out handles; Shift kept down keeps the move at 45° steps, and a Shift-click that doesn't move leaves the anchor as it was (`path.moveAnchor`). A selected blend spine's segment dragged with the Anchor Point tool, or a curved one dragged with Direct Selection, bends the same way (`object.blend.spine.reshapeSegment`). - **Live Corners:** drag a live rectangle's corner widgets (Selection or Direct Selection) to round all corners, with a radius readout; with Direct Selection, select corner anchors to show and round just those corners (#381). Each corner keeps its own radius and kind (Round, Inverted Round, Chamfer): Alt-click a widget to cycle the kind, double-click it for the Corners dialog, and the Properties and Transform radius fields set the selected corners (`object.setLiveShape {corners, radius, kind}`). A link toggle behind Corner Radius (the `singleCornerRadius` preference) switches the panels to a field for each corner of a live rectangle: Top Left, Top Right, Bottom Right and Bottom Left. Corners stay circular when the rectangle is scaled unevenly or along its own sides when rotated (the radius keeps its size, or scales by the mean scale with Scale Corners on); only a shear distorts them. On a rectangle that isn't square every corner is the same circle: a radius past half the shorter side stops there for all of them, the widgets sit on the corners as drawn and turn the edited corners red at that limit, CSS export writes the drawn radii, and rectangles saved stretched by older versions get circular corners when their corners are next set (#442). Live Corners work on any path's corners too, as on a rectangle's (#511): a star's, a live polygon's (which also shows them to the Selection tool, has a Corner Radius field in the Properties and Transform panels and keeps its radius as its sides change) and a pen path's, wherever two sides meet at an angle at an anchor that isn't smooth: curved sides too, trimmed to what the cut leaves of them (#1144). Direct Selection shows the widgets of every corner, or of the corners holding selected anchors; each corner is a circle tangent to both sides, drawn no larger than takes its cut halfway along its shorter side; a path keeps its uncut outline so its corners stay editable, and the same command, dialog, angle preference and View › Hide Corner Widget apply. With Direct Selection a click on a widget (no drag) selects its corner, as a click on the corner's anchor does, so the next drag on it rounds that corner alone; Shift-click toggles it (#1239). While a corner widget is dragged with the Selection tool the bounding box hides, so the rounding shows against the path alone (#1229). A round corner next to a curved side curves smoothly instead of sticking out of the shape (#1547, fixes #1512). View › Hide Edges hides the Live Corners widgets, the bounding box and the type widget, and the selection tools then do not answer a press on them or change the cursor over them. + - **Polygon side widget:** a selected live polygon shows a small diamond beside the middle of the right side of its bounding box, with the Selection tool and with the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools, while the bounding box and the edges are shown. Dragging the widget sets the polygon's side count, from 3 to 11, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html) describes; typed counts in the Transform panel and `object.setLiveShape` still go from 3 to 1000. A drag down adds one side and a drag up removes one for every 12 screen pixels along the box's own vertical axis, and the pointer shows the count while measurement labels are on. A polygon of more than 11 sides keeps its count until the drag goes up, which gives it 11. The drag sends `object.setLiveShape {sides}`, so the polygon keeps its center, radius and rotation; the release adds one undo step when the count changed and none when it ends where it began, and Escape puts the count back. The widget's look and place, the drag direction, the step and the rule for more than 11 sides are VectorCraft's own (`crates/tools/src/sidewidget.rs`). - **Blend spine Anchor Point tool (#2544):** on a selected blend, dragging a spine corner makes symmetric Smooth handles; the tool displays and picks existing spine handles when switched to, drags one independently or retracts it on click, and clicking a point with handles retracts both. The spine is edited live without moving its key objects. Windows native canvas checks and screenshots reviewed: symmetric and independent handles, corner/retraction, Shift constraints and perpendicular reshaping, tool switching, key preservation, Undo/Redo, save/reopen, hidden handles and overlapping Path/Blend priority (PR #2643). Behaviour reference: [public path-editing documentation](https://helpx.adobe.com/illustrator/using/adjust-path-segments.html). - **Blend spine points by marquee:** with Direct Selection, a marquee picks the spine points inside it on a selected blend, the topmost one when several are selected, and the picked points drag together as Shift-clicked ones do; Shift-marquee adds points or takes picked ones away, a plain marquee around none of them drops the picks, and Escape during the marquee keeps them. Unselected, locked and hidden blends are skipped. The spine's points are anchor points edited with Direct Selection ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/modify-spine-of-blended-objects.html)), and a boundary drag with the tool selects anchor points ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/select-anchor-points-in-paths.html)); the rules for selected, topmost and Shift are VectorCraft's own (`crates/tools/src/direct/tests.rs`, `marquee_picks_selected_blend_spine_points_which_drag_together`, `shift_marquee_toggles_selected_blend_spine_points`, `marquee_skips_unselected_locked_and_hidden_blend_spines`, `escape_cancels_a_marquee_and_keeps_the_picked_spine_points`). - **Blend steps of brushed strokes:** the steps interpolate the pen pressure, tilt, bearing and rotation recorded with the Paintbrush, so a Calligraphic, Scatter or Art brush that varies with the pen changes gradually from one key to the next. A key without a recording counts as half pressure, half tilt and 0°, as brushes read it, and angles turn the shorter way round. When the blend starts a key's path at another anchor (an open path run from its end, a closed one turned to another start), the key's recordings, width profile, arrowheads, dashes and a gradient along or across the stroke turn with the path. Different brushes still switch halfway (VectorCraft's own rule; strokes blend their options, as [Blended objects overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blended-objects-overview.html) describes; `crates/doc/src/blend.rs`, `pen_pressure_tilt_and_angles_interpolate_for_brushes`, `stroke_profiles_turn_with_a_key_path_started_elsewhere`, `stroke_gradients_and_dashes_turn_with_a_key_path_started_elsewhere`). diff --git a/docs/ui-parity.md b/docs/ui-parity.md index c0ae4fd14a..034a54f4b1 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -232,6 +232,7 @@ tools, never checked side by side) isn't captured row by row. | Live Corners widgets (radius readout, Alt-click cycles kind, double-click the Corners dialog) | done | a Direct Selection click on a widget selects its corner (#1239), and with every corner selected a Shift-click on a widget picks that corner alone instead of deselecting it (#5188); a press-and-drag on a widget of a path selected whole still rounds every corner (#908), and adding widgets to the selection by Shift-click (#1232) is missing; the bounding box hides while a widget is dragged with the Selection tool (#1229); a round corner next to a curved side curves smoothly instead of sticking out of the shape (#1512); a corner rounds until its cut reaches its neighbours' cuts, so one corner of a square alone reaches the whole side (#2332) | | Corners between curved sides (#1144), Relative rounding | done | #1144 closed; Relative rounding in the Corners dialog (Relative / Absolute, radius as a percentage of each corner's maximum, kept as the shape is resized; `object.setLiveShape` `relativeRadii`, #3091, `tests_livecorners::relative_corner_rounding_keeps_fraction_on_resize`) | | Pie widgets on a live ellipse: drag one to set Pie Start or End Angle, double-click one to make the ellipse whole | done | Selection tool, with the bounding box showing | +| Side widget on a live polygon: drag it to set the number of sides from 3 to 11 | done | Selection tool and the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools, with the bounding box showing; a drag down adds sides and a drag up removes them; Escape cancels ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html)) | | A shape just drawn shows its bounding box and Live Shape widgets with the shape tool still active, and the selection can be moved and turned without switching tools | done | #5477: Rectangle, Rounded Rectangle, Ellipse, Polygon and Star keep the selection's bounding box, corner widgets and pie widgets on show while they draw nothing; a drag on a corner or pie widget adjusts it (arrows step the corner kind, Escape cancels), a press on the selection's centre point (Attributes › Show Center) moves the selection — the Selection tool's move arrow, snapping and Alt copy — a press just outside a corner of the box turns it about the centre (the Selection tool's rotate zone and cursor), and a press anywhere else draws (so a second shape drawn from the first one's centre moves the first: press elsewhere or deselect first). Public descriptions: [Live Shapes](https://helpx.adobe.com/illustrator/using/live-shapes.html) (live shapes adjust without switching tools) and [CreativePro, Working with Live Shapes](https://creativepro.com/?p=23921) (a widget shows in every corner on release; drag one toward the centre to round). A drag on one of the box's handles scales the selection as the Selection tool's handles do. A double-click on a corner widget of a selected live rectangle or polygon shows and selects the Transform panel where it is (closed, docked, floating or in an icon column; a second double-click keeps it on show), and leaves the tool, the selection and the document as they were; a double-click on a pie widget, off the widgets, with Show Corner Widget off or with Line Segment does nothing, and the Selection tool's double-click on a corner widget still opens the Corners dialog. Public description: [Live shape properties](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/live-shape-properties.html) (a double-click on a corner widget of a selected live shape opens the Transform panel). Tests `a_shape_tool_drags_the_selected_shapes_widgets`, `a_shape_tool_moves_the_selection_by_its_centre_point_and_turns_it_from_a_corner`, `a_shape_tool_scales_the_selection_by_its_bounding_box_handles`, `a_double_click_on_a_corner_widget_shows_the_transform_panel`, `a_double_click_on_a_corner_widget_with_a_shape_tool_asks_for_the_transform_panel` (engine), `a_corner_widget_double_click_with_a_shape_tool_requests_the_transform_panel` (MCP: the `pointer_gesture` reply's `requests` carry `{"panel": "transform"}`) and `a_tools_panel_request_shows_the_panel_and_a_second_keeps_it_shown` (UI) | | Isolation mode by double-click (groups and single objects), breadcrumbs, Esc to exit | done | Single paths, compound paths, images, meshes and placed files isolate too ([helpx: Isolate objects](https://helpx.adobe.com/africa/illustrator/desktop/manage-objects/select-objects/isolate-objects.html)); locking or hiding the layer (or a group) around the isolated object afterwards keeps clicks and marquees off it, as outside isolation mode (#5309) | | "Magnetic" moves of selected anchors with a modifier (#955 request) | missing | not a feature of the reference app as documented; under discussion | From b957d5d07c7651b4b69a6bf9645c5de4a4639936 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 15:07:16 -0800 Subject: [PATCH 071/247] Swatches: swatches dragged onto the New Swatch button are duplicated A swatch dragged from the Swatches panel, in any view, and released on the New Swatch button is copied through swatch.duplicate without opening the New Swatch dialog. A swatch that is part of the selection carries the other selected swatches with it, and the copies of one drop are one undo step. Each copy goes just after its swatch and in its color group, takes the usual "copy" name, and is selected. Modifiers held on release do not change the drop. Color groups, None and Registration are not duplicated; a user swatch whose name starts with a bracket is. The button is outlined only while such a swatch of the active document is held over it, so a paint from another panel, art, a swatch dragged from another document and a swatch deleted during the drag duplicate nothing. A click on the button still opens New Swatch. --- crates/ui-egui/src/panels/swatches/actions.rs | 59 +++++- crates/ui-egui/src/panels/swatches/tests.rs | 175 +++++++++++++++++- docs/target-app-parity.md | 1 + 3 files changed, 226 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/swatches/actions.rs b/crates/ui-egui/src/panels/swatches/actions.rs index 1779f9dfa6..c1fd461d09 100644 --- a/crates/ui-egui/src/panels/swatches/actions.rs +++ b/crates/ui-egui/src/panels/swatches/actions.rs @@ -83,10 +83,14 @@ pub(super) fn bottom(app: &mut VectorcraftApp, ui: &mut Ui, sel: &[String]) { app.run("ui.newColorGroup", json!({"swatches": deletable(sel)})).ok(); } // Alt-click skips the dialog; Ctrl/Cmd-click makes a spot color, and Ctrl/Cmd+Shift-click - // makes a global process color. - if widgets::icon_button(ui, "dc-new-item", tl!("New Swatch"), false, 24.0).clicked() { + // makes a global process color. Swatches dragged from the list and dropped on it are + // duplicated. + let copies = dragged_swatches(app, ui.ctx()); + let new = widgets::icon_button(ui, "dc-new-item", tl!("New Swatch"), false, 24.0); + if new.clicked() { new_swatch(app, sel, ui.input(|i| i.modifiers)); } + drop_on_new(app, ui, &new, copies); // Alt-click deletes without asking. Swatches or color groups dragged from the list can be // dropped on it, also with nothing selected: the button is enabled while they are held. let del = deletable(sel); @@ -106,12 +110,19 @@ pub(super) const DRAG_DOC: &str = "swatch-drag-doc"; /// Swatch can delete: neither None nor Registration, and still in the document. Empty for any other /// drag, and for a drag started in another document. fn dragged_deletable(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<String> { + let Some(st) = app.session.active() else { return vec![] }; + deletable(&dragged_rows(app, ctx)).into_iter().filter(|n| st.doc.swatch_name_taken(n)).collect() +} + +/// The names of the swatches or color groups of the active document being dragged from the list, +/// in panel order. Empty for any other drag, and for a drag started in another document. +fn dragged_rows(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<String> { let Some(st) = app.session.active() else { return vec![] }; if pstate::<Option<u64>>(ctx, DRAG_DOC) != Some(st.uid) { return vec![]; } match egui::DragAndDrop::payload::<PanelDrag>(ctx).as_deref() { - Some(PanelDrag::Paint { rows: Some(r), .. }) => deletable(&r.names).into_iter().filter(|n| st.doc.swatch_name_taken(n)).collect(), + Some(PanelDrag::Paint { rows: Some(r), .. }) => r.names.clone(), _ => vec![], } } @@ -133,6 +144,48 @@ fn drop_on_delete(app: &mut VectorcraftApp, ui: &Ui, button: &Response, names: V } } +/// The swatches of the active document being dragged from the list that New Swatch can duplicate, +/// in panel order: the dragged rows ([`dragged_rows`]) that are swatches still in the document, +/// other than None and Registration. +fn dragged_swatches(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<String> { + let Some(st) = app.session.active() else { return vec![] }; + dragged_rows(app, ctx).into_iter().filter(|n| st.doc.swatch(n).is_some_and(|w| !w.is_reserved())).collect() +} + +/// Swatches (`names`) dragged onto New Swatch (`button`): the button is outlined while they are +/// held over it, and the release of the primary button duplicates them ([`duplicate`]), whatever +/// modifiers are held. The release of another button ends the drag, and other drags are left to +/// their own targets. +fn drop_on_new(app: &mut VectorcraftApp, ui: &Ui, button: &Response, names: Vec<String>) { + if names.is_empty() || button.dnd_hover_payload::<PanelDrag>().is_none() { + return; + } + widgets::drop_target_outline(ui, button.rect); + if !ui.input(|i| i.pointer.button_released(egui::PointerButton::Primary)) { + return; + } + if button.dnd_release_payload::<PanelDrag>().is_some() { + duplicate(app, ui.ctx(), &names); + } +} + +/// Duplicates the swatches `names` (`swatch.duplicate`, each copy just after its swatch and in its +/// color group) in one undo step and selects the copies. A failure is shown in the status bar and +/// changes nothing. +fn duplicate(app: &mut VectorcraftApp, ctx: &egui::Context, names: &[String]) { + let made = if let [name] = names { + app.run("swatch.duplicate", json!({ "name": name })).map(|r| vec![r]) + } else { + let commands: Vec<Value> = names.iter().map(|n| json!({ "command": "swatch.duplicate", "params": { "name": n } })).collect(); + app.run("command.batch", json!({ "label": "Duplicate Swatch", "commands": commands })) + .map(|r| r["results"].as_array().cloned().unwrap_or_default()) + }; + match made { + Ok(made) => set_pstate(ctx, "swatch-selected", made.iter().filter_map(|r| r["name"].as_str().map(str::to_string)).collect::<Vec<_>>()), + Err(e) => app.status(e), + } +} + /// The colour group the selection points at: the last selected group, or the group of the last /// selected swatch. fn target_group(app: &VectorcraftApp, sel: &[String]) -> Option<String> { diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index 9fb6a94e22..f664b8b8c1 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -593,8 +593,13 @@ fn frame_out(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<Event>, /// The Delete Swatch button in `out`: its rectangle and whether it is enabled. fn trash_button(out: &egui::FullOutput) -> (Rect, bool) { + footer_button(out, "Delete Swatch") +} + +/// The button labeled `label` in `out`: its rectangle and whether it is enabled. +fn footer_button(out: &egui::FullOutput, label: &str) -> (Rect, bool) { let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes; - let node = nodes.iter().map(|(_, n)| n).find(|n| n.label().is_some_and(|l| l.trim() == "Delete Swatch")).expect("a Delete Swatch button"); + let node = nodes.iter().map(|(_, n)| n).find(|n| n.label().is_some_and(|l| l.trim() == label)).unwrap_or_else(|| panic!("a {label} button")); let b = node.bounds().expect("the button's bounds"); (Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32)), !node.is_disabled()) } @@ -611,16 +616,23 @@ fn outlined(out: &egui::FullOutput, rect: Rect) -> bool { /// there, a frame per step from `time`. Returns whether the button was outlined and enabled while /// the drag was held over it. fn drag_to_trash(app: &mut VectorcraftApp, ctx: &egui::Context, name: &str, modifiers: Modifiers, time: f64) -> (bool, bool) { + drag_to_button(app, ctx, name, "Delete Swatch", modifiers, time) +} + +/// Drag the tile of `name` with `modifiers` held onto the button labeled `label` and release the +/// primary button there, a frame per step from `time`. Returns whether the button was outlined and +/// enabled while the drag was held over it. +fn drag_to_button(app: &mut VectorcraftApp, ctx: &egui::Context, name: &str, label: &str, modifiers: Modifiers, time: f64) -> (bool, bool) { frame_out(app, ctx, vec![], modifiers, time); - let (trash, _) = trash_button(&frame_out(app, ctx, vec![], modifiers, time + 0.05)); + let (target, _) = footer_button(&frame_out(app, ctx, vec![], modifiers, time + 0.05), label); let from = tile_center(ctx, name); let button = |pos, pressed| Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers }; frame_out(app, ctx, vec![Event::PointerMoved(from), button(from, true)], modifiers, time + 0.1); frame_out(app, ctx, vec![Event::PointerMoved(from + vec2(6.0, 4.0))], modifiers, time + 0.2); - frame_out(app, ctx, vec![Event::PointerMoved(trash.center())], modifiers, time + 0.3); - let held = frame_out(app, ctx, vec![Event::PointerMoved(trash.center())], modifiers, time + 0.4); - let seen = (outlined(&held, trash), trash_button(&held).1); - frame_out(app, ctx, vec![Event::PointerMoved(trash.center()), button(trash.center(), false)], modifiers, time + 0.5); + frame_out(app, ctx, vec![Event::PointerMoved(target.center())], modifiers, time + 0.3); + let held = frame_out(app, ctx, vec![Event::PointerMoved(target.center())], modifiers, time + 0.4); + let seen = (outlined(&held, target), footer_button(&held, label).1); + frame_out(app, ctx, vec![Event::PointerMoved(target.center()), button(target.center(), false)], modifiers, time + 0.5); seen } @@ -750,6 +762,157 @@ fn delete_swatch_ignores_other_drags() { unchanged(&app, "the first document"); } +/// Swatches dragged from the list onto New Swatch are duplicated without a dialog, in thumbnail +/// and list views: each copy goes just after its swatch, in its color group, and is selected, and +/// the copies of one drop are one undo step. A selected swatch carries the other selected swatches +/// with it, but not the selected groups, None or Registration. Modifiers do not change the drop, a +/// repeated name is numbered, and a group, None and Registration dragged alone duplicate nothing. +#[test] +fn swatches_dropped_on_new_swatch_are_duplicated() { + let mut app = app(); + let ctx = context(); + let after = |app: &VectorcraftApp, group: Option<&str>, name: &str| { + let n = names_of(app, group); + n.iter().position(|x| x == name).and_then(|i| n.get(i + 1).cloned()) + }; + let undo = undo_steps(&app); + // An unselected swatch, nothing selected. + assert_eq!(drag_to_button(&mut app, &ctx, "Orange", "New Swatch", Modifiers::NONE, 1.0), (true, true), "outlined while held"); + assert!(app.ui.dialog.is_none(), "no dialog"); + assert_eq!(after(&app, None, "Orange").as_deref(), Some("Orange copy")); + assert_eq!(selected(&ctx), ["Orange copy"], "the copy is selected"); + assert_eq!(undo_steps(&app), undo + 1, "one undo step"); + let copy = app.session.doc().unwrap().doc.swatch("Orange copy").cloned().unwrap(); + assert_eq!(copy.paint, app.session.doc().unwrap().doc.swatch("Orange").unwrap().paint, "the copy keeps the paint"); + app.run("edit.undo", json!({})).unwrap(); + assert!(app.session.doc().unwrap().doc.swatch("Orange copy").is_none(), "Undo removes the copy"); + app.run("edit.redo", json!({})).unwrap(); + assert_eq!(after(&app, None, "Orange").as_deref(), Some("Orange copy"), "Redo brings it back"); + // Again: the copy's name is numbered. + set_pstate(&ctx, "swatch-selected", Vec::<String>::new()); + drag_to_button(&mut app, &ctx, "Orange", "New Swatch", Modifiers::NONE, 2.0); + assert_eq!(after(&app, None, "Orange").as_deref(), Some("Orange copy 2")); + assert_eq!(selected(&ctx), ["Orange copy 2"]); + // A selected swatch carries the selected swatches, in panel order and into their groups, with + // Alt held; the copies are one undo step. + let sel = ["[None]", "Bright Red", "Grays", "Sunset", "Lime"].map(String::from).to_vec(); + set_pstate(&ctx, "swatch-selected", sel); + let undo = undo_steps(&app); + assert_eq!(drag_to_button(&mut app, &ctx, "Lime", "New Swatch", Modifiers::ALT, 3.0), (true, true)); + assert!(app.ui.dialog.is_none(), "no dialog with Alt"); + assert_eq!(after(&app, None, "Lime").as_deref(), Some("Lime copy")); + assert_eq!(after(&app, None, "Sunset").as_deref(), Some("Sunset copy")); + assert_eq!(after(&app, Some("Brights"), "Bright Red").as_deref(), Some("Bright Red copy")); + assert_eq!(selected(&ctx), ["Lime copy", "Sunset copy", "Bright Red copy"]); + assert_eq!(names_of(&app, Some("Grays")).len(), 9, "the group is not duplicated"); + assert_eq!(undo_steps(&app), undo + 1, "one undo step for all"); + app.run("edit.undo", json!({})).unwrap(); + let d = app.session.doc().unwrap().doc.clone(); + assert!(["Lime copy", "Sunset copy", "Bright Red copy"].iter().all(|n| d.swatch(n).is_none()), "Undo removes every copy"); + // A group, None and Registration dragged alone: nothing. + set_pstate(&ctx, "swatch-selected", Vec::<String>::new()); + let (kept, undo) = (app.session.doc().unwrap().doc.clone(), undo_steps(&app)); + for (i, name) in ["Grays", "[None]", REGISTRATION].into_iter().enumerate() { + assert_eq!(drag_to_button(&mut app, &ctx, name, "New Swatch", Modifiers::NONE, 4.0 + i as f64), (false, true), "{name}"); + assert!(app.ui.dialog.is_none(), "{name}"); + assert_eq!(app.session.doc().unwrap().doc, kept, "{name}"); + } + assert_eq!(undo_steps(&app), undo); + // A swatch of the user's whose name starts with a bracket is an ordinary swatch. + app.run("swatch.new", json!({"name": "[Blue]", "color": "#0000ff"})).unwrap(); + assert_eq!(drag_to_button(&mut app, &ctx, "[Blue]", "New Swatch", Modifiers::NONE, 8.0), (true, true)); + assert_eq!(after(&app, None, "[Blue]").as_deref(), Some("[Blue] copy")); + // In a list view. + let undo = undo_steps(&app); + app.ui.swatches_view = View::SmallList; + assert_eq!(drag_to_button(&mut app, &ctx, "Red", "New Swatch", Modifiers::NONE, 9.0), (true, true)); + assert_eq!(after(&app, None, "Red").as_deref(), Some("Red copy")); + assert_eq!(undo_steps(&app), undo + 1); +} + +/// New Swatch duplicates only swatches dragged from the active document's list that are still in +/// it: a paint dragged from elsewhere, art, a swatch dragged from another document, and a swatch +/// deleted while it is dragged duplicate nothing. A secondary button released while a swatch is +/// held over the button ends the drag without duplicating, and a click still opens New Swatch. +#[test] +fn new_swatch_ignores_other_drags() { + let mut app = app(); + let id = app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap(); + let ctx = context(); + let (new, _) = footer_button(&frame_out(&mut app, &ctx, vec![], Modifiers::NONE, 0.0), "New Swatch"); + let (before, undo) = (app.session.doc().unwrap().doc.clone(), undo_steps(&app)); + let unchanged = |app: &VectorcraftApp, case: &str| { + assert!(app.ui.dialog.is_none(), "{case}: no dialog"); + assert_eq!(app.session.doc().unwrap().doc, before, "{case}: duplicates nothing"); + assert_eq!(undo_steps(app), undo, "{case}: no undo step"); + }; + // The payloads are set directly, as if dragged from this document's list. + set_pstate(&ctx, super::actions::DRAG_DOC, app.session.active().map(|st| st.uid)); + let release = |at| Event::PointerButton { pos: at, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }; + let cases = [ + ("a paint", PanelDrag::paint(Paint::solid(Color::from_hex("#ed1c24").unwrap()))), + ("art", PanelDrag::Art(vec![vectorcraft_doc::NodeId(id)])), + ]; + for (i, (case, drag)) in cases.into_iter().enumerate() { + egui::DragAndDrop::set_payload(&ctx, drag); + let held = frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 1.0 + i as f64); + assert!(!outlined(&held, new), "{case}: not outlined"); + frame_out(&mut app, &ctx, vec![release(new.center())], Modifiers::NONE, 1.5 + i as f64); + unchanged(&app, case); + egui::DragAndDrop::clear_payload(&ctx); + } + let press = |at, button, pressed| Event::PointerButton { pos: at, button, pressed, modifiers: Modifiers::NONE }; + let hold_orange = |app: &mut VectorcraftApp, time: f64| { + frame_out(app, &ctx, vec![], Modifiers::NONE, time); + let from = tile_center(&ctx, "Orange"); + frame_out(app, &ctx, vec![Event::PointerMoved(from), press(from, PointerButton::Primary, true)], Modifiers::NONE, time + 0.1); + frame_out(app, &ctx, vec![Event::PointerMoved(from + vec2(6.0, 4.0))], Modifiers::NONE, time + 0.2); + assert!(egui::DragAndDrop::payload::<PanelDrag>(&ctx).is_some(), "Orange is dragged"); + }; + // A secondary release over the button, then the primary release. + hold_orange(&mut app, 3.0); + frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 3.3); + let held = frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 3.4); + assert!(outlined(&held, new), "Orange is held over the button"); + frame_out(&mut app, &ctx, vec![press(new.center(), PointerButton::Secondary, true)], Modifiers::NONE, 3.5); + frame_out(&mut app, &ctx, vec![press(new.center(), PointerButton::Secondary, false)], Modifiers::NONE, 3.6); + unchanged(&app, "a secondary release"); + frame_out(&mut app, &ctx, vec![release(new.center())], Modifiers::NONE, 3.7); + unchanged(&app, "the primary release after it"); + // A swatch deleted while it is dragged. + hold_orange(&mut app, 4.0); + app.run("swatch.delete", json!({"names": ["Orange"]})).unwrap(); + let (gone, undo_gone) = (app.session.doc().unwrap().doc.clone(), undo_steps(&app)); + frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 4.3); + let held = frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 4.4); + assert!(!outlined(&held, new), "a deleted swatch is not outlined"); + frame_out(&mut app, &ctx, vec![release(new.center())], Modifiers::NONE, 4.5); + assert_eq!((app.session.doc().unwrap().doc.clone(), undo_steps(&app)), (gone, undo_gone), "a deleted swatch is not duplicated"); + app.run("edit.undo", json!({})).unwrap(); + // A swatch dragged from this document while another document with the same swatches becomes + // active. + hold_orange(&mut app, 5.0); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + let (other, undo_new) = (app.session.doc().unwrap().doc.clone(), undo_steps(&app)); + frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 5.3); + let held = frame_out(&mut app, &ctx, vec![Event::PointerMoved(new.center())], Modifiers::NONE, 5.4); + let (new_other, _) = footer_button(&held, "New Swatch"); + assert!(!outlined(&held, new_other), "not outlined in the other document"); + frame_out(&mut app, &ctx, vec![release(new_other.center())], Modifiers::NONE, 5.5); + assert_eq!((app.session.doc().unwrap().doc.clone(), undo_steps(&app)), (other, undo_new), "the other document duplicates nothing"); + assert!(app.session.set_active(0)); + unchanged(&app, "the first document"); + // A click still opens New Swatch. + frame_out(&mut app, &ctx, vec![], Modifiers::NONE, 6.0); + let click = vec![ + Event::PointerMoved(new.center()), + press(new.center(), PointerButton::Primary, true), + press(new.center(), PointerButton::Primary, false), + ]; + frame_out(&mut app, &ctx, click, Modifiers::NONE, 6.1); + assert!(app.ui.dialog.is_some(), "a click opens the New Swatch dialog"); +} + #[test] fn art_dropped_on_the_panel_becomes_a_pattern_swatch() { let mut app = app(); diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 26c000262a..e667daf73e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1679,6 +1679,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Right-clicking a swatch in either list or thumbnail view selects it without applying paint and offers Swatch Options…, Duplicate Swatch and Delete Swatch for that item. None, [Registration] and missing swatches disable these actions. Existing active-item multiselection is retained; actions still target only the clicked item. Evidence: `panels::swatches::tests::context_menu` harness tests cover all five views, selection, dialog dispatch, duplicate/delete and Undo. All 39 Swatches tests pass; the regression fails with the menu hooks removed. Rendered headless list and thumbnail menus were inspected, and a fresh local deep CodeRabbit review reported zero findings. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. Scores and estimates unchanged. Validation on 2026-11-15: native Windows formatting, workspace Clippy and all 39 focused Swatches tests passed. Windows full CI stopped at unchanged engine tests `tests::package::a_confined_package_names_files_outside_the_read_root_by_name` (slash-sensitive report assertion) and `tests::plugins::plugin_storage_behind_a_link_is_left_alone` (storage-link setup returned AlreadyExists). Both cases pass in the Linux/WSL full CI run, which passed all 13 gates. No engine or CI workflow changes are included. Dragging swatches onto Delete Swatch deletes them ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=136), Replace, merge, or delete swatches section, lists this drag as one of the ways to delete the selected swatches): a swatch or color group dragged from the Swatches panel, in any view, and released on the Delete Swatch button is deleted through `swatch.delete`, even while nothing was selected and the button is disabled for clicks. A swatch that is part of the selection carries the other selected swatches of its kind with it. VectorCraft's own rules: the drop asks first as a plain click does, and Alt does not skip the question; Cancel keeps everything, and OK deletes them in one undo step; None and [Registration] are never taken; the button is enabled while swatches are selected or while a swatch or group of the active document is being dragged, and it is outlined only while such a swatch or group is held over it, so a paint from another panel, art and a swatch dragged from another document delete nothing. Tests: `panels::swatches::tests::swatches_dropped_on_delete_swatch_are_deleted_after_asking`, `delete_swatch_ignores_other_drags`. + Dragging swatches onto New Swatch duplicates them ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/use-swatches/duplicate-swatches.html) gives this drag as another way to duplicate the selected swatches): a swatch dragged from the Swatches panel, in any view, and released on the New Swatch button is copied through `swatch.duplicate` without opening the New Swatch dialog. A swatch that is part of the selection carries the other selected swatches with it. VectorCraft's own rules: each copy goes just after its swatch and in its color group, named `<name> copy` and then `<name> copy 2`; the copies of one drop are one undo step and are selected; modifiers held on release do not change the drop; color groups, None and [Registration] are not duplicated; the button is outlined only while such a swatch of the active document is held over it, so a paint from another panel, art, a swatch dragged from another document and a swatch deleted during the drag duplicate nothing. Tests: `panels::swatches::tests::swatches_dropped_on_new_swatch_are_duplicated`, `new_swatch_ignores_other_drags`. Editing, renaming, deleting or merging a global swatch also changes the colors linked to it in graph designs, the art of brushes and the tile that pattern editing's Cancel puts back, in the same undo step as the rest of the art; Default Swatches with replace unlinks them there too. A swatch step in `command.batch` (Delete, Swatch Options, Merge, Edit Color Group) changes the fill and stroke for new art as the command run on its own does, so art drawn later in the batch or after it takes the same paint; a batch that fails, and a canceled batch preview, put back the paints it started with, and a canceled Swatch Options preview leaves them as they were. These swatch commands also change the fills and strokes of the appearance new art takes, and Undo and Redo of the command or the batch put the paints for new art back with the swatches. Spot Colors options (`swatch.spotOptions`) and Default Swatches with replace (`swatch.resetDefaults {replace: true}`) as `command.batch` steps also change the fill and stroke for new art as each command run on its own does: a fill or stroke linked to a Lab spot swatch keeps its link and tint and takes the Lab values or their CMYK equivalent, and one linked to a swatch the replace removes keeps its color and loses the link. Evidence: `swatch_steps_in_a_batch_change_the_new_art_paints_as_commands_do`, `spot_colors_options_in_a_batch_change_the_new_art_paints_as_the_command_does`, `default_swatches_replace_in_a_batch_unlinks_the_new_art_paints_as_the_command_does`, `undo_and_redo_of_a_swatch_edit_put_back_the_new_art_paints`, `swatch_edits_reach_the_paints_of_the_new_art_template`, `a_failed_batch_puts_back_the_new_art_paints_a_swatch_step_changed` and `canceling_a_swatch_options_preview_keeps_the_new_art_paints` in `crates/engine/src/tests/swatches.rs`. Add Used Colors (`swatch.addUsedColors`) and Select All Unused (`swatch.unused`) look colors, swatch names, links, tints and gradients up in hash sets instead of searching every swatch and color for each color or linked paint (New Color Group from artwork too), and New Swatch with several colors (`swatch.new`), New Color Group (`swatch.newGroup`) and Edit Color Group (`swatch.editGroup`) name their new swatches from one set of the names already taken. The new swatches keep their names, order and links, and Select All Unused lists the same swatches. Evidence: `add_used_colors_adds_each_new_color_once_with_free_names`, `add_used_colors_global_links_every_paint_of_a_new_color`, `unused_matches_links_tints_colors_gradients_and_patterns_exactly`, `new_swatches_from_colors_are_numbered_after_names_already_taken`, `new_color_group_numbers_its_colors_after_the_group_and_its_moved_swatches`, `new_color_group_from_artwork_lists_each_color_once_with_free_names` and `edit_color_group_numbers_extra_colors_after_the_names_it_keeps` in `crates/engine/src/tests/swatchcmds.rs`; `free_swatch_names_match_naming_each_swatch_as_it_is_added` and `free_swatch_names_match_new_swatch_names_as_swatches_are_added` in `crates/doc/src/swatches.rs`. From 788ebb396168e7ca932f80160a833640e76c44a3 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 15:23:35 -0800 Subject: [PATCH 072/247] Swatches: a user swatch named with a leading bracket dropped on Delete Swatch is deleted Delete Swatch took dragged rows through the name-prefix filter of the selection's click path, so a user swatch such as [Blue] dropped on the button was ignored. The drop now keeps color groups and every swatch of the document other than None and Registration, as swatch.delete does. --- crates/ui-egui/src/panels/swatches/actions.rs | 3 ++- crates/ui-egui/src/panels/swatches/tests.rs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/swatches/actions.rs b/crates/ui-egui/src/panels/swatches/actions.rs index c1fd461d09..5c3fe41597 100644 --- a/crates/ui-egui/src/panels/swatches/actions.rs +++ b/crates/ui-egui/src/panels/swatches/actions.rs @@ -111,7 +111,8 @@ pub(super) const DRAG_DOC: &str = "swatch-drag-doc"; /// drag, and for a drag started in another document. fn dragged_deletable(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<String> { let Some(st) = app.session.active() else { return vec![] }; - deletable(&dragged_rows(app, ctx)).into_iter().filter(|n| st.doc.swatch_name_taken(n)).collect() + let d = &st.doc; + dragged_rows(app, ctx).into_iter().filter(|n| d.swatch_name_taken(n) && d.swatch(n).is_none_or(|w| !w.is_reserved())).collect() } /// The names of the swatches or color groups of the active document being dragged from the list, diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index f664b8b8c1..c8e9755cd6 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -695,6 +695,14 @@ fn swatches_dropped_on_delete_swatch_are_deleted_after_asking() { assert_eq!(doc(&app), kept, "{name}"); } assert_eq!(undo_steps(&app), undo + 2); + // A swatch of the user's whose name starts with a bracket is an ordinary swatch. + app.run("swatch.new", json!({"name": "[Blue]", "color": "#0000ff"})).unwrap(); + let undo = undo_steps(&app); + assert_eq!(drag_to_trash(&mut app, &ctx, "[Blue]", Modifiers::NONE, 7.0), (true, true)); + assert_eq!(dialog_message(&app).as_deref(), Some("Delete “[Blue]”?")); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(doc(&app).swatch("[Blue]").is_none(), "OK deletes it"); + assert_eq!(undo_steps(&app), undo + 1); } /// Delete Swatch takes only swatches dragged from the active document's list: a paint dragged from From 3046868fbcc0fb1151d1728780a52b06ae41d51d Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 16:02:53 -0800 Subject: [PATCH 073/247] Shortcuts: a shifted key with a hold shortcut holds before the character it types When one entry holds a key with Shift (Shift+1) and another the character that key types (`!`), holding Shift+1 runs the hold shortcut of Shift+1. Before, the typed character was matched first, so the Shift+1 hold shortcut could not run. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 14 +++++++------- crates/ui-egui/src/shortcuts/hold_keys/tests.rs | 14 ++++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index 8bec32c8bd..7cb360baf8 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -163,19 +163,19 @@ fn settle(app: &mut VectorcraftApp, ctx: &egui::Context, hold: bool, down: bool) opened } -/// The chords a press names for a hold shortcut, first match first: those of the text it typed, as -/// a single-key shortcut reads them, then the key itself with its Shift (Shift+1 typing `!`). A -/// letter names only the chord with its own Shift state: a hold on X does not catch Shift+X. +/// The chords a press names for a hold shortcut, first match first: the key itself with its Shift +/// (Shift+1 typing `!`), then those of the text it typed, as a single-key shortcut reads them. When +/// one entry holds Shift+1 and another `!`, Shift+1 runs the first. A letter names only the chord +/// with its own Shift state: a hold on X does not catch Shift+X. fn press_chords(text: &str, key: Key, m: Modifiers) -> Vec<craft_keymap::Chord> { let mut chords = super::text_chords(text, m, Some(key)); if !text.is_empty() && text.chars().all(char::is_alphabetic) { chords.retain(|c| c.mods.shift == m.shift); } let shift = Modifiers { shift: m.shift, ..Modifiers::NONE }; - if let Some(c) = crate::shortcut_editor::chord_from_event(key, shift).and_then(|t| crate::keymap::vc_chord(&t)) - && !chords.contains(&c) - { - chords.push(c); + if let Some(c) = crate::shortcut_editor::chord_from_event(key, shift).and_then(|t| crate::keymap::vc_chord(&t)) { + chords.retain(|t| *t != c); + chords.insert(0, c); } chords } diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 13255e273c..e8838fcfec 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -530,6 +530,20 @@ fn a_shifted_digit_holds_when_it_types_its_symbol() { assert_eq!(fill(&app), "#0000ff"); } +/// With one entry holding Shift+1 and another `!`, which Shift+1 types, holding Shift+1 runs the +/// entry that holds the key itself. +#[test] +fn a_shifted_digit_holds_before_the_symbol_it_types() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+1"})).unwrap(); + app.run("shortcuts.set", json!({"id": "select.all", "hold": "!"})).unwrap(); + assert_eq!(app.ui.shortcut_holds.len(), 2); + let keys = Keyboard::new(); + keys.frame(&mut app, 0.0, press(Key::Num1, "!", Modifiers::SHIFT)); + keys.frame(&mut app, 0.4, vec![]); + assert_eq!(fill(&app), "#0000ff", "Shift+1's hold ran"); +} + /// A quick press of a shifted key with a hold shortcut runs what the key runs without one: a /// shortcut on Shift+. (typing `>`) runs, and Shift+1 (typing `!`) runs what `!` runs. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index ea0ce74230..5d050c1497 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6644,7 +6644,8 @@ go; let go sooner, it runs what the key runs without a hold shortcut, at the rel waits, or Cmd, Ctrl or Alt pressed then, ends the wait first, so keys act in the order they went down. The window losing the keyboard, a dialog, a text field, Presentation Mode or an input method composition ends the wait and runs nothing. Keys without a hold shortcut run on their press as before, and so does a letter with Shift when only the letter alone -has a hold shortcut, or a key the active tool uses itself (E with the Extend Path tool). +has a hold shortcut, or a key the active tool uses itself (E with the Extend Path tool). When one entry holds a key with +Shift (Shift+1) and another the character it types (`!`), that key runs the hold shortcut of the first. `shortcuts.set {id, hold}` sets a hold shortcut, and `hold: ""` or `null` removes it; `hold` alone leaves the entry's shortcut as it is, and a key that another entry already holds is refused unless `force` is true. Hold shortcuts are From cd3b09051803ac10fa8837fa78dff844e15e825f Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 16:03:01 -0800 Subject: [PATCH 074/247] Shortcuts: after a chord before a hold key, the key's repeats reach the frame When a command chord comes before a key with a hold shortcut in one frame, and the key's wait ends in that frame, the key goes back to the frame as with Hold Shortcuts off. Its repeats in that frame, the text they type and its repeats in later frames now go back too; before, they were held back until the key was let go. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 21 ++++++------- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index 7cb360baf8..b504be57d8 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -283,9 +283,9 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { let text_of = |k: usize| typed_by.iter().position(|by| *by == Some(k)).and_then(|j| events.get(j).map(|e| (j, e))); let mut taken: Vec<usize> = vec![]; let mut stop_at = None; - // The press of a wait that started in this frame: when the wait also ends in this frame, the - // keys typed before it run first. - let mut started: Option<usize> = None; + // The press of a wait that started in this frame, and how many events were taken before it: + // when the wait also ends in this frame, the keys typed before it run first. + let mut started: Option<(usize, usize)> = None; for (j, e) in events.iter().enumerate() { if let Some(p) = app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport) { let overdue = now - p.since >= p.delay; @@ -312,14 +312,15 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { let start = started.take(); // After a chord with Cmd, Ctrl or Alt pressed before it, which the frame's shortcuts // run, the key goes back to the frame without waiting, so the frame handles it as it - // does with Hold Shortcuts off and its tap does not run before the chord. - if let Some(start) = start + // does with Hold Shortcuts off and its tap does not run before the chord. Its press, + // its repeats and their texts stay in the frame, and its later repeats reach later + // frames. + if let Some((start, before)) = start && chord_before(&events, start, &taken) { - cancel(app, ctx); - let text = text_of(start).map(|(t, _)| t); - taken.retain(|&k| k != start && Some(k) != text); - } else if let Some(start) = start + app.hold_keys.pending = None; + taken.truncate(before); + } else if let Some((start, _)) = start && let Some(opened) = run_typed_before(app, ctx, &events, &typed_by, start, &mut taken) { // A key typed before it that opened a dialog or the palette ends the wait @@ -349,7 +350,7 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { if tool_takes(app, *key, text) { continue; } - started = Some(j); + started = Some((j, taken.len())); taken.extend([j, t]); // The key's repeats in this frame, and the text they type, stay out of the frame too. for (r, later) in events.iter().enumerate().skip(j + 1) { diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index e8838fcfec..09d4b41689 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -419,6 +419,36 @@ fn a_chord_before_a_wait_ended_in_its_frame_runs_first() { assert!(app.hold_keys.pending.is_none()); } +/// After a command chord before a wait that starts and ends in one frame, the key's repeats in +/// that frame and in later ones, and the text they type, reach the frame as with Hold Shortcuts +/// off. +#[test] +fn a_chord_before_a_wait_leaves_the_key_repeats_to_the_frame() { + let run = |app: &mut VectorcraftApp| { + app.run("paint.setFill", json!({"color": "#00ff00"})).unwrap(); + let n = steps(app, 0).len(); + let keys = Keyboard::new(); + let mut events = + vec![egui::Event::Key { key: Key::Z, physical_key: Some(Key::Z), pressed: true, repeat: false, modifiers: Modifiers::COMMAND }]; + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.extend(press(Key::D, "d", Modifiers::NONE)); + let first = keys.frame_left(app, 0.0, events); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.extend([release(Key::X), release(Key::D)]); + let second = keys.frame_left(app, 0.05, events); + (steps(app, n), first, second, fill(app)) + }; + let mut off = swap_on_x(); + off.run("prefs.set", json!({"key": "holdShortcuts", "value": false})).unwrap(); + let off = run(&mut off); + let mut app = swap_on_x(); + let on = run(&mut app); + assert_eq!(on, off); + assert!(app.hold_keys.pending.is_none()); + assert!(app.hold_keys.swallowed.is_empty()); +} + /// The repeats of a key in the frame that starts its wait, and the text they type, stay out of the /// frame. #[test] From 5255d612731b9947e97341e3dc420653096e9ac3 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 16:03:02 -0800 Subject: [PATCH 075/247] Tests: a key typed before a wait keeps later letters from its dialog The test for a key typed before a wait that opens a dialog now presses a letter between the two keys and checks that neither its press nor its text reaches the dialog. A second test sends the same keys in the web build's order, with each text before its press. --- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 09d4b41689..86ee5f5c0c 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -664,12 +664,35 @@ fn a_key_typed_before_a_wait_does_not_let_later_keys_reach_its_dialog() { app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); let keys = Keyboard::new(); let mut events = press(Key::D, "d", Modifiers::NONE); - events.push(egui::Event::Key { key: Key::Enter, physical_key: Some(Key::Enter), pressed: true, repeat: false, modifiers: Modifiers::NONE }); + events.extend(press(Key::A, "a", Modifiers::NONE)); events.extend(press(Key::X, "x", Modifiers::NONE)); events.push(release(Key::X)); let left = keys.frame_left(&mut app, 0.0, events); assert!(app.ui.dialog.is_some(), "D opened Preferences"); - assert!(!left.iter().any(|e| matches!(e, egui::Event::Key { key: Key::Enter, .. })), "{left:?}"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { key: Key::A, pressed: true, .. })), "{left:?}"); + assert_eq!(fill(&app), "#ff0000"); +} + +/// On the web build, where each press's text comes before it, a key typed before a wait that +/// starts and ends in one frame, and that opens a dialog, keeps the frame's later keys from the +/// dialog too. +#[test] +fn a_key_typed_before_a_wait_on_the_web_build_does_not_let_later_keys_reach_its_dialog() { + let mut app = app_with(true); + app.run("shortcuts.set", json!({"id": "edit.preferences", "shortcut": "D", "force": true})).unwrap(); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "X"})).unwrap(); + let keys = Keyboard::new(); + let web = |key: Key, text: &str| { + [egui::Event::Text(text.into()), egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers: Modifiers::NONE }] + }; + let mut events = vec![]; + for (key, text) in [(Key::D, "d"), (Key::A, "a"), (Key::X, "x")] { + events.extend(web(key, text)); + } + events.push(release(Key::X)); + let left = keys.frame_left(&mut app, 0.0, events); + assert!(app.ui.dialog.is_some(), "D opened Preferences"); + assert!(!left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), "{left:?}"); assert_eq!(fill(&app), "#ff0000"); } From 4d9dde74610b1b1c855ea09e2d3479398bf3db3e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 16:19:00 -0800 Subject: [PATCH 076/247] Shortcuts: OK in Keyboard Shortcuts saves Hold Shortcuts and its delay When OK in Edit > Keyboard Shortcuts changes Hold Shortcuts or the Hold Shortcut Delay, the preferences are copied into the saved UI state and the host is asked to write the preferences file, as OK in Preferences does. Before, the change waited for the host's delayed save. --- crates/ui-egui/src/shortcut_editor.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 106c04405b..b9bfe65546 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1500,6 +1500,9 @@ pub fn confirm(app: &mut VectorcraftApp) -> Result<Value, String> { let prefs = &app.session.prefs; if d.kind == "shortcuts" && (on != prefs.hold_shortcuts || delay != prefs.key_hold_delay()) { app.run("prefs.set", json!({"values": {"holdShortcuts": on, "keyHoldDelay": delay}})).map_err(|e| e.to_string())?; + // Saved as OK in Preferences saves them. + crate::prefs_dialog::snapshot(app); + app.prefs_changed = true; } app.ui.shortcut_overrides = dialog_overrides(&d); app.ui.shortcut_holds = dialog_holds(&d); @@ -3741,8 +3744,8 @@ mod tests { } /// Hold Shortcuts is off by default: the dialog shows its checkbox and no Hold column. Turned - /// on, the dialog shows the column and the delay, and OK turns hold shortcuts on; Cancel keeps - /// them off. + /// on, the dialog shows the column and the delay, and OK turns hold shortcuts on and asks the + /// host to write the preferences file; Cancel keeps them off. #[test] fn the_hold_shortcuts_checkbox_shows_the_hold_column() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); @@ -3756,6 +3759,7 @@ mod tests { assert!(on.iter().any(|t| t == "Hold") && on.iter().any(|t| t == "Hold Shortcut Delay"), "{on:?}"); app.ui.dialog = None; assert!(!app.session.prefs.hold_shortcuts, "Cancel keeps them off"); + assert!(!app.take_prefs_changed(), "nothing to write after Cancel"); open(&mut app); let d = app.ui.dialog.as_mut().unwrap(); d.fields.insert("holdShortcuts".into(), json!(true)); @@ -3763,6 +3767,9 @@ mod tests { confirm(&mut app).unwrap(); assert!(app.session.prefs.hold_shortcuts); assert_eq!(app.session.prefs.key_hold_delay, 0.5); + assert!(app.take_prefs_changed(), "OK asks the host to write the preferences file"); + assert_eq!(app.ui.engine_prefs["holdShortcuts"], json!(true)); + assert_eq!(app.ui.engine_prefs["keyHoldDelay"], json!(0.5)); } /// The info button shows how hold shortcuts work. From 2e4b61086f723a9b8efe67519463663191a2b0a7 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 18:38:16 -0800 Subject: [PATCH 077/247] Export for Screens: Include Bleed PDF rows warn about art short of the bleed With Include Bleed, a PDF row's page now keeps the artboard as its TrimBox and puts the bleed around it, so art that reaches the artboard's edge and stops there is short of the bleed. The row warns about it, as it does without Include Bleed. Art that reaches the bleed edge, and pages of a selection's, layer's or asset's bounds, do not warn. --- crates/engine/src/cmd/fileio/screens.rs | 9 ++++--- crates/engine/src/cmd/fileio/tests_screens.rs | 24 +++++++++++++------ docs/mcp.md | 5 ++-- docs/target-app-parity.md | 2 +- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/crates/engine/src/cmd/fileio/screens.rs b/crates/engine/src/cmd/fileio/screens.rs index bc914c8323..a1794f5ff4 100644 --- a/crates/engine/src/cmd/fileio/screens.rs +++ b/crates/engine/src/cmd/fileio/screens.rs @@ -1310,15 +1310,14 @@ fn encode_and_write(export: ScreenExport, writer: &mut dyn FnMut(&str, &[u8]) -> } // The document a PDF row writes: with Include Bleed, the artboards as they are. let pdf_doc = ungrown.as_deref(); - // A grown artboard's trim edge is the bleed edge, and a page of its art's bounds has every - // object at its edge: neither says whether art stops short of the bleed. + // A PDF page of an artboard has the artboard as its trim, with or without Include Bleed. A + // page of its art's bounds has every object at its edge: it doesn't say whether art stops + // short of the bleed. let artboard_page = o.assets.is_none() && o.layers.is_none() && o.selection.is_none(); let mut write = |doc: &Document, format: &str, options: &Value| -> Result<Vec<u8>> { - // Include Bleed grows the artboards only when the document has a bleed. - let trim_on_page = artboard_page && !(o.include_bleed && doc.setup.has_bleed()); // The steps are the files: an encoder's own steps (artboards, pages) are not reported. let (bytes, given) = vectorcraft_doc::cancel::quiet(|| encode_with_notes(doc, format, options))?; - for n in given.into_iter().filter(|n| trim_on_page || !super::pdf::is_short_of_bleed(&n.text)) { + for n in given.into_iter().filter(|n| artboard_page || !super::pdf::is_short_of_bleed(&n.text)) { add_note(&mut notes, n); } Ok(bytes) diff --git a/crates/engine/src/cmd/fileio/tests_screens.rs b/crates/engine/src/cmd/fileio/tests_screens.rs index 66ea2d4529..d42c23e07b 100644 --- a/crates/engine/src/cmd/fileio/tests_screens.rs +++ b/crates/engine/src/cmd/fileio/tests_screens.rs @@ -611,21 +611,31 @@ fn include_bleed_pdfx_rows_do_not_warn_about_the_bleed() { assert!(warned(&export(&mut s, json!({"includeBleed": true, "selection": "one", "formats": row})))); } -/// A PDF row with the document's bleed warns about art that stops short of it on an artboard's -/// page, but not on a page Include Bleed grows or on a page of a selection's bounds. +/// A PDF row with a bleed warns about art that reaches an artboard's edge and stops short of the +/// bleed, with or without Include Bleed: the page's trim is the artboard either way. It doesn't +/// warn about art that reaches the bleed, or on a page of a selection's bounds. #[test] fn pdf_rows_warn_about_art_short_of_the_bleed_on_artboard_pages_only() { + let warned = |r: &Value| r["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())); + let row = json!([{"format": "pdf", "bleed": {"useDocument": true}}]); let mut s = session(1); s.execute("document.setup", &json!({"bleed": 6})).unwrap(); // Against the artboard's top edge. s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 10})).unwrap(); - let warned = |r: &Value| r["warnings"].as_array().unwrap().iter().any(|w| super::pdf::is_short_of_bleed(w.as_str().unwrap())); - let row = json!([{"format": "pdf", "bleed": {"useDocument": true}}]); assert!(warned(&export(&mut s, json!({"formats": row})))); - assert!(!warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); + assert!(warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); + assert!(warned(&export(&mut s, json!({"includeBleed": true, "formats": [{"format": "pdf"}]}))), "the row takes the document's bleed"); assert!(!warned(&export(&mut s, json!({"selection": "one", "formats": row})))); - // Without a document bleed, Include Bleed doesn't grow the artboard, so a row's own bleed warns. - s.execute("document.setup", &json!({"bleed": 0})).unwrap(); + assert!(!warned(&export(&mut s, json!({"includeBleed": true, "selection": "one", "formats": row})))); + // Out to the bleed edge on the top, left and right. + let mut s = session(1); + s.execute("document.setup", &json!({"bleed": 6})).unwrap(); + s.execute("shape.rectangle", &json!({"x": -6, "y": -6, "width": 52, "height": 16})).unwrap(); + assert!(!warned(&export(&mut s, json!({"formats": row})))); + assert!(!warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); + // Without a document bleed, a row's own bleed warns. + let mut s = session(1); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 10})).unwrap(); let row = json!([{"format": "pdf", "bleed": {"top": 6, "bottom": 6, "left": 6, "right": 6}}]); assert!(warned(&export(&mut s, json!({"includeBleed": true, "formats": row})))); } diff --git a/docs/mcp.md b/docs/mcp.md index 81b4226031..b93e379490 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6187,8 +6187,9 @@ itself. It leaves out hidden objects, guides, objects at 0% opacity and paths wi measure objects with brushed strokes or an opacity mask, area type, type on a path, or groups that hold one of them. It leaves out template layers, layers with an opacity mask, and layers that don't print unless `includeNonPrinting` is on. The export writes the art and the page boxes unchanged. A page of the -art's bounds (`useArtboards: false`) does not warn. Export for Screens does not warn for a PDF row when Include Bleed -grows the artboards, or for a page of assets, layers or a selection. `.ai` saves do not warn. When OK in File › +art's bounds (`useArtboards: false`) does not warn. Export for Screens warns for a PDF row of an artboard, with or +without Include Bleed. With Include Bleed the page's trim is the artboard and the bleed lies around it. It does not +warn for a page of assets, layers or a selection. `.ai` saves do not warn. When OK in File › Document Setup raises the bleed on a side, the status bar counts the objects that stop short of the new bleed on the sides OK raised, on every artboard. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 661bc18b25..4802e7f7a0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1956,7 +1956,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`). That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`). PDF export warns when a PDF/X file has no bleed on a side where the document's bleed has one, and writes the file as asked. - PDF export, and Document Setup when OK raises the bleed, count the objects that reach the trim edge on a side with a bleed but stop short of the bleed edge, and change no art or page box (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). + PDF export, and Document Setup when OK raises the bleed, count the objects that reach the trim edge on a side with a bleed but stop short of the bleed edge, and change no art or page box (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). Export for Screens counts them for a PDF row of an artboard, with Include Bleed too (`crates/engine/src/cmd/fileio/tests_screens.rs`). In a PDF without a standard, the warning for a page longer than 14,400 pt written with a `UserUnit` names "Write pages longer than 200 in at full size in points" (`crates/engine/src/cmd/fileio/tests_pdf.rs`). A PDF/A-2b export at PDF 1.4 with a page longer than 14,400 pt is written as PDF 1.6 with a `UserUnit` and a warning, whether or not `longPagesInPoints` is on, so its page boundaries stay within PDF/A-2's limit of 14,400 units (ISO 19005-2, 6.1.13) unless the page is too narrow for that (`crates/pdf/src/tests/marks.rs`). PDF/X-1a, PDF/X-3 and PDF 1.3 files keep the art under the hidden part of a picture, gradient, pattern, mesh or raster effect that a clipping mask or clipping layer crops: flattening rasterizes only the part of such art that its clipping path shows, on its own page and on the next one. Layers the file leaves out are left out of the flattening, and transparent art that a clipping path hides entirely is removed (`crates/engine/src/cmd/fileio/tests_pdfx.rs`). From 8cd51bf95a2ceca77b3e157ab3a63a718b7e89ef Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 21:28:31 -0800 Subject: [PATCH 078/247] Command Palette: "setting" finds Preferences, and a Recent Commands pick gives the focus back The stem forms of a group's English words join the group, so "setting" finds Preferences through settings. A pick from Recent Commands with the keyboard, which leaves the focus on its row, now gives the focus back to the widget that had it when the palette opened. --- crates/ui-egui/src/palette.rs | 52 ++++++++++++++++++++++++++-- crates/ui-egui/src/palette/search.rs | 28 +++++++++++---- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 2ad2ffcea3..3330281587 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -569,16 +569,21 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { // closed it focused another widget, such as a field in a window above the backdrop. let focus_id = egui::Id::unique("palette-focus-before"); let field_id = egui::Id::unique("palette-field"); + // The Recent Commands rows drawn in the last frame, so a pick with the keyboard, which leaves the + // focus on its row, gives the focus back too. + let rows_id = egui::Id::unique("palette-recent-rows"); if !app.ui.palette_open { - let field = ctx.data_mut(|d| { + let (field, rows) = ctx.data_mut(|d| { let field = d.get_temp::<egui::Id>(field_id); d.remove::<egui::Id>(field_id); - field + let rows = d.get_temp::<Vec<egui::Id>>(rows_id).unwrap_or_default(); + d.remove::<Vec<egui::Id>>(rows_id); + (field, rows) }); let now = ctx.memory(|m| m.focused()); if let Some(Some(before)) = ctx.data_mut(|d| d.remove_temp::<Option<egui::Id>>(focus_id)) && app.ui.dialog.is_none() - && (now.is_none() || now == field) + && (now.is_none() || now == field || now.is_some_and(|n| rows.contains(&n))) { ctx.memory_mut(|m| m.request_focus(before)); } @@ -701,12 +706,14 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if !list_open && !history_focused { r.request_focus(); } + let mut rows = Vec::new(); egui::Popup::menu(&button).id(recent_list_id()).show(|ui| { if recent.is_empty() { ui.add_enabled(false, egui::Button::new(tl!("No recent commands"))); } for (i, e) in recent.iter().enumerate() { let row = ui.add(egui::Button::new(e.shown.as_str()).shortcut_text(menus::shown_shortcut(&e.shortcut))); + rows.push(row.id); if i == rsel { row.request_focus(); } @@ -715,6 +722,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { } } }); + ui.ctx().data_mut(|d| d.insert_temp(rows_id, rows)); r }) .inner; @@ -2334,6 +2342,44 @@ mod tests { assert_eq!(ctx.memory(|m| m.focused()), Some(above), "the clicked field keeps the focus"); } + /// A pick with the keyboard from Recent Commands that opens no dialog gives the focus back to + /// the widget that had it when the palette opened, though the picked row had the keyboard. + #[test] + fn a_pick_from_recent_commands_gives_the_focus_back() { + let ctx = egui::Context::default(); + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default()); + app.ui.recent_commands = vec!["paint.swap".into()]; + let mut text = String::new(); + let field = egui::Id::unique("other field"); + let mut frame = |app: &mut VectorcraftApp, focus: bool, events: Vec<egui::Event>| { + ctx.run_ui(egui::RawInput { events, ..Default::default() }, |ui| { + let r = ui.add(egui::TextEdit::singleline(&mut text).id(field)); + if focus { + r.request_focus(); + } + show(app, ui.ctx()); + }) + .textures_delta + .clear(); + }; + frame(&mut app, true, vec![]); + frame(&mut app, false, vec![]); + app.ui.palette_open = true; + frame(&mut app, false, vec![]); + egui::Popup::open_id(&ctx, recent_list_id()); + frame(&mut app, false, vec![]); + frame(&mut app, false, vec![]); + assert!(recent_list_open(&ctx), "the list is open"); + assert_ne!(ctx.memory(|m| m.focused()), Some(field), "the row has the keyboard"); + let enter = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }; + frame(&mut app, false, vec![enter]); + assert!(!app.ui.palette_open, "the pick closes the palette"); + assert!(app.ui.dialog.is_none(), "{}", app.ui.status); + frame(&mut app, false, vec![]); + frame(&mut app, false, vec![]); + assert_eq!(ctx.memory(|m| m.focused()), Some(field)); + } + /// The whole window, with a document whose rectangle is selected, drawn a frame at a time in /// English with screen readers on. struct Window { diff --git a/crates/ui-egui/src/palette/search.rs b/crates/ui-egui/src/palette/search.rs index e70b9f3637..8f1dd0e504 100644 --- a/crates/ui-egui/src/palette/search.rs +++ b/crates/ui-egui/src/palette/search.rs @@ -72,8 +72,9 @@ pub(crate) struct Index { initials_text: String, /// Each result's offset and length in `initials_text`. initials: Vec<(u32, u16)>, - /// Each word of a group of words with the same meaning ([`super::words::GROUPS`], and the - /// words the UI language's catalog adds), with the group's place in the table. + /// Each word of a group of words with the same meaning ([`super::words::GROUPS`], the words the + /// UI language's catalog adds, and the English words' stem forms), with the group's place in the + /// table. synonyms: HashMap<Box<str>, u16>, } @@ -84,8 +85,10 @@ pub(crate) fn is_one_word(w: &str) -> bool { } /// The words of each group of [`super::words::GROUPS`], with the words `search_row` gives for the -/// group's catalog row ([`super::words::row_key`]) in the UI language. A word the catalog gives -/// that is not a single word, or that is already a word of a group, is left out. +/// group's catalog row ([`super::words::row_key`]) in the UI language, and the English stem forms +/// ([`stems`]) of the group's English words (`setting` of settings). A word the catalog gives that +/// is not a single word, or that is already a word of a group, is left out, and so is a stem form +/// that is already a word of a group. fn synonym_groups(search_row: impl Fn(&str) -> Option<String>) -> HashMap<Box<str>, u16> { let mut out: HashMap<Box<str>, u16> = HashMap::new(); let groups = super::words::GROUPS.iter().enumerate().filter_map(|(g, words)| u16::try_from(g).ok().map(|g| (g, words))); @@ -94,7 +97,7 @@ fn synonym_groups(search_row: impl Fn(&str) -> Option<String>) -> HashMap<Box<st out.insert(w.into(), g); } } - for (g, words) in groups { + for (g, words) in groups.clone() { let Some(text) = search_row(&super::words::row_key(words)) else { continue }; for (w, single) in super::words::row_words(&text) { if single { @@ -102,6 +105,11 @@ fn synonym_groups(search_row: impl Fn(&str) -> Option<String>) -> HashMap<Box<st } } } + for (g, words) in groups { + for form in words.iter().flat_map(|w| stems(w)) { + out.entry(form.into()).or_insert(g); + } + } out.shrink_to_fit(); out } @@ -1104,8 +1112,9 @@ mod tests { /// A query word finds a result whose label or menu path holds another word of its group of words /// with the same meaning: below a result whose label holds the word itself, above one whose menu - /// path holds the word, and with a menu path word of the group last. A stem form of the query word - /// and of a result's word meet the group too; ids, word starts and words of no group do not. + /// path holds the word, and with a menu path word of the group last. A stem form of the query word, + /// of a result's word and of a group's word meet the group too; ids, word starts and words of no + /// group do not. #[test] fn a_word_with_the_same_meaning_finds_the_result() { let c = synthetic(vec![ @@ -1121,6 +1130,10 @@ mod tests { let c = synthetic(vec![entry("Zz Unite", "a.one"), entry("Zz Merge", "b.two")]); assert_eq!(ranked(&c, "merge"), ["b.two"], "merge is in no group"); assert_eq!(ranked(&c, "combine"), ["a.one"]); + // The stem form of a plural word of a group is in the group too: "setting" meets settings. + let c = synthetic(vec![entry("Zz Preferences", "a.one"), entry("Zz Other", "b.two")]); + assert_eq!(ranked(&c, "setting zz"), ["a.one"], "a stem form of a group's word"); + assert_eq!(ranked(&c, "settings zz"), ["a.one"]); // Among results that match equally well, the whole query read with the word of the same // meaning ("colour" as "color") puts the label Color first, but never above a label that // holds the query word itself. @@ -1164,6 +1177,7 @@ mod tests { assert!(place(&c, "unite", "object.slice.combine").is_some(), "{:?}", ranked(&c, "unite")); assert!(place(&c, "delete", "view.guides.clear").is_some(), "{:?}", ranked(&c, "delete")); assert!(place(&c, "settings", "edit.preferences").is_some(), "{:?}", ranked(&c, "settings")); + assert!(place(&c, "setting", "edit.preferences").is_some(), "{:?}", ranked(&c, "setting")); let merge = ranked(&c, "merge"); let unite = merge.iter().position(|id| id == "object.pathfinder.unite"); let named = |id: &String| c.list.iter().any(|e| &e.id == id && split_name(&e.shown).0 == "Merge"); From aafe3b7296e2bfe6c0572b63e4d77c2ac7a3f295 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Mon, 16 Nov 2026 22:29:41 -0800 Subject: [PATCH 079/247] Add built-in Arrows brush library --- crates/engine/src/cmd/brushlib.rs | 40 ++++++++++++++++++++++++++++- crates/engine/src/tests/brushlib.rs | 31 ++++++++++++++++++++++ docs/gaps.md | 6 ++--- docs/mcp.md | 4 +-- 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index 34becd7c02..e6db9f1d49 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -12,7 +12,8 @@ use std::sync::{Arc, LazyLock}; use serde_json::{Value, json}; use vectorcraft_brush::{ - self as brush, ArtBrush, Bristle, BristleShape, Brush, BrushKind, Calligraphic, Colorization, PatternBrush, PatternFit, Scatter, Variation, + self as brush, ArtBrush, ArtScale, Bristle, BristleShape, Brush, BrushKind, Calligraphic, Colorization, PatternBrush, PatternFit, Scatter, + Variation, }; use vectorcraft_color::{Color, Paint}; use vectorcraft_doc::{Appearance, AppearanceItem, Document, FillLayer, Node, NodeId, NodeKind, PatternDef, Symbol}; @@ -179,6 +180,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[ BuiltinBrushLibrary { id: "energy-beams", name: "Energy Beams", make: energy_beams }, BuiltinBrushLibrary { id: "dry-media", name: "Dry Media", make: dry_media }, BuiltinBrushLibrary { id: "tech-circuit", name: "Tech Circuit", make: tech_circuit }, + BuiltinBrushLibrary { id: "arrows", name: "Arrows", make: arrows }, ]; /// Built-in library `id`, made once. @@ -232,6 +234,42 @@ fn art(name: &str, art: Node, colorization: Colorization) -> Brush { Brush { name: name.into(), kind: BrushKind::Art(ArtBrush { art, colorization, ..Default::default() }) } } +fn arrow_art(name: &str, art: Node, start: f64) -> Brush { + Brush { + name: name.into(), + kind: BrushKind::Art(ArtBrush { + art, + scale: ArtScale::BetweenGuides { start, end: 0.76 }, + colorization: Colorization::Tints, + ..Default::default() + }), + } +} + +/// Arrows: original art brushes whose stems stretch while their heads keep their proportions. +fn arrows() -> BrushLibrary { + let shaft = || black(shapes::rectangle(Rect::new(0.0, -1.0, 82.0, 1.0))); + let head = || black(polygon(&[(76.0, -7.0), (100.0, 0.0), (76.0, 7.0), (82.0, 0.0)])); + let solid = group(vec![shaft(), head()]); + let outline = group(vec![shaft(), black(polygon(&[(76.0, -7.0), (100.0, 0.0), (76.0, 7.0), (78.0, 4.0), (91.0, 0.0), (78.0, -4.0)]))]); + let double = group(vec![ + black(shapes::rectangle(Rect::new(18.0, -1.0, 82.0, 1.0))), + head(), + black(polygon(&[(24.0, -7.0), (0.0, 0.0), (24.0, 7.0), (18.0, 0.0)])), + ]); + let chevrons = group(vec![shaft(), head(), black(polygon(&[(53.0, -5.0), (66.0, 0.0), (53.0, 5.0), (56.0, 0.0)]))]); + built( + "Arrows", + Document::new(100.0, 100.0), + vec![ + arrow_art("Solid Arrow", solid, 0.0), + arrow_art("Open Arrow", outline, 0.0), + arrow_art("Double Arrow", double, 0.24), + arrow_art("Chevron Arrow", chevrons, 0.0), + ], + ) +} + /// Art Ribbons: art brushes, 100 pt long, drawn here; Striped Ribbon is filled with the library's /// own pattern, Pinstripes. fn art_ribbons() -> BrushLibrary { diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index 4f0b739951..e0bf926830 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -218,6 +218,37 @@ fn black_stroke() -> vectorcraft_doc::StrokeLayer { vectorcraft_doc::StrokeLayer::new(vectorcraft_color::Paint::solid(vectorcraft_color::Color::BLACK), 1.0) } +#[test] +fn arrows_library_lists_renders_and_applies_original_brushes() { + let mut s = session(); + let listed = run(&mut s, "brush.libraries", json!({})); + let entry = listed["libraries"].as_array().unwrap().iter().find(|l| l["id"] == "arrows").unwrap(); + assert_eq!((entry["name"].as_str(), entry["category"].as_str(), entry["count"].as_u64()), (Some("Arrows"), Some("builtIn"), Some(4))); + let (_, lib) = cmd::brushlib::library(&s, "Arrows").unwrap(); + assert_eq!( + lib.brushes.iter().map(|b| (b.name.as_str(), b.kind.type_id())).collect::<Vec<_>>(), + [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art")] + ); + for b in &lib.brushes { + for length in [2.0, 200.0] { + let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line_to(length), &black_stroke()); + let pts = anchors(&pieces.iter().collect::<Vec<_>>()); + assert!(!pts.is_empty() && pts.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{} at {length} pt", b.name); + } + } + let path = run(&mut s, "shape.line", json!({"x1": 10, "y1": 20, "x2": 210, "y2": 20}))["id"].as_u64().unwrap(); + let before = undo_len(&s); + let added = run(&mut s, "brush.addFromLibrary", json!({"library": "arrows", "name": "Double Arrow", "apply": true, "ids": [path]})); + assert_eq!(strs(&added["added"]), ["Double Arrow"]); + assert_eq!(added["applied"], json!([path])); + assert_eq!(undo_len(&s), before + 1); + assert_eq!(doc(&s).node(NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(), Some("Double Arrow")); + run(&mut s, "edit.undo", json!({})); + assert!(vectorcraft_brush::find(doc(&s), "Double Arrow").is_none()); + run(&mut s, "edit.redo", json!({})); + assert_eq!(brush(&s, "Double Arrow"), lib.brushes[2]); +} + /// Original circuit art and repeat tiles survive adding, applying and saving a library. #[test] fn the_tech_circuit_library_constructs_adds_and_applies_each_brush() { diff --git a/docs/gaps.md b/docs/gaps.md index a6f6defbb0..015fe031de 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -670,8 +670,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi libraries ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html)): Window › Brush Libraries and the Brushes panel's Brush Libraries Menu open each library in a library panel of - its own (ten original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes (one - bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes) and Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a + its own (eleven original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes (one + bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), and Arrows (Solid, Open, Double and Chevron Arrow); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a click adds a brush to the document's Brushes with the patterns, symbols and other resources its art uses, as one undo step (applied to the selected paths in the same step), dragging one onto a path adds and applies it and @@ -693,7 +693,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi Fine Grain, Canvas Weave, Burlap Sack, Cracked Glaze, Mosaic Floor, Quilted Squares, Leaded Glass and Damp Paper, painted with the texture effects; User Defined; Other Library…; `graphicStyle.libraries`, `graphicStyle.addFromLibrary`). -- **Missing:** more built-in brush libraries beyond the ten shipped (and further graphic-style libraries beyond the eleven shipped, and further symbol libraries beyond Basic +- **Missing:** more built-in brush libraries beyond the eleven shipped (and further graphic-style libraries beyond the eleven shipped, and further symbol libraries beyond Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons; original, generated in code, never Adobe's); dynamic symbols' `.ai` read and write. - **Estimate:** 3–13 h (estimated). diff --git a/docs/mcp.md b/docs/mcp.md index 4abaa8bafe..2aa95f1540 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5032,9 +5032,9 @@ error. ## Brush libraries -Brush libraries are read-only sets of brushes: ten generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle +Brush libraries are read-only sets of brushes: eleven generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes with one bristle brush for each tip shape, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, and Dry Media with the Chalk Grain, Graphite Pencil, Wax Crayon and -Charcoal Dust art brushes, id `dry-media`, and Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`), the `.vectorcraft` files in the user library folder of the desktop app (User +Charcoal Dust art brushes, id `dry-media`, Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Arrows with Solid, Open, Double and Chevron Arrow art brushes, id `arrows`), the `.vectorcraft` files in the user library folder of the desktop app (User Defined) and the brushes of any document loaded with `brush.loadLibrary` (a document without brushes of its own has the default ones). `brush.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`) and `brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). From f71fe2e5d83b9aa141dbc1678232540db6aa24b8 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 11:11:58 +0000 Subject: [PATCH 080/247] .ai import: type that ends a clipping group without a clipping path clips it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Illustrator writes a clipping mask of type from the text document as a clipping group (`q` ... `Q`) with no clipping path (`W`), the text object (`/AI11Text`) last. The reader took only `W` paths (and legacy type in rendering modes 4 to 7) as clipping paths, so it read such a group unclipped: its art painted past the letters, and where the layers then differed too much from the page the file opened as its page. - `Reader::end_container` records each clipping group with no clipping path whose last object is a text slot (not the type a look draws) in `Structure::type_clips`, by the group's id. The group is still read as it is: the slot is filled later. - `clip_by_type` (crates/eps/src/import/ai/read.rs) moves the type to the front as the group's clipping path once its slot became one text object that is still the group's last object. A slot left empty or filled with several objects (type and the strokes the page draws around it) leaves the group as read, unclipped, as before. - The layers apply it after `fill_slots`; such type is never weighed as type the page doesn't draw (`MADE` is taken off), since the page shows it by what it clips. Envelopes of type apply it to their contents after `put_type`, so one opens live where its drawn art shows the clip (`WarpedType::type_clips`). Measured on 224 garment files we own (used locally, never committed): 14 renders change; 12 come closer to the file's own page (for example 15.7 % → 0.07 %, 26.5 % → 0.28 %, 58.5 % → 1.4 % of the page differing), one file has no PDF content to compare with, and in one the texture inside a word changes along the letters' edges (0.35 % → 0.56 %). Envelopes of type that open live stay at 185; no file opens another way and no note changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai.rs | 2 +- crates/eps/src/import/ai/envelope.rs | 4 + crates/eps/src/import/ai/read.rs | 41 ++++++++++ crates/eps/src/import/ai/read/containers.rs | 12 +++ crates/eps/src/import/ai/read/document.rs | 2 + crates/eps/src/import/ai/tests.rs | 66 +++++++++++++++- crates/eps/src/import/native/build.rs | 26 ++++++ crates/eps/src/import/tests_native.rs | 88 ++++++++++++++++++++- docs/file-format-parity.md | 5 +- docs/target-app-parity.md | 3 +- 10 files changed, 243 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/import/ai.rs b/crates/eps/src/import/ai.rs index 92847a96ef..4d6e8e4260 100644 --- a/crates/eps/src/import/ai.rs +++ b/crates/eps/src/import/ai.rs @@ -62,7 +62,7 @@ pub use read::{ palette, read_beside, read_in, symbols, variables, }; -pub(crate) use read::is_look_slot; +pub(crate) use read::{clip_by_type, is_look_slot}; pub(crate) use style::{MAX_LISTED, MAX_LISTED_NAME, warp_number}; #[cfg(test)] diff --git a/crates/eps/src/import/ai/envelope.rs b/crates/eps/src/import/ai/envelope.rs index 501b9f4b00..d598799364 100644 --- a/crates/eps/src/import/ai/envelope.rs +++ b/crates/eps/src/import/ai/envelope.rs @@ -692,6 +692,8 @@ pub struct WarpedType { pub(super) checks: usize, pub(super) spent: Spent, pub(super) page: Option<Rect>, + /// [`super::Structure::type_clips`]: type in an envelope's contents clips its clipping group too. + pub(super) type_clips: HashMap<NodeId, NodeId>, /// The envelopes of type that may open live in layers built without a page, by their place /// among them ([`Self::open_alone`]): none when `None`. pub(super) alone: Option<BTreeSet<usize>>, @@ -811,8 +813,10 @@ impl WarpedType { texts.insert(slot, text); hidden.push(id); } + let typed = |slot: NodeId| texts.get(&slot).map(|t| t.id); for n in before.iter_mut().chain(inner.iter_mut()) { put_type(n, &texts); + super::clip_by_type(n, &self.type_clips, &typed, &mut |_| ()); } // A warp that VectorCraft's own warp doesn't draw as its drawn art may still draw as the // grid the file saves for it: then it opens as a mesh envelope on that grid. diff --git a/crates/eps/src/import/ai/read.rs b/crates/eps/src/import/ai/read.rs index b045dd128f..ac9b9db163 100644 --- a/crates/eps/src/import/ai/read.rs +++ b/crates/eps/src/import/ai/read.rs @@ -193,6 +193,10 @@ pub struct Structure { pub unread_elsewhere: Vec<(NodeId, Rect)>, /// The names of text objects, by their slot's id. pub slot_names: HashMap<NodeId, String>, + /// The clipping groups whose type clips them, by the group's id: the text slot of that type, + /// the group's last object ([`Reader::end_container`]). Once the slot holds its type, the type + /// clips the group ([`clip_by_type`]). + pub type_clips: HashMap<NodeId, NodeId>, /// Where the drawn looks lay that objects read with their art style took the place of (the /// document's coordinates): the page draws Illustrator's rendering of those styles there. pub restyled: Vec<Rect>, @@ -660,6 +664,8 @@ struct Reader<'a> { obj_hidden: bool, /// The names of text objects, by their slot's id. slot_names: HashMap<NodeId, String>, + /// [`Structure::type_clips`]. + type_clips: HashMap<NodeId, NodeId>, /// [`Structure::xml_ids`]. xml_ids: HashMap<String, Option<NodeId>>, /// The bytes of the ids in `xml_ids`. @@ -730,6 +736,40 @@ pub(crate) fn is_look_slot(name: Option<&str>) -> bool { name == Some(document::LOOK_SLOT) } +/// Make the clipping groups of [`Structure::type_clips`] in `n` and its groups clip by their type, +/// once their slots are filled: where a group's slot became one text object (`typed` gives its id by +/// the slot's) that is still the group's last object, that text object moves to the front as its +/// clipping path, and `clipping` is called on it. Where the slot was left empty or became several +/// objects, the group stays as read, unclipped. How many groups clip. +pub(crate) fn clip_by_type( + n: &mut Node, + clips: &HashMap<NodeId, NodeId>, + typed: &impl Fn(NodeId) -> Option<NodeId>, + clipping: &mut impl FnMut(&mut Node), +) -> usize { + if clips.is_empty() || matches!(n.kind, NodeKind::Compound { .. }) { + return 0; + } + let mut made = 0; + if let Some(children) = n.children_mut() { + for c in children.iter_mut().filter(|c| c.children().is_some_and(|k| !k.is_empty())) { + made += clip_by_type(Arc::make_mut(c), clips, typed, clipping); + } + } + let Some(text) = clips.get(&n.id).and_then(|slot| typed(*slot)) else { return made }; + if let NodeKind::Group { children, clip } = &mut n.kind + && !*clip + && children.last().is_some_and(|last| last.id == text && matches!(last.kind, NodeKind::Text(_))) + && let Some(mut last) = children.pop() + { + clipping(Arc::make_mut(&mut last)); + children.insert(0, last); + *clip = true; + made += 1; + } + made +} + impl<'a> Reader<'a> { /// A reader of the editing data `data` as a whole, with the names its gradients and patterns /// get in the document and its art styles found first ([`swatch_names`]): the symbols defined @@ -851,6 +891,7 @@ impl<'a> Reader<'a> { done: false, obj_hidden: false, slot_names: HashMap::new(), + type_clips: HashMap::new(), xml_ids: HashMap::new(), xml_id_bytes: 0, art_size: None, diff --git a/crates/eps/src/import/ai/read/containers.rs b/crates/eps/src/import/ai/read/containers.rs index 9db1470093..fcc29c6f20 100644 --- a/crates/eps/src/import/ai/read/containers.rs +++ b/crates/eps/src/import/ai/read/containers.rs @@ -134,6 +134,15 @@ impl<'a> Reader<'a> { } return Ok(()); } + // A clipping group (`q` … `Q`) with no clipping path whose last object is type: that type is + // its clipping path, as Illustrator writes a clipping mask of type made from the text + // document (`/AI11Text`), which has no `W`. The slot is filled later ([`clip_by_type`]). + let type_clip = match kids.last() { + Some(last) if matches!(kind, Kind::Clip) && clips.is_empty() && !super::is_look_slot(last.name.as_deref()) => { + slot_of(last.name.as_deref()).map(|_| last.id) + } + _ => None, + }; // A compound path of clipping paths clips its clipping group. let clipping = matches!(kind, Kind::Compound) && !clips.is_empty(); self.group_ended = !matches!(kind, Kind::Compound); @@ -179,6 +188,9 @@ impl<'a> Reader<'a> { if clipping && let Some(f) = self.frames.last_mut() { f.clips.push(f.children.len()); } + if let Some(slot) = type_clip { + self.type_clips.insert(node.id, slot); + } if compound_members { self.compound_groups.insert(node.id); } diff --git a/crates/eps/src/import/ai/read/document.rs b/crates/eps/src/import/ai/read/document.rs index 258d7d584b..6833c03274 100644 --- a/crates/eps/src/import/ai/read/document.rs +++ b/crates/eps/src/import/ai/read/document.rs @@ -1380,6 +1380,7 @@ impl<'a> Reader<'a> { unread: self.unread, unread_elsewhere: self.unread_elsewhere, slot_names: self.slot_names, + type_clips: self.type_clips.clone(), restyled: self.restyled, placeholders: self.placeholders, placed_elsewhere: self.placed_elsewhere, @@ -1392,6 +1393,7 @@ impl<'a> Reader<'a> { spent: self.envelope_spent, page, alone: None, + type_clips: self.type_clips, }, styles_read, text_patterns, diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 68ba060352..e745657e3d 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -3741,6 +3741,70 @@ fn placed_files_are_linked_images_showing_their_preview() { assert!(read(stream(&layer("~\n")).as_bytes()).unwrap_err().contains("`~`")); } +/// Type made a clipping mask: a clipping group (`q` … `Q`) with no clipping path, whose last object +/// is a text object, is clipped by that type once its slot holds it, the type first as its +/// clipping path. Anything else stays as it was read. +#[test] +fn type_that_ends_a_clipping_group_without_a_clipping_path_clips_it() { + let text = |story: u32| format!("/AI11Text :\n0 /FreeUndo ,\n0 /FrameIndex ,\n{story} /StoryIndex ,\n;\n"); + let square = format!("{RED}{}f\n", rect_path(0.0, 0.0, 10.0, 10.0)); + let clipper = format!("{RED}{}h W n\n", rect_path(2.0, 2.0, 8.0, 8.0)); + let r = read_ok(&layer(&format!("q\n{square}{}Q\n", text(4)))); + let a = art(&r.doc); + let [group] = a.as_slice() else { panic!("{a:#?}") }; + let slot = group.children().and_then(|c| c.last()).map(|n| n.id).unwrap(); + assert!(matches!(group.kind, NodeKind::Group { clip: false, .. }), "read as it is, until the slot holds its type"); + assert_eq!(r.type_clips.get(&group.id), Some(&slot)); + assert_eq!(r.warped_type.type_clips, r.type_clips, "envelopes' contents are clipped by their type too"); + // Filled with one text object, the slot's type clips the group. + let typed = |doc: &Document, one: bool| { + let mut layer = (*doc.layers[0]).clone(); + let mut n = 0; + let put = |n: &mut Node| { + if let NodeKind::Group { children, .. } = &mut n.kind + && let Some(last) = children.last_mut() + && last.id == slot + { + let t = Node::new( + vectorcraft_doc::NodeId(9_000), + NodeKind::Text(Box::new(vectorcraft_doc::TextObject::point(kurbo::Point::ZERO, "M", Default::default()))), + ); + if one { + *last = Arc::new(t); + } else { + let mut stroke = t.clone(); + stroke.id = vectorcraft_doc::NodeId(9_001); + *last = Arc::new(t); + children.push(Arc::new(stroke)); + } + } + }; + layer.children_mut().unwrap().iter_mut().for_each(|c| put(Arc::make_mut(c))); + let clipped = clip_by_type(&mut layer, &r.type_clips, &|s| (s == slot).then_some(vectorcraft_doc::NodeId(9_000)), &mut |_| n += 1); + (layer, clipped, n) + }; + let (layer_one, clipped, called) = typed(&r.doc, true); + assert_eq!((clipped, called), (1, 1)); + let g = &layer_one.children().unwrap()[0]; + let NodeKind::Group { children, clip: true } = &g.kind else { panic!("{g:#?}") }; + assert!(matches!(children[0].kind, NodeKind::Text(_)) && matches!(children[1].kind, NodeKind::Path { .. }), "{children:#?}"); + // Several objects in its place (the type and strokes round it): the group stays unclipped. + let (layer_two, clipped, _) = typed(&r.doc, false); + assert_eq!(clipped, 0); + assert!(matches!(layer_two.children().unwrap()[0].kind, NodeKind::Group { clip: false, .. })); + // A clipping path in the group clips it, not the type; type that isn't last doesn't; nor does a + // group (`u` … `U`) or the type a look draws. + for body in [ + format!("q\n{square}{clipper}{}Q\n", text(4)), + format!("q\n{}{square}Q\n", text(4)), + format!("u\n{square}{}U\n", text(4)), + format!("q\n{square}/AI11Text :\n1 /FreeUndo ,\n0 /FrameIndex ,\n0 /StoryIndex ,\n;\nQ\n"), + ] { + let r = read_ok(&layer(&body)); + assert!(r.type_clips.is_empty(), "{body}: {:?}", r.type_clips); + } +} + #[test] fn text_objects_are_slots_named_after_their_story() { let words = "/AI11Text :\n0 /FreeUndo ,\n0 /FrameIndex ,\n3 /StoryIndex ,\n;\n%_/ArtDictionary :\n%_/XMLUID : (Title) ; (AI10_ArtUID) ,\n%_;\n"; @@ -8580,7 +8644,7 @@ fn warped_type_on_the_page_spends_what_is_left_of_the_budget() { let copy = |w: &super::envelope::WarpedLook| super::envelope::WarpedLook { slot: w.slot, look: w.look.clone(), left_out: None }; let page = Some(Rect::new(0.0, 60.0, 60.0, 100.0)); let settle = |w: &super::envelope::WarpedLook, spent| { - let warped = super::envelope::WarpedType { looks: vec![copy(w)], envelopes: vec![], checks: 1, spent, page, alone: None }; + let warped = super::envelope::WarpedType { looks: vec![copy(w)], checks: 1, spent, page, ..Default::default() }; warped.settle(&mut doc.clone(), Some, &Default::default(), &mut vec![]) }; let spent = || super::envelope::Spent { any: MAX_DIFFERENCE / 2.0, solid: MAX_SOLID_DIFFERENCE / 2.0 }; diff --git a/crates/eps/src/import/native/build.rs b/crates/eps/src/import/native/build.rs index 86d6976d89..5a2282f807 100644 --- a/crates/eps/src/import/native/build.rs +++ b/crates/eps/src/import/native/build.rs @@ -329,6 +329,7 @@ pub(super) fn build_weighing( unread, unread_elsewhere, slot_names, + type_clips, restyled, placeholders, placed_elsewhere, @@ -527,6 +528,7 @@ pub(super) fn build_weighing( let mut made = vec![]; let mut filled = std::collections::HashMap::new(); fill_slots(&mut doc, &mut layers, &mut content.into_iter(), &slot_names, &mut empty, &mut made, &mut vec![], &mut filled); + clip_by_type(&mut layers, &type_clips, &filled); doc.layers = layers; made.sort(); let threaded_frames: BTreeSet<NodeId> = @@ -2155,6 +2157,30 @@ fn unmark(nodes: &mut [Arc<Node>], shown: bool, prints: bool, found: &mut Vec<(N } } +/// Make the clipping groups in `layers` that their type clips ([`Structure::type_clips`]) clip by it, +/// where its slot became one text object (`filled`). The page shows that type by what it clips, so +/// it is never weighed as type the page doesn't draw ([`prune_unseen`]). +fn clip_by_type( + layers: &mut [Arc<Node>], + type_clips: &std::collections::HashMap<NodeId, NodeId>, + filled: &std::collections::HashMap<NodeId, Filled>, +) { + let one = |slot: NodeId| { + filled.get(&slot).and_then(|f| match f.objects.as_slice() { + [id] => Some(*id), + _ => None, + }) + }; + let mut seen = |n: &mut Node| { + if let Some(name) = n.name.as_deref().and_then(|m| m.strip_prefix(MADE)) { + n.name = (!name.is_empty()).then(|| name.to_string()); + } + }; + for l in layers { + ai::clip_by_type(Arc::make_mut(l), type_clips, &one, &mut seen); + } +} + /// Take object `id` out of `nodes` (`hide`: leave it, hidden); whether it was there. fn take_out(nodes: &mut Vec<Arc<Node>>, id: NodeId, hide: bool) -> bool { if let Some(i) = nodes.iter().position(|n| n.id == id) { diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index dbac845dad..451e273816 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -5887,12 +5887,18 @@ fn type_envelope_on(keys: &str, shape: &str, drawn: &str, after: &str) -> String /// [`type_envelope_on`] around the type of story `story`. fn type_envelope_on_story(story: u32, keys: &str, shape: &str, drawn: &str, after: &str) -> String { + type_envelope_holding(keys, shape, &format!("{}{after}", text_object(story)), drawn) +} + +/// [`type_envelope_on`] whose contents are `contents` (on plain lines, written on `%_` ones), which +/// hold its text objects. +fn type_envelope_holding(keys: &str, shape: &str, contents: &str, drawn: &str) -> String { let hidden = |s: &str| -> String { s.lines().map(|l| format!("%_{l}\n")).collect() }; format!( "{}{}%_X=\n{}%_X+\n%_ (AIDeformArtKey) ,\n%_1 /Int (AIDeformStyle) ,\n%_;\n%_\n%_9 () XW\nu\n{drawn}U\n9 () XW\n(Adobe Deform Plugin) 1 0 0 XP\n", hidden(&format!("u\n{shape}U\n")), hidden(&format!("/ArtDictionary :\n{keys}")), - hidden(&format!("u\n{}{after}U\n9 () XW\n", text_object(story))), + hidden(&format!("u\n{contents}U\n9 () XW\n")), ) } @@ -6556,6 +6562,86 @@ fn a_warp_of_type_opens_as_a_mesh_on_its_saved_grid_and_keeps_its_shape_when_its } } +/// In the layers, type from the text document made a clipping mask (a clipping group with no +/// clipping path, the type last) clips the group's art as the page draws it: the type comes in as +/// the group's clipping path, editable, and the art doesn't paint past it. +#[test] +fn type_made_a_clipping_mask_clips_its_group_in_the_layers() { + use vectorcraft_doc::live::{EnvelopeKind, EnvelopeOptions, envelope_content_bounds}; + let Some(family) = installed_family() else { return }; + let doc = type_envelope_text(&family, None); + // The page: the type's glyphs in the yellow of the square they clip, which covers the page, and + // drawn through a flat mesh over their box, which leaves them where they are. + let mut yellow = made_envelope_type(&type_envelope_text(&family, Some("/0 << /0 2 /1 [ 1.0 0.0 0.0 1.0 0.0 ] >>"))); + yellow.visible = true; + let content = vec![std::sync::Arc::new(yellow)]; + let g = envelope_content_bounds(&content).unwrap(); + let points = vec![kurbo::Point::new(g.x0, g.y0), kurbo::Point::new(g.x1, g.y0), kurbo::Point::new(g.x0, g.y1), kurbo::Point::new(g.x1, g.y1)]; + let kind = Box::new(EnvelopeKind::Mesh { rows: 1, cols: 1, points, handles: vec![[kurbo::Vec2::ZERO; 4]; 4] }); + let options = EnvelopeOptions::NEW; + let flat = Node::new( + vectorcraft_doc::NodeId(1_000_000), + NodeKind::Envelope { content, kind, fidelity: 50.0, editing: false, options, frame: Box::default() }, + ); + let (_, page) = drawn_envelope(&flat); + let clipped = format!("q\n0 0 1 0 k\n0 0 m\n100 0 L\n100 100 L\n0 100 L\nf\n{}Q\n", text_object(0)); + let art = native_with_text(&layer("Art", true, &clipped), &doc); + let r = import(&eps(&page, &art)).unwrap(); + // The layers are used, none of their art replaced with the page's (the note on how the type + // differs from the page is about the edges of its glyphs). + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + assert!(!r.warnings.iter().any(|w| w.contains("came in as its art") || w.contains("weren't read")), "{:?}", r.warnings); + let children = r.document.layers[0].children().unwrap(); + let [group] = children.as_slice() else { panic!("{children:#?}") }; + let NodeKind::Group { children, clip: true } = &group.kind else { panic!("not clipped: {group:#?}") }; + let (NodeKind::Text(t), NodeKind::Path { .. }) = (&children[0].kind, &children[1].kind) else { panic!("{children:#?}") }; + assert_eq!(t.plain_text(), "FLUX"); +} + +/// Type made a clipping mask in an envelope's contents (a clipping group with no clipping path, the +/// type last) clips the art under it there, as the drawn art shows: the envelope opens live, its +/// type editable as the group's clipping path. The art it clips covers the type's glyphs and stays +/// inside their box, so the envelope maps from that box however the art past the type would count. +#[test] +fn an_envelope_whose_type_clips_its_contents_opens_live_with_the_type_clipping_them() { + let Some(family) = installed_family() else { return }; + let doc = type_envelope_text(&family, None); + // What it draws: the type in the yellow of the square it clips, which covers it. + let yellow = made_envelope_type(&type_envelope_text(&family, Some("/0 << /0 2 /1 [ 1.0 0.0 0.0 1.0 0.0 ] >>"))); + let shaped = |text: Node| { + let mut text = text; + text.visible = true; + let options = vectorcraft_doc::live::EnvelopeOptions::NEW; + let content = vec![std::sync::Arc::new(text)]; + Node::new( + vectorcraft_doc::NodeId(1_000_000), + NodeKind::Envelope { content, kind: Box::new(rising_kind()), fidelity: 50.0, editing: false, options, frame: Box::default() }, + ) + }; + let glyphs = vectorcraft_doc::live::envelope_content_bounds(&[std::sync::Arc::new(yellow.clone())]).unwrap(); + let (drawn, page) = drawn_envelope(&shaped(yellow)); + // A yellow square over the glyphs' box, just inside it. + let (x0, y0) = to_art(kurbo::Point::new(glyphs.x0 + 0.01, glyphs.y1 - 0.01)); + let (x1, y1) = to_art(kurbo::Point::new(glyphs.x1 - 0.01, glyphs.y0 + 0.01)); + let contents = format!("q\n0 0 1 0 k\n{x0} {y0} m\n{x1} {y0} L\n{x1} {y1} L\n{x0} {y1} L\nf\n{}Q\n", text_object(0)); + let envelope = type_envelope_holding(&arc_keys(0.3), &rising_grid(), &contents, &drawn); + let art = native_with_text(&layer("Art", true, &format!("{}\n{envelope}", square(10, 10))), &doc); + let r = import(&eps(&format!("{}\n{page}", page_square(10, 10)), &art)).unwrap(); + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + assert!(super::tests::program_warnings(&r.warnings).is_empty(), "{:?}", r.warnings); + let mut live = vec![]; + r.document.walk(|n| { + if let NodeKind::Envelope { content, .. } = &n.kind { + live.push(content.clone()); + } + }); + let [content] = live.as_slice() else { panic!("{:?}", r.warnings) }; + let [group] = content.as_slice() else { panic!("{content:#?}") }; + let NodeKind::Group { children, clip: true } = &group.kind else { panic!("not clipped: {group:#?}") }; + let (NodeKind::Text(t), NodeKind::Path { .. }) = (&children[0].kind, &children[1].kind) else { panic!("{children:#?}") }; + assert_eq!(t.plain_text(), "FLUX"); +} + /// A warp of stroked type with Distort Appearance whose drawn art maps the type's bounds with its /// strokes onto the grid the file saves (not its glyphs' bounds alone) opens live as a mesh envelope /// mapping from that box (#3179). The drawn art strokes the bent outlines at the stroke's own weight, diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 0cc9985a9c..76c2125ae7 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (`.ai` and EPS import: type from the text document that a file makes a clipping mask clips its clipping group, #8106; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -288,7 +288,7 @@ private editing data. VectorCraft: ### Illustrator's private editing data -The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners, a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. +The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789; type from the text document that a clipping group ends with, in a clipping group with no clipping path (`q` … `Q` with no `W`), is that group's clipping path once its text object holds that type alone, as a clipping mask of type is written; where it holds more, or nothing, the group comes in unclipped as before; VectorCraft's own reader rule, learned from saved files), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners, a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. A run of type in the editing data whose baseline direction is 1 opens with Standard Vertical Roman Alignment (https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) on, which is VectorCraft's own mapping: its half-width characters stand upright in vertical type, and horizontal type keeps the mark with no change to its layout. A run whose baseline direction is 2 or 3 (Tate-chu-yoko), or that names none in the run, its character style or the document's defaults, opens with it off. The scripting reference lists 1, 2 and 3 as the Standard, vertical rotated and Tate-chu-yoko baseline directions (https://web.archive.org/web/20170621180804/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20VBScript%20Reference.pdf, page 256). A Scatter brush in the editing data whose last 15 numbers start with 1 comes into the Brushes panel in Tints. Each brush art section is read without its frame: an unnamed, unpainted rectangle with no settings of its own at the art's bounds (within 1/1000 pt), closed, or open with its first corner again at the end. A wider frame stays in the art, and an art group with a state or look of its own (hidden, locked, isolated, knockout, an opacity, a blend mode, a name, a mask, a note or an appearance) stays a group. @@ -361,6 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8106): type from the text document made a clipping mask clips the art of its clipping group. Illustrator writes such a group as a clipping group (`q` … `Q`) with no clipping path (`W`) whose last object is the text object; the reader now keeps that group, and once the text object holds its type alone, the type moves to the front as the group's clipping path, in the layers and in an envelope's contents. Before, the group came in unclipped, its art painting outside the letters. A slot left empty or filled with several objects (type and strokes the page draws round it) leaves the group unclipped as before. Such type is never weighed as type the page doesn't draw. VectorCraft's own reader rule, learned from saved files (tests `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`, `type_made_a_clipping_mask_clips_its_group_in_the_layers` and `an_envelope_whose_type_clips_its_contents_opens_live_with_the_type_clipping_them` in `crates/eps/src/import/tests_native.rs`). | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f393c7b8d8..56445290ce 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8106: `.ai` and EPS import: type made a clipping mask clips the art of its clipping group; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8106): type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art once its text object holds that type alone, in the layers and in envelopes' contents, instead of the art painting outside the letters; scores and estimates unchanged (details in [file-format-parity.md](file-format-parity.md); tests `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`, `type_made_a_clipping_mask_clips_its_group_in_the_layers` and `an_envelope_whose_type_clips_its_contents_opens_live_with_the_type_clipping_them` in `crates/eps/src/import/tests_native.rs`). | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | From 88c2c3558f5192d867495a19223ac6f833bcd814 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 16:48:54 +0000 Subject: [PATCH 081/247] docs: note type clipping masks (#8106) in the File formats rows and evidence The area rows and the evidence list name the change and its tests, as AGENTS.md asks of a change that lands. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 56445290ce..57bc5fad81 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -535,7 +535,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | `.ai` and EPS import: type made a clipping mask clips the art of its clipping group (#8106; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -585,6 +585,8 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **`.ai` type clipping masks (#8106):** `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs` covers a clipping group with no clipping path whose last object is a text object: once its slot holds one text object, the type comes first as the group's clipping path; a slot left empty or filled with several objects leaves the group as read, unclipped. `type_made_a_clipping_mask_clips_its_group_in_the_layers` and `an_envelope_whose_type_clips_its_contents_opens_live_with_the_type_clipping_them` in `crates/eps/src/import/tests_native.rs` cover the layers (the type stays editable and the art doesn't paint past it) and an envelope's contents (the envelope opens live). Synthetic files written in the tests; no fonts or fixtures added. Scores and hours unchanged. + - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. From 90ba03faa9b26df924b64227cf86282f95f13650 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:10:34 +0000 Subject: [PATCH 082/247] docs: the first File formats row names the saved editing copy's limits (#868) It still said Illustrator's editing data isn't written, while the other two File formats rows give what a saved `.ai`'s editing copy leaves out. It now has their words. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 57bc5fad81..233ce7b6f8 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,7 +270,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents (#8106, `type_that_ends_a_clipping_group_without_a_clipping_path_clips_it` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | From c7ab67d6c53097ce98e5b16a02f15a9a34403e0e Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:45:36 +0000 Subject: [PATCH 083/247] docs: roadmap M4 Files row notes #8106 The status line, the M4 Files row and the revision history name the change, as AGENTS.md asks of a change that lands. Estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index bfaa10db30..cd62063ad3 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M4: `.ai` and EPS import: type made a clipping mask clips the art of its clipping group, #8106; scores and estimates unchanged; previously: M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: type made a clipping mask clips its clipping group (#8106; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | M4: `.ai` and EPS import (#8106): type from the text document made a clipping mask (a clipping group with no clipping path, the text object last) clips the group's art, in the layers and in envelopes' contents; details in [file-format-parity.md](file-format-parity.md). Scores and estimates unchanged. | | 2026-11-16 | minor | M1: rows or the selected-art square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | From a34140bd6a2c25ab57708cef1813ce76b6b1511c Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 13:08:22 +0000 Subject: [PATCH 084/247] .ai import: clipping paths grouped in a compound path are its subpaths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A compound clipping path can hold its clipping paths in groups (`*u u <path> W n … U *U`, possibly nested in other groups). The reader passed a group of nothing but clipping paths up only to a clipping group (`q` … `Q`). In a compound path it read each such group as a clipping group of its own: several clipping paths in one group nested one clipping group per path (their intersection), so the compound path held clipping groups instead of subpaths and clipped nothing, and past the document's depth limit (some files hold hundreds of them) the whole file opened from its PDF part ("its clipping masks are nested too deeply"). `Reader::end_container` now also passes such a group's clipping paths up when the group is in a compound path, directly or through other groups (`Reader::in_compound`). The compound path takes them as subpaths, as it already takes the other paths grouped in it (`ungrouped`), and as a compound path of clipping paths it is one clipping path, their union, which clips its clipping group. A group of clipping paths anywhere else is read as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai/read/containers.rs | 16 ++++++++- crates/eps/src/import/ai/tests.rs | 36 +++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/ai/read/containers.rs b/crates/eps/src/import/ai/read/containers.rs index 9db1470093..224b561281 100644 --- a/crates/eps/src/import/ai/read/containers.rs +++ b/crates/eps/src/import/ai/read/containers.rs @@ -120,11 +120,13 @@ impl<'a> Reader<'a> { } // A group holding only clipping paths (`q … u <path> W n U … Q`) doesn't clip on its own: `u`/`U` don't save // the graphics state as `q`/`Q` do, so its paths clip the clipping group around it, as the file's PDF part draws it. + // In a compound path (`*u u <path> W n … U *U`, possibly nested in other groups) they are the compound + // path's subpaths, as its other grouped paths are: the compound clipping path, their union. if matches!(kind, Kind::Group) && unread.is_empty() && !clips.is_empty() && clips.len() == kids.len() - && matches!(self.frames.last(), Some(Frame { kind: Kind::Clip, .. })) + && (matches!(self.frames.last(), Some(Frame { kind: Kind::Clip, .. })) || self.in_compound()) { for kid in kids { if let Some(parent) = self.frames.last_mut() { @@ -197,6 +199,18 @@ impl<'a> Reader<'a> { Ok(()) } + /// Is the innermost open frame a compound path (`*u`), or a group in one with only groups between them? + fn in_compound(&self) -> bool { + for f in self.frames.iter().rev() { + match f.kind { + Kind::Group => {} + Kind::Compound => return true, + _ => return false, + } + } + false + } + /// The compound path of `kids`, painted and made transparent as its subpaths say. fn compound(&mut self, mut kids: Vec<Node>, gs: &GState) -> Option<Node> { // The compound path's paint is its last path's (a gradient's instance wraps only diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 68ba060352..1b8a064437 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -1549,6 +1549,42 @@ fn a_clipping_path_alone_in_a_group_clips_its_clipping_group() { assert_eq!(fill(&children[1]).color(), Some(Color::rgb(1.0, 0.0, 0.0))); } +/// Clipping paths grouped in a compound path (`*u u <path> W n … U *U`, possibly nested in other groups) are +/// the compound path's subpaths, as its other grouped paths are: the compound clipping path, their union, clips its +/// clipping group, however many there are and wherever in the group it is written. +#[test] +fn clipping_paths_grouped_in_a_compound_path_are_its_subpaths() { + let square = rect_path(0.0, 0.0, 80.0, 80.0); + let (a, b, c) = (rect_path(0.0, 0.0, 10.0, 10.0), rect_path(30.0, 0.0, 40.0, 10.0), rect_path(60.0, 0.0, 70.0, 10.0)); + let clip = |p: &str| format!("{p}h\nW\nn\n"); + let bodies = [ + // One group of them, after the art. + format!("0 Ae\nq\n{RED}{square}f\n*u\n0 Ae\nu\n{}{}{}U\n*U\nQ\n", clip(&a), clip(&b), clip(&c)), + // Groups in a group, and one path straight in the compound path, before the art. + format!("0 Ae\nq\n*u\n0 Ae\nu\n0 Ae\nu\n{}{}U\n0 Ae\nu\n{}U\nU\n*U\n{RED}{square}f\nQ\n", clip(&a), clip(&b), clip(&c)), + format!("0 Ae\nq\n*u\n0 Ae\nu\n{}{}U\n{}*U\n{RED}{square}f\nQ\n", clip(&a), clip(&b), clip(&c)), + ]; + for body in &bodies { + let doc = read_ok(&layer(body)).doc; + let NodeKind::Group { children, clip: true } = &art(&doc)[0].kind else { panic!("{body}: {:?}", art(&doc)[0].kind) }; + assert_eq!(children.len(), 2, "{body}: {children:?}"); + let NodeKind::Compound { children: subpaths, .. } = &children[0].kind else { panic!("{body}: {:?}", children[0].kind) }; + assert_eq!(subpaths.len(), 3, "{body}: {subpaths:?}"); + assert!(subpaths.iter().all(|p| matches!(p.kind, NodeKind::Path { clipping: true, .. })), "{body}: {subpaths:?}"); + assert_eq!(fill(&children[1]).color(), Some(Color::rgb(1.0, 0.0, 0.0)), "{body}"); + } + // Hundreds of them, one union: not clipping groups nested past the document's depth limit. + let many = format!("0 Ae\nq\n{RED}{square}f\n*u\n0 Ae\nu\n{}U\n*U\nQ\n", clip(&a).repeat(300)); + let doc = read_ok(&layer(&many)).doc; + let NodeKind::Group { children, clip: true } = &art(&doc)[0].kind else { panic!("{:?}", art(&doc)[0].kind) }; + let NodeKind::Compound { children: subpaths, .. } = &children[0].kind else { panic!("{:?}", children[0].kind) }; + assert_eq!(subpaths.len(), 300); + // A group of clipping paths outside a compound path or a clipping group is read as before: a clipping group. + let alone = format!("0 Ae\nu\n{}{}U\n{RED}{square}f\n", clip(&a), clip(&b)); + let doc = read_ok(&layer(&alone)).doc; + assert!(matches!(art(&doc)[0].kind, NodeKind::Group { clip: true, .. }), "{:?}", art(&doc)[0].kind); +} + /// #1410: a compound path shows its last path's paint, and paths grouped in it stay its paths. #[test] fn compound_path_takes_its_last_paths_paint() { From 6d3c56ccb1671e34674fb213f261fae4ba5c93c9 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 13:08:22 +0000 Subject: [PATCH 085/247] docs: clipping paths grouped in a compound path (.ai import) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/file-format-parity.md | 5 +++-- docs/target-app-parity.md | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 0cc9985a9c..2817de001e 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group instead of reading as nested clipping groups that clip nothing or stop the editing data from being read; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -288,7 +288,7 @@ private editing data. VectorCraft: ### Illustrator's private editing data -The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners, a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. +The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip, its clipping paths grouped in it, at any depth, included; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners, a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. A run of type in the editing data whose baseline direction is 1 opens with Standard Vertical Roman Alignment (https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) on, which is VectorCraft's own mapping: its half-width characters stand upright in vertical type, and horizontal type keeps the mark with no change to its layout. A run whose baseline direction is 2 or 3 (Tate-chu-yoko), or that names none in the run, its character style or the document's defaults, opens with it off. The scripting reference lists 1, 2 and 3 as the Standard, vertical rotated and Tate-chu-yoko baseline directions (https://web.archive.org/web/20170621180804/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20VBScript%20Reference.pdf, page 256). A Scatter brush in the editing data whose last 15 numbers start with 1 comes into the Brushes panel in Tints. Each brush art section is read without its frame: an unnamed, unpainted rectangle with no settings of its own at the art's bounds (within 1/1000 pt), closed, or open with its first corner again at the end. A wider frame stays in the art, and an art group with a state or look of its own (hidden, locked, isolated, knockout, an opacity, a blend mode, a name, a mask, a note or an appearance) stays a group. @@ -361,6 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8128): clipping paths grouped in a compound path (`*u u <path> W n … U *U`, possibly nested in other groups) are the compound path's subpaths, as its other grouped paths are (#1410), so the compound clipping path, their union, clips its clipping group. Before, each such group came in as a clipping group of its own, its paths nested one level each as an intersection: the compound path clipped nothing, and with dozens of them the file's layers weren't read ("its clipping masks are nested too deeply") and it opened as its PDF part. A group of clipping paths elsewhere is read as before (test `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`). | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f393c7b8d8..680fc04914 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8128): clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups that clip nothing or, past the document's depth limit, stop the layers from being read; scores and estimates unchanged (details in [file-format-parity.md](file-format-parity.md); test `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`). | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | From 6d920ea6ec23cc990a2037ec5c95de578120060d Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 16:48:54 +0000 Subject: [PATCH 086/247] docs: note grouped clipping paths in a compound path (#8128) in the File formats rows and evidence The area rows and the evidence list name the change and its test, as AGENTS.md asks of a change that lands. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 680fc04914..ed236a0f57 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -535,7 +535,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group (#8128; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -585,6 +585,8 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **`.ai` clipping paths grouped in a compound path (#8128):** `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs` covers clipping paths grouped in a compound path (`*u u <path> W n … U *U`, also nested in other groups): they are the compound path's subpaths, and the compound clipping path, their union, clips its clipping group however many there are and wherever in the group it is written. Synthetic files written in the test; no fixtures added. Scores and hours unchanged. + - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. From 7f30dab913d19c94f706273190c57694c90966a0 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:10:34 +0000 Subject: [PATCH 087/247] docs: the first File formats row names the saved editing copy's limits (#868) It still said Illustrator's editing data isn't written, while the other two File formats rows give what a saved `.ai`'s editing copy leaves out. It now has their words. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ed236a0f57..5b3b4132a9 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,7 +270,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups (#8128, `clipping_paths_grouped_in_a_compound_path_are_its_subpaths` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | From ae08b3f3d027f48533bd05fedfb66bd81e621a5f Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:45:37 +0000 Subject: [PATCH 088/247] docs: roadmap M4 Files row notes #8128 The status line, the M4 Files row and the revision history name the change, as AGENTS.md asks of a change that lands. Estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index bfaa10db30..8be8a14b73 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | M4: `.ai` and EPS import (#8128): clipping paths grouped in a compound path are the compound path's subpaths, so the compound clipping path clips its clipping group instead of coming in as nested clipping groups; details in [file-format-parity.md](file-format-parity.md). Scores and estimates unchanged. | | 2026-11-16 | minor | M1: rows or the selected-art square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | From 46745dbf8547680f9b4a5ceaeca9e5d089073330 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 14:57:01 +0000 Subject: [PATCH 089/247] .ai import: an envelope of type that paints nothing, as its drawn art, opens live An envelope of type whose type has no fill and no stroke, its drawn art unpainted too, inks no pixel either way. The drawn-art check took that as a difference and kept the drawn art, with its type hidden. `alike_within` now first asks whether either side has any paint at all (`paints`). When neither has any, they draw alike (nothing) and add nothing to the page check's share. Art that paints, however faintly, is compared as before. The shapes aren't compared when nothing paints: the first way tried (the envelope as saved) is taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai/envelope.rs | 70 +++++++++++++++++++++++++-- crates/eps/src/import/tests_native.rs | 26 ++++++++++ 2 files changed, 92 insertions(+), 4 deletions(-) diff --git a/crates/eps/src/import/ai/envelope.rs b/crates/eps/src/import/ai/envelope.rs index 501b9f4b00..264471eb15 100644 --- a/crates/eps/src/import/ai/envelope.rs +++ b/crates/eps/src/import/ai/envelope.rs @@ -980,10 +980,11 @@ pub(super) fn warps(appearance: &Appearance) -> bool { appearance.effects.iter().any(warp) || appearance.items.iter().any(|i| i.visible() && i.effects().iter().any(warp)) } -/// Do `live` and `drawn` draw alike: few of the pixels either inks differ, and fewer still where a -/// whole patch differs; and, on `page` (when the file has one), do they differ little enough that -/// with the differences in `spent` the page check still takes the layers' art (it is added to -/// `spent` when they do)? Both are drawn on `layer`, a layer id no other node has. +/// Do `live` and `drawn` draw alike? Either neither has any paint ([`paints`]), or few of the +/// pixels either inks differ and fewer still where a whole patch differs, and, on `page` (when the +/// file has one), they differ little enough that with the differences in `spent` the page check +/// still takes the layers' art (it is added to `spent` when they do). Both are drawn on `layer`, a +/// layer id no other node has. pub(super) fn drawn_alike(live: &Node, drawn: &Node, layer: NodeId, shared: &Shared<'_>, page: Option<Rect>, spent: &mut Spent) -> bool { alike_within(live, drawn, live.visual_bounds(), layer, shared, page, spent) } @@ -997,6 +998,12 @@ pub(super) fn warped_alike(live: &Node, drawn: &Node, layer: NodeId, shared: &Sh /// [`drawn_alike`], with `live` measured as `reach`. fn alike_within(live: &Node, drawn: &Node, reach: Option<Rect>, layer: NodeId, shared: &Shared<'_>, page: Option<Rect>, spent: &mut Spent) -> bool { + // Neither has any paint (type with no fill and no stroke, its drawn art the outlines unpainted): + // both draw nothing, so they draw alike and add nothing to what the page check sees. Their + // shapes aren't compared. Art that paints, however faintly, is compared as before. + if !paints(live, 0) && !paints(drawn, 0) { + return true; + } let (Some(a), Some(b)) = (reach, drawn.visual_bounds()) else { return false }; let region = a.union(b).inflate(2.0, 2.0); if !(region.is_finite() && region.width() > 0.0 && region.height() > 0.0) || region.width().max(region.height()) > 1e6 { @@ -1029,6 +1036,26 @@ fn alike_within(live: &Node, drawn: &Node, reach: Option<Rect>, layer: NodeId, s true } +/// Does `n`, shown, paint anything: a fill or stroke of its own or of its type with a paint, an +/// effect, or an object of another kind than a path, type or container (an image, a mesh, a symbol +/// instance…)? Hidden objects paint nothing. Past `depth` 64 it is taken to paint. +fn paints(n: &Node, depth: usize) -> bool { + if depth > 64 { + return true; + } + if !n.visible { + return false; + } + if n.appearance.items.iter().any(|i| i.visible() && !i.paint().is_none()) || n.appearance.effects.iter().any(|e| e.visible) { + return true; + } + match &n.kind { + NodeKind::Path { .. } => false, + NodeKind::Text(t) => t.runs.iter().any(|r| !r.style.fill.is_none() || !r.style.stroke.is_none()), + _ => n.children().is_none_or(|c| c.iter().any(|c| paints(c, depth + 1))), + } +} + #[cfg(test)] mod tests { use super::*; @@ -1056,6 +1083,41 @@ mod tests { } } + /// A 40 × 40 square at (10, 10) filled black at `opacity`, or with no fill when `None`. + fn square_node(id: u64, opacity: Option<f32>) -> Node { + let mut bp = BezPath::new(); + bp.move_to((10.0, 10.0)); + bp.line_to((50.0, 10.0)); + bp.line_to((50.0, 50.0)); + bp.line_to((10.0, 50.0)); + bp.close_path(); + let mut n = Node::new( + NodeId(id), + NodeKind::Path { path: PathData::from_bezpath(&bp), rule: Default::default(), live: None, clipping: false, guide: false }, + ); + let mut appearance = (*n.appearance).clone(); + appearance.items.clear(); + if let Some(o) = opacity { + appearance.items.push(AppearanceItem::Fill(vectorcraft_doc::FillLayer::new(Paint::solid(Color::BLACK)))); + n.opacity = o; + } + n.appearance = appearance.into(); + n + } + + /// Two objects with no paint draw alike; two that paint too faintly to ink a pixel (an alpha of + /// 8 or less) aren't taken as alike, nor is one with paint against one without. + #[test] + fn art_with_no_paint_draws_alike_and_faint_art_is_still_compared() { + let shared = Shared { patterns: &[], images: &BTreeMap::new() }; + let alike = |a: &Node, b: &Node| drawn_alike(a, b, NodeId(999), &shared, None, &mut Spent::default()); + let (none, other_none) = (square_node(1, None), square_node(2, None)); + assert!(alike(&none, &other_none)); + let (faint, other_faint) = (square_node(1, Some(0.02)), square_node(2, Some(0.02))); + assert!(!alike(&faint, &other_faint)); + assert!(!alike(&none, &square_node(2, Some(1.0)))); + } + /// "AVA" at 40 points, at (10, 60). fn type_node(id: u64, style: CharStyle) -> Node { Node::new(NodeId(id), NodeKind::Text(Box::new(TextObject::point(Point::new(10.0, 60.0), "AVA", CharStyle { size: 40.0, ..style })))) diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index dbac845dad..999bacf2f4 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -5998,6 +5998,32 @@ fn an_envelope_of_type_that_draws_as_its_drawn_art_opens_live() { assert!(super::tests::program_warnings(&r.warnings).is_empty(), "{:?}", r.warnings); } +/// An envelope of type with no fill and no stroke, its drawn art the bent outlines unpainted, opens +/// live: neither draws a pixel, so they draw alike, and the type stays editable. +#[test] +fn an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live() { + let Some(family) = installed_family() else { return }; + // The outlines come from the type filled; the file's type has its fill turned off (`/56 false`). + let filled = type_envelope_text(&family, None); + let mut doc = text_document(&[("FLUX\r", 0, (8170.0, 8180.0), (0.0, 0.0), 0.0)]) + .replace("(Helvetica)", &format!("({family})")) + .replace("/53 <<", "/56 false /53 <<"); + while ascii85(doc.as_bytes()).len() % 60 == 1 { + doc.push('\n'); + } + assert_eq!(text_fill(&made_envelope_type(&doc)), None); + let (drawn, _) = drawn_envelope(&arc_envelope(&made_envelope_type(&filled), 30.0)); + assert!(drawn.contains("f\n"), "{drawn}"); + let unpainted = drawn.replace("f\n", "n\n"); + let art = native_with_text(&layer("Art", true, &format!("{}\n{}", square(10, 10), type_envelope(&arc_keys(0.3), &unpainted))), &doc); + let r = import(&eps(&page_square(10, 10), &art)).unwrap(); + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + let (envelopes, loose) = envelopes_and_type(&r.document); + assert_eq!(envelopes, [vec!["FLUX".to_string()]], "{:?}", r.warnings); + assert!(loose.is_empty(), "{loose:?}"); + assert!(super::tests::program_warnings(&r.warnings).is_empty(), "{:?}", r.warnings); +} + /// An envelope of type whose live envelope draws apart from its drawn art (the file's art bends the /// other way) keeps its drawn art and its type, hidden, with a note. #[test] From b08135cb6683657bff50a7fbee0de576a20c6b34 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 14:57:01 +0000 Subject: [PATCH 090/247] docs: an envelope of type that paints nothing opens live (.ai import) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/file-format-parity.md | 3 ++- docs/target-app-parity.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 0cc9985a9c..30bd1f5c7f 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8154: `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -361,6 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8154): an envelope of type whose type has no fill and no stroke, its drawn art the bent outlines unpainted, opens live instead of keeping its drawn art and its type, hidden: neither inks a pixel, and the drawn-art check took that as a difference. Now, where neither the live envelope nor its drawn art has any paint (no fill or stroke with a paint, no effect, nothing else that draws), they draw alike and add nothing to what the page check sees; their shapes aren't compared then, so the envelope as saved is taken. Art that paints, however faintly, is compared as before. In 200 garment files we own (used locally, never committed), envelopes of type that open live go from 108 to 110, in 2 files, none fewer; no render changes and no file opens another way; in another 224 garment files, nothing changes. Tests `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs` and `art_with_no_paint_draws_alike_and_faint_art_is_still_compared` in `crates/eps/src/import/ai/envelope.rs`. Scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f393c7b8d8..0f9eb817be 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8154: `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8154): an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable; scores and estimates unchanged (details in [file-format-parity.md](file-format-parity.md)). | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | From 33942295e5f9c582352efd3a19f65565fc705023 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 16:48:54 +0000 Subject: [PATCH 091/247] docs: note envelopes of type that paint nothing (#8154) in the File formats rows and evidence The area rows and the evidence list name the change and its tests, as AGENTS.md asks of a change that lands. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0f9eb817be..bbced2d5c8 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -535,7 +535,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live (#8154; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -585,6 +585,8 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **`.ai` envelopes of type that paint nothing (#8154):** `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs` covers an envelope of type with no fill and no stroke whose drawn art is unpainted: neither draws a pixel, so they draw alike, and the envelope opens live with its type editable. `art_with_no_paint_draws_alike_and_faint_art_is_still_compared` in `crates/eps/src/import/ai/envelope.rs` checks that two objects with no paint draw alike, while art that paints too faintly to ink a pixel, or paint against no paint, is still compared. Synthetic files written in the tests; no fixtures added. Scores and hours unchanged. + - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. From 00598bfa2a353169b94b8042f56adeb972f58376 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:10:34 +0000 Subject: [PATCH 092/247] docs: the first File formats row names the saved editing copy's limits (#868) It still said Illustrator's editing data isn't written, while the other two File formats rows give what a saved `.ai`'s editing copy leaves out. It now has their words. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index bbced2d5c8..b01611a9b2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,7 +270,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable (#8154, `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | From 1f974b5cd965f979b6b4dab528a03b5a0cfe5e64 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:10:34 +0000 Subject: [PATCH 093/247] docs: the evidence for envelopes of type that paint nothing (#8154) states its limit When nothing paints the shapes aren't compared, so a fill added to the type later may bend it unlike the unpainted outlines the file saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b01611a9b2..820bab910b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -585,7 +585,7 @@ since 2026-10-01. ## Evidence: what ships today, by area -- **`.ai` envelopes of type that paint nothing (#8154):** `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs` covers an envelope of type with no fill and no stroke whose drawn art is unpainted: neither draws a pixel, so they draw alike, and the envelope opens live with its type editable. `art_with_no_paint_draws_alike_and_faint_art_is_still_compared` in `crates/eps/src/import/ai/envelope.rs` checks that two objects with no paint draw alike, while art that paints too faintly to ink a pixel, or paint against no paint, is still compared. Synthetic files written in the tests; no fixtures added. Scores and hours unchanged. +- **`.ai` envelopes of type that paint nothing (#8154):** `an_envelope_of_unpainted_type_whose_drawn_art_paints_nothing_opens_live` in `crates/eps/src/import/tests_native.rs` covers an envelope of type with no fill and no stroke whose drawn art is unpainted: neither draws a pixel, so they draw alike, and the envelope opens live with its type editable. `art_with_no_paint_draws_alike_and_faint_art_is_still_compared` in `crates/eps/src/import/ai/envelope.rs` checks that two objects with no paint draw alike, while art that paints too faintly to ink a pixel, or paint against no paint, is still compared. Limit: when nothing paints, the shapes aren't compared and the envelope as saved is taken, so a fill added to the type later may bend it unlike the unpainted outlines the file saved. Synthetic files written in the tests; no fixtures added. Scores and hours unchanged. - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. From bd2e5ed73755a2e85047356007377d3c8e173fe0 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 23:45:38 +0000 Subject: [PATCH 094/247] docs: roadmap M4 Files row notes #8154 The status line, the M4 Files row and the revision history name the change, as AGENTS.md asks of a change that lands. Estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index bfaa10db30..9fcd69e766 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M4: `.ai` and EPS import: an envelope of type with no fill and no stroke, its drawn art unpainted, opens live, #8154; scores and estimates unchanged; previously: M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: an envelope of type that paints nothing opens live (#8154; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | M4: `.ai` and EPS import (#8154): an envelope of type with no fill and no stroke, its drawn art unpainted, opens live with its type editable instead of as its drawn art; details in [file-format-parity.md](file-format-parity.md). Scores and estimates unchanged. | | 2026-11-16 | minor | M1: rows or the selected-art square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | From ccbdef2ac070abad97471afaad8632f2a35951ca Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 16:17:30 +0000 Subject: [PATCH 095/247] .ai import: dashes aligned to corners come in live where they draw as their look A stroke in an art style whose dictionary turns on aligning dashes to corners and path ends (`BSDashAdj`) made the reader keep the object's drawn look, the dashes fitted to the path as outlines that can't be edited. VectorCraft draws such dashes itself (`Dash::align_corners`). The style now reads the stroke with its dashes aligned. The reason the look was kept (#1439: the style's dash array doesn't hold the fitted pattern) still holds, as the fitting is VectorCraft's own, so the reader takes the stroke only where the object with it draws as its drawn look, through the check images with a Warp already use (now `look_alike`). Aligned dashes have checks of their own (`MAX_DASH_CHECKS`) and don't weigh the page, so the envelopes' checks and share of the page check stay theirs. Elsewhere, past those checks and on type, the look stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai.rs | 2 +- crates/eps/src/import/ai/envelope.rs | 3 + crates/eps/src/import/ai/read.rs | 4 + crates/eps/src/import/ai/read/directives.rs | 5 +- crates/eps/src/import/ai/read/ops.rs | 41 +++++-- crates/eps/src/import/ai/style.rs | 11 +- crates/eps/src/import/ai/style/tests.rs | 10 +- crates/eps/src/import/ai/tests.rs | 30 +++-- crates/eps/src/import/tests_native.rs | 116 ++++++++++++++++++++ 9 files changed, 192 insertions(+), 30 deletions(-) diff --git a/crates/eps/src/import/ai.rs b/crates/eps/src/import/ai.rs index 92847a96ef..09f553ad2f 100644 --- a/crates/eps/src/import/ai.rs +++ b/crates/eps/src/import/ai.rs @@ -37,10 +37,10 @@ use crate::ps; pub(crate) use blend::{MAX_BLEND_OBJECTS, MAX_KEYS as MAX_BLEND_KEYS, PLUGIN as BLEND_PLUGIN, blend_reads}; pub(crate) use brush::{BrushesRead, MANAGER_NAME as BRUSH_MANAGER, brushes_kept, plugin_name as brush_plugin_name, read_brush_object}; pub(crate) use envelope::DRAWN as ENVELOPE_DRAWN; -pub(crate) use envelope::MAX_CHECKED; pub(crate) use envelope::TYPE_DRAWN as ENVELOPE_TYPE_DRAWN; pub(crate) use envelope::{GridPoint as EnvelopeGridPoint, PLUGIN as DEFORM_PLUGIN, outline as envelope_outline, upright as envelope_upright}; pub(crate) use envelope::{MAX_ANY as ENVELOPE_MAX_ANY, MAX_SOLID as ENVELOPE_MAX_SOLID}; +pub(crate) use envelope::{MAX_CHECKED, MAX_DASH_CHECKS}; pub(crate) use envelope::{WARPED_TYPE_DRAWN, WarpedType}; #[cfg(test)] pub(crate) use frames::TEXT_FRAME_SCANS; diff --git a/crates/eps/src/import/ai/envelope.rs b/crates/eps/src/import/ai/envelope.rs index 501b9f4b00..b70329ae11 100644 --- a/crates/eps/src/import/ai/envelope.rs +++ b/crates/eps/src/import/ai/envelope.rs @@ -59,6 +59,9 @@ pub(crate) fn drawn_note(typed: bool) -> &'static str { pub(super) const MAX_PENDING: usize = 64; /// The most envelopes and warped text objects one import draws to check; more keep their drawn art. pub(crate) const MAX_CHECKED: usize = 256; +/// The most strokes with dashes aligned to corners one import draws to check against their drawn +/// looks (apart from [`MAX_CHECKED`]); more keep their drawn looks. +pub(crate) const MAX_DASH_CHECKS: usize = 256; /// The most rows or columns of a mesh read (Make with Mesh's own limit). const MAX_GRID: u32 = 50; /// How far, in points over width and height together, a saved size may lie from the contents' diff --git a/crates/eps/src/import/ai/read.rs b/crates/eps/src/import/ai/read.rs index b045dd128f..6c2071c0d0 100644 --- a/crates/eps/src/import/ai/read.rs +++ b/crates/eps/src/import/ai/read.rs @@ -593,6 +593,9 @@ struct Reader<'a> { envelope_checks: usize, /// How far the live envelopes read so far draw from their drawn art ([`super::envelope::Spent`]). envelope_spent: super::envelope::Spent, + /// How many more strokes with dashes aligned to corners this import may draw to check + /// ([`super::MAX_DASH_CHECKS`]). + dash_checks: usize, /// The text objects read with a Warp ([`super::envelope::WarpedType`]). warped_type: Vec<super::envelope::WarpedLook>, /// The envelopes of type read with their drawn art, settled once the type is laid out @@ -822,6 +825,7 @@ impl<'a> Reader<'a> { envelopes: Vec::new(), envelope_checks: super::envelope::MAX_CHECKED, envelope_spent: super::envelope::Spent::default(), + dash_checks: super::MAX_DASH_CHECKS, warped_type: Vec::new(), typed_envelopes: Vec::new(), envelopes_drawn: Vec::new(), diff --git a/crates/eps/src/import/ai/read/directives.rs b/crates/eps/src/import/ai/read/directives.rs index 8ca3781717..67b3e799e2 100644 --- a/crates/eps/src/import/ai/read/directives.rs +++ b/crates/eps/src/import/ai/read/directives.rs @@ -837,11 +837,13 @@ impl<'a> Reader<'a> { } /// Lend `sub`, a reader of a definition, what this import may still spend on laying out blends - /// and checking envelopes ([`Reader::take_back_budgets`] takes back what is left). + /// and checking envelopes and aligned dashes ([`Reader::take_back_budgets`] takes back what is + /// left). fn lend_budgets(&mut self, sub: &mut Reader<'_>) { sub.blend_budget = self.blend_budget; sub.envelope_checks = self.envelope_checks; sub.envelope_spent = std::mem::take(&mut self.envelope_spent); + sub.dash_checks = self.dash_checks; } /// Take back from `sub` what [`Self::lend_budgets`] lent it, less what it spent. @@ -849,6 +851,7 @@ impl<'a> Reader<'a> { self.blend_budget = sub.blend_budget; self.envelope_checks = sub.envelope_checks; self.envelope_spent = std::mem::take(&mut sub.envelope_spent); + self.dash_checks = sub.dash_checks; } /// In a pattern's definition, the operands of its first operator start with its head, diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 721a6988ba..60bf922c63 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -835,15 +835,30 @@ impl<'a> Reader<'a> { }) }); // An image with a Warp is the object only where its live warp draws as its drawn look, and - // while the import has a check left for it; otherwise its drawn look stays. + // while the import has a check left for it; otherwise its drawn look stays. So is a stroke + // with dashes aligned to corners and path ends, whose fitting is VectorCraft's own, within + // checks of its own ([`crate::import::ai::MAX_DASH_CHECKS`]) and without weighing the page: + // the envelopes' checks and share of the page check stay theirs alone. Type with such + // dashes keeps its drawn look, as before. let appearance = match appearance { + Some(ap) if aligns_dashes(&ap) && slot_of(object.name.as_deref()).is_some() => None, Some(ap) if matches!(object.kind, NodeKind::Image(_)) && ap.effects.iter().any(|e| e.id.starts_with("warp.")) => { let alike = self.envelope_checks > 0 && { self.envelope_checks -= 1; let layer = self.doc.alloc_id(); let shared = crate::import::ai::envelope::Shared { patterns: &self.doc.patterns, images: &self.doc.images }; let shown = !hidden && object.visible && look.visible; - image_warp_alike(object, &ap, look, &self.hidden_ids, hidden, layer, &shared, page.filter(|_| shown), &mut self.envelope_spent) + look_alike(object, &ap, look, &self.hidden_ids, hidden, layer, &shared, page.filter(|_| shown), &mut self.envelope_spent) + }; + alike.then_some(ap) + } + Some(ap) if aligns_dashes(&ap) => { + let alike = self.dash_checks > 0 && { + self.dash_checks -= 1; + let layer = self.doc.alloc_id(); + let shared = crate::import::ai::envelope::Shared { patterns: &self.doc.patterns, images: &self.doc.images }; + let mut spent = crate::import::ai::envelope::Spent::default(); + look_alike(object, &ap, look, &self.hidden_ids, hidden, layer, &shared, None, &mut spent) }; alike.then_some(ap) } @@ -1187,18 +1202,19 @@ fn moves_with(object: &Node, st: &crate::import::ai::style::ArtStyle) -> bool { /// Is `object` an image without an opacity mask, and `st` one Warp on it with nothing else that /// paints ([`crate::import::ai::style::ArtStyle::image_warp`])? Such an image is read with its Warp -/// live where that draws as its drawn look ([`image_warp_alike`]). +/// live where that draws as its drawn look ([`look_alike`]). fn image_warps(object: &Node, st: &crate::import::ai::style::ArtStyle) -> bool { matches!(object.kind, NodeKind::Image(_)) && object.extras().mask.is_none() && st.image_warp } -/// Does image `object` with `appearance` (its style's Warp) draw as `look`, its drawn look, compared -/// over all that the warp draws ([`crate::import::ai::envelope::warped_alike`]) on `layer`, a layer -/// id no other node has? Both are drawn shown, opaque and in the Normal mode; a hidden look is drawn -/// with every object in it shown, as the hidden object's look holds them. Unless the look is on -/// `%_` lines itself (`hidden`), the copies in it that are on `%_` lines (`hidden_ids`) are left out. +/// Does `object` with `appearance` (an image's Warp, or a stroke with dashes aligned to corners) +/// draw as `look`, its drawn look, compared over all that it draws, effects included +/// ([`crate::import::ai::envelope::warped_alike`]), on `layer`, a layer id no other node has? Both +/// are drawn shown, opaque and in the Normal mode; a hidden look is drawn with every object in it +/// shown, as the hidden object's look holds them. Unless the look is on `%_` lines itself +/// (`hidden`), the copies in it that are on `%_` lines (`hidden_ids`) are left out. #[allow(clippy::too_many_arguments)] -fn image_warp_alike( +fn look_alike( object: &Node, appearance: &Appearance, look: &Node, @@ -1224,6 +1240,11 @@ fn image_warp_alike( crate::import::ai::envelope::warped_alike(&live, &plain, layer, shared, page, spent) } +/// Does `appearance` stroke with dashes aligned to corners and path ends? +fn aligns_dashes(appearance: &Appearance) -> bool { + appearance.items.iter().any(|i| matches!(i, AppearanceItem::Stroke(s) if s.dash.as_ref().is_some_and(|d| d.align_corners && d.is_dashed()))) +} + /// Show every object in container `n`, at any depth. fn show_members(n: &mut Node) { for c in n.children_mut().into_iter().flatten() { @@ -1245,7 +1266,7 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p let slot = slot_of(object.name.as_deref()).is_some(); // Several fills and strokes, on a path or a compound path. let stacked = !slot && !st.simple && st.stacked && matches!(object.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }); - // One Warp on an image, checked against its drawn look by the caller ([`image_warp_alike`]). + // One Warp on an image, checked against its drawn look by the caller ([`look_alike`]). let image_warp = !st.simple && image_warps(object, st); // A symbol instance draws its symbol's art: it keeps its drawn look. if !st.plain diff --git a/crates/eps/src/import/ai/style.rs b/crates/eps/src/import/ai/style.rs index e0068a52be..aea1ec9906 100644 --- a/crates/eps/src/import/ai/style.rs +++ b/crates/eps/src/import/ai/style.rs @@ -1461,11 +1461,10 @@ fn stroke_item(f: &Filter, align: StrokeAlign) -> Result<Option<StyleItem>, ()> if !f.paints.0 { return Ok(None); } - // Dashes aligned to corners and path ends draw as the look's pieces: a solid end at each end - // and the pattern, fitted, between them. - if f.params.get("BSDashAdj").is_some_and(|v| *v != 0.0) { - return Err(()); - } + // Dashes aligned to corners and path ends (the switch in the stroke's dictionary): the look + // draws them fitted between solid ends, which the reader checks the stroke against before it + // takes it. + let aligned = f.params.get("BSDashAdj").is_some_and(|v| *v != 0.0); match &f.stroke { Some(p) if !f.gradient && f.pattern.is_none() => Ok(Some(StyleItem::Stroke { paint: p.clone(), @@ -1473,7 +1472,7 @@ fn stroke_item(f: &Filter, align: StrokeAlign) -> Result<Option<StyleItem>, ()> cap: f.cap, join: f.join, miter: f.miter, - dash: f.dash.clone(), + dash: f.dash.clone().map(|d| Dash { align_corners: aligned, ..d }), profile: width_profile(&f.arrays), align, brush: None, diff --git a/crates/eps/src/import/ai/style/tests.rs b/crates/eps/src/import/ai/style/tests.rs index c4b006fe2a..b5cd7db1cb 100644 --- a/crates/eps/src/import/ai/style/tests.rs +++ b/crates/eps/src/import/ai/style/tests.rs @@ -61,13 +61,17 @@ fn a_uniform_or_unreadable_width_profile_stays_a_live_stroke() { } #[test] -fn dashes_aligned_to_corners_keep_the_drawn_look() { - // GUARDS: the look holds the fitted pattern and the solid ends the style's dash array doesn't. +fn dashes_aligned_to_corners_read_as_aligned_dashes() { + // The look holds the fitted pattern, which the style's dash array doesn't: the reader takes the + // stroke only where VectorCraft's own fitting draws as that look. let data = b"/KnownStyle :\n(Stitches) /Name ,\n/ActiveStyle :\n/CompoundFilter :\n(Chain Style Filter) 0 0 /Filter ,\n1 /Visible ,\n\ /BasicFilter :\n(Stroke Style Filter) 0 0 /Filter ,\n1 /Visible ,\n2 /FillOrStroke ,\n/Dictionary : /NotRecorded ,\n\ /Dictionary : /NotRecorded ,\n1 /Bool (BSDashAdj) ,\n; (kAIBeautifulStrokesParamsDictKey) ,\n\ /StrokeStyle : 0 R\n0 0 0 0 0 0 1 XA\n1 J 0 j 2 w 10 M [5 10 ]0 d\n0 XR\n1 0 Xd\n/Def ;\n (StrokeStyle) ,\n; /Dict ;\n /Part ,\n;\n"; - assert!(!art_styles(data)["Stitches"].plain); + let style = &art_styles(data)["Stitches"]; + assert!(style.plain, "{style:?}"); + let [StyleItem::Stroke { dash: Some(dash), .. }] = style.items.as_slice() else { panic!("{:?}", style.items) }; + assert_eq!((dash.pattern.as_slice(), dash.align_corners), ([5.0, 10.0].as_slice(), true)); } /// The style `Shade`: a Drop Shadow whose dictionary holds `keys`. diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 68ba060352..adef4a4dc5 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -6216,21 +6216,13 @@ fn a_stroke_offset_filter_keeps_its_strokes_style() { } /// A Stroke Offset stroke this doesn't read as a stroke keeps the object's drawn look: a switch -/// written as another kind, dashes aligned to corners and path ends, a gradient. +/// written as another kind, a gradient. #[test] fn a_stroke_offset_filter_with_a_stroke_this_does_not_read_keeps_the_drawn_look() { let outside = "0 /Bool (StrokeOffsetInside) ,\n"; let gradient = "0 R\nBb\n0 0 0 0 Bh\n2 (Red ramp) 0 0 90 1 1 0 0 1 0 0 1 Bg\n0 BB\n0 J 0 j 2 w 10 M []0 d\n0 XR\n1 0 Xd"; let cases = [ ("a switch written as a number", offset_stroke_style_with("Edge", "1 /Int (StrokeOffsetInside) ,\n", OFFSET_STROKE)), - ( - "dashes aligned to corners", - offset_stroke_style_with( - "Edge", - &format!("{outside}/Dictionary : /NotRecorded ,\n1 /Bool (BSDashAdj) ,\n; (kAIBeautifulStrokesParamsDictKey) ,\n"), - &OFFSET_STROKE.replace("[]0 d", "[5 10 ]0 d"), - ), - ), ("a gradient", offset_stroke_style_with("Edge", outside, gradient)), ]; for (why, style) in cases { @@ -6239,6 +6231,26 @@ fn a_stroke_offset_filter_with_a_stroke_this_does_not_read_keeps_the_drawn_look( } } +/// A Stroke Offset stroke with dashes aligned to corners and path ends reads as such a stroke, +/// outside the path; the object takes it only where it draws as its drawn look. Here the look (a +/// filled square) draws otherwise, so the look check keeps the drawn look. +#[test] +fn a_stroke_offset_with_dashes_aligned_to_corners_unlike_its_look_keeps_the_look() { + use crate::import::ai::style::StyleItem; + use vectorcraft_doc::StrokeAlign; + let keys = "0 /Bool (StrokeOffsetInside) ,\n/Dictionary : /NotRecorded ,\n1 /Bool (BSDashAdj) ,\n; (kAIBeautifulStrokesParamsDictKey) ,\n"; + let style = offset_stroke_style_with("Edge", keys, &OFFSET_STROKE.replace("[]0 d", "[5 10 ]0 d")); + let styles = crate::import::ai::style::art_styles(style.as_bytes()); + let Some(StyleItem::Stroke { dash: Some(dash), align, .. }) = styles["Edge"].items.iter().find(|i| matches!(i, StyleItem::Stroke { .. })) else { + panic!("{:?}", styles["Edge"]) + }; + assert_eq!((dash.pattern.as_slice(), dash.align_corners, *align), ([5.0, 10.0].as_slice(), true, StrokeAlign::Outside)); + let r = read_ok(&format!("%AI9_BeginArtStyles\n{style}%AI9_EndArtStyles\n{}", layer(&styled_square("Edge")))); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Group { .. })), "the drawn look: {a:#?}"); +} + /// A listed `[Default]` style whose stroke is aligned outside comes in as the default graphic /// style with that stroke. #[test] diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index dbac845dad..c88a071d42 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -7198,6 +7198,122 @@ fn warped_type_that_draws_apart_from_its_look_comes_in_as_the_look() { } } +/// An art style section with style `Dashed`: a black stroke 2 units wide with butt caps, miter joins +/// and dashes of 6 and gaps of 4, aligned to corners and path ends (`BSDashAdj`). +fn aligned_dash_style() -> String { + "%AI9_BeginArtStyles\n/KnownStyle :\n(Dashed) /Name ,\n/ActiveStyle :\n/CompoundFilter :\n(Chain Style Filter) 0 0 /Filter ,\n1 /Visible ,\n\ + /BasicFilter :\n(Stroke Style Filter) 0 0 /Filter ,\n1 /Visible ,\n2 /FillOrStroke ,\n/Dictionary : /NotRecorded ,\n\ + /Dictionary : /NotRecorded ,\n1 /Bool (BSDashAdj) ,\n; (kAIBeautifulStrokesParamsDictKey) ,\n\ + /StrokeStyle : 0 R\n0 0 0 1 0 0 0 XA\n0 J 0 j 2 w 10 M [6 4 ]0 d\n0 XR\n1 0 Xd\n/Def ;\n (StrokeStyle) ,\n; /Dict ;\n /Part ,\n;\n%AI9_EndArtStyles\n" + .to_string() +} + +/// The open path of [`aligned_dash_file`], a corner at (80, 20), in the document's coordinates. +fn aligned_dash_path() -> kurbo::BezPath { + let mut bp = kurbo::BezPath::new(); + bp.move_to((20.0, 20.0)); + bp.line_to((80.0, 20.0)); + bp.line_to((80.0, 70.0)); + bp +} + +/// What [`aligned_dash_style`] draws along [`aligned_dash_path`], with its dashes aligned to corners +/// and path ends by VectorCraft or (`aligned` false) not, as look operators in black. +fn aligned_dash_look(aligned: bool) -> String { + use vectorcraft_color::{Color, Paint}; + use vectorcraft_doc::{Dash, LineCap, LineJoin, StrokeLayer}; + let mut stroke = StrokeLayer::new(Paint::solid(Color::BLACK), 2.0); + (stroke.cap, stroke.join, stroke.miter_limit) = (LineCap::Butt, LineJoin::Miter, 10.0); + stroke.dash = Some(Dash { pattern: vec![6.0, 4.0], offset: 0.0, align_corners: aligned }); + let outline = vectorcraft_effects::stroke::line_outline(&aligned_dash_path(), &stroke, 2.0, 0.01); + assert!(!outline.elements().is_empty()); + drawn_as_operators(&outline).replace("0 1 1 0 1 0 0 Xa", "0 0 0 1 0 0 0 Xa") +} + +/// The editing copy of [`aligned_dash_path`] under [`aligned_dash_style`], with the look `drawing`. +fn aligned_dash_file(drawing: &str) -> String { + aligned_dash_files(drawing, 1) +} + +/// [`aligned_dash_file`] with `n` such paths. +fn aligned_dash_files(drawing: &str, n: usize) -> String { + let own = "%_0 0 0 1 0 0 0 XA\n%_2 w\n%_20 80 m\n%_80 80 L\n%_80 30 L\n%_S\n"; + let one = format!("u\n{drawing}\nU\n9 () XW\n{own}1 (Dashed) XW\n"); + native(&(aligned_dash_style() + &layer("Art", true, &one.repeat(n)))) +} + +/// The paths of `d` that stroke with dashes, each with whether its dashes are aligned to corners. +fn dashed_paths(d: &Document) -> Vec<bool> { + let mut out = vec![]; + d.walk(|n| { + if matches!(n.kind, NodeKind::Path { .. }) { + for i in &n.appearance.items { + if let vectorcraft_doc::AppearanceItem::Stroke(s) = i + && let Some(dash) = &s.dash + { + out.push(dash.align_corners); + } + } + } + }); + out +} + +/// A stroke whose dashes are aligned to corners and path ends comes in as the path with that stroke, +/// editable, where VectorCraft's fitting draws as its drawn look. +#[test] +fn dashes_aligned_to_corners_that_draw_as_the_look_come_in_live() { + let (d, notes) = crate::ai_alone(&private(&aligned_dash_file(&aligned_dash_look(true)))).unwrap(); + assert_eq!(dashed_paths(&d), [true], "{notes:?}"); + assert!(!notes.iter().any(|w| w.contains("drawn look")), "{notes:?}"); +} + +/// Where the look draws the dashes elsewhere (here, not fitted), the path keeps its drawn look. +#[test] +fn dashes_aligned_to_corners_that_draw_apart_from_the_look_keep_it() { + let (d, notes) = crate::ai_alone(&private(&aligned_dash_file(&aligned_dash_look(false)))).unwrap(); + assert!(dashed_paths(&d).is_empty(), "{notes:?}"); + let looks = d.layers[0].children().unwrap(); + assert!(matches!(looks.as_slice(), [l] if matches!(l.kind, NodeKind::Group { .. }) && l.visual_bounds().is_some()), "{looks:#?}"); +} + +/// The strokes with aligned dashes one import checks against their looks are limited +/// ([`crate::import::ai::MAX_DASH_CHECKS`]), apart from the envelopes' checks: past the +/// limit, a path that would draw as its look keeps the look. +#[test] +fn dashes_aligned_to_corners_past_their_checks_keep_the_look() { + let n = crate::import::ai::MAX_DASH_CHECKS; + let (d, notes) = crate::ai_alone(&private(&aligned_dash_files(&aligned_dash_look(true), n + 1))).unwrap(); + assert_eq!(dashed_paths(&d).len(), n, "{notes:?}"); + let looks = d.layers[0].children().unwrap().iter().filter(|c| matches!(c.kind, NodeKind::Group { .. })).count(); + assert_eq!(looks, 1); +} + +/// Type under a style with dashes aligned to corners keeps its drawn look, as before, and takes no +/// such stroke: the look check isn't made for type. +#[test] +fn type_with_dashes_aligned_to_corners_keeps_its_drawn_look() { + let doc = text_document(&[("TILT\r", 0, (8200.0, 8180.0), (0.0, 0.0), 0.0)]); + let own: String = text_object(0).lines().map(|l| format!("%_{l}\n")).collect(); + let look = format!("u\n{}\nU\n9 () XW\n", aligned_dash_look(true)); + let file = native_with_text(&(aligned_dash_style() + &layer("Art", true, &format!("{look}{own}1 (Dashed) XW\n"))), &doc); + let (d, notes) = crate::ai_alone(&private(&file)).unwrap(); + // The look stays, and the type takes no stroke with aligned dashes. + let kids = d.layers[0].children().unwrap(); + assert!(kids.iter().any(|c| matches!(c.kind, NodeKind::Group { .. }) && c.visual_bounds().is_some()), "{notes:?}"); + let mut aligned = false; + d.walk(|n| { + if matches!(n.kind, NodeKind::Text(_)) { + aligned |= n + .appearance + .items + .iter() + .any(|i| matches!(i, vectorcraft_doc::AppearanceItem::Stroke(s) if s.dash.as_ref().is_some_and(|d| d.align_corners))); + } + }); + assert!(!aligned, "{notes:?}"); +} + /// Warped type that a text variable binds stays type with the effect live and keeps its binding, /// though its live warp draws apart from its look. #[test] From 04e226902e3afbaa4d3db144684c7a8f2da1bfb9 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 07:38:47 +0000 Subject: [PATCH 096/247] docs: roadmap M4 Files row: the envelope's drawn art paints nothing too (#8154) The row said an envelope of type that paints nothing opens live, which reads as if the type painting nothing were enough. It also takes drawn art that paints nothing, as the other docs say. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index 9fcd69e766..149933cb4a 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: an envelope of type that paints nothing opens live (#8154; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: an envelope of type that paints nothing, its drawn art unpainted too, opens live (#8154; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | From 2093d5aa52a375ec8f198d4804f82bb5a3c7fc07 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 16:41:55 +0000 Subject: [PATCH 097/247] docs: dashes aligned to corners come in live where they draw as their look (.ai import) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/file-format-parity.md | 5 +++-- docs/target-app-parity.md | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 0cc9985a9c..ffd4342700 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8196: `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -288,7 +288,7 @@ private editing data. VectorCraft: ### Illustrator's private editing data -The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners, a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. +The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself with them and their saved settings. A path, compound path or group (not a clipping group) whose only effect is Transform (not with copies or Random) or a Free Distort whose corners make a parallelogram comes in as itself with it too, when neither it nor anything in it paints with a gradient or pattern and everything in it is a path, compound path or group with no opacity mask and no effects of its own; Transform that scales, rotates or reflects needs nothing in it to be stroked. Twist as the only effect is read the same way when nothing in the object is stroked: up to 180° either way (a limit VectorCraft sets) on a path or compound path whose segments are all straight, except a compound path with a guide member that reaches past its other members at an angle other than 0°, and up to 90° either way (a limit VectorCraft sets) on another path, compound path or group with no guide in it. One with more, other effects (Zig Zag, a Pucker & Bloat of another amount, a Free Distort with other corners), an effect setting that is not read (an unknown key, a missing or out-of-range value, a Scribble with a color of its own), a variable-width stroke with one centered width array, dashes aligned to corners that VectorCraft's own fitting doesn't draw as the drawn look (or past 256 such checks an import makes, or on type), a brush other than a Calligraphic or Art one, a Calligraphic brush with settings of its own, an entry that isn't read, a variable width or an angle that follows the path, a path followed by samples of the pen (`(…) Xt n XD`) whose Calligraphic brush varies with the pen, or an Art brush other than the ones described next comes in as its drawn look (a group named after it). Objects in a symbol defined before the file's art styles section, as newer files write it, take the same styles as the layers' objects. A path with a Calligraphic brush otherwise comes in as the path, the brush on its stroke at the stroke's weight, which scales the brush (#372), and so does a path with an Art brush, whose weight scales the art across the path, when all of these hold: the brush is in Tints or None, at a fixed width from 1% to 1,000%, stretched to the path or stretched between guides that leave art between them, flipped along or across or not ([Art brush options](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf), printed page 193), with `Spacing` 0, `Adjustment` 1 and `FoldAdjustment` 1 (VectorCraft's own reading of these numbers; a brush that scales its art proportionately comes into the Brushes panel with that option, and its paths keep their drawn look); the path's settings are the brush's own (apart from the lowest and highest width of a fixed width and the guides' lengths without Stretch Between Guides, which don't draw), with no entry that isn't read, no variable width and no effects; a stroke in Tints isn't a swatch; and the art is paths, compound paths and groups in solid fills, with no strokes, masks or effects, and has some length along the path. A stroke takes the brush the Brushes panel keeps under its name, and one whose name the panel doesn't keep comes in as its drawn look. Type with an Art brush keeps its drawn look under the type. A Calligraphic brush's Pressure, Tilt, Bearing and Rotation come in as those channels (a 6D Art Pen's brushes vary with the pressure, the bearing and the barrel's rotation); its Stylus Wheel varies at random. The file's Calligraphic, Scatter, Art and Bristle brushes replace the default ones in the Brushes panel, in the file's order, also when the file comes in as its PDF part (a brush library has no layers); pattern brushes and brushes it can't read are left out with a note. When the file opens from its layers, the spot colors in the art of each brush that comes in become swatches, and that art's colors count toward the document's color mode, as a pattern's do. The swatches take at most 20,000 color names in all across the brush art, and each brush-art section keeps at most 20,000 names. Each name keeps its first definition, with the color operators' names before the gradient stops' names. A spot color past those limits makes no swatch, and its color still counts toward the color mode. A spot color that the page's art, a pattern or a symbol also defines keeps the value defined there. Type keeps its art style as a live appearance whatever its stack (an Art brush aside), so it can be retyped: each fill and stroke of the style's stack (solid colours, gradients and pattern fills, placed as the drawn look places them) with its own opacity, blend mode and effects, the effects on the whole object, and where the characters paint among them; the effects read are Warp, Offset Path, Outline Object, Outline Stroke, Transform (with copies, Transform Objects, Transform Patterns and Scale Strokes & Effects; not with Random), Free Distort, Pucker & Bloat, Twist, Zig Zag, Tweak (only when it moves nothing, the file holding none of its random outline), Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Gaussian Blur, Bas Relief (its detail, smoothness and light direction from its settings block, or the effect's defaults when the style holds no settings block; a settings block that isn't read keeps the drawn look) and Convert to Shape, and a style with others, or with an effect setting that isn't read, keeps the type's drawn look. Convert to Shape keeps its Rectangle, Rounded Rectangle or Ellipse, its Absolute or Relative size (a relative size in the file is added to each side) and its corner radius; a relative Ellipse, or a setting that isn't read, keeps the drawn look. The page's drawing of such a style isn't held to look like VectorCraft's where its drawn look lay. Gradients take their matrix (`Xm`, radials and skewed ones too), focal point and the order of stops sharing a ramp point; gradient meshes, a clipping path's own fill and its stroke, and the artboards' names are read too. `editingData: "always"` (`convert --editing-data`) opens a `.ai` or an EPS with editing data from its editing data even where it draws differently from its page, which can be older, with a note. Type is made from the file's text document, whole and editable, shown or not: point type (its frame's matrix, which newer files leave out when it is neither turned nor scaled, read as none), area type (a story in several frames as threaded type) and type on a path, with its characters, fonts, size, leading, tracking, scaling, baseline shift, fill and stroke (grey, RGB or CMYK), alignment, indents and paragraph spacing (a character attribute a run doesn't set comes from its character style, then the style that one is based on, then the document's defaults); area type keeps its frame's Area Type Options rows and columns, the gutter between rows and the gutter between columns, and its first baseline (Fixed, Cap Height, Leading or x Height) with its minimum; type on a path keeps its frame's Type on a Path effect, Align to Path and Flip (a frame whose options set key 6 to true keeps their defaults), and the first frame's Spacing is fitted from the file's layout, not read from the dialog's value; the distance from the path under Align to Path is measured for each character at its size and vertical scale (in vertical type, its horizontal scale), from the top of its font's em box (Ascender), half the height of the top of its font's H (Center) or the bottom of its font's bounding box (Descender); the fit under Gravity does not reproduce the file's layout, and its glyphs can lie up to 7.4 pt from the positions the file keeps; the page's drawing of it (often in pieces) is left out. Vertical type keeps its orientation, its columns from right to left, and a run set to Tate-chu-yoko keeps that setting. When it makes the type of every text object that shows, the page's type is only compared with it, each text object keeps its own group, frame and layer, and a line break inside a paragraph stays one. Where it can't make a text object's type (a frame of another kind), that text object takes the page's type where the text document puts its lines, or else what is left of the page's type in painting order (no group around it); the page's type where made type draws stays that type's, and hidden type is left out with a note. Text wrap is read too: an object whose dictionary has the wrap options (offset and Invert Wrap), or any graphic of a legacy wraparound group (`*w` … `*W`, before or after its type, with no offset), is a wrap object, and area type below it in its layer flows around it when the file opens, threaded type included (#2763). Kerning, underline and the other character and paragraph options aren't read yet. A `.ai` saved without PDF compatibility (a placeholder page) opens from its editing data alone, its point type, area type and type on a path made from the text document. A `.ai` whose PDF part shows only text isn't taken for that placeholder when its page states an art, trim or bleed box: it opens from its editing data alone where that reads, else from its PDF part (#1387). A `.ai` whose PDF part draws nothing at all (an empty page, with or without those boxes) opens from its editing data alone where that reads too: there is no page art to check its layers against, and the empty page would lose all of it. Text objects with an appearance keep their own text and frame, type of hidden layers stays hidden, and type on later artboards lands on its text objects (#1391); area type whose frame is too short for a line of the fallback font shows its first line (the frame is made taller, with a warning in the open result) (#1392). In a PDF saved with some of its artboards, the type on each page after the first goes to an artboard of that page's size after the previous page's artboard, and only to one that leaves an artboard for each later page; the first page's artboard also leaves one for each later page. When several artboards fit a later page, VectorCraft takes the one whose art draws most like the page, and compares at most 16 artboards for all the later pages together. Symbols are read into the Symbols panel, in the file's symbol list order, with their art, their registration point and the instances in their art, and their instances come in live with their matrix, name, hide, lock, opacity, blending mode, isolation, knockout and opacity mask; a symbol whose art isn't read whole (type, placed files, an image it leaves out or anything else it doesn't read) isn't kept. A file that comes in as its page or PDF part because its editing data has no layers (a symbol library), or because its layers can't be read or used (any of the cases below), gets the symbols its editing data defines before its first layer, in the symbol list's order, while its page art stays as the page draws it. Instances of symbols it can't read, instances with appearance changes of their own (a dynamic symbol's), pattern fills whose pattern it can't read, placed files the data keeps no preview of and anything else it doesn't read make the file come in as its page (on a layer that doesn't show, they are left out of that layer), with a warning saying what. An unread object on a shown layer whose box can be found instead comes in as a group of the page's objects inside that box, named after it, with the rest of the layers and groups kept and a warning listing what came in as the page's art; the file still comes in as its page when live art or another unread object shares that page art, when the object spans two artboards or lies on an artboard that has no page, when no page art lies inside its box, when that page art is inside a page group with a clip, mask, transparency or appearance, when the object holds a frame of threaded type, when the page art uses a pattern, image or swatch that the page lacks or that differs from the editing data's, or when the page art doesn't carry its transparency (#4806). The layers' art is also compared with the page (by lightness, so colours written as their CMYK equivalents compare alike, and by whether a pixel is inked at all); the page is used when they differ by more than 5% (away from type, when all the type is made from the text document), where one draws an object the other doesn't (away from type, whose lines may be laid out afresh), and when an EPS whose page is its art's box has art printed outside it (#735). A `.ai` is not compared with its page, and its PDF part is not imported, when its text document makes the type of every text object (at least one shows, and none is drawn by the appearance of the layer or group it is in), no object is unread, no placed file has a second placement, no live envelope keeps its drawn art, it declares no large canvas, and its artboards are its pages' trim boxes one for one, in points or in the first page's `UserUnit`: it opens from its layers, with the bleed of its pages' bleed boxes. When they differ because some objects draw differently (an object in another color, or one that only one of them draws), each top-level object of the layers that holds such a difference comes in as a group of the page's objects inside its box and the layers stay, with a warning that names the layer or sublayer of each such object as the Layers panel shows it (`<Layer>` for one without a name) and how many came in from it; an export or Save As to the file's own path then needs `acknowledgeLoss: true`, and a wrap object replaced this way keeps its wrap options. The file still comes in as its page when only edges or type differ, when a difference lies outside every top-level object, when more than half of the top-level objects or more than 64 hold one, when such an object is or holds type or holds a wrap object inside a group, when the page's type of a text object that stays lies inside such an object's box, when the page's art can't replace such an object for one of the reasons above for an unread object, when matching the differences to the objects would take too much work, or when the result still differs from the page. `editingData: "always"` keeps the objects as read, and placed files at the other point their data gives are tried as well. An EPS whose page is its art's box keeps that page when it comes in through its layers, not the editing data's artboard, and a text object counts as drawn by the page by its colours, not only its lightness, so a red stroke stacked over a dark red one stays (#1102). `textAs: "outlines"` opens a `.ai` whose type shows from its PDF part, which has the outlines; `editingData: false` opens any of them as its page or PDF part only, for print pipelines (#735). A file whose import left something out (hidden text, art or layers) is never written over by an export or Save As to its own path unless `acknowledgeLoss: true` (`convert --replace-lossy`), so the original keeps what the document lacks. Where a `.ai` can't be read that way (or its layers are turned off in the import options), we read its PDF-compatible part, so live objects that only the editing data holds arrive as appearance, and plain groups arrive ungrouped: that part draws each object on its own and marks only layers, clipping groups and groups with opacity, blending or a mask (those come back). Art outside the artboards isn't in that part at all (the PDF part leaves it out), so it doesn't open; the import says so in a note (#472). Its pages still go where the editing data puts the artboards (a grid stays a grid), with the art on each, when it has as many artboards as pages, of the same sizes (#1068); the page of the artboard `CropAreaActive` names is then the active artboard. A `.ai` whose editing data has artboards but no layers also opens on that page under the same check, and its pages stay where they are. A `.ai` whose PDF part's pages are cropped to its art (each page the box of all the art, which is the editing data's bounding box) instead of its artboards opens from its layers, with its own artboards, where they draw as that page does. Its pages are laid out so that art one of them draws past its artboard (notes beside a design, which the part doesn't clip) doesn't lie over the page before it in the row, where it was taken for that page's art: the check against the editing data then found art its layers don't have there and opened the file as its PDF part, without the art outside the artboards. That part also has no paragraphs: area type is written line by line, and comes back as area type only where its font is installed and lays the lines out with the same breaks, else as a point type object per line (#508). Art off the page that a PDF does draw opens on the pasteboard. A run of type in the editing data whose baseline direction is 1 opens with Standard Vertical Roman Alignment (https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) on, which is VectorCraft's own mapping: its half-width characters stand upright in vertical type, and horizontal type keeps the mark with no change to its layout. A run whose baseline direction is 2 or 3 (Tate-chu-yoko), or that names none in the run, its character style or the document's defaults, opens with it off. The scripting reference lists 1, 2 and 3 as the Standard, vertical rotated and Tate-chu-yoko baseline directions (https://web.archive.org/web/20170621180804/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20VBScript%20Reference.pdf, page 256). A Scatter brush in the editing data whose last 15 numbers start with 1 comes into the Brushes panel in Tints. Each brush art section is read without its frame: an unnamed, unpainted rectangle with no settings of its own at the art's bounds (within 1/1000 pt), closed, or open with its first corner again at the end. A wider frame stays in the art, and an art group with a state or look of its own (hidden, locked, isolated, knockout, an opacity, a blend mode, a name, a mask, a note or an appearance) stays a group. @@ -361,6 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8196): a stroke from an art style with dashes aligned to corners and path ends (`BSDashAdj` in its dictionary) is read with `Dash::align_corners` instead of refused, and the object takes it where it draws as its drawn look (the check images with a Warp use, renamed `look_alike`), within 256 checks of its own per import that leave the envelopes' checks and share of the page check alone; elsewhere, past those checks and on type, the drawn look stays. The reason #1439 kept the look (the style's dash array doesn't hold the fitted pattern) still holds, hence the check. The check draws at min(400 / the longer side, 4) pixels per point with a threshold of 48 levels, so dots below a pixel on a long path can sit elsewhere and still pass. A Graphic Styles panel style with the switch now comes in with aligned dashes (no check: there is no look to compare with; before, the style was left out), and a stroke with the switch and no dash array comes in as a solid stroke. Before, every such object came in as its drawn look. In 200 garment files we own (used locally, never committed), such objects come in live in 12 files (23 fewer objects kept as their drawn look), and in another 224 in 23 files (78 fewer); one file whose dots VectorCraft fits elsewhere keeps its look; no file opens another way, no live envelope comes or goes, and no render changes by more than 0.005% of its pixels past the threshold. Tests `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live`, `dashes_aligned_to_corners_that_draw_apart_from_the_look_keep_it`, `dashes_aligned_to_corners_past_their_checks_keep_the_look`, `type_with_dashes_aligned_to_corners_keeps_its_drawn_look` in `crates/eps/src/import/tests_native.rs`, `a_stroke_offset_with_dashes_aligned_to_corners_unlike_its_look_keeps_the_look` in `crates/eps/src/import/ai/tests.rs` and `dashes_aligned_to_corners_read_as_aligned_dashes` in `crates/eps/src/import/ai/style/tests.rs`. Scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f393c7b8d8..800dd8e1fc 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8196: `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import (#8196): strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look; scores and estimates unchanged (details in [file-format-parity.md](file-format-parity.md)). | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | From 500f583110fcde5a2e7d6e79777cefb49d78de37 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 06:56:24 +0000 Subject: [PATCH 098/247] .ai import: the reads of a file apart from its layers spend none of the layers' checks Besides the reader of its layers, a file whose layers come from its PDF part is read again over all of its data for its artboards (once more for the page scale), its variable library, its swatches, brushes, graphic styles and symbols. Each of those readers started with every envelope check (`MAX_CHECKED`) and every aligned-dash check (`MAX_DASH_CHECKS`) an import has, so such a file could draw several times the strokes the limit allows. - The artboard and variable-library readers start with no checks (`reader_aside`): neither depends on how a stroke or an envelope draws. - The swatch, brush, style and symbol readers, which need only what comes before the first layer, make no more checks once they reach it (`Reader::defs_only`). What they read is unchanged in files that write their definitions before their layers, as saved files do (symbols after the first layer aren't read at all). A pattern tile or brush art defined after the first layer is still read, without checks: it draws the same, and keeps its drawn art where it could have come in live. Definitions read before the layers (pattern tiles, brush art, symbols) are still checked by each of those readers within the limit. Test `the_reads_apart_from_the_layers_check_no_aligned_dashes`, which counts the checks made (`DASH_CHECKS_MADE`, in tests only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai.rs | 2 ++ crates/eps/src/import/ai/envelope.rs | 7 ++++++ crates/eps/src/import/ai/read.rs | 5 +++++ crates/eps/src/import/ai/read/containers.rs | 3 +++ crates/eps/src/import/ai/read/document.rs | 18 +++++++++++++-- crates/eps/src/import/ai/read/ops.rs | 2 ++ crates/eps/src/import/tests_native.rs | 25 +++++++++++++++++++++ docs/file-format-parity.md | 2 +- 8 files changed, 61 insertions(+), 3 deletions(-) diff --git a/crates/eps/src/import/ai.rs b/crates/eps/src/import/ai.rs index 09f553ad2f..649b7fc096 100644 --- a/crates/eps/src/import/ai.rs +++ b/crates/eps/src/import/ai.rs @@ -36,6 +36,8 @@ use crate::ps; pub(crate) use blend::{MAX_BLEND_OBJECTS, MAX_KEYS as MAX_BLEND_KEYS, PLUGIN as BLEND_PLUGIN, blend_reads}; pub(crate) use brush::{BrushesRead, MANAGER_NAME as BRUSH_MANAGER, brushes_kept, plugin_name as brush_plugin_name, read_brush_object}; +#[cfg(test)] +pub(crate) use envelope::DASH_CHECKS_MADE; pub(crate) use envelope::DRAWN as ENVELOPE_DRAWN; pub(crate) use envelope::TYPE_DRAWN as ENVELOPE_TYPE_DRAWN; pub(crate) use envelope::{GridPoint as EnvelopeGridPoint, PLUGIN as DEFORM_PLUGIN, outline as envelope_outline, upright as envelope_upright}; diff --git a/crates/eps/src/import/ai/envelope.rs b/crates/eps/src/import/ai/envelope.rs index b70329ae11..6fc5fbad5d 100644 --- a/crates/eps/src/import/ai/envelope.rs +++ b/crates/eps/src/import/ai/envelope.rs @@ -62,6 +62,13 @@ pub(crate) const MAX_CHECKED: usize = 256; /// The most strokes with dashes aligned to corners one import draws to check against their drawn /// looks (apart from [`MAX_CHECKED`]); more keep their drawn looks. pub(crate) const MAX_DASH_CHECKS: usize = 256; + +#[cfg(test)] +thread_local! { + /// How many strokes with dashes aligned to corners have been drawn on this thread to check them + /// against their looks. + pub(crate) static DASH_CHECKS_MADE: std::cell::Cell<u64> = const { std::cell::Cell::new(0) }; +} /// The most rows or columns of a mesh read (Make with Mesh's own limit). const MAX_GRID: u32 = 50; /// How far, in points over width and height together, a saved size may lie from the contents' diff --git a/crates/eps/src/import/ai/read.rs b/crates/eps/src/import/ai/read.rs index 6c2071c0d0..3d4c3122e4 100644 --- a/crates/eps/src/import/ai/read.rs +++ b/crates/eps/src/import/ai/read.rs @@ -596,6 +596,10 @@ struct Reader<'a> { /// How many more strokes with dashes aligned to corners this import may draw to check /// ([`super::MAX_DASH_CHECKS`]). dash_checks: usize, + /// Whether this reader reads only what comes before the first layer (swatches, brushes, styles, + /// symbols) for a file whose layers another reader reads: it makes no more checks once it + /// reaches the layers, so it spends none of theirs. + defs_only: bool, /// The text objects read with a Warp ([`super::envelope::WarpedType`]). warped_type: Vec<super::envelope::WarpedLook>, /// The envelopes of type read with their drawn art, settled once the type is laid out @@ -826,6 +830,7 @@ impl<'a> Reader<'a> { envelope_checks: super::envelope::MAX_CHECKED, envelope_spent: super::envelope::Spent::default(), dash_checks: super::MAX_DASH_CHECKS, + defs_only: false, warped_type: Vec::new(), typed_envelopes: Vec::new(), envelopes_drawn: Vec::new(), diff --git a/crates/eps/src/import/ai/read/containers.rs b/crates/eps/src/import/ai/read/containers.rs index 9db1470093..7e0fe615d4 100644 --- a/crates/eps/src/import/ai/read/containers.rs +++ b/crates/eps/src/import/ai/read/containers.rs @@ -16,6 +16,9 @@ impl<'a> Reader<'a> { if matches!(kind, Kind::Layer(_)) { self.ensure_space(); self.check_symbols(); + if self.defs_only { + (self.envelope_checks, self.dash_checks) = (0, 0); + } } let base = if matches!(kind, Kind::Obj(_)) { self.stack.len() } else { self.frames.last().map_or(0, |f| f.base) }; self.frames.push(Frame { diff --git a/crates/eps/src/import/ai/read/document.rs b/crates/eps/src/import/ai/read/document.rs index 258d7d584b..5432cb554e 100644 --- a/crates/eps/src/import/ai/read/document.rs +++ b/crates/eps/src/import/ai/read/document.rs @@ -336,6 +336,7 @@ fn repoint(n: &mut Node, renamed: &std::collections::BTreeMap<String, String>) { /// those the swatches take. pub fn palette(data: &[u8], patterns: &[PatternDef], names: &mut obj::Names) -> Option<PaletteSwatches> { let mut r = Reader::with_names(data, names.encoding); + r.defs_only = true; // The palette, the gradients and the patterns it names come before the art, so an error in the // art leaves them read. let _ = r.run(); @@ -396,6 +397,7 @@ pub fn brushes(data: &[u8], patterns: &[PatternDef], names: &mut obj::Names) -> // Brush objects are plug-in objects: data without one isn't read again. memchr::memmem::find(data, b"BeginPluginObject")?; let mut r = Reader::with_names(data, names.encoding); + r.defs_only = true; // The brushes come before the art, so an error in the art leaves them read. let _ = r.run(); let (mut lib, unread) = r.brush_library()?; @@ -449,6 +451,7 @@ pub fn graphic_styles(data: &[u8], large_canvas: bool, names: &mut obj::Names) - return (vec![], 1.0); } let mut r = Reader::with_names(data, names.encoding); + r.defs_only = true; r.large_canvas = large_canvas.then_some(1.0); // The styles come before the art, so an error in the art leaves them read. let _ = r.run(); @@ -482,6 +485,7 @@ pub struct Symbols { pub fn symbols(data: &[u8], names: &mut obj::Names) -> Option<Symbols> { crate::import::ai::find(data, b"BeginSymbol")?; let mut r = Reader::with_names(data, names.encoding); + r.defs_only = true; // The symbols come before the art, so an error in the art leaves them read. let _ = r.run(); r.check_symbols(); @@ -536,10 +540,20 @@ pub fn symbols(data: &[u8], names: &mut obj::Names) -> Option<Symbols> { Some(Symbols { symbols, images, swatches, canvas_scale: r.canvas_scale, own_size: r.symbols_own_size }) } +/// A reader of all of `data` for what doesn't depend on how its art draws (its artboards, its +/// variable library): it checks no envelope and no stroke with aligned dashes against its drawn +/// look, so it spends none of the import's checks ([`super::MAX_CHECKED`], +/// [`super::MAX_DASH_CHECKS`]), which are the layers' reader's. +fn reader_aside(data: &[u8]) -> Reader<'_> { + let mut r = Reader::new(data); + (r.envelope_checks, r.dash_checks) = (0, 0); + r +} + /// [`artboards`] as far as reading `data` from its start gets: those read before an error, and /// those of a `/Document` still open when it stopped (its art can be what stopped it). fn artboards_read(data: &[u8], names: &mut obj::Names) -> (Vec<(String, Rect)>, Option<usize>) { - let mut r = Reader::new(data); + let mut r = reader_aside(data); r.names = obj::Names::new(names.encoding); let _ = r.run(); let open: Vec<Obj> = r.frames.iter().filter_map(|f| if let Kind::Obj(o) = &f.kind { Some((**o).clone()) } else { None }).collect(); @@ -608,7 +622,7 @@ pub fn variables(data: &[u8], names: &mut obj::Names) -> VariableRead { if crate::import::ai::find(data, b"variableSets").is_none() { return VariableRead::default(); } - let mut r = Reader::new(data); + let mut r = reader_aside(data); r.names = obj::Names::new(names.encoding); let _ = r.run(); if r.variables.present { diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 60bf922c63..de7817062d 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -855,6 +855,8 @@ impl<'a> Reader<'a> { Some(ap) if aligns_dashes(&ap) => { let alike = self.dash_checks > 0 && { self.dash_checks -= 1; + #[cfg(test)] + crate::import::ai::DASH_CHECKS_MADE.set(crate::import::ai::DASH_CHECKS_MADE.get() + 1); let layer = self.doc.alloc_id(); let shared = crate::import::ai::envelope::Shared { patterns: &self.doc.patterns, images: &self.doc.images }; let mut spent = crate::import::ai::envelope::Spent::default(); diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index c88a071d42..27081f8b45 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -7289,6 +7289,31 @@ fn dashes_aligned_to_corners_past_their_checks_keep_the_look() { assert_eq!(looks, 1); } +/// The reads of a file apart from its layers check no stroke with dashes aligned to corners in its +/// layers against its look: the import's checks ([`crate::import::ai::MAX_DASH_CHECKS`]) are its +/// layers' reader's, though those reads go over all of the data. Its artboards and variable library +/// are read with no checks at all, and its swatches (and so its brushes, styles and symbols, read +/// the same way) with none once their reader reaches the layers. The layers' reader still checks +/// the one such stroke. +#[test] +fn the_reads_apart_from_the_layers_check_no_aligned_dashes() { + use vectorcraft_testkit::ai::{sample_variable_sets, variable_library_data}; + let library = variable_library_data(&sample_variable_sets("variableAndTypes", &[])); + let own = "%_0 0 0 1 0 0 0 XA\n%_2 w\n%_20 80 m\n%_80 80 L\n%_80 30 L\n%_S\n"; + let one = format!("u\n{}\nU\n9 () XW\n{own}1 (Dashed) XW\n", aligned_dash_look(true)); + let data = native(&(library + &aligned_dash_style() + &layer("Art", true, &one))); + let checks = |f: &dyn Fn()| { + crate::import::ai::DASH_CHECKS_MADE.set(0); + f(); + crate::import::ai::DASH_CHECKS_MADE.get() + }; + let names = crate::import::ai::Names::default; + assert_eq!(checks(&|| drop(crate::ai_alone(&private(&data)))), 1); + assert_eq!(checks(&|| drop(crate::import::ai::artboards(data.as_bytes(), &mut names()))), 0); + assert_eq!(checks(&|| assert!(crate::import::ai::variables(data.as_bytes(), &mut names()).present)), 0); + assert_eq!(checks(&|| drop(crate::import::ai::palette(data.as_bytes(), &[], &mut names()))), 0); +} + /// Type under a style with dashes aligned to corners keeps its drawn look, as before, and takes no /// such stroke: the look check isn't made for type. #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index ffd4342700..efb50988b3 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -361,7 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-16 | minor | `.ai` and EPS import (#8196): a stroke from an art style with dashes aligned to corners and path ends (`BSDashAdj` in its dictionary) is read with `Dash::align_corners` instead of refused, and the object takes it where it draws as its drawn look (the check images with a Warp use, renamed `look_alike`), within 256 checks of its own per import that leave the envelopes' checks and share of the page check alone; elsewhere, past those checks and on type, the drawn look stays. The reason #1439 kept the look (the style's dash array doesn't hold the fitted pattern) still holds, hence the check. The check draws at min(400 / the longer side, 4) pixels per point with a threshold of 48 levels, so dots below a pixel on a long path can sit elsewhere and still pass. A Graphic Styles panel style with the switch now comes in with aligned dashes (no check: there is no look to compare with; before, the style was left out), and a stroke with the switch and no dash array comes in as a solid stroke. Before, every such object came in as its drawn look. In 200 garment files we own (used locally, never committed), such objects come in live in 12 files (23 fewer objects kept as their drawn look), and in another 224 in 23 files (78 fewer); one file whose dots VectorCraft fits elsewhere keeps its look; no file opens another way, no live envelope comes or goes, and no render changes by more than 0.005% of its pixels past the threshold. Tests `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live`, `dashes_aligned_to_corners_that_draw_apart_from_the_look_keep_it`, `dashes_aligned_to_corners_past_their_checks_keep_the_look`, `type_with_dashes_aligned_to_corners_keeps_its_drawn_look` in `crates/eps/src/import/tests_native.rs`, `a_stroke_offset_with_dashes_aligned_to_corners_unlike_its_look_keeps_the_look` in `crates/eps/src/import/ai/tests.rs` and `dashes_aligned_to_corners_read_as_aligned_dashes` in `crates/eps/src/import/ai/style/tests.rs`. Scores and estimates unchanged. | +| 2026-11-16 | minor | `.ai` and EPS import (#8196): a stroke from an art style with dashes aligned to corners and path ends (`BSDashAdj` in its dictionary) is read with `Dash::align_corners` instead of refused, and the object takes it where it draws as its drawn look (the check images with a Warp use, renamed `look_alike`), within 256 checks of its own per import that leave the envelopes' checks and share of the page check alone; elsewhere, past those checks and on type, the drawn look stays. The reason #1439 kept the look (the style's dash array doesn't hold the fitted pattern) still holds, hence the check. The check draws at min(400 / the longer side, 4) pixels per point with a threshold of 48 levels, so dots below a pixel on a long path can sit elsewhere and still pass. A Graphic Styles panel style with the switch now comes in with aligned dashes (no check: there is no look to compare with; before, the style was left out), and a stroke with the switch and no dash array comes in as a solid stroke. Before, every such object came in as its drawn look. In 200 garment files we own (used locally, never committed), such objects come in live in 12 files (23 fewer objects kept as their drawn look), and in another 224 in 23 files (78 fewer); one file whose dots VectorCraft fits elsewhere keeps its look; no file opens another way, no live envelope comes or goes, and no render changes by more than 0.005% of its pixels past the threshold. Tests `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live`, `dashes_aligned_to_corners_that_draw_apart_from_the_look_keep_it`, `dashes_aligned_to_corners_past_their_checks_keep_the_look`, `the_reads_apart_from_the_layers_check_no_aligned_dashes`, `type_with_dashes_aligned_to_corners_keeps_its_drawn_look` in `crates/eps/src/import/tests_native.rs`, `a_stroke_offset_with_dashes_aligned_to_corners_unlike_its_look_keeps_the_look` in `crates/eps/src/import/ai/tests.rs` and `dashes_aligned_to_corners_read_as_aligned_dashes` in `crates/eps/src/import/ai/style/tests.rs`. Scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | From e463d06579bb46916ec11be55a43be70e070fc80 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 06:56:24 +0000 Subject: [PATCH 099/247] docs: roadmap M4 Files row notes #8196 The status line, the M4 Files row and the revision history name the change, as AGENTS.md asks of a change that lands. Estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index bfaa10db30..aba78d182d 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M4: `.ai` and EPS import: strokes with dashes aligned to corners come in live where they draw as their drawn look, #8196; scores and estimates unchanged; previously: M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: dashes aligned to corners come in live where they draw as their look (#8196; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | M4: `.ai` and EPS import (#8196): strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within checks of their own per import; details in [file-format-parity.md](file-format-parity.md). Scores and estimates unchanged. | | 2026-11-16 | minor | M1: rows or the selected-art square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | From be9684ed9fe94d6954c37c52e68e6d67f14d98ec Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 20:48:30 +0000 Subject: [PATCH 100/247] .ai import: a path or compound path filled with a pattern through its art style comes in with it A path or compound path whose art style fills it with a pattern (alone, or among other fills and strokes) came in as its drawn look: the style's stack (`ArtStyle::stacked`) took solid colors and gradients only, though the reader already places a style's pattern fill, as type takes it (#6856). A style's pattern fill now counts in the stack. As for the stack's gradients, the reader takes it only where the drawn look paints with that pattern (fills only), once (`placed_paints` keeps the first placement of each name), and places it as the look does; otherwise the drawn look stays. Type keeps taking its style's pattern from wherever its look paints with it, as before. Under effects on the object, a stack with a pattern fill keeps its drawn look: a conservative rule, as in one garment file a Scribble over such a fill drew unlike the look though the tiles were placed as the look's are, for a reason not established. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai/read/ops.rs | 21 ++-- crates/eps/src/import/ai/style.rs | 19 +++- crates/eps/src/import/ai/tests.rs | 163 +++++++++++++++++++++++++++ 3 files changed, 190 insertions(+), 13 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 721a6988ba..796e8687fa 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1065,15 +1065,17 @@ fn tick(vals: &[V]) -> Option<(Affine, Rect, String)> { } /// The gradients and patterns `look` paints with, placed as it draws them, by their swatch's name -/// (the first of each; a pattern's name after `PATTERN_KEY`). -fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, depth: usize) { +/// (the first of each; a pattern's name after `PATTERN_KEY`). With `fill_patterns`, a pattern only +/// where the look fills with it: a style's pattern is a fill, so a path's stack takes it from the +/// look's fills alone (type keeps taking it from either). +fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, fill_patterns: bool, depth: usize) { if depth > MAX_DEPTH { return; } for item in &look.appearance.items { let key = match item.paint() { Paint::Gradient(g) => g.swatch.clone(), - Paint::Pattern { pattern, .. } => Some(format!("{PATTERN_KEY}{pattern}")), + Paint::Pattern { pattern, .. } if item.is_fill() || !fill_patterns => Some(format!("{PATTERN_KEY}{pattern}")), _ => None, }; if let Some(key) = key { @@ -1081,7 +1083,7 @@ fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, depth: usize) { } } for c in look.children().into_iter().flatten() { - placed_paints(c, out, depth + 1); + placed_paints(c, out, fill_patterns, depth + 1); } } @@ -1265,14 +1267,19 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p // A style's gradients are written in a space of the object's bounds that isn't documented; its // drawn look has each where the app placed it. let mut placed = HashMap::new(); - placed_paints(look, &mut placed, 0); + placed_paints(look, &mut placed, stacked, 0); // A stack's gradients are each its own swatch, placed where the drawn look has it: one fitted - // to the object's bounds instead could lie elsewhere, so such a stack keeps its drawn look. + // to the object's bounds instead could lie elsewhere, so such a stack keeps its drawn look. So + // are its patterns, each once (`placed_paints` keeps the first placement of each name). if stacked { - let mut seen = HashSet::new(); + let (mut seen, mut seen_patterns) = (HashSet::new(), HashSet::new()); let placed_apart = st.items.iter().all(|i| match i { StyleItem::Gradient { name: Some(n), .. } => seen.insert(n) && placed.contains_key(paints.names.get(Global::Gradient, n)), StyleItem::Gradient { name: None, .. } => false, + StyleItem::Pattern { name, .. } => { + let key = format!("{PATTERN_KEY}{}", paints.names.get(Global::Pattern, name)); + seen_patterns.insert(key.clone()) && placed.contains_key(&key) + } _ => true, }); if !placed_apart { diff --git a/crates/eps/src/import/ai/style.rs b/crates/eps/src/import/ai/style.rs index e0068a52be..8fa1ceca74 100644 --- a/crates/eps/src/import/ai/style.rs +++ b/crates/eps/src/import/ai/style.rs @@ -188,10 +188,11 @@ pub(super) struct ArtStyle { /// It would be [`Self::simple`] but for a Stroke Style filter's variable width written as one /// centered array ([`centered_widths`]): an object whose drawn look is empty takes it with its profile. pub uneven: bool, - /// It is several fills and strokes in solid colours or gradients (strokes without a brush), - /// each with its own visibility, opacity and blend mode but no effects of its own, under only - /// the effects any object takes that don't move the outline: what a path or compound path is - /// read with when each gradient is placed as its drawn look has it (`read::ops`' `styled`). + /// It is several fills and strokes in solid colours, gradients or patterns (strokes without a + /// brush), each with its own visibility, opacity and blend mode but no effects of its own, under + /// only the effects any object takes that don't move the outline, and under none when a pattern + /// paints: what a path or compound path is read with when each gradient and pattern is placed as + /// its drawn look has it (`read::ops`' `styled`). pub stacked: bool, /// It is one Warp on the whole object, under fills and strokes that paint nothing and have no /// effects of their own: what an image is read with when its live warp draws as its drawn look @@ -1853,9 +1854,15 @@ fn style(filters: &[Filter]) -> ArtStyle { && st.plain && !st.pathfinder && !st.moves_outline() - && st.items.iter().all(|i| matches!(i, StyleItem::Fill(_) | StyleItem::Gradient { .. } | StyleItem::Stroke { brush: None, .. })) + && st.items.iter().all(|i| { + matches!(i, StyleItem::Fill(_) | StyleItem::Gradient { .. } | StyleItem::Pattern { .. } | StyleItem::Stroke { brush: None, .. }) + }) && st.looks.iter().all(|l| l.effects.is_empty()) - && st.effects.iter().all(any_object_takes); + && st.effects.iter().all(any_object_takes) + // A pattern fill under the object's effects keeps the drawn look, a conservative rule: in + // one file a Scribble over a pattern fill drew unlike its look, its tiles placed as the + // look's are (why isn't established). + && (st.effects.is_empty() || !st.items.iter().any(|i| matches!(i, StyleItem::Pattern { .. }))); st.image_warp = st.plain && matches!(st.effects.as_slice(), [e] if e.id.starts_with("warp.")) && st.items.iter().all(|i| matches!(i, StyleItem::Fill(p) | StyleItem::Stroke { paint: p, .. } if p.is_none())) diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 68ba060352..2edc75f59e 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -1260,6 +1260,169 @@ fn a_style_pattern_fill_is_placed_as_a_direct_one() { } } +/// An art style `Stacked` whose stack holds `filters` (basic filters, top first). +fn stacked_style(filters: &[String]) -> String { + format!( + "%AI9_BeginArtStyles\n/KnownStyle :\n(Stacked) /Name ,\n/ActiveStyle :\n/CompoundFilter :\n(Chain Style Filter) 0 0 /Filter ,\n1 /Visible ,\n\ + /CompoundFilter :\n(Stack Style Filter) 0 0 /Filter ,\n1 /Visible ,\n{}\ + /BasicFilter :\n(Conduit Filter) 0 0 /Filter ,\n1 /Visible ,\n;\n /Part ,\n;\n /Part ,\n;\n%AI9_EndArtStyles\n", + filters.concat() + ) +} + +/// A fill filter painting with `paint` (operators). +fn fill_filter(paint: &str) -> String { + format!( + "/BasicFilter :\n(Fill Style Filter) 0 0 /Filter ,\n1 /Visible ,\n/Dictionary : /NotRecorded ,\n/FillStyle : 0 O\n{paint}\n0 1 Xd\n/Def ;\n (FillStyle) ,\n; /Dict ;\n /Part ,\n" + ) +} + +/// A black stroke filter `width` wide. +fn stroke_filter(width: f64) -> String { + format!( + "/BasicFilter :\n(Stroke Style Filter) 0 0 /Filter ,\n1 /Visible ,\n/Dictionary : /NotRecorded ,\n\ + /StrokeStyle : 0 R\n0 0 0 1 0 0 0 XA\n0 J 0 j {width} w 10 M []0 d\n0 XR\n1 0 Xd\n/Def ;\n (StrokeStyle) ,\n; /Dict ;\n /Part ,\n" + ) +} + +/// The layers of a file whose object (`own`, on `%_` lines) has the style `Stacked` and the drawn +/// look `look`. +fn stacked_object(look: &str, own: &str) -> String { + let own: String = own.lines().map(|l| format!("%_{l}\n")).collect(); + layer(&format!("0 Ae\nu\n{look}U\n{own}1 (Stacked) XW\n")) +} + +/// The pattern placement of `n`'s fill painting with a pattern. +fn pattern_xf(n: &Node) -> [f64; 6] { + n.appearance + .items + .iter() + .find_map(|i| match i.paint() { + Paint::Pattern { xf, .. } => Some(xf.as_coeffs()), + _ => None, + }) + .unwrap_or_else(|| panic!("no pattern fill: {:?}", n.appearance.items)) +} + +/// A path or compound path whose art style fills it with a pattern (as a stack of fills and strokes +/// can) comes in as itself with that fill, the pattern placed where the drawn look places it (not +/// where the style's own operands would), among the style's other fills and strokes in their order. +#[test] +fn a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let hole = rect_path(30.0, 40.0, 50.0, 60.0); + // The style's operands and the look's differ: the look's placement is taken. + let (style_ops, look_ops) = ("0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]", "25 30 1.5 .75 30 1 45 10 0 [.8 .1 -.2 1.1 4 -6]"); + let pattern = fill_filter(&format!("(Dots) {style_ops} p")); + let look_xf = |shape: &str| { + let direct = read_ok(&format!("{DOTS}{}", layer(&format!("(Dots) {look_ops} p\n{shape}f\n")))); + pattern_xf(&art(&direct.doc)[0]) + }; + let close = |a: [f64; 6], b: [f64; 6]| a.iter().zip(b).all(|(x, y)| (x - y).abs() < 1e-9); + // The style's operands alone would place it elsewhere. + let style_xf = pattern_xf(&art(&read_ok(&format!("{DOTS}{}", layer(&format!("(Dots) {style_ops} p\n{rect}f\n")))).doc)[0]); + assert!(!close(style_xf, look_xf(&rect)), "{style_xf:?}"); + // A path filled with the pattern alone. + let look = format!("(Dots) {look_ops} p\n{rect}f\n"); + let r = read_ok(&format!("{}{DOTS}{}", stacked_style(std::slice::from_ref(&pattern)), stacked_object(&look, &format!("{rect}n")))); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Path { .. })), "the path: {a:#?} {:?}", r.warnings); + assert!(close(pattern_xf(&a[0]), look_xf(&rect)), "{:?} {:?}", pattern_xf(&a[0]), look_xf(&rect)); + assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + // A compound path, the pattern over a solid fill and under a 3 unit stroke. + let style = stacked_style(&[stroke_filter(3.0), pattern.clone(), fill_filter("0 1 1 0 1 0 0 Xa")]); + let look = format!("{RED}*u\n{rect}f\n{hole}f\n*U\n(Dots) {look_ops} p\n*u\n{rect}f\n{hole}f\n*U\n"); + let own = format!("*u\n{rect}n\n{hole}n\n*U"); + let r = read_ok(&format!("{style}{DOTS}{}", stacked_object(&look, &own))); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Compound { .. })), "the compound path: {a:#?} {:?}", r.warnings); + let items: Vec<String> = a[0] + .appearance + .items + .iter() + .map(|i| match (i, i.paint()) { + (AppearanceItem::Fill(_), Paint::Pattern { .. }) => "pattern fill".into(), + (AppearanceItem::Fill(_), p) => format!("fill {:?}", p.color()), + (AppearanceItem::Stroke(s), _) => format!("stroke {}", s.width), + }) + .collect(); + assert_eq!(items, [format!("fill {:?}", Some(Color::rgb(1.0, 0.0, 0.0))), "pattern fill".into(), "stroke 3".into()]); + assert!(close(pattern_xf(&a[0]), look_xf(&format!("*u\n{rect}f\n{hole}f\n*U\n")))); +} + +/// A stack's pattern fill keeps the drawn look where the look doesn't fill with that pattern: its +/// placement isn't known. A look that only strokes with it doesn't place the fill either. +#[test] +fn a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let ops = "0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]"; + let pattern = fill_filter(&format!("(Dots) {ops} p")); + for (why, look) in + [("a look without the pattern", format!("{RED}{rect}f\n")), ("a look that strokes with it", format!("(Dots) {ops} P\n{rect}S\n"))] + { + let r = read_ok(&format!("{}{DOTS}{}", stacked_style(std::slice::from_ref(&pattern)), stacked_object(&look, &format!("{rect}n")))); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Group { .. })), "{why}: the drawn look: {a:#?}"); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{why}: {:?}", r.warnings); + } +} + +/// A stack that fills with one pattern twice keeps the drawn look: which of the look's placements is +/// whose isn't known. +#[test] +fn a_stack_with_one_pattern_twice_keeps_the_drawn_look() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let ops = "0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]"; + let pattern = fill_filter(&format!("(Dots) {ops} p")); + let look = format!("(Dots) {ops} p\n{rect}f\n(Dots) {ops} p\n{rect}f\n"); + let r = read_ok(&format!("{}{DOTS}{}", stacked_style(&[pattern.clone(), pattern]), stacked_object(&look, &format!("{rect}n")))); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Group { .. })), "the drawn look: {a:#?}"); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); +} + +/// A style's pattern fill under an effect on the object keeps the drawn look, a conservative rule +/// (in one file a Scribble over a pattern fill drew unlike its look; why isn't established). +#[test] +fn a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let hidden = rect.replace('\n', "\n%_"); + let ops = "0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]"; + let shadow = "/BasicFilter :\n(Adobe Drop Shadow) 1 0 /Filter ,\n1 /Visible ,\n/Dictionary : /NotRecorded ,\n2 /Int (blnd) ,\n0.43 /Real (opac) ,\n\ + 37 /Real (dark) ,\n-13 /Real (vert) ,\n11 /Real (horz) ,\n17 /Real (blur) ,\n\ + /FillStyle : 0 O\n0 0 0 0 0 1 0 Xa\n0 1 0 0 0 Xy\n0 J 0 j 1 w 10 M []0 d\n0 XR\n0 1 Xd\n/Def ;\n (sclr) ,\n0 /Int (csrc) ,\n; /Dict ;\n /Part ,\n"; + let style = tiled_style("Dots", ops); + // After the stack, in the object's chain. + let end = ";\n /Part ,\n;\n%AI9_EndArtStyles"; + assert!(style.contains(end)); + let style = style.replace(end, &format!(";\n /Part ,\n{shadow};\n%AI9_EndArtStyles")); + // The style reads, with its pattern fill and the shadow: what keeps the look is the rule. + let st = crate::import::ai::style::art_styles(style.as_bytes()); + let tiled = &st["Tiled"]; + assert!(tiled.plain && tiled.effects.len() == 1, "{tiled:?}"); + let look = format!("0 Ae\nu\n(Dots) {ops} p\n{rect}f\nU\n"); + let r = read_ok(&format!("{style}{DOTS}{}", layer(&format!("{look}%_{hidden}n\n1 (Tiled) XW\n")))); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Group { .. })), "the drawn look: {a:#?}"); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); +} + +/// Type whose style fills it with a pattern takes the placement from its drawn look wherever the look +/// paints with that pattern, a stroke of it too (as before paths took such styles): the look's +/// fills-only rule is the path stack's. +#[test] +fn type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let (style_ops, look_ops) = ("0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]", "25 30 1.5 .75 30 1 45 10 0 [.8 .1 -.2 1.1 4 -6]"); + let look = format!("0 Ae\nu\n/AI11Text :\n1 /FreeUndo ,\n0 /FrameIndex ,\n0 /StoryIndex ,\n;\n(Dots) {look_ops} P\n{rect}S\nU\n"); + let own = "%_/AI11Text :\n%_0 /FreeUndo ,\n%_0 /FrameIndex ,\n%_0 /StoryIndex ,\n%_;\n"; + let styled = read_ok(&format!("{}{DOTS}{}", tiled_style("Dots", style_ops), layer(&format!("{look}{own}1 (Tiled) XW\n")))); + let stroked = read_ok(&format!("{DOTS}{}", layer(&format!("(Dots) {look_ops} P\n{rect}S\n")))); + let Paint::Pattern { xf: got, .. } = fill(&art(&styled.doc)[0]) else { panic!("{:?} {:?}", art(&styled.doc), styled.warnings) }; + let want = pattern_xf(&art(&stroked.doc)[0]); + assert!(got.as_coeffs().iter().zip(want).all(|(g, w)| (g - w).abs() < 1e-9), "{got:?} {want:?}"); +} + /// An art style's pattern fill paints with the pattern under the name it is shown with. #[test] fn a_style_pattern_fill_paints_with_the_shown_name() { From 3ae72821b4e3c84038ac624fb01404db14568299 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Mon, 16 Nov 2026 20:48:30 +0000 Subject: [PATCH 101/247] docs: a path or compound path filled with a pattern through its art style comes in with it (.ai import) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/file-format-parity.md | 3 ++- docs/target-app-parity.md | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 0cc9985a9c..6d5addde38 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (`.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239); scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -361,6 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern (alone, or among other fills and strokes) comes in as itself with that pattern fill instead of its drawn look (#8239). As for a stack's gradients, the pattern is taken only where the drawn look fills with it, once, and is placed as the look places it (type keeps taking its style's pattern from wherever its look paints with it, as before); a stack that fills with one pattern twice, or whose look doesn't fill with the pattern, keeps the drawn look. Under effects on the object a stack with a pattern fill keeps the drawn look too, a conservative rule: in one garment file a Scribble over such a fill drew unlike the look though the tiles were placed as the look's are, for a reason not established. In 200 garment files we own (used locally, never committed), 5 files have paths or compound paths under such styles: 11 objects in 3 files no longer come in as their drawn look; one file is held back by the effects rule; in one, the objects' styles aren't stacks for another reason, not looked into. One render changes, by 0.003% of its pixels, none past the threshold (why wasn't looked into). In another 224 garment files, nothing changes. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f393c7b8d8..5d9a9d9ebf 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (`.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239); scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -61,6 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill (#8239), placed as its drawn look fills with the pattern, once per pattern, not under effects on the object (a conservative rule); type keeps taking its style's pattern as before. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | @@ -269,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -534,7 +535,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -584,6 +585,8 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **`.ai` paths and compound paths with a pattern fill in their art style (#8239):** `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs` cover a path or compound path whose style's stack fills it with a pattern: it comes in with that fill, placed as its drawn look places it (not by the style's own operands), among the style's other fills and strokes in order; a look that doesn't fill with the pattern, a stack that fills with one pattern twice, or effects on the object keep the drawn look. + - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. From 911efc9549e42d38789872e1a92dcc78c8f8e466 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 06:56:24 +0000 Subject: [PATCH 102/247] .ai import: a stack's pattern the drawn look places two ways keeps the look The check that a stack's patterns are each its own took each style item's pattern once, but not that the drawn look places it one way: `placed_paints` keeps a pattern's first placement, so a look filling with one pattern at two placements, for a style that names it once, came in with the first placement for both. `placed_paints` now also notes each pattern the look places otherwise than its first placement, and a stack with such a pattern keeps its drawn look. The same placement again, as a compound path's look has for each subpath, is still one. Test `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look` (two placements keep the look; the same one twice comes in as the path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- crates/eps/src/import/ai/read/ops.rs | 28 ++++++++++++++++++++-------- crates/eps/src/import/ai/tests.rs | 22 ++++++++++++++++++++++ docs/file-format-parity.md | 2 +- docs/target-app-parity.md | 10 +++++----- 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/crates/eps/src/import/ai/read/ops.rs b/crates/eps/src/import/ai/read/ops.rs index 796e8687fa..87e114cfe8 100644 --- a/crates/eps/src/import/ai/read/ops.rs +++ b/crates/eps/src/import/ai/read/ops.rs @@ -1067,8 +1067,9 @@ fn tick(vals: &[V]) -> Option<(Affine, Rect, String)> { /// The gradients and patterns `look` paints with, placed as it draws them, by their swatch's name /// (the first of each; a pattern's name after `PATTERN_KEY`). With `fill_patterns`, a pattern only /// where the look fills with it: a style's pattern is a fill, so a path's stack takes it from the -/// look's fills alone (type keeps taking it from either). -fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, fill_patterns: bool, depth: usize) { +/// look's fills alone (type keeps taking it from either). `moved` gets each pattern that the look +/// also places elsewhere than its first placement. +fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, moved: &mut HashSet<String>, fill_patterns: bool, depth: usize) { if depth > MAX_DEPTH { return; } @@ -1079,11 +1080,20 @@ fn placed_paints(look: &Node, out: &mut HashMap<String, Paint>, fill_patterns: b _ => None, }; if let Some(key) = key { - out.entry(key).or_insert_with(|| item.paint().clone()); + match out.get(&key) { + Some(first) => { + if matches!(first, Paint::Pattern { .. }) && first != item.paint() { + moved.insert(key); + } + } + None => { + out.insert(key, item.paint().clone()); + } + } } } for c in look.children().into_iter().flatten() { - placed_paints(c, out, fill_patterns, depth + 1); + placed_paints(c, out, moved, fill_patterns, depth + 1); } } @@ -1266,11 +1276,13 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p let own_gradient = object.appearance.fill().filter(|f| matches!(f.paint, Paint::Gradient(_))); // A style's gradients are written in a space of the object's bounds that isn't documented; its // drawn look has each where the app placed it. - let mut placed = HashMap::new(); - placed_paints(look, &mut placed, stacked, 0); + let (mut placed, mut moved) = (HashMap::new(), HashSet::new()); + placed_paints(look, &mut placed, &mut moved, stacked, 0); // A stack's gradients are each its own swatch, placed where the drawn look has it: one fitted // to the object's bounds instead could lie elsewhere, so such a stack keeps its drawn look. So - // are its patterns, each once (`placed_paints` keeps the first placement of each name). + // are its patterns, each once, and each placed one way in the look: `placed_paints` keeps the + // first placement of each name, and which of several is the style's isn't known. The same + // placement again (a compound path's look fills each subpath) is still one. if stacked { let (mut seen, mut seen_patterns) = (HashSet::new(), HashSet::new()); let placed_apart = st.items.iter().all(|i| match i { @@ -1278,7 +1290,7 @@ fn styled(object: &Node, look: &Node, st: &crate::import::ai::style::ArtStyle, p StyleItem::Gradient { name: None, .. } => false, StyleItem::Pattern { name, .. } => { let key = format!("{PATTERN_KEY}{}", paints.names.get(Global::Pattern, name)); - seen_patterns.insert(key.clone()) && placed.contains_key(&key) + seen_patterns.insert(key.clone()) && placed.contains_key(&key) && !moved.contains(&key) } _ => true, }); diff --git a/crates/eps/src/import/ai/tests.rs b/crates/eps/src/import/ai/tests.rs index 2edc75f59e..cc33a87b5f 100644 --- a/crates/eps/src/import/ai/tests.rs +++ b/crates/eps/src/import/ai/tests.rs @@ -1381,6 +1381,28 @@ fn a_stack_with_one_pattern_twice_keeps_the_drawn_look() { assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); } +/// A stack that fills with a pattern once, whose drawn look fills with it twice at different +/// placements, keeps the drawn look: which placement is the style's isn't known. A look filling with +/// it twice at the same placement still comes in as the path with that fill. +#[test] +fn a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look() { + let rect = rect_path(10.0, 20.0, 70.0, 80.0); + let ops = "0 0 1 1 0 0 0 0 0 [1 0 0 1 0 0]"; + let other = "25 30 1.5 .75 30 1 45 10 0 [.8 .1 -.2 1.1 4 -6]"; + let pattern = fill_filter(&format!("(Dots) {ops} p")); + let read = |second: &str| { + let look = format!("(Dots) {ops} p\n{rect}f\n(Dots) {second} p\n{rect}f\n"); + read_ok(&format!("{}{DOTS}{}", stacked_style(std::slice::from_ref(&pattern)), stacked_object(&look, &format!("{rect}n")))) + }; + let r = read(other); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Group { .. })), "the drawn look: {a:#?}"); + assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings); + let r = read(ops); + let a = art(&r.doc); + assert!(matches!(a.as_slice(), [n] if matches!(n.kind, NodeKind::Path { .. })), "the path: {a:#?} {:?}", r.warnings); +} + /// A style's pattern fill under an effect on the object keeps the drawn look, a conservative rule /// (in one file a Scribble over a pattern fill drew unlike its look; why isn't established). #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 6d5addde38..f69404a75b 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -361,7 +361,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern (alone, or among other fills and strokes) comes in as itself with that pattern fill instead of its drawn look (#8239). As for a stack's gradients, the pattern is taken only where the drawn look fills with it, once, and is placed as the look places it (type keeps taking its style's pattern from wherever its look paints with it, as before); a stack that fills with one pattern twice, or whose look doesn't fill with the pattern, keeps the drawn look. Under effects on the object a stack with a pattern fill keeps the drawn look too, a conservative rule: in one garment file a Scribble over such a fill drew unlike the look though the tiles were placed as the look's are, for a reason not established. In 200 garment files we own (used locally, never committed), 5 files have paths or compound paths under such styles: 11 objects in 3 files no longer come in as their drawn look; one file is held back by the effects rule; in one, the objects' styles aren't stacks for another reason, not looked into. One render changes, by 0.003% of its pixels, none past the threshold (why wasn't looked into). In another 224 garment files, nothing changes. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | +| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern (alone, or among other fills and strokes) comes in as itself with that pattern fill instead of its drawn look (#8239). As for a stack's gradients, the pattern is taken only where the drawn look fills with it, once, and is placed as the look places it (type keeps taking its style's pattern from wherever its look paints with it, as before); a stack that fills with one pattern twice, or whose look doesn't fill with the pattern, keeps the drawn look. Under effects on the object a stack with a pattern fill keeps the drawn look too, a conservative rule: in one garment file a Scribble over such a fill drew unlike the look though the tiles were placed as the look's are, for a reason not established. In 200 garment files we own (used locally, never committed), 5 files have paths or compound paths under such styles: 11 objects in 3 files no longer come in as their drawn look; one file is held back by the effects rule; in one, the objects' styles aren't stacks for another reason, not looked into. One render changes, by 0.003% of its pixels, none past the threshold (why wasn't looked into). In another 224 garment files, nothing changes. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) came in with butt caps, miter joins and a miter limit of 10 whatever the file stroked it with, while paths kept the graphics state's. The characters' stroke now takes the line cap (`J`), line join (`j`) and miter limit (`M`) of the graphics state, as a path's stroke does, and glyphs stroked with other ones start a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined, so the glyphs before it keep their stroke (#7741). Test `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`. Scores and estimates unchanged. | | 2026-11-13 | minor | `.ai` and EPS import: layers that don't draw as the page, even with the drawn art of every live envelope put back, no longer put back the drawn art of every envelope of type. Each live envelope of type is weighed in the page check's own drawing of the pages it lies on, on the pixels that it and its drawn art ink there (the two drawn together on a layer of their own, without the rest of the layers; a pixel inks with an alpha above 8 of 255): it keeps its drawn art and its type, hidden, with the note, where the layers with it differ from the page in more of those pixels than its own check allows against its drawn art (10% of them, or 3% differing with all their neighbours, away from type), or where the envelopes of type that stay live, in the order they were read, would together differ there in more of a page than half of what the page check allows (a budget of the same size as the one their own checks share, kept apart from it). Art that differs elsewhere on the page no longer costs them their editable type; art that differs on their pixels still does. An envelope of type that a clip group or a clipping sublayer clips, an opacity mask masks, or a group with an appearance of its own, another envelope, a repeat or a blend holds keeps its drawn art as before, wherever it lies: drawn on its own it would be weighed elsewhere than it draws, and what holds it can draw it onto the page from off it. An envelope on no page stays live, as the page check doesn't see it, unless the page holds all the art that prints (an EPS's page that is its art's box, where art past the page is compared too): there one reaching past the page keeps its drawn art. Past 12 of them on the pages, all keep it. This holds where the editing data is trusted, where the objects that differ come in as the page's art (the placed files' other placement weighed on its own, as it draws them elsewhere under or over the envelopes; layers that draw as the page with only the envelopes the page holds put back are used as they are; where none of the objects that differ can then come in as the page's art, because an object holds type, the drawn art of every envelope of type is put back and that is tried again, as before), and for a `.ai` whose layers would open alone, which still opens alone: its envelopes of type are all settled again as they were with the page, in the same order and with the same checks, so each that opens live draws as it was weighed, and those the page held get their drawn art back. Where putting the drawn art of every live envelope back makes the layers draw as the page, it is still put back (#5065). In 224 users' files (used locally, never committed): envelopes of type that open live go from 174 to 186, in 8 files, none fewer in any file; no file changes between its layers and its PDF part; 7 renders change, by at most 0.7% of their pixels at 40 ppi (1 closer to the page, 1 alike, 5 further, by at most 0.7 of a percentage point, where VectorCraft's own envelope draws a little apart from the drawn art, within its check); the note for type in an envelope goes from 6 files. Of the 14 envelopes of type that had opened live and lost it to the page check, 2 keep their drawn art: one where the page draws something else where it is, and one in a file that comes in as its PDF part (#7141). Tests `build::candidate_tests::the_page_holds_back_only_envelopes_of_type_where_it_differs_from_them`, `envelopes_of_type_stay_live_within_half_of_what_the_page_check_allows`, `an_envelope_of_type_differing_in_more_of_its_pixels_than_its_check_allows_is_held_back`, `envelopes_of_type_the_layers_dont_draw_in_place_are_held_back`, `on_a_page_that_holds_all_the_art_an_envelope_of_type_past_it_is_held_back`, `objects_come_in_as_the_page_art_with_every_envelope_of_type_put_back_where_a_live_one_holds_a_difference`, `tests_native::layers_that_would_open_alone_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `layers_that_would_open_alone_keep_live_only_the_envelopes_of_type_the_page_doesnt_hold`, `trusted_layers_that_would_open_alone_open_alone_with_an_envelope_of_type_the_page_doesnt_hold_live`, `layers_with_objects_that_come_in_as_the_page_art_keep_an_envelope_of_type_that_draws_as_the_page_live`, `trusted_layers_keep_an_envelope_of_type_live_where_other_art_differs_from_the_page`, `trusted_layers_leave_an_envelope_of_type_the_page_draws_otherwise_its_drawn_art`, `build::candidate_tests::the_other_placement_of_placed_files_is_weighed_on_its_own`, `layers_that_draw_as_the_page_with_the_held_envelopes_of_type_put_back_are_used_so` | | 2026-11-13 | minor | PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke instead of being left out, adding no text (#6971; `empty_actual_text_keeps_the_glyphs_art` in `crates/pdf/src/tests/actual_text.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 5d9a9d9ebf..4861d1c75b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -61,7 +61,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill (#8239), placed as its drawn look fills with the pattern, once per pattern, not under effects on the object (a conservative rule); type keeps taking its style's pattern as before. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | +| 2026-11-16 | minor | `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill (#8239), placed as its drawn look fills with the pattern, once per pattern, not under effects on the object (a conservative rule); type keeps taking its style's pattern as before. Tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`. Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork › Assign: native Lab entry in the Color Picker, swatch libraries access in the picker, and row context menu options (Pick from Swatches, Limit to Library) (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | PDF import: stroked type (text rendering modes 1, 2, 5 and 6, and glyphs under `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do, instead of butt caps, miter joins and a miter limit of 10; a glyph filled and then stroked otherwise than the run its fill joined comes in as a run of its own, so the glyphs before it keep their stroke (#7741; `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). Scores and estimates unchanged. | | 2026-11-15 | minor | G5: Neon & Glow joins Shadows and Glows, Outlines and Rules, Hand-Drawn, Textures, Painted and Sketched, Gradient Finishes, Shape Effects, Blends and Transparency, Game HUD and Status Effects as an eleventh built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor; original procedural styles generated in code); area score and estimate unchanged. | @@ -270,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -585,7 +585,7 @@ since 2026-10-01. ## Evidence: what ships today, by area -- **`.ai` paths and compound paths with a pattern fill in their art style (#8239):** `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs` cover a path or compound path whose style's stack fills it with a pattern: it comes in with that fill, placed as its drawn look places it (not by the style's own operands), among the style's other fills and strokes in order; a look that doesn't fill with the pattern, a stack that fills with one pattern twice, or effects on the object keep the drawn look. +- **`.ai` paths and compound paths with a pattern fill in their art style (#8239):** `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs` cover a path or compound path whose style's stack fills it with a pattern: it comes in with that fill, placed as its drawn look places it (not by the style's own operands), among the style's other fills and strokes in order; a look that doesn't fill with the pattern, a stack that fills with one pattern twice, or effects on the object keep the drawn look. - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. From 074d7f9facc8b61c5c1287f1634eaf56c941a9fe Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 06:56:24 +0000 Subject: [PATCH 103/247] docs: roadmap M4 Files row notes #8239 The status line, the M4 Files row and the revision history name the change, as AGENTS.md asks of a change that lands. Estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/roadmap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index bfaa10db30..620d7e6932 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (M4: `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill, #8239; scores and estimates unchanged; previously: M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -160,7 +160,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: a path or compound path filled with a pattern through its art style comes in with it (#8239; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-16 | minor | M4: `.ai` and EPS import (#8239): a path or compound path whose art style fills it with a pattern comes in with that pattern fill, placed as its drawn look fills with it, each pattern once; details in [file-format-parity.md](file-format-parity.md). Scores and estimates unchanged. | | 2026-11-16 | minor | M1: rows or the selected-art square dragged over the Layers panel's list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | From f9b4313027212caecdb7395f3f4e10d9ca80516e Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 07:39:09 +0000 Subject: [PATCH 104/247] docs: the first File formats row names the saved editing copy's limits (#868) It still said Illustrator's editing data isn't written, while the other two File formats rows give what a saved `.ai`'s editing copy leaves out. It now has their words. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 4861d1c75b..f7f664103c 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,7 +270,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: a path or compound path whose art style fills it with a pattern comes in with that pattern fill where its drawn look places the pattern (#8239) (tests `a_path_with_a_style_pattern_fill_comes_in_as_the_path_with_it`, `a_style_pattern_fill_the_look_doesnt_paint_keeps_the_drawn_look`, `a_stack_with_one_pattern_twice_keeps_the_drawn_look`, `a_look_placing_a_stacks_pattern_twice_keeps_the_drawn_look`, `a_path_with_a_style_pattern_fill_under_an_effect_keeps_its_drawn_look` and `type_with_a_style_pattern_fill_takes_a_stroke_only_looks_placement` in `crates/eps/src/import/ai/tests.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | From 5b55952641fab6239972ac657cc978e57ce2dfe5 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 07:39:09 +0000 Subject: [PATCH 105/247] docs: the status line names the aligned-dash strokes that keep their look (#8196) Type with dashes aligned to corners, and strokes past the 256 checks an import makes, keep their drawn look; the status line said only that such strokes come in live where they draw as their look. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 800dd8e1fc..5eaf747539 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8196: `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (#8196: `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, except type with such dashes and strokes past the 256 an import checks, which keep their drawn look; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > From 07f9948a08518c004fa34f27e477cae7c587b51f Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 08:35:23 +0000 Subject: [PATCH 106/247] docs: note dashes aligned to corners (#8196) in the File formats rows and evidence The area rows and the evidence list name the change and its tests, as AGENTS.md asks of a change that lands. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 5eaf747539..677956b6a8 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,9 +270,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -535,7 +535,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | `.ai` and EPS import: dashes aligned to corners come in live where they draw as their drawn look (#8196; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -585,6 +585,8 @@ since 2026-10-01. ## Evidence: what ships today, by area +- **`.ai` dashes aligned to corners (#8196):** `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` and `dashes_aligned_to_corners_that_draw_apart_from_the_look_keep_it` in `crates/eps/src/import/tests_native.rs` cover a stroke from an art style with dashes aligned to corners and path ends: it comes in live where VectorCraft's fitting draws as its drawn look, and keeps the look where it doesn't. `dashes_aligned_to_corners_past_their_checks_keep_the_look` covers the 256 checks an import makes, `the_reads_apart_from_the_layers_check_no_aligned_dashes` that the reads of a file apart from its layers spend none of them, and `type_with_dashes_aligned_to_corners_keeps_its_drawn_look` that type keeps its look. `a_stroke_offset_with_dashes_aligned_to_corners_unlike_its_look_keeps_the_look` in `crates/eps/src/import/ai/tests.rs` and `dashes_aligned_to_corners_read_as_aligned_dashes` in `crates/eps/src/import/ai/style/tests.rs` cover the style. Synthetic files written in the tests; no fixtures added. Scores and hours unchanged. + - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Save refusal (#6146):** ordinary File > Save to its own location offers Save As after a terminal permission/read-only refusal, suggesting the original name and format, preserving options for the unchanged format and opening the chosen format’s Save options on a change. Cancel keeps the failed-save state. Busy pickers, recovery-copy errors, other failures, explicit destinations and Close/Quit keep the existing dialog. Engine, UI and MCP regression cases are in `cmd/fileio/tests_readonly.rs`, `io/tests_read_only_save.rs` and MCP `tests/fileio.rs`; focused UI regressions passed; engine regression execution and native panel acceptance pending. Scores and hours unchanged. From f3299f377d50ee341eefa1d36351b7b35b4d1f06 Mon Sep 17 00:00:00 2001 From: jmverges <juanmanuel.vergessolanas@gmail.com> Date: Tue, 17 Nov 2026 08:35:23 +0000 Subject: [PATCH 107/247] docs: the first File formats row names the saved editing copy's limits (#868) It still said Illustrator's editing data isn't written, while the other two File formats rows give what a saved `.ai`'s editing copy leaves out. It now has their words. Scores and estimates unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 677956b6a8..4194ff5b0b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -270,7 +270,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.| 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. `.ai` and EPS import: strokes with dashes aligned to corners come in live where VectorCraft's fitting draws as their drawn look, within 256 checks per import, type with such dashes keeping its look (#8196, `dashes_aligned_to_corners_that_draw_as_the_look_come_in_live` in `crates/eps/src/import/tests_native.rs`); score, gaps and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | From 48709eeb448b39704e2d7146db17f177627cfc7f Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 04:11:51 -0800 Subject: [PATCH 108/247] Brushes: the built-in library test covers Arrows The built-in library test now expects arrows as the eleventh library, checks its brush names, types and count, and draws each of its brushes with the other art libraries. --- crates/engine/src/tests/brushlib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index e0bf926830..0f04a3c4dd 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -116,7 +116,8 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { "game-trails", "energy-beams", "dry-media", - "tech-circuit" + "tech-circuit", + "arrows" ] ); assert!(libs.iter().all(|l| l["category"] == "builtIn")); @@ -144,6 +145,12 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { [("Chalk Grain", "art"), ("Graphite Pencil", "art"), ("Wax Crayon", "art"), ("Charcoal Dust", "art")] ); assert_eq!((libs[8]["name"].as_str(), libs[8]["count"].as_u64()), (Some("Dry Media"), Some(4))); + let arrows = run(&mut s, "brush.library", json!({"library": "Arrows"})); + assert_eq!( + arrows["brushes"].as_array().unwrap().iter().map(|b| (b["name"].as_str().unwrap(), b["type"].as_str().unwrap())).collect::<Vec<_>>(), + [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art")] + ); + assert_eq!((libs[10]["name"].as_str(), libs[10]["count"].as_u64()), (Some("Arrows"), Some(4))); run(&mut s, "file.new", json!({"width": 200, "height": 200})); let id = run(&mut s, "shape.rectangle", json!({"x": 10, "y": 20, "width": 40, "height": 8}))["id"].as_u64().unwrap(); let added = run(&mut s, "brush.addFromLibrary", json!({"library": "energy-beams", "name": "Laser Bolt", "apply": true, "ids": [id]})); @@ -160,6 +167,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { ("game-trails", "art"), ("energy-beams", "art"), ("dry-media", "art"), + ("arrows", "art"), ] { let (_, lib) = cmd::brushlib::library(&s, id).unwrap(); assert!(lib.len() >= 4, "{id}"); From 25e0b79d071852c3edebd98d7672dfc9ef4522f7 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 04:23:31 -0800 Subject: [PATCH 109/247] Brushes: Arrows names in the catalogs and the UI library tests Every complete catalog gets rows for the Arrows library and its Solid, Open and Chevron Arrow brushes, plus Double Arrow where the catalog had none. The Window menu test expects arrows after tech-circuit, and the catalog test counts 50 built-in brush names. --- crates/ui-egui/src/i18n/bg.tsv | 6 ++++++ crates/ui-egui/src/i18n/bs.tsv | 6 ++++++ crates/ui-egui/src/i18n/ca.tsv | 6 ++++++ crates/ui-egui/src/i18n/cs.tsv | 6 ++++++ crates/ui-egui/src/i18n/da.tsv | 6 ++++++ crates/ui-egui/src/i18n/de.tsv | 7 +++++++ crates/ui-egui/src/i18n/el.tsv | 6 ++++++ crates/ui-egui/src/i18n/es.tsv | 6 ++++++ crates/ui-egui/src/i18n/fi.tsv | 6 ++++++ crates/ui-egui/src/i18n/fr.tsv | 6 ++++++ crates/ui-egui/src/i18n/gu.tsv | 7 +++++++ crates/ui-egui/src/i18n/hi.tsv | 6 ++++++ crates/ui-egui/src/i18n/hu.tsv | 6 ++++++ crates/ui-egui/src/i18n/id.tsv | 6 ++++++ crates/ui-egui/src/i18n/it.tsv | 7 +++++++ crates/ui-egui/src/i18n/ja.tsv | 7 +++++++ crates/ui-egui/src/i18n/ka.tsv | 6 ++++++ crates/ui-egui/src/i18n/ko.tsv | 7 +++++++ crates/ui-egui/src/i18n/nl.tsv | 6 ++++++ crates/ui-egui/src/i18n/pl.tsv | 6 ++++++ crates/ui-egui/src/i18n/pt-br.tsv | 6 ++++++ crates/ui-egui/src/i18n/ru.tsv | 6 ++++++ crates/ui-egui/src/i18n/sv.tsv | 6 ++++++ crates/ui-egui/src/i18n/tests.rs | 2 +- crates/ui-egui/src/i18n/tr.tsv | 6 ++++++ crates/ui-egui/src/i18n/uk.tsv | 7 +++++++ crates/ui-egui/src/i18n/vi.tsv | 7 +++++++ crates/ui-egui/src/i18n/zh-hans.tsv | 7 +++++++ crates/ui-egui/src/i18n/zh-hant.tsv | 7 +++++++ crates/ui-egui/src/panels/tests_brush_libraries.rs | 3 ++- 30 files changed, 180 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index f5c3d81538..a79d211e4a 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -6415,6 +6415,12 @@ axis Y Axis Y ос Bus Lines Шинни линии Terminal Nodes Крайни възли +# Original arrow art brushes. + Arrows Стрелки + Solid Arrow Плътна стрелка + Open Arrow Отворена стрелка + Chevron Arrow Стрелка с шеврон + Notched Ribbon Назъбена лента Double Line Двойна линия Wave Вълна diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3eb20cef41..a27f1242d4 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -6469,6 +6469,12 @@ axis Y Axis Y osa Bus Lines Linije sabirnice Terminal Nodes Priključni čvorovi +# Original arrow art brushes. + Arrows Strelice + Solid Arrow Puna strelica + Open Arrow Otvorena strelica + Chevron Arrow Strelica sa ševronom + Notched Ribbon Zarezana traka Double Line Dvostruka linija Wave Talas diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index cf2b3aa96b..d2faf90332 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4123,6 +4123,12 @@ digits Malayalam Malaiàlam Bus Lines Línies de bus Terminal Nodes Nodes terminals +# Original arrow art brushes. + Arrows Fletxes + Solid Arrow Fletxa sòlida + Open Arrow Fletxa oberta + Chevron Arrow Fletxa amb galó + Notched Ribbon Cinta dentada Double Line Línia doble Wave Ona diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 0f55ec62b5..fbaa957581 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7100,6 +7100,12 @@ axis Y Axis osa Y Bus Lines Sběrnicové linky Terminal Nodes Koncové uzly +# Original arrow art brushes. + Arrows Šipky + Solid Arrow Plná šipka + Open Arrow Otevřená šipka + Chevron Arrow Šipka s krokví + Notched Ribbon Vroubkovaná stuha Double Line Dvojitá čára Wave Vlna diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 2ef968f154..fe62578f75 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -9186,6 +9186,12 @@ axis Y Axis Y-akse Bus Lines Buslinjer Terminal Nodes Terminalpunkter +# Original arrow art brushes. + Arrows Pile + Solid Arrow Massiv pil + Open Arrow Åben pil + Chevron Arrow Chevronpil + Notched Ribbon Takket bånd Double Line Dobbelt linje Wave Bølge diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index ccedd8def5..dbf8a65a86 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6687,6 +6687,13 @@ axis Y Axis Y-Achse Bus Lines Busleitungen Terminal Nodes Anschlussknoten +# Original arrow art brushes. + Arrows Pfeile + Solid Arrow Gefüllter Pfeil + Open Arrow Offener Pfeil + Double Arrow Doppelpfeil + Chevron Arrow Winkelpfeil + Notched Ribbon Gekerbtes Band Double Line Doppellinie Wave Welle diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index af13a82f93..1d09447d06 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7082,6 +7082,12 @@ axis Y Axis Άξονας Y Bus Lines Γραμμές διαύλου Terminal Nodes Τερματικοί κόμβοι +# Original arrow art brushes. + Arrows Βέλη + Solid Arrow Συμπαγές βέλος + Open Arrow Ανοιχτό βέλος + Chevron Arrow Βέλος με σεβρόν + Notched Ribbon Οδοντωτή κορδέλα Double Line Διπλή γραμμή Wave Κύμα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 42018b5f2c..21351d3d58 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7070,6 +7070,12 @@ axis Y Axis Eje Y Bus Lines Líneas de bus Terminal Nodes Nodos terminales +# Original arrow art brushes. + Arrows Flechas + Solid Arrow Flecha sólida + Open Arrow Flecha abierta + Chevron Arrow Flecha con cheurón + Notched Ribbon Cinta dentada Double Line Línea doble Wave Onda diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 39fc4744fb..89dcf14f8e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7159,6 +7159,12 @@ axis Y Axis Y-akseli Bus Lines Väylälinjat Terminal Nodes Liitäntäpisteet +# Original arrow art brushes. + Arrows Nuolet + Solid Arrow Umpinainen nuoli + Open Arrow Avoin nuoli + Chevron Arrow Kulmanuoli + Notched Ribbon Lovettu nauha Double Line Kaksoisviiva Wave Aalto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 07208d40e8..4fbfe2d7f9 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7095,6 +7095,12 @@ axis Y Axis Axe Y Bus Lines Lignes de bus Terminal Nodes Nœuds terminaux +# Original arrow art brushes. + Arrows Flèches + Solid Arrow Flèche pleine + Open Arrow Flèche ouverte + Chevron Arrow Flèche à chevron + Notched Ribbon Ruban cranté Double Line Double ligne Wave Vague diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 0529faf266..b304a4ff89 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4680,6 +4680,13 @@ antiAlias Sharp શાર્પ Bus Lines બસ રેખાઓ Terminal Nodes ટર્મિનલ નોડ્સ +# Original arrow art brushes. + Arrows તીરો + Solid Arrow ભરેલું તીર + Open Arrow ખુલ્લું તીર + Double Arrow બેવડું તીર + Chevron Arrow શેવરોન તીર + Notched Ribbon ખાંચાવાળી રિબન Double Line બેવડી રેખા Wave તરંગ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 725d5147c1..f229c1d2c2 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -452,6 +452,12 @@ antiAlias Sharp शार्प Bus Lines बस रेखाएँ Terminal Nodes टर्मिनल नोड +# Original arrow art brushes. + Arrows तीर ब्रश + Solid Arrow ठोस तीर + Open Arrow खुला तीर + Chevron Arrow शेवरॉन तीर + Notched Ribbon नोकदार रिबन Double Line दोहरी लाइन Wave लहर diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 8cd65be0ab..2ec0b3755a 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7084,6 +7084,12 @@ axis Y Axis Y tengely Bus Lines Buszvonalak Terminal Nodes Csatlakozási pontok +# Original arrow art brushes. + Arrows Nyilak + Solid Arrow Tömör nyíl + Open Arrow Nyitott nyíl + Chevron Arrow Ékmintás nyíl + Notched Ribbon Csipkézett szalag Double Line Dupla vonal Wave Hullám diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index c6b98ebc8a..da5b6d38e9 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -6431,6 +6431,12 @@ axis Y Axis Sumbu Y Bus Lines Jalur bus Terminal Nodes Simpul terminal +# Original arrow art brushes. + Arrows Kuas panah + Solid Arrow Panah solid + Open Arrow Panah terbuka + Chevron Arrow Panah chevron + Notched Ribbon Pita bertakik Double Line Garis ganda Wave Gelombang diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 415aa31ca5..d6e2fd97e3 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -6723,6 +6723,13 @@ axis Y Axis Asse Y Bus Lines Linee del bus Terminal Nodes Nodi terminali +# Original arrow art brushes. + Arrows Frecce + Solid Arrow Freccia piena + Open Arrow Freccia aperta + Double Arrow Doppia freccia + Chevron Arrow Freccia con gallone + Notched Ribbon Nastro dentellato Double Line Doppia linea Wave Onda diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 751572fc02..86921fbc19 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8602,6 +8602,13 @@ axis Y Axis Y 軸 Bus Lines バス配線 Terminal Nodes 端子ノード +# Original arrow art brushes. + Arrows 矢印ブラシ + Solid Arrow 塗りつぶし矢印 + Open Arrow 中抜き矢印 + Double Arrow 両矢印 + Chevron Arrow 山形付き矢印 + Notched Ribbon ノッチリボン Double Line 二重線 Wave 波 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 97ea30797e..ee7b732bb5 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9241,6 +9241,12 @@ axis Y Axis Y ღერძი Bus Lines სალტის ხაზები Terminal Nodes ტერმინალური კვანძები +# Original arrow art brushes. + Arrows ისრები + Solid Arrow მყარი ისარი + Open Arrow ღია ისარი + Chevron Arrow შევრონიანი ისარი + Notched Ribbon დაკბილული ლენტი Double Line ორმაგი ხაზი Wave ტალღა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index d80bd672b8..c65d18379d 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6687,6 +6687,13 @@ axis Y Axis Y축 Bus Lines 버스 배선 Terminal Nodes 단자 노드 +# Original arrow art brushes. + Arrows 화살표 브러시 + Solid Arrow 채워진 화살표 + Open Arrow 속이 빈 화살표 + Double Arrow 양방향 화살표 + Chevron Arrow 갈매기형 화살표 + Notched Ribbon 노치 리본 Double Line 이중선 Wave 물결 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 46d76fdcbb..955ab57715 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9009,6 +9009,12 @@ axis Y Axis Y-as Bus Lines Buslijnen Terminal Nodes Aansluitpunten +# Original arrow art brushes. + Arrows Pijlen + Solid Arrow Massieve pijl + Open Arrow Open pijl + Chevron Arrow Chevronpijl + Notched Ribbon Gekerfd lint Double Line Dubbele lijn Wave Golf diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 4e59903186..c7444a05cb 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -6954,6 +6954,12 @@ axis Y Axis Oś Y Bus Lines Linie magistrali Terminal Nodes Węzły końcowe +# Original arrow art brushes. + Arrows Strzałki + Solid Arrow Pełna strzałka + Open Arrow Otwarta strzałka + Chevron Arrow Strzałka z szewronem + Notched Ribbon Wstęga z nacięciami Double Line Podwójna linia Wave Fala diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index ac559a9266..753a1a78e3 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7012,6 +7012,12 @@ axis Y Axis Eixo Y Bus Lines Linhas de barramento Terminal Nodes Nós terminais +# Original arrow art brushes. + Arrows Setas + Solid Arrow Seta Sólida + Open Arrow Seta Aberta + Chevron Arrow Seta com Divisa + Notched Ribbon Fita Entalhada Double Line Linha Dupla Wave Onda diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 1bcbfbb578..0df245417d 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -6724,6 +6724,12 @@ axis Y Axis Ось Y Bus Lines Линии шины Terminal Nodes Контактные узлы +# Original arrow art brushes. + Arrows Кисти-стрелки + Solid Arrow Сплошная стрелка + Open Arrow Открытая стрелка + Chevron Arrow Стрелка с шевроном + Notched Ribbon Лента с насечками Double Line Двойная линия Wave Волна diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 89ea62fb01..0bdcef01da 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7101,6 +7101,12 @@ axis Y Axis Y-axel Bus Lines Bussledningar Terminal Nodes Anslutningspunkter +# Original arrow art brushes. + Arrows Pilar + Solid Arrow Massiv pil + Open Arrow Öppen pil + Chevron Arrow Chevronpil + Notched Ribbon Hackat band Double Line Dubbellinje Wave Våg diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index ed4b44b0da..24aa62671d 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -502,7 +502,7 @@ fn built_in_library_brush_names_are_in_complete_catalogs() { .collect(); names.sort(); names.dedup(); - assert_eq!(names.len(), 46, "{names:?}"); + assert_eq!(names.len(), 50, "{names:?}"); let mut bad = vec![]; for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { let missing: Vec<&String> = names.iter().filter(|n| lang.catalog().plain(n).is_none()).collect(); diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index e232187cad..8ef24d0686 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -8981,6 +8981,12 @@ axis Y Axis Y ekseni Bus Lines Veriyolu hatları Terminal Nodes Bağlantı düğümleri +# Original arrow art brushes. + Arrows Oklar + Solid Arrow Dolu Ok + Open Arrow Açık Ok + Chevron Arrow Köşeli Ok + Notched Ribbon Çentikli Şerit Double Line Çift Çizgi Wave Dalga diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index d7815a42ed..c4836570af 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -6705,6 +6705,13 @@ axis Y Axis Вісь Y Bus Lines Лінії шини Terminal Nodes Контактні вузли +# Original arrow art brushes. + Arrows Пензлі-стрілки + Solid Arrow Суцільна стрілка + Open Arrow Відкрита стрілка + Double Arrow Подвійна стрілка + Chevron Arrow Стрілка з шевроном + Notched Ribbon Стрічка з насічками Double Line Подвійна лінія Wave Хвиля diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d288931824..95b0e32544 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -6736,6 +6736,13 @@ axis Y Axis Trục Y Bus Lines Đường bus Terminal Nodes Nút đầu cuối +# Original arrow art brushes. + Arrows Cọ mũi tên + Solid Arrow Mũi tên đặc + Open Arrow Mũi tên rỗng + Double Arrow Mũi tên đôi + Chevron Arrow Mũi tên chữ V + Notched Ribbon Dải băng khía Double Line Đường đôi Wave Sóng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index bf7a1bcc7c..deac7a0ce1 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -6938,6 +6938,13 @@ axis Y Axis Y 轴 Bus Lines 总线 Terminal Nodes 端子节点 +# Original arrow art brushes. + Arrows 箭头画笔 + Solid Arrow 实心箭头 + Open Arrow 空心箭头 + Double Arrow 双向箭头 + Chevron Arrow 人字纹箭头 + Notched Ribbon 凹口丝带 Double Line 双线 Wave 波浪 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 87e1bde68b..ea134ed591 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -6746,6 +6746,13 @@ axis Y Axis Y 軸 Bus Lines 匯流排 Terminal Nodes 端子節點 +# Original arrow art brushes. + Arrows 箭頭筆刷 + Solid Arrow 實心箭頭 + Open Arrow 空心箭頭 + Double Arrow 雙向箭頭 + Chevron Arrow 人字紋箭頭 + Notched Ribbon 凹口緞帶 Double Line 雙線 Wave 波浪 diff --git a/crates/ui-egui/src/panels/tests_brush_libraries.rs b/crates/ui-egui/src/panels/tests_brush_libraries.rs index 87fe34953f..e48a9355e8 100644 --- a/crates/ui-egui/src/panels/tests_brush_libraries.rs +++ b/crates/ui-egui/src/panels/tests_brush_libraries.rs @@ -201,7 +201,8 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() { json!("game-trails"), json!("energy-beams"), json!("dry-media"), - json!("tech-circuit") + json!("tech-circuit"), + json!("arrows") ] ); let dry = entries.iter().find(|e| under(e) && e.params["library"] == "dry-media").map(|e| e.label.as_str()); From 176db2d09cabbc7600025d8f52c32982880575b0 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 05:10:33 -0800 Subject: [PATCH 110/247] Object Mosaic: true or false replaces a refused percentages value After ui.dialog.set gave Resize Using Percentages a value that is not true or false, setting false (or setting true while the sizes were already in percentages) left the refused value in place, so OK kept failing. The dialog now remembers the mode the sizes were in while such a value is set: the same mode stores the boolean and keeps the sizes, and the other mode shows the sizes the other way, as the checkbox does. Null is read as false, as the command reads it, so percentage sizes are converted to points. --- crates/ui-egui/src/dialogs/object_mosaic.rs | 57 ++++++++++++++++++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index 313751320a..bc7ebdbbfe 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -129,7 +129,7 @@ pub(super) fn note_set(d: &mut Dialog, field: &str) { fn derived(d: &Dialog) -> Option<(&'static str, f64)> { let key = follower(d)?; let (iw, ih) = image(d); - let pct = d.bool("percentages"); + let pct = in_percentages(d); Some(if key == "height" { let w = d.f64("width", 0.0); (key, if pct { w } else { w * ih / iw }) @@ -161,18 +161,36 @@ fn switch_percentages(d: &mut Dialog, on: bool) { return; } d.fields.remove(form::REFUSED); + d.fields.remove(&kept("percentages")); d.fields.insert("width".into(), json!(w)); d.fields.insert("height".into(), json!(h)); d.fields.insert("percentages".into(), json!(on)); } -/// `ui.dialog.set` of `percentages`: true or false switches the new size as the checkbox does; -/// another value is kept as it is, and the command refuses it on OK. +/// Whether the new size fields hold percentages: Resize Using Percentages, or while that field holds +/// a value that is not true or false, the mode it held before that value was set. +fn in_percentages(d: &Dialog) -> bool { + match d.fields.get("percentages") { + Some(Value::Bool(on)) => *on, + Some(_) => d.bool(&kept("percentages")), + None => false, + } +} + +/// `ui.dialog.set` of `percentages`: true or false switches the new size as the checkbox does, and +/// replaces a value that is not true or false; null is false. Another value is kept as it is, and +/// the command refuses it on OK. pub(super) fn set_percentages(d: &mut Dialog, value: &Value) { - match value.as_bool() { - Some(on) if on != d.bool("percentages") => switch_percentages(d, on), - Some(_) => {} + let mode = in_percentages(d); + // The command reads null as the field left out, which is off. + match if value.is_null() { Some(false) } else { value.as_bool() } { + Some(on) if on != mode => switch_percentages(d, on), + Some(on) => { + d.fields.remove(&kept("percentages")); + d.fields.insert("percentages".into(), json!(on)); + } None => { + d.fields.insert(kept("percentages"), json!(mode)); d.fields.insert("percentages".into(), value.clone()); } } @@ -261,7 +279,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { }); ui.add_space(4.0); let follows = follower(d); - let pct = d.bool("percentages"); + let pct = in_percentages(d); widgets::label_row(ui, tl!("New Size:"), LABEL_W, |ui| pair(ui, d, ["width", "height"], unit, (pct, 0.1), follows)); follow_ratio(d); ui.add_space(4.0); @@ -601,6 +619,31 @@ mod tests { assert_eq!(mosaic(&app), None); } + /// True or false set after a Resize Using Percentages value the command refuses replaces it: the + /// same mode as before keeps the sizes, and the other mode shows them the other way. Null is + /// false, as the command reads it. OK then makes the mosaic. + #[test] + fn true_or_false_replaces_a_refused_percentages_value() { + let pct = json!({"percentages": true, "width": 50, "height": 50}); + for (given, sets, size) in [ + (json!({}), vec![json!("yes"), json!(false)], (100.0, 50.0)), + (pct.clone(), vec![json!("yes"), json!(false)], (50.0, 25.0)), + (pct.clone(), vec![Value::Null], (50.0, 25.0)), + (pct, vec![json!("yes"), Value::Null], (50.0, 25.0)), + ] { + let mut app = app_with_image(); + open(&mut app, &given).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + for value in sets { + crate::dialogs::set_field(d, "percentages".into(), value); + } + assert_eq!(d.fields.get("percentages"), Some(&json!(false)), "{given}"); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0)), size, "{given}"); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some(size), "{given}"); + } + } + /// With Constrain Ratio on, a refused height `ui.dialog.set` gave is refused on OK even when it /// equals the size Constrain Ratio works out from the width (0.05 pt from 0.1 pt over 100 × 50 pt). #[test] From 74ae933b5345a1d64ff2f5469fc0a485b299ed35 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 05:37:12 -0800 Subject: [PATCH 111/247] Flare: a click on a selected flare's handle opens the dialog again A click without a drag on the selected flare's center or end handle is a click with the Flare tool again: it opens Flare Tool Options at the click, and with Alt (Option on macOS) held it draws a flare there with the tool's options. Before this, the click did nothing. shape.editFlare also refuses an explicit center or end point that is not finite where the flare was drawn (`x2 must be a finite coordinate`, or `y2`, `cx`, `cy`), instead of storing it as null and drawing the flare with the default path. --- crates/engine/src/cmd/flare.rs | 7 ++++++- crates/engine/src/tests.rs | 18 +++++++++++++----- crates/tools/src/extra.rs | 27 ++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/flare.rs b/crates/engine/src/cmd/flare.rs index 05b25421eb..8871ddf921 100644 --- a/crates/engine/src/cmd/flare.rs +++ b/crates/engine/src/cmd/flare.rs @@ -164,7 +164,12 @@ fn edited(old: &Value, p: &Value, xf: Affine) -> Result<Value> { if p.get(kx).is_none_or(Value::is_null) && p.get(ky).is_none_or(Value::is_null) { return Ok(None); } - Ok(Some(inv * Point::new(f64_req(p, kx, C)?, f64_req(p, ky, C)?))) + // A point that leaves the finite range where the flare was drawn is refused, not stored. + let q = inv * Point::new(f64_req(p, kx, C)?, f64_req(p, ky, C)?); + match [(kx, q.x), (ky, q.y)].into_iter().find(|(_, v)| !v.is_finite()) { + None => Ok(Some(q)), + Some((key, _)) => Err(bad(C, format!("{key} must be a finite coordinate"))), + } }; let c = point("cx", "cy")?; let end = point("x2", "y2")?; diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index b6b3414fcd..92c2c6611f 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -3363,17 +3363,25 @@ fn flare_counts_are_whole_numbers() { assert!(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rays": 2.5})).is_err()); } -/// `shape.editFlare` on a flare scaled far down: a `pathLength` whose end point, taken back to -/// where the flare was drawn, is not a finite number is an error, and the flare keeps its settings. +/// `shape.editFlare` on a flare scaled far down: a `pathLength`, an end point or a center that, +/// taken back to where the flare was drawn, is not a finite number is an error, and the flare keeps +/// its settings. #[test] fn edit_flare_end_points_that_are_not_finite_are_errors() { let mut s = session(); let id = NodeId(s.execute("shape.flare", &json!({"cx": 100, "cy": 100, "rings": 2})).unwrap()["id"].as_u64().unwrap()); s.execute("object.scale", &json!({"sx": 1e-4, "sy": 1e-4})).unwrap(); let before = flare_settings(&s.doc().unwrap().doc, id).expect("a flare"); - let err = s.execute("shape.editFlare", &json!({"pathLength": 1e305})).unwrap_err().to_string(); - assert!(err.ends_with("x2 must be a finite coordinate"), "{err}"); - assert_eq!(flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"), before); + for (p, key) in [ + (json!({"pathLength": 1e305}), "x2"), + (json!({"x2": 1e305, "y2": 0}), "x2"), + (json!({"x2": 0, "y2": -1e305}), "y2"), + (json!({"cx": 1e305, "cy": 0}), "cx"), + ] { + let err = s.execute("shape.editFlare", &p).unwrap_err().to_string(); + assert!(err.ends_with(&format!("{key} must be a finite coordinate")), "{p}: {err}"); + assert_eq!(flare_settings(&s.doc().unwrap().doc, id).expect("still a flare"), before, "{p}"); + } } /// A flare drawn again keeps its parts' pixel-aligned property, whatever the document's Align New diff --git a/crates/tools/src/extra.rs b/crates/tools/src/extra.rs index 39344e3697..cd263db143 100644 --- a/crates/tools/src/extra.rs +++ b/crates/tools/src/extra.rs @@ -90,13 +90,15 @@ pub struct FlareTool { } /// A drag of a selected flare's handle: the flare, whether it is the end handle (else the center), -/// where the handle was, where it was pressed and whether the drag has begun its undo step. +/// where the handle was, where it was pressed, whether Alt (Option on macOS) was held at the press +/// and whether the drag has begun its undo step. #[derive(Clone, Copy, Debug)] struct HandleDrag { id: vectorcraft_doc::NodeId, end: bool, from: Point, at: Point, + alt: bool, began: bool, } @@ -307,7 +309,14 @@ impl Tool for FlareTool { } PointerKind::Up => { self.handle = None; - if h.began { vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos)), Action::Commit] } else { vec![] } + if h.began { + vec![Action::Preview("shape.editFlare".into(), handle_params(h, ev.pos)), Action::Commit] + } else if h.alt { + // A click on a handle without a drag is a click with the tool. + self.click_flare(cx, h.at) + } else { + vec![Action::Dialog("flare".into(), json!({ "x": h.at.x, "y": h.at.y }))] + } } _ => vec![], }; @@ -322,7 +331,7 @@ impl Tool for FlareTool { let (dc, de) = (ev.pos.distance(c), ev.pos.distance(e)); if dc.min(de) <= tol { let end = de < dc; - self.handle = Some(HandleDrag { id, end, from: if end { e } else { c }, at: ev.pos, began: false }); + self.handle = Some(HandleDrag { id, end, from: if end { e } else { c }, at: ev.pos, alt: ev.mods.alt, began: false }); return vec![]; } } @@ -1128,9 +1137,17 @@ mod tests { assert_eq!(a.last(), Some(&Action::Preview("shape.editFlare".into(), json!({ "ids": [gid.0], "cx": 150.0, "cy": 120.0 })))); assert_eq!(t.key(&cx, ToolKey::Escape, Mods::default()), vec![Action::Cancel]); assert!(!t.busy()); - // A click on a handle without a drag changes nothing. + // A click on a handle without a drag is a click with the tool: it opens the dialog, and + // with Alt held it draws a flare there with the tool's options. t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 110.0, 120.0)); - assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 110.0, 120.0)).is_empty()); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 110.0, 120.0)); + assert_eq!(a, vec![Action::Dialog("flare".into(), json!({ "x": 110.0, "y": 120.0 }))]); + assert!(!t.busy()); + let alt = Mods { alt: true, ..Default::default() }; + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 310.0, 121.0).with_mods(alt)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 310.0, 121.0).with_mods(alt)); + assert_eq!(a, vec![Action::Exec("shape.flare".into(), flare_params(&t.options(), Point::new(310.0, 121.0)))]); + assert!(!t.busy()); // Away from the handles a drag draws a new flare. t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 200.0, 300.0)); let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 240.0, 300.0)); From 2125c795b8e0704158bba661c25ec16c6b9477f6 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 05:39:03 -0800 Subject: [PATCH 112/247] i18n: French prose uses a no-break space before colons The five French rows for Smooth Bridge that contain a colon (the Reach label and four messages about the circles' distance, the gap, the reach and the bridge count) had an ordinary space before ":". They now use U+202F, the narrow no-break space, which french_catalog_uses_nonbreaking_prose_punctuation accepts. --- crates/ui-egui/src/i18n/fr.tsv | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 8ed4277c7f..142883ad97 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7529,15 +7529,15 @@ breakText Glyphs Glyphes Keep Originals Conserver les originaux @msg select two or more circles to bridge sélectionnez au moins deux cercles à relier @msg one circle is inside the other un cercle est à l’intérieur de l’autre -@msg the circles are too far apart for this radius: raise the radius les cercles sont trop éloignés pour ce rayon : augmentez le rayon +@msg the circles are too far apart for this radius: raise the radius les cercles sont trop éloignés pour ce rayon : augmentez le rayon @msg the circles are too far apart for this radius les cercles sont trop éloignés pour ce rayon Constant Gap Écart constant - Reach: Portée : -@msg the circles are too far apart for this gap: raise the gap les cercles sont trop éloignés pour cet écart : augmentez l’écart + Reach: Portée : +@msg the circles are too far apart for this gap: raise the gap les cercles sont trop éloignés pour cet écart : augmentez l’écart @msg the circles are too far apart for this gap les cercles sont trop éloignés pour cet écart -@msg no two circles are within reach: raise the reach aucun couple de cercles n’est à portée : augmentez la portée +@msg no two circles are within reach: raise the reach aucun couple de cercles n’est à portée : augmentez la portée @msg select at most 2000 circles to bridge sélectionnez au plus 2000 cercles à relier -@msg that makes too many bridges (at most 8000): lower the reach cela crée trop de ponts (au plus 8000) : réduisez la portée +@msg that makes too many bridges (at most 8000): lower the reach cela crée trop de ponts (au plus 8000) : réduisez la portée @msg the bridged circles are too complex to unite les cercles reliés sont trop complexes pour être réunis # Path Precision Tools add-on: Common Tangents. Common Tangents… Tangentes communes… From 8c6a707558dcde9a48e722cb5562f8b24ca3d3a1 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 05:45:35 -0800 Subject: [PATCH 113/247] Tests: a key that ends a wait checks that the tap and the key both ran, in order The test now records the undo steps of a swap tap on X and of D, so a dropped tap fails it instead of leaving only the final tool to check. --- crates/ui-egui/src/shortcuts/hold_keys/tests.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 86ee5f5c0c..a2406fcf83 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -294,17 +294,22 @@ fn turning_hold_shortcuts_off_ends_the_wait() { /// first. #[test] fn another_key_ends_the_wait_and_runs_after_it() { - let mut app = erolka_x(true); + let (swap, default) = (label("paint.swap"), label("paint.default")); + let mut app = swap_on_x(); + app.select_tool("selection"); let keys = Keyboard::new(); keys.press(&mut app, 0.0, Key::P, "p"); assert_eq!(app.session.tool_id(), "pen", "P runs on its press"); keys.release(&mut app, 0.05, Key::P); + let n = steps(&app, 0).len(); keys.press(&mut app, 0.1, Key::X, "x"); - keys.press(&mut app, 0.2, Key::V, "v"); - assert_eq!(app.session.tool_id(), "selection", "X's tap (Eyedropper) ran, then V (Selection)"); - assert_eq!(fill(&app), "#ff0000"); + assert_eq!(steps(&app, n), Vec::<String>::new(), "X waits"); + keys.press(&mut app, 0.2, Key::D, "d"); + assert_eq!(steps(&app, n), [swap.clone(), default.clone()], "X's tap ran, then D"); keys.release(&mut app, 0.3, Key::X); - assert_eq!(app.session.tool_id(), "selection", "the release of X runs nothing more"); + keys.release(&mut app, 0.35, Key::D); + assert_eq!(steps(&app, n), [swap, default], "the release of X runs nothing more"); + assert_eq!(selected(&app), 1, "and no hold"); } /// The labels of the document's undo steps after the first `from`. From fd037661013424bcfcf91aad1313eb9e11e2f210 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 05:52:43 -0800 Subject: [PATCH 114/247] Add Dashed Arrow brush with separated shaft and persistence coverage --- crates/engine/src/cmd/brushlib.rs | 10 +++++++++ crates/engine/src/tests/brushlib.rs | 32 +++++++++++++++++++++++++---- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/gaps.md | 2 +- docs/mcp.md | 2 +- 32 files changed, 68 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index e6db9f1d49..a709d9b05e 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -258,6 +258,15 @@ fn arrows() -> BrushLibrary { black(polygon(&[(24.0, -7.0), (0.0, 0.0), (24.0, 7.0), (18.0, 0.0)])), ]); let chevrons = group(vec![shaft(), head(), black(polygon(&[(53.0, -5.0), (66.0, 0.0), (53.0, 5.0), (56.0, 0.0)]))]); + let dashed = group( + (0..5) + .map(|i| { + let x = f64::from(i) * 16.0; + black(shapes::rectangle(Rect::new(x, -1.0, x + 10.0, 1.0))) + }) + .chain(std::iter::once(head())) + .collect(), + ); built( "Arrows", Document::new(100.0, 100.0), @@ -266,6 +275,7 @@ fn arrows() -> BrushLibrary { arrow_art("Open Arrow", outline, 0.0), arrow_art("Double Arrow", double, 0.24), arrow_art("Chevron Arrow", chevrons, 0.0), + arrow_art("Dashed Arrow", dashed, 0.0), ], ) } diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index 0f04a3c4dd..06d2ddc242 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -148,9 +148,9 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { let arrows = run(&mut s, "brush.library", json!({"library": "Arrows"})); assert_eq!( arrows["brushes"].as_array().unwrap().iter().map(|b| (b["name"].as_str().unwrap(), b["type"].as_str().unwrap())).collect::<Vec<_>>(), - [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art")] + [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art"), ("Dashed Arrow", "art")] ); - assert_eq!((libs[10]["name"].as_str(), libs[10]["count"].as_u64()), (Some("Arrows"), Some(4))); + assert_eq!((libs[10]["name"].as_str(), libs[10]["count"].as_u64()), (Some("Arrows"), Some(5))); run(&mut s, "file.new", json!({"width": 200, "height": 200})); let id = run(&mut s, "shape.rectangle", json!({"x": 10, "y": 20, "width": 40, "height": 8}))["id"].as_u64().unwrap(); let added = run(&mut s, "brush.addFromLibrary", json!({"library": "energy-beams", "name": "Laser Bolt", "apply": true, "ids": [id]})); @@ -231,11 +231,11 @@ fn arrows_library_lists_renders_and_applies_original_brushes() { let mut s = session(); let listed = run(&mut s, "brush.libraries", json!({})); let entry = listed["libraries"].as_array().unwrap().iter().find(|l| l["id"] == "arrows").unwrap(); - assert_eq!((entry["name"].as_str(), entry["category"].as_str(), entry["count"].as_u64()), (Some("Arrows"), Some("builtIn"), Some(4))); + assert_eq!((entry["name"].as_str(), entry["category"].as_str(), entry["count"].as_u64()), (Some("Arrows"), Some("builtIn"), Some(5))); let (_, lib) = cmd::brushlib::library(&s, "Arrows").unwrap(); assert_eq!( lib.brushes.iter().map(|b| (b.name.as_str(), b.kind.type_id())).collect::<Vec<_>>(), - [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art")] + [("Solid Arrow", "art"), ("Open Arrow", "art"), ("Double Arrow", "art"), ("Chevron Arrow", "art"), ("Dashed Arrow", "art")] ); for b in &lib.brushes { for length in [2.0, 200.0] { @@ -257,6 +257,30 @@ fn arrows_library_lists_renders_and_applies_original_brushes() { assert_eq!(brush(&s, "Double Arrow"), lib.brushes[2]); } +#[test] +fn dashed_arrow_keeps_separate_dashes_and_survives_library_save() { + let mut s = session(); + let (_, lib) = cmd::brushlib::library(&s, "Arrows").unwrap(); + let b = lib.brush("Dashed Arrow").unwrap(); + let mut curve = line_to(40.0); + curve.curve_to((60.0, -40.0), (140.0, 40.0), (200.0, 0.0)); + for path in [line_to(2.0), line_to(200.0), curve] { + let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &path, &black_stroke()); + let pts = anchors(&pieces.iter().collect::<Vec<_>>()); + assert!(!pts.is_empty() && pts.iter().all(|p| p.x.is_finite() && p.y.is_finite())); + } + let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line_to(200.0), &black_stroke()); + let children = pieces[0].children().unwrap(); + assert_eq!(children.len(), 6, "five separate dashes and one head"); + let bounds: Vec<_> = children.iter().map(|n| n.geometric_bounds().unwrap()).collect(); + assert!(bounds.windows(2).all(|p| p[0].x1 < p[1].x0), "the dashes and head remain separated"); + run(&mut s, "brush.addFromLibrary", json!({"library": "arrows", "name": "Dashed Arrow"})); + let saved = run(&mut s, "brush.saveLibrary", json!({"names": ["Dashed Arrow"]})); + let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap(); + let reopened = vectorcraft_format::load(&bytes).unwrap(); + assert_eq!(vectorcraft_brush::find(&reopened, "Dashed Arrow").unwrap(), *b); +} + /// Original circuit art and repeat tiles survive adding, applying and saving a library. #[test] fn the_tech_circuit_library_constructs_adds_and_applies_each_brush() { diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a79d211e4a..923190d5ed 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -7167,3 +7167,4 @@ breakText Glyphs Глифи @msg A fold line is on a non-printing layer. Линия на сгъване е на слой, който не се печата. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, панти: {hinges}, грешки: {errors}, предупреждения: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Dashed Arrow Пунктирана стрелка diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index a27f1242d4..ecb1e4a5c3 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -7221,3 +7221,4 @@ shape Open Otvoren @msg A fold line is on a non-printing layer. Linija savijanja je na sloju koji se ne štampa. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneli: {panels}, šarke: {hinges}, greške: {errors}, upozorenja: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine" + Dashed Arrow Isprekidana strelica diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index d2faf90332..a8a2ac3ed9 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -8051,3 +8051,4 @@ breakText Glyphs Glifs @msg A fold line is on a non-printing layer. Una línia de plegat és en una capa que no s’imprimeix. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panells: {panels}, frontisses: {hinges}, errors: {errors}, avisos: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Dashed Arrow Fletxa discontínua diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index fbaa957581..2b9dacb7aa 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9846,3 +9846,4 @@ breakText Glyphs Glyfy @msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu. @msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings} + Dashed Arrow Přerušovaná šipka diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index fe62578f75..5371b4940b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -9950,3 +9950,4 @@ breakText Glyphs Glyffer @msg A fold line is on a non-printing layer. En foldelinje ligger på et lag, der ikke udskrives. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, hængsler: {hinges}, fejl: {errors}, advarsler: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" + Dashed Arrow Stiplet pil diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index dbf8a65a86..f4ed48e72a 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9445,3 +9445,4 @@ breakText Glyphs Glyphen @msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden. @msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings} + Dashed Arrow Gestrichelter Pfeil diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1d09447d06..946f465939 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -8025,3 +8025,4 @@ breakText Glyphs Γλύφοι @msg A fold line is on a non-printing layer. Μια γραμμή δίπλωσης βρίσκεται σε επίπεδο που δεν εκτυπώνεται. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Πάνελ: {panels}, μεντεσέδες: {hinges}, σφάλματα: {errors}, προειδοποιήσεις: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" + Dashed Arrow Διακεκομμένο βέλος diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 21351d3d58..acdf592cd9 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -8012,3 +8012,4 @@ breakText Glyphs Glifos @msg A fold line is on a non-printing layer. Una línea de plegado está en una capa que no se imprime. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneles: {panels}, bisagras: {hinges}, errores: {errors}, advertencias: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Dashed Arrow Flecha discontinua diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 89dcf14f8e..99087fed4c 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -8108,3 +8108,4 @@ breakText Glyphs Merkit @msg A fold line is on a non-printing layer. Taittoviiva on tasolla, jota ei tulosteta. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneelit: {panels}, saranat: {hinges}, virheet: {errors}, varoitukset: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" + Dashed Arrow Katkoviivanuoli diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 4fbfe2d7f9..d2523e1927 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9832,3 +9832,4 @@ breakText Glyphs Glyphes @msg A fold line is on a non-printing layer. Une ligne de pliage se trouve sur un calque non imprimable. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} {panels} panneau(x), {hinges} charnière(s), {errors} erreur(s), {warnings} avertissement(s) @msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution + Dashed Arrow Flèche en pointillés diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index b304a4ff89..7f4419596b 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4930,3 +4930,4 @@ swatch [Registration] [રજિસ્ટ્રેશન] Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine" + Dashed Arrow તૂટક તીર diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index f229c1d2c2..625533bb9d 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -9452,3 +9452,4 @@ theme Appearance अपीयरेंस @msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है। @msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है। @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings} + Dashed Arrow बिंदीदार तीर diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 2ec0b3755a..2a19d6be2e 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9834,3 +9834,4 @@ breakText Glyphs Glifák @msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez. @msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings} + Dashed Arrow Szaggatott nyíl diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index da5b6d38e9..2f0ce82a87 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -7182,3 +7182,4 @@ breakText Glyphs Glif @msg A fold line is on a non-printing layer. Sebuah garis lipat berada di lapisan yang tidak dicetak. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panel: {panels}, engsel: {hinges}, galat: {errors}, peringatan: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine" + Dashed Arrow Panah Putus-putus diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index d6e2fd97e3..d0f169ab26 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9479,3 +9479,4 @@ breakText Glyphs Glifi @msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura. @msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings} + Dashed Arrow Freccia tratteggiata diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 86921fbc19..21f6424961 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -9546,3 +9546,4 @@ breakText Glyphs 字形 @msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。 @msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings} + Dashed Arrow 破線矢印 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index ee7b732bb5..cab3b036fb 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -10213,3 +10213,4 @@ font-script Japanese იაპონური @msg A fold line is on a non-printing layer. მოკეცვის ხაზი არაბეჭდვად შრეზეა. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} პანელები: {panels}, ანჯამები: {hinges}, შეცდომები: {errors}, გაფრთხილებები: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine" + Dashed Arrow წყვეტილი ისარი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index c65d18379d..22677ea1b9 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9442,3 +9442,4 @@ breakText Glyphs 글리프 @msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다. @msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings} + Dashed Arrow 점선 화살표 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 955ab57715..6c4f2a5962 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9879,3 +9879,4 @@ breakText Glyphs Glyphs @msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden. @msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings} + Dashed Arrow Gestreepte pijl diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c7444a05cb..98aea7f7bc 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9699,3 +9699,4 @@ breakText Glyphs Glify @msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania. @msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings} + Dashed Arrow Przerywana strzałka diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 753a1a78e3..fe1d4e862b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9917,3 +9917,4 @@ swatch Yellow Green Verde-amarelado @msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco. @msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings} + Dashed Arrow Seta tracejada diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 0df245417d..6c7e9550ee 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9940,3 +9940,4 @@ shape Open Открытый @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, шарниры: {hinges}, ошибки: {errors}, предупреждения: {warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Dashed Arrow Пунктирная стрелка diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 0bdcef01da..6aa6c6c573 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9529,3 +9529,4 @@ digits Hindi Hindi @msg A fold line is on a non-printing layer. En falslinje ligger på ett lager som inte skrivs ut. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, gångjärn: {hinges}, fel: {errors}, varningar: {warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen + Dashed Arrow Streckad pil diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 8ef24d0686..5b04c1122e 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9800,3 +9800,4 @@ breakText Glyphs Glifler @msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil. @msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings} + Dashed Arrow Kesikli Ok diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index c4836570af..a161a6c248 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9454,3 +9454,4 @@ breakText Glyphs Гліфи @msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки. @msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings} + Dashed Arrow Пунктирна стрілка diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 95b0e32544..bd54a108f0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7683,3 +7683,4 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" + Dashed Arrow Mũi tên nét đứt diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index deac7a0ce1..a9d670adcd 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9686,3 +9686,4 @@ breakText Glyphs 字形 @msg A fold line is on a non-printing layer. 一条折线位于不打印的图层上。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},铰链:{hinges},错误:{errors},警告:{warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率 + Dashed Arrow 虚线箭头 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index ea134ed591..ca6d3fe3ef 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9496,3 +9496,4 @@ breakText Glyphs 字符 @msg A fold line is on a non-printing layer. 一條摺線位於不列印的圖層上。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},鉸鏈:{hinges},錯誤:{errors},警告:{warnings} @msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小 + Dashed Arrow 虛線箭頭 diff --git a/docs/gaps.md b/docs/gaps.md index 015fe031de..e37340058c 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -671,7 +671,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html)): Window › Brush Libraries and the Brushes panel's Brush Libraries Menu open each library in a library panel of its own (eleven original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes (one - bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), and Arrows (Solid, Open, Double and Chevron Arrow); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a + bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), and Arrows (Solid, Open, Double, Chevron and Dashed Arrow); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a click adds a brush to the document's Brushes with the patterns, symbols and other resources its art uses, as one undo step (applied to the selected paths in the same step), dragging one onto a path adds and applies it and diff --git a/docs/mcp.md b/docs/mcp.md index 2aa95f1540..4abd074bba 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5034,7 +5034,7 @@ error. Brush libraries are read-only sets of brushes: eleven generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes with one bristle brush for each tip shape, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, and Dry Media with the Chalk Grain, Graphite Pencil, Wax Crayon and -Charcoal Dust art brushes, id `dry-media`, Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Arrows with Solid, Open, Double and Chevron Arrow art brushes, id `arrows`), the `.vectorcraft` files in the user library folder of the desktop app (User +Charcoal Dust art brushes, id `dry-media`, Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Arrows with Solid, Open, Double, Chevron and Dashed Arrow art brushes, id `arrows`), the `.vectorcraft` files in the user library folder of the desktop app (User Defined) and the brushes of any document loaded with `brush.loadLibrary` (a document without brushes of its own has the default ones). `brush.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`) and `brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). From e91116e0bfba872eb69e03116edd81aefaea0545 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 06:00:08 -0800 Subject: [PATCH 115/247] Object Mosaic: percentages convert against the image's current size The dialog reads the selected image's size again each frame, before ui.dialog.set sets fields, and on OK. An image scaled while the dialog is open shows its new Current Size, and Resize Using Percentages converts New Size against it, so OK makes the size shown. With no image selected, switching Resize Using Percentages leaves the fields as they are and the dialog asks for an image. --- crates/ui-egui/src/control.rs | 2 + crates/ui-egui/src/dialogs/object_mosaic.rs | 97 ++++++++++++++++++++- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index a2c29fadc4..3ce5846e65 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -1607,6 +1607,8 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, req: &ControlRequest) let names = crate::dialogs::field_names(d).join(", "); return err(format!("the `{}` dialog has no field `{f}`; its fields: {names}", d.kind)); } + // Create Object Mosaic converts New Size against the selected image's size as it is now. + crate::dialogs::object_mosaic::refresh(app); // In order: a field that sets others (an export preset) goes before the fields after it. // A field that fails leaves the dialog as it was before the request. let before = app.ui.dialog.clone(); diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index bc7ebdbbfe..cab5371d93 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -6,7 +6,9 @@ //! Fields: `width`, `height` (pt, or percentages of the image's size with `percentages`), //! `spacingX`, `spacingY` (pt), `columns`, `rows`, `lock` (Constrain Ratio on), `constrain` //! (`width` | `height`: the side Constrain Ratio and Use Ratio keep), `gray`, `percentages` and -//! `deleteRaster`. `__imageW` and `__imageH` hold the image's size (pt). +//! `deleteRaster`. `__imageW` and `__imageH` hold the image's size (pt), read again from the +//! selected image each frame, before `ui.dialog.set` sets fields and on OK; `__noImage` is true +//! while no image is selected. use serde_json::{Value, json}; use vectorcraft_doc::NodeKind; @@ -68,6 +70,36 @@ pub fn open(app: &mut VectorcraftApp, given: &Value) -> Result<Value, String> { Ok(json!({ "dialog": KIND })) } +/// The field that is true while no image is selected. +const NO_IMAGE: &str = "__noImage"; + +/// What the dialog shows when Resize Using Percentages is switched with no image selected. +const NO_IMAGE_WHY: &str = "select an image"; + +/// The selected image's size `size` (from [`image_size`]) read into the dialog, so New Size is +/// converted and constrained against the image as it is now, also after it was scaled while the +/// dialog was open. With no image selected the last size read stays and `__noImage` is set. +fn read_image(size: Option<(f64, f64)>, d: &mut Dialog) { + let Some((w, h)) = size else { + d.fields.insert(NO_IMAGE.into(), json!(true)); + return; + }; + if d.fields.remove(NO_IMAGE).is_some() && d.str(form::REFUSED) == NO_IMAGE_WHY { + d.fields.remove(form::REFUSED); + } + d.fields.insert("__imageW".into(), json!(w)); + d.fields.insert("__imageH".into(), json!(h)); +} + +/// [`read_image`] on the open dialog when it is this one. `ui.dialog.set` runs it before it sets +/// any field. +pub(crate) fn refresh(app: &mut VectorcraftApp) { + let size = image_size(app); + if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == KIND) { + read_image(size, d); + } +} + /// The image's size (pt) the dialog holds. fn image(d: &Dialog) -> (f64, f64) { (d.f64("__imageW", 1.0).max(1e-9), d.f64("__imageH", 1.0).max(1e-9)) @@ -142,8 +174,13 @@ fn derived(d: &Dialog) -> Option<(&'static str, f64)> { /// Resize Using Percentages turned on or off: the new size shown the other way, so it stays the /// same size. When a size field does not hold a number, or a size the command takes (all but the /// side Constrain Ratio sets) falls outside what the command accepts the other way, the fields and -/// the mode stay as they are and the dialog shows why. +/// the mode stay as they are and the dialog shows why. With no image selected, nothing changes and +/// the dialog asks for one. fn switch_percentages(d: &mut Dialog, on: bool) { + if d.bool(NO_IMAGE) { + d.fields.insert(form::REFUSED.into(), json!(NO_IMAGE_WHY)); + return; + } let (iw, ih) = image(d); let size = |key: &str| number(d, key, 100.0).as_f64().ok_or_else(|| format!("`{key}` must be a number (got {})", d.str(key))); let (w, h) = match (size("width"), size("height")) { @@ -270,6 +307,7 @@ fn pair(ui: &mut egui::Ui, d: &mut Dialog, keys: [&str; 2], unit: vectorcraft_do fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let unit = app.session.general_unit(); + read_image(image_size(app), d); let (iw, ih) = image(d); widgets::label_row(ui, tl!("Current Size:"), LABEL_W, |ui| { widgets::dim_label(ui, tl!("Width:")); @@ -335,8 +373,12 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { false } +/// OK: the new size worked out against the image's size as it is now, as a frame would show it. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { - run_and_close(app, COMMAND, params(d)) + let mut d = d.clone(); + read_image(image_size(app), &mut d); + follow_ratio(&mut d); + run_and_close(app, COMMAND, params(&d)) } #[cfg(test)] @@ -619,6 +661,55 @@ mod tests { assert_eq!(mosaic(&app), None); } + /// The image scaled from 100 × 50 pt to 200 × 100 pt while the dialog is open: Current Size shows + /// the new size, and Resize Using Percentages, by `ui.dialog.set` or by its checkbox, converts + /// New Size against it, so OK makes the size shown. With no image selected, switching is refused. + #[test] + fn percentages_convert_against_the_image_scaled_while_the_dialog_is_open() { + let set = |app: &mut VectorcraftApp, field: &str, value: Value| { + let (req, _) = crate::control::ControlRequest::new("ui.dialog.set", json!({"field": field, "value": value})); + let crate::control::Outcome::Done(r) = crate::control::handle(app, &egui::Context::default(), &req) else { + panic!("expected an immediate reply") + }; + r + }; + let mut app = app_with_image(); + open(&mut app, &json!({"width": 200, "height": 100})).unwrap(); + app.run("object.scale", json!({"sx": 200, "sy": 200})).unwrap(); + let ctx = context(); + frame(&mut app, &ctx); + let texts = frame(&mut app, &ctx); + assert!(texts.iter().any(|t| t == "200 pt"), "Current Size shows the scaled image: {texts:?}"); + let r = set(&mut app, "percentages", json!(true)); + assert_eq!(r["ok"], json!(true), "{r}"); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0), d.bool("percentages")), (100.0, 100.0, true)); + app.run("object.scale", json!({"sx": 50, "sy": 50})).unwrap(); + // The checkbox, after the image went back to 100 × 50 pt: 100% of it is 100 × 50 pt. + let size = image_size(&app); + let d = app.ui.dialog.as_mut().unwrap(); + read_image(size, d); + switch_percentages(d, false); + assert_eq!((d.f64("width", 0.0), d.f64("height", 0.0)), (100.0, 50.0)); + crate::dialogs::set_field(d, "percentages".into(), json!(true)); + app.run("object.scale", json!({"sx": 200, "sy": 200})).unwrap(); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(mosaic(&app).map(|m| (m.0, m.1)), Some((200.0, 100.0)), "100% of the image as it is on OK"); + app.run("edit.undo", json!({})).unwrap(); + // No image selected: the mode and sizes stay and the dialog asks for an image. + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + open(&mut app, &json!({})).unwrap(); + app.run("select.set", json!({"ids": []})).unwrap(); + set(&mut app, "percentages", json!(true)); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("width", 0.0), d.bool("percentages")), (200.0, false)); + assert_eq!(d.str(form::REFUSED), NO_IMAGE_WHY); + app.run("select.set", json!({"ids": [image_id(&app)]})).unwrap(); + set(&mut app, "percentages", json!(true)); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("width", 0.0), d.bool("percentages"), d.str(form::REFUSED)), (100.0, true, String::new())); + } + /// True or false set after a Resize Using Percentages value the command refuses replaces it: the /// same mode as before keeps the sizes, and the other mode shows them the other way. Null is /// false, as the command reads it. OK then makes the mosaic. From dc8ba2daf901ab50768580d4666c8e4688bb8e8e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 06:01:47 -0800 Subject: [PATCH 116/247] Update complete catalog brush count for Dashed Arrow --- crates/ui-egui/src/i18n/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 24aa62671d..c1d5164081 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -502,7 +502,7 @@ fn built_in_library_brush_names_are_in_complete_catalogs() { .collect(); names.sort(); names.dedup(); - assert_eq!(names.len(), 50, "{names:?}"); + assert_eq!(names.len(), 51, "{names:?}"); let mut bad = vec![]; for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { let missing: Vec<&String> = names.iter().filter(|n| lang.catalog().plain(n).is_none()).collect(); From 4c15d161fb691b6e4f60f5556a2fc0051f50409b Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 06:06:36 -0800 Subject: [PATCH 117/247] Background Save: a Cancel the string writers stop on reports the save canceled A Cancel that came after the encoder filled a streamed save, while the shared stream writer was flushing it or making its last check, came back as a write error, so the save showed an error dialog instead of Save canceled. The same held for the plain string writer. Their Cancel message now maps to the Cancelled error while the save is canceled; any other message, such as one naming the copies a failed replacement kept, stays a write error. --- crates/ui-egui/src/io/save.rs | 16 +++++++++++-- crates/ui-egui/src/tests/background.rs | 33 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/io/save.rs b/crates/ui-egui/src/io/save.rs index 9d242427d1..ce4cb57ecd 100644 --- a/crates/ui-egui/src/io/save.rs +++ b/crates/ui-egui/src/io/save.rs @@ -542,6 +542,18 @@ pub(crate) fn saved_status(path: &str, r: &Value) -> String { } } +/// A string writer's error during a save: [`EngineError::Cancelled`] when the save was canceled and +/// the writer stopped on that Cancel (its message is the Cancel's own, alone or after the path), so +/// the file was not put in place. Any other message, such as one naming the copies a failed +/// replacement kept, stays [`EngineError::Other`]. +fn writer_error(e: String) -> EngineError { + use vectorcraft_engine::cancel; + let stopped = [EngineError::Cancelled.to_string(), cancel::Cancelled.to_string()] + .iter() + .any(|c| e == *c || e.strip_suffix(c.as_str()).is_some_and(|rest| rest.ends_with(": "))); + if stopped && cancel::is_cancelled() { EngineError::Cancelled } else { EngineError::Other(e) } +} + /// Write a planned save through the services and report it in the status bar. /// With Background Save on, the file is encoded and written from a snapshot off the UI thread /// ([`background`]): this returns `{path, background: true, status, format, warnings}` at once @@ -610,8 +622,8 @@ fn write_plan( let r = match (save_stream, save_write, stream) { (Some(stream), _, _) => job.write_streamed(&mut |p, fill| observed(p, stream(p, fill))), (_, Some(write), _) => job.write_unless(check, |p, b| observed(p, write(p, b))), - (_, _, Some(stream)) => job.write_streamed(&mut |p, fill| stream(p, fill).map_err(EngineError::Other)), - _ => job.write_unless(check, |p, b| write(p, b).map_err(EngineError::Other)), + (_, _, Some(stream)) => job.write_streamed(&mut |p, fill| stream(p, fill).map_err(writer_error)), + _ => job.write_unless(check, |p, b| write(p, b).map_err(writer_error)), }; match r { // Nothing written: the file is as it was. diff --git a/crates/ui-egui/src/tests/background.rs b/crates/ui-egui/src/tests/background.rs index ff26f7ff7c..f4e358bcf8 100644 --- a/crates/ui-egui/src/tests/background.rs +++ b/crates/ui-egui/src/tests/background.rs @@ -285,6 +285,39 @@ fn a_line_set_after_cancel_save_stays() { assert_eq!(app.ui.status, "Another command's line"); } +/// A Cancel that comes once the encoder has filled a streamed save, while the host's writer is still +/// flushing it, stops the save as any other Cancel does: the writer's last check refuses to put the +/// file in place, and the save reports it canceled, not failed. +#[test] +fn a_cancel_after_a_streamed_save_is_filled_cancels_it() { + let (gate, filled) = (Gate::default(), Gate::default()); + let (g, w) = (gate.clone(), filled.clone()); + let services = Services { + write_shared: Some(Arc::new(|_: &str, _: &[u8]| Ok(()))), + stream_shared: Some(Arc::new(move |_: &str, fill: &mut dyn FnMut(&mut dyn std::io::Write) -> std::io::Result<()>| { + fill(&mut Vec::new()).map_err(|e| e.to_string())?; + w.open(); + g.wait(); + // The atomic writer's last check before the file is put in place. + vectorcraft_engine::cancel::check().map_err(|e| std::io::Error::other(e).to_string()) + })), + ..Default::default() + }; + let mut app = VectorcraftApp::new(Session::new(), services); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + let r = app.run("file.save", json!({"path": "/docs/streamed.vectorcraft"})).unwrap(); + assert_eq!(r["background"], true, "{r}"); + filled.wait(); + assert_eq!(app.run("file.cancelSave", json!({})).unwrap()["cancelled"], 1); + gate.open(); + background::wait_all(&mut app); + assert!(app.ui.dialog.is_none(), "no error is shown"); + assert_eq!(app.ui.status, io::SAVE_CANCELED); + let st = app.session.active().unwrap(); + assert!(st.is_dirty() && st.path.is_none(), "the canceled save left the document as it was"); +} + #[test] fn quitting_waits_for_background_saves() { let gate = Gate::default(); From c8d16e66ae28d7275c4f5648cb4301c818fed2ae Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 06:11:27 -0800 Subject: [PATCH 118/247] Object Mosaic: OK refuses a Constrain Ratio value the command refuses A Constrain Ratio side other than width or height, set through ui.dialog.set, is passed to object.createObjectMosaic, which refuses it, instead of being read as the width. A Constrain Ratio (lock) that is not true or false is refused on OK, and the dialog stays open. --- crates/ui-egui/src/dialogs/object_mosaic.rs | 36 ++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index cab5371d93..08497fb3c0 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -266,6 +266,18 @@ fn switch(d: &Dialog, key: &str) -> Value { d.fields.get(key).cloned().unwrap_or(json!(false)) } +/// `constrain` as the command takes it: null with Constrain Ratio off, else the side the field +/// holds (the width when it holds none), and any other value as it is, for the command to refuse. +fn constrained_side(d: &Dialog) -> Value { + if !d.bool("lock") { + return Value::Null; + } + match d.fields.get("constrain") { + None | Some(Value::Null) => json!("width"), + Some(v) => v.clone(), + } +} + /// `object.createObjectMosaic` parameters from the fields. With Constrain Ratio on, the side it /// sets is left out while it holds the size Constrain Ratio gives it: the command works it out from /// the kept side and grows both in proportion to its 0.1 pt minimum. Any other value set on that @@ -275,7 +287,7 @@ fn params(d: &Dialog) -> Value { let mut p = json!({ "columns": number(d, "columns", 10.0), "rows": number(d, "rows", 10.0), "width": number(d, "width", 100.0), "height": number(d, "height", 100.0), "percentages": switch(d, "percentages"), - "constrain": if d.bool("lock") { json!(if keeps_width(d) { "width" } else { "height" }) } else { Value::Null }, + "constrain": constrained_side(d), "spacingX": number(d, "spacingX", 0.0), "spacingY": number(d, "spacingY", 0.0), "gray": switch(d, "gray"), "deleteRaster": switch(d, "deleteRaster"), }); @@ -374,7 +386,11 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } /// OK: the new size worked out against the image's size as it is now, as a frame would show it. +/// A Constrain Ratio (`lock`) that is not true or false is refused, and the dialog stays open. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { + if d.fields.get("lock").is_some_and(|v| !v.is_boolean() && !v.is_null()) { + return Err("`lock` must be true or false".into()); + } let mut d = d.clone(); read_image(image_size(app), &mut d); follow_ratio(&mut d); @@ -710,6 +726,24 @@ mod tests { assert_eq!((d.f64("width", 0.0), d.bool("percentages"), d.str(form::REFUSED)), (100.0, true, String::new())); } + /// A Constrain Ratio side other than width or height, or a Constrain Ratio that is not true or + /// false, set by `ui.dialog.set`, is refused on OK and makes no mosaic. + #[test] + fn a_constrain_ratio_value_the_command_refuses_is_refused() { + for (field, value, also) in [("constrain", json!("both"), Some(("lock", json!(true)))), ("lock", json!("yes"), None)] { + let mut app = app_with_image(); + open(&mut app, &json!({})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + if let Some((k, v)) = also { + crate::dialogs::set_field(d, k.into(), v); + } + crate::dialogs::set_field(d, field.into(), value.clone()); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains(field), "{value}: {e}"); + assert_eq!(mosaic(&app), None, "{value}"); + } + } + /// True or false set after a Resize Using Percentages value the command refuses replaces it: the /// same mode as before keeps the sizes, and the other mode shows them the other way. Null is /// false, as the command reads it. OK then makes the mosaic. From b1276adf59e5a57987fc31361069585630f27c85 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 06:20:01 -0800 Subject: [PATCH 119/247] Package: a canceled save before packaging writes no package With Background Save and Background Export on, a package waits for the document's save and started once that save answered without an error, so a save that Cancel Save stopped still let the package be written from a document left unsaved. A canceled save now stops the package, as a failed one does. --- crates/ui-egui/src/dialogs/package.rs | 6 +++--- crates/ui-egui/src/dialogs/tests_package.rs | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/package.rs b/crates/ui-egui/src/dialogs/package.rs index 25d17d3902..3e69af017c 100644 --- a/crates/ui-egui/src/dialogs/package.rs +++ b/crates/ui-egui/src/dialogs/package.rs @@ -173,10 +173,10 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { Ok(r) } -/// Did a save whose applied result is `r` write the document (no error, and no question asked -/// before writing)? +/// Did a save whose applied result is `r` write the document (no error, no question asked before +/// writing, and not canceled by Cancel Save)? fn saved(r: &Result<Value, String>) -> bool { - r.as_ref().is_ok_and(|r| r.get("pending").is_none()) + r.as_ref().is_ok_and(|r| r.get("pending").is_none() && r.get("cancelled").and_then(Value::as_bool) != Some(true)) } /// Report the package `r` (`file.package`'s reply): the status bar, the web's download, and the diff --git a/crates/ui-egui/src/dialogs/tests_package.rs b/crates/ui-egui/src/dialogs/tests_package.rs index 0c0f8e492a..e89e5501f5 100644 --- a/crates/ui-egui/src/dialogs/tests_package.rs +++ b/crates/ui-egui/src/dialogs/tests_package.rs @@ -280,6 +280,27 @@ fn a_failed_save_before_packaging_writes_no_package() { } } +/// A save before packaging that Cancel Save stops writes no package either: the document keeps +/// its unsaved changes, so the package would not hold it as saved. +#[test] +fn a_canceled_save_before_packaging_writes_no_package() { + let dir = Folder::new("canceled-save"); + let gate = Gate::default(); + let (mut app, files) = saved_with_worker(&dir, &gate); + let out = dir.path("out"); + // An export holds the worker, so the save waits behind it and Cancel comes before it starts. + crate::io::export(&mut app, Some("svg"), Some(dir.path("first.svg")), &json!({})).unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + package_dialog(&mut app, &out); + assert_eq!(confirm(&mut app).unwrap()["background"], true); + assert_eq!(app.run("file.cancelSave", json!({})).unwrap()["cancelled"], 1); + gate.open(); + background::wait_all(&mut app); + assert_eq!(written(&files), [dir.path("first.svg")], "only the export"); + assert!(!std::path::Path::new(&out).join("card Folder").exists(), "no package folder"); + assert!(app.session.active().unwrap().is_dirty(), "the save was canceled"); +} + /// A package that an automation request confined to its roots asks for, started once the /// document's background save is written, is still confined to those roots, though the save's /// result arrives outside the request. From e6bf84050a6a72a86141842bb7f348ab44d98e4d Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 07:04:55 -0800 Subject: [PATCH 120/247] Preferences: the description line has sentences for Hold Shortcuts and its delay General's description line now shows a sentence for Hold Shortcuts and for Hold Shortcut Delay, with a row in every catalog, as main requires for each General setting. --- crates/ui-egui/src/i18n/bg.tsv | 2 ++ crates/ui-egui/src/i18n/bs.tsv | 2 ++ crates/ui-egui/src/i18n/ca.tsv | 2 ++ crates/ui-egui/src/i18n/cs.tsv | 2 ++ crates/ui-egui/src/i18n/da.tsv | 2 ++ crates/ui-egui/src/i18n/de.tsv | 2 ++ crates/ui-egui/src/i18n/el.tsv | 2 ++ crates/ui-egui/src/i18n/es.tsv | 2 ++ crates/ui-egui/src/i18n/fi.tsv | 2 ++ crates/ui-egui/src/i18n/fr.tsv | 2 ++ crates/ui-egui/src/i18n/gu.tsv | 2 ++ crates/ui-egui/src/i18n/hi.tsv | 2 ++ crates/ui-egui/src/i18n/hu.tsv | 2 ++ crates/ui-egui/src/i18n/id.tsv | 2 ++ crates/ui-egui/src/i18n/it.tsv | 2 ++ crates/ui-egui/src/i18n/ja.tsv | 2 ++ crates/ui-egui/src/i18n/ka.tsv | 2 ++ crates/ui-egui/src/i18n/ko.tsv | 2 ++ crates/ui-egui/src/i18n/nl.tsv | 2 ++ crates/ui-egui/src/i18n/pl.tsv | 2 ++ crates/ui-egui/src/i18n/pt-br.tsv | 2 ++ crates/ui-egui/src/i18n/ru.tsv | 2 ++ crates/ui-egui/src/i18n/sv.tsv | 2 ++ crates/ui-egui/src/i18n/tr.tsv | 2 ++ crates/ui-egui/src/i18n/uk.tsv | 2 ++ crates/ui-egui/src/i18n/vi.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hans.tsv | 2 ++ crates/ui-egui/src/i18n/zh-hant.tsv | 2 ++ crates/ui-egui/src/prefs_dialog/descriptions.rs | 2 ++ 29 files changed, 58 insertions(+) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 456f1c2f9c..50aee8d56b 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3015,6 +3015,8 @@ digits Malayalam Малаялам The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колелцето на мишката с натиснат Cmd/Ctrl превърта платното настрани. Dragging sideways on a numeric field's label changes the field's value. Влаченето настрани върху етикета на числово поле променя стойността на полето. A two-finger rotate gesture on a trackpad rotates the canvas view. Жест за завъртане с два пръста върху тъчпад завърта изгледа на платното. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Задържането на клавиш изпълнява инструмента или командата от колоната „Задръжте“ в „Клавишни комбинации“; краткото натискане изпълнява обичайната му комбинация. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Колко секунди трябва да се задържи клавиш, преди вместо обичайната му комбинация да се изпълни комбинацията му със задържане. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Задържането на клавишната комбинация на инструмент го избира, докато я пуснете, а след това отново се избира предишният инструмент. Shows the bounding box while you move the selection or draw a shape. Показва ограничителната рамка, докато премествате селекцията или рисувате форма. Create Trim Marks draws Japanese-style marks instead of Roman ones. „Създаване на режещи знаци“ рисува знаци в японски стил вместо в римски. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 978e396bfa..119fcdbbdf 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4452,6 +4452,8 @@ font-technology Variable Varijabilni The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Točkić miša uz pritisnut Cmd/Ctrl pomjera platno u stranu. Dragging sideways on a numeric field's label changes the field's value. Prevlačenje u stranu po oznaci brojčanog polja mijenja vrijednost polja. A two-finger rotate gesture on a trackpad rotates the canvas view. Pokret rotacije s dva prsta na dodirnoj podlozi rotira prikaz platna. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Držanje tipke pokreće alat ili naredbu iz njene kolone „Zadrži“ u Prečicama na tastaturi; kratki pritisak pokreće njenu uobičajenu prečicu. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Koliko sekundi tipka mora biti pritisnuta prije nego što se umjesto uobičajene prečice pokrene njena prečica zadržavanjem. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Držanje prečice alata bira taj alat dok je ne pustite, a zatim se ponovo bira prethodni alat. Shows the bounding box while you move the selection or draw a shape. Prikazuje granični okvir dok pomjerate odabir ili crtate oblik. Create Trim Marks draws Japanese-style marks instead of Roman ones. Kreiraj oznake za obrezivanje crta oznake u japanskom stilu umjesto rimskih. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 796323f63e..18d31cd0e8 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3845,6 +3845,8 @@ digits Malayalam Malaiàlam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La roda del ratolí amb Cmd/Ctrl premut desplaça el llenç en horitzontal. Dragging sideways on a numeric field's label changes the field's value. Arrossegar en horitzontal sobre l’etiqueta d’un camp numèric canvia el valor del camp. A two-finger rotate gesture on a trackpad rotates the canvas view. Un gest de rotació amb dos dits al trackpad gira la vista del llenç. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Mantenir premuda una tecla executa l’eina o l’ordre de la seva columna Mantén a Dreceres de teclat; una pulsació breu executa la seva drecera habitual. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Quants segons cal mantenir premuda una tecla perquè s’executi la seva drecera de pulsació llarga en lloc de la drecera habitual. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantenir premuda la drecera d’una eina la tria fins que la deixeu anar, i després es torna a triar l’eina anterior. Shows the bounding box while you move the selection or draw a shape. Mostra el quadre delimitador mentre moveu la selecció o dibuixeu una forma. Create Trim Marks draws Japanese-style marks instead of Roman ones. Crea marques de retall dibuixa marques d’estil japonès en lloc de romanes. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index fd48e6ecf8..263f476165 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4556,6 +4556,8 @@ font-technology Variable Variabilní The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kolečko myši s podrženou klávesou Cmd/Ctrl posouvá plátno do stran. Dragging sideways on a numeric field's label changes the field's value. Tažení do stran po popisku číselného pole mění hodnotu pole. A two-finger rotate gesture on a trackpad rotates the canvas view. Gesto otočení dvěma prsty na trackpadu otáčí zobrazení plátna. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Podržení klávesy spustí nástroj nebo příkaz ze sloupce Podržení v Klávesových zkratkách; krátký stisk spustí její obvyklou zkratku. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Jak dlouho v sekundách je nutné klávesu podržet, než se místo obvyklé zkratky spustí její zkratka podržením. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Podržení zkratky nástroje vybere nástroj, dokud ji nepustíte, a pak se znovu vybere předchozí nástroj. Shows the bounding box while you move the selection or draw a shape. Zobrazí ohraničovací rámeček, když přesouváte výběr nebo kreslíte tvar. Create Trim Marks draws Japanese-style marks instead of Roman ones. Vytvořit značky ořezu nakreslí značky v japonském stylu místo římských. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 8c55a88674..2b565218f7 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6955,6 +6955,8 @@ font-technology Variable Variable The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Musehjulet med Cmd/Ctrl holdt nede ruller lærredet sidelæns. Dragging sideways on a numeric field's label changes the field's value. Når du trækker sidelæns på et talfelts etiket, ændres feltets værdi. A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsbevægelse med to fingre på en pegeplade roterer visningen af lærredet. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Når du holder en tast nede, køres værktøjet eller kommandoen i dens Hold-kolonne i Tastaturgenveje; et kort tryk kører dens sædvanlige genvej. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hvor mange sekunder en tast skal holdes nede, før dens holdegenvej køres i stedet for dens sædvanlige genvej. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Når du holder et værktøjs genvejstast nede, er værktøjet valgt, indtil du slipper, og derefter vælges det forrige værktøj igen. Shows the bounding box while you move the selection or draw a shape. Viser afgrænsningsboksen, mens du flytter markeringen eller tegner en form. Create Trim Marks draws Japanese-style marks instead of Roman ones. Opret beskæringsmærker tegner mærker i japansk stil i stedet for romerske. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index db775c9948..98b4343eab 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3067,6 +3067,8 @@ digits Malayalam Malayalam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mit gedrückter Befehls-/Strg-Taste scrollt das Mausrad die Arbeitsfläche seitwärts. Dragging sideways on a numeric field's label changes the field's value. Seitliches Ziehen auf der Beschriftung eines Zahlenfelds ändert den Wert des Felds. A two-finger rotate gesture on a trackpad rotates the canvas view. Eine Drehgeste mit zwei Fingern auf einem Trackpad dreht die Ansicht der Arbeitsfläche. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Halten Sie eine Taste, wird das Werkzeug oder der Befehl aus ihrer Spalte „Halten“ unter „Tastaturbefehle“ ausgeführt; ein kurzer Druck führt ihren üblichen Tastaturbefehl aus. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Wie viele Sekunden eine Taste gehalten werden muss, bevor statt ihres üblichen Tastaturbefehls ihr Halte-Tastaturbefehl ausgeführt wird. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Solange Sie das Tastaturkürzel eines Werkzeugs gedrückt halten, ist dieses Werkzeug gewählt; danach wird wieder das vorherige gewählt. Shows the bounding box while you move the selection or draw a shape. Zeigt den Begrenzungsrahmen an, während Sie die Auswahl verschieben oder eine Form zeichnen. Create Trim Marks draws Japanese-style marks instead of Roman ones. „Schnittmarken erstellen“ zeichnet japanische statt römische Marken. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b0b9fa49c4..00ec0c4ff6 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3885,6 +3885,8 @@ digits Malayalam Μαλαγιάλαμ The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Ο τροχός του ποντικιού με πατημένο το Cmd/Ctrl κυλά τον καμβά οριζόντια. Dragging sideways on a numeric field's label changes the field's value. Η μεταφορά προς τα πλάγια πάνω στην ετικέτα ενός αριθμητικού πεδίου αλλάζει την τιμή του πεδίου. A two-finger rotate gesture on a trackpad rotates the canvas view. Μια κίνηση περιστροφής με δύο δάχτυλα σε επιφάνεια αφής περιστρέφει την προβολή του καμβά. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Το παρατεταμένο πάτημα ενός πλήκτρου εκτελεί το εργαλείο ή την εντολή της στήλης «Κρατήστε πατημένο» στις Συντομεύσεις πληκτρολογίου· ένα σύντομο πάτημα εκτελεί τη συνηθισμένη συντόμευσή του. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Πόσα δευτερόλεπτα πρέπει να μένει πατημένο ένα πλήκτρο πριν εκτελεστεί η συντόμευση παρατεταμένου πατήματος αντί για τη συνηθισμένη συντόμευσή του. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Όσο κρατάτε πατημένη τη συντόμευση ενός εργαλείου, το εργαλείο είναι επιλεγμένο, και μετά επιλέγεται ξανά το προηγούμενο εργαλείο. Shows the bounding box while you move the selection or draw a shape. Εμφανίζει το πλαίσιο οριοθέτησης όσο μετακινείτε την επιλογή ή σχεδιάζετε ένα σχήμα. Create Trim Marks draws Japanese-style marks instead of Roman ones. Η Δημιουργία σημαδιών ξακρίσματος σχεδιάζει σημάδια ιαπωνικού τύπου αντί για ρωμαϊκά. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index bd977fac3d..f0789457eb 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3105,6 +3105,8 @@ digits Malayalam Malayálam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rueda del mouse con Cmd/Ctrl pulsado desplaza el lienzo en horizontal. Dragging sideways on a numeric field's label changes the field's value. Arrastrar en horizontal sobre la etiqueta de un campo numérico cambia el valor del campo. A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto de giro con dos dedos en un trackpad gira la vista del lienzo. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Mantener pulsada una tecla ejecuta la herramienta o el comando de su columna Mantener pulsado en Métodos abreviados de teclado; una pulsación breve ejecuta su método abreviado habitual. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Cuántos segundos hay que mantener pulsada una tecla para que se ejecute su método abreviado de pulsación larga en lugar del habitual. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantener pulsado el atajo de una herramienta la elige hasta que lo suelta, y después vuelve a elegirse la herramienta anterior. Shows the bounding box while you move the selection or draw a shape. Muestra el cuadro delimitador mientras mueve la selección o dibuja una forma. Create Trim Marks draws Japanese-style marks instead of Roman ones. Crear marcas de recorte dibuja marcas de estilo japonés en lugar de romanas. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 1c7caa141a..7862c201b4 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4475,6 +4475,8 @@ font-technology Variable Muuttuvat The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Hiiren rulla vierittää piirtopintaa sivuttain, kun Cmd/Ctrl on painettuna. Dragging sideways on a numeric field's label changes the field's value. Numerokentän nimiön vetäminen sivuttain muuttaa kentän arvoa. A two-finger rotate gesture on a trackpad rotates the canvas view. Kahden sormen kiertoele kosketuslevyllä kiertää piirtopinnan näkymää. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Näppäimen pitäminen painettuna suorittaa työkalun tai komennon sen Pidä pohjassa -sarakkeesta Pikanäppäimissä; lyhyt painallus suorittaa sen tavallisen pikanäppäimen. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Kuinka monta sekuntia näppäintä on pidettävä painettuna, ennen kuin tavallisen pikanäppäimen sijaan suoritetaan sen pitkän painalluksen pikanäppäin. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Työkalun pikanäppäimen pitäminen painettuna valitsee työkalun, kunnes päästät irti, ja sitten edellinen työkalu valitaan uudelleen. Shows the bounding box while you move the selection or draw a shape. Näyttää rajausruudun, kun siirrät valintaa tai piirrät muotoa. Create Trim Marks draws Japanese-style marks instead of Roman ones. Luo leikkuumerkit piirtää japanilaistyyliset merkit roomalaisten sijaan. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 5da3445561..16fc1f2e4f 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3093,6 +3093,8 @@ digits Malayalam Malayalam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La molette de la souris avec Cmd/Ctrl enfoncée fait défiler la zone de travail latéralement. Dragging sideways on a numeric field's label changes the field's value. Faire glisser latéralement le libellé d’un champ numérique modifie la valeur du champ. A two-finger rotate gesture on a trackpad rotates the canvas view. Un geste de rotation à deux doigts sur un pavé tactile fait pivoter la vue de la zone de travail. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Maintenir une touche exécute l’outil ou la commande de sa colonne Maintenir dans Raccourcis clavier. Un appui bref exécute son raccourci habituel. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Durée, en secondes, pendant laquelle une touche doit être maintenue pour que son raccourci de maintien s’exécute à la place de son raccourci habituel. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Maintenir le raccourci d’un outil choisit cet outil jusqu’à ce que vous le relâchiez, puis l’outil précédent est de nouveau choisi. Shows the bounding box while you move the selection or draw a shape. Affiche le cadre de sélection pendant que vous déplacez la sélection ou dessinez une forme. Create Trim Marks draws Japanese-style marks instead of Roman ones. Créer des traits de coupe dessine des traits de style japonais au lieu de traits romains. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 880fe97eae..24bb9714d3 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3179,6 +3179,8 @@ The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl દબાવી રાખીને માઉસ વ્હીલ ફેરવવાથી કેનવાસ બાજુમાં સ્ક્રોલ થાય છે. Dragging sideways on a numeric field's label changes the field's value. સંખ્યાત્મક ફીલ્ડના લેબલ પર બાજુમાં ખેંચવાથી ફીલ્ડનું મૂલ્ય બદલાય છે. A two-finger rotate gesture on a trackpad rotates the canvas view. ટ્રેકપેડ પર બે આંગળીથી ફેરવવાનો હાવભાવ કેનવાસનું દૃશ્ય ફેરવે છે. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. કી દબાવી રાખવાથી કીબોર્ડ શૉર્ટકટમાં તેની હોલ્ડ કૉલમનું ટૂલ અથવા કમાન્ડ ચાલે છે; ટૂંકું દબાણ તેનો સામાન્ય શોર્ટકટ ચલાવે છે. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. કીનો હોલ્ડ શોર્ટકટ તેના સામાન્ય શોર્ટકટને બદલે ચાલે તે પહેલાં કીને કેટલી સેકન્ડ દબાવી રાખવી પડે. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ટૂલની શોર્ટકટ કી દબાવી રાખવાથી છોડો ત્યાં સુધી તે ટૂલ પસંદ રહે છે, પછી અગાઉનું ટૂલ ફરી પસંદ થાય છે. Shows the bounding box while you move the selection or draw a shape. તમે પસંદગી ખસેડો કે આકાર દોરો ત્યારે બાઉન્ડિંગ બોક્સ બતાવે છે. Create Trim Marks draws Japanese-style marks instead of Roman ones. ટ્રિમ માર્ક્સ બનાવો રોમન ને બદલે જાપાની શૈલીના ચિહ્નો દોરે છે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index ba969e3f7a..34ed704661 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4215,6 +4215,8 @@ antiAlias Sharp शार्प The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl दबाकर माउस व्हील घुमाने से कैनवास बगल की ओर स्क्रॉल होता है। Dragging sideways on a numeric field's label changes the field's value. किसी संख्या वाले फ़ील्ड के लेबल पर बगल की ओर ड्रैग करने से फ़ील्ड का मान बदलता है। A two-finger rotate gesture on a trackpad rotates the canvas view. ट्रैकपैड पर दो उंगलियों से घुमाने का जेस्चर कैनवास के व्यू को घुमाता है। + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. किसी कुंजी को दबाए रखने पर कीबोर्ड शॉर्टकट में उसके होल्ड कॉलम का टूल या कमांड चलता है; जल्दी दबाने पर उसका सामान्य शॉर्टकट चलता है। + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. किसी कुंजी को कितने सेकंड दबाए रखना होगा, ताकि उसके सामान्य शॉर्टकट के बजाय उसका होल्ड शॉर्टकट चले। Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. किसी टूल की शॉर्टकट कुंजी दबाए रखने पर वह टूल छोड़ने तक चुना रहता है, फिर पिछला टूल दोबारा चुना जाता है। Shows the bounding box while you move the selection or draw a shape. सिलेक्शन खिसकाते या आकार ड्रॉ करते समय बाउंडिंग बॉक्स दिखाता है। Create Trim Marks draws Japanese-style marks instead of Roman ones. ट्रिम मार्क्स बनाएं रोमन की जगह जापानी शैली के निशान ड्रॉ करता है। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index acbe927e9f..3d2cdc1e8c 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3686,6 +3686,8 @@ mark-style Japanese Japán The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Az egérgörgő lenyomott Cmd/Ctrl billentyűvel oldalirányban görgeti a vásznat. Dragging sideways on a numeric field's label changes the field's value. Egy számmező címkéjén oldalirányban húzva módosul a mező értéke. A two-finger rotate gesture on a trackpad rotates the canvas view. Az érintőpadon végzett kétujjas forgató kézmozdulat elforgatja a vászon nézetét. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Egy billentyű nyomva tartása a Billentyűparancsok Nyomva tartás oszlopában lévő eszközt vagy parancsot futtatja; egy rövid lenyomás a szokásos billentyűparancsát futtatja. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hány másodpercig kell nyomva tartani egy billentyűt, hogy a szokásos billentyűparancsa helyett a nyomva tartásos billentyűparancsa fusson. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Egy eszköz billentyűparancsát lenyomva tartva az eszköz a felengedésig ki van választva, utána ismét az előző eszköz lesz kiválasztva. Shows the bounding box while you move the selection or draw a shape. Megjeleníti a befoglaló keretet, miközben a kijelölést mozgatja vagy alakzatot rajzol. Create Trim Marks draws Japanese-style marks instead of Roman ones. A Vágójelek létrehozása római helyett japán stílusú jeleket rajzol. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 4cb906773e..3105753e9d 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4207,6 +4207,8 @@ font-technology Variable Variabel The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Roda mouse dengan Cmd/Ctrl ditahan menggulir kanvas ke samping. Dragging sideways on a numeric field's label changes the field's value. Menyeret ke samping pada label bidang angka mengubah nilai bidang itu. A two-finger rotate gesture on a trackpad rotates the canvas view. Gerakan putar dua jari pada trackpad memutar tampilan kanvas. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Menahan tombol menjalankan alat atau perintah di kolom Tahan pada Pintasan papan ketik; tekanan singkat menjalankan pintasan biasanya. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Berapa detik tombol harus ditahan sebelum pintasan tahannya berjalan sebagai ganti pintasan biasanya. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Menahan tombol pintasan alat memilih alat itu sampai Anda melepasnya, lalu alat sebelumnya dipilih lagi. Shows the bounding box while you move the selection or draw a shape. Menampilkan kotak pembatas saat Anda memindahkan seleksi atau menggambar bentuk. Create Trim Marks draws Japanese-style marks instead of Roman ones. Buat tanda potong menggambar tanda bergaya Jepang, bukan Romawi. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 6da474e5b7..38036f2cc2 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3148,6 +3148,8 @@ digits Malayalam Malayalam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rotellina del mouse con Cmd/Ctrl premuto scorre l'area di lavoro in orizzontale. Dragging sideways on a numeric field's label changes the field's value. Trascinare in orizzontale sull'etichetta di un campo numerico ne cambia il valore. A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto di rotazione con due dita sul trackpad ruota la vista dell'area di lavoro. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Tenere premuto un tasto esegue lo strumento o il comando della sua colonna Tieni premuto in Scelte rapide da tastiera; una pressione breve esegue la sua scorciatoia abituale. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Per quanti secondi va tenuto premuto un tasto prima che venga eseguita la sua scorciatoia a pressione prolungata invece di quella abituale. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Tenere premuta la scorciatoia di uno strumento lo sceglie finché non la rilasci, poi viene scelto di nuovo lo strumento precedente. Shows the bounding box while you move the selection or draw a shape. Mostra il riquadro di delimitazione mentre sposti la selezione o disegni una forma. Create Trim Marks draws Japanese-style marks instead of Roman ones. Crea segni di taglio disegna segni in stile giapponese invece di quelli romani. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index fbd38a5e07..1344c21a5b 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3125,6 +3125,8 @@ mark-style Japanese 日本式 The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl キーを押しながらマウスホイールを回すとカンバスを横にスクロールします。 Dragging sideways on a numeric field's label changes the field's value. 数値フィールドのラベルを横にドラッグすると、フィールドの値が変わります。 A two-finger rotate gesture on a trackpad rotates the canvas view. トラックパッドで 2 本指の回転ジェスチャーをすると、カンバスの表示が回転します。 + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. キーを長押しすると、キーボードショートカットの長押し列にあるツールまたはコマンドを実行します。短く押すと通常のショートカットを実行します。 + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 通常のショートカットの代わりに長押しショートカットを実行するまで、キーを押し続ける秒数です。 Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ツールのショートカットキーを押している間はそのツールを選び、離すと前のツールに戻ります。 Shows the bounding box while you move the selection or draw a shape. 選択範囲の移動中や図形の描画中にバウンディングボックスを表示します。 Create Trim Marks draws Japanese-style marks instead of Roman ones. トリムマークを作成で、西洋式ではなく日本式のトンボを描きます。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index bb93a48b3f..8c842c60e1 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6273,6 +6273,8 @@ font-technology Variable ცვლადი The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს. Dragging sideways on a numeric field's label changes the field's value. რიცხვითი ველის წარწერაზე გვერდულად გადათრევა ველის მნიშვნელობას ცვლის. A two-finger rotate gesture on a trackpad rotates the canvas view. ტრეკპადზე ორი თითით მობრუნების ჟესტი ტილოს ხედს აბრუნებს. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. კლავიშის ხანგრძლივი დაჭერა უშვებს ხელსაწყოს ან ბრძანებას კლავიატურის მალსახმობების დაჭერის სვეტიდან; მოკლე დაჭერა უშვებს მის ჩვეულ მალსახმობს. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. რამდენი წამი უნდა იყოს კლავიში დაჭერილი, სანამ ჩვეული მალსახმობის ნაცვლად მისი ხანგრძლივი დაჭერის მალსახმობი გაეშვება. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ხელსაწყოს მალსახმობი კლავიშის დაჭერით ხელსაწყო არჩეულია მის აშვებამდე, შემდეგ კი ისევ წინა ხელსაწყო აირჩევა. Shows the bounding box while you move the selection or draw a shape. აჩვენებს შემომსაზღვრელ ჩარჩოს, სანამ მონიშნულს გადაადგილებთ ან ფიგურას ხატავთ. Create Trim Marks draws Japanese-style marks instead of Roman ones. ჭრის ნიშნების შექმნა რომაულის ნაცვლად იაპონური სტილის ნიშნებს ხატავს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 71acb3c37f..1acd895bde 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3114,6 +3114,8 @@ mark-style Japanese 일본식 The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl 키를 누른 채 마우스 휠을 돌리면 캔버스가 가로로 스크롤됩니다. Dragging sideways on a numeric field's label changes the field's value. 숫자 필드의 레이블을 옆으로 드래그하면 필드 값이 바뀝니다. A two-finger rotate gesture on a trackpad rotates the canvas view. 트랙패드에서 두 손가락으로 회전하는 동작을 하면 캔버스 보기가 회전합니다. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 키를 누르고 있으면 키보드 단축키의 누르고 있기 열에 있는 도구나 명령이 실행되고, 짧게 누르면 평소 단축키가 실행됩니다. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 평소 단축키 대신 길게 누르기 단축키가 실행되기 전까지 키를 누르고 있어야 하는 시간(초)입니다. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 도구의 바로 가기 키를 누르고 있는 동안 그 도구가 선택되고, 키를 놓으면 이전 도구가 다시 선택됩니다. Shows the bounding box while you move the selection or draw a shape. 선택 영역을 이동하거나 모양을 그리는 동안 테두리 상자를 표시합니다. Create Trim Marks draws Japanese-style marks instead of Roman ones. 트림 마크 만들기에서 서양식 대신 일본식 표시를 그립니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 96c20d9809..41aa245899 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4829,6 +4829,8 @@ font-technology Variable Variabel The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Het muiswiel met Cmd/Ctrl ingedrukt schuift het canvas zijwaarts. Dragging sideways on a numeric field's label changes the field's value. Zijwaarts slepen over het label van een numeriek veld wijzigt de waarde van het veld. A two-finger rotate gesture on a trackpad rotates the canvas view. Een draaigebaar met twee vingers op een trackpad draait de weergave van het canvas. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Als u een toets vasthoudt, wordt het gereedschap of de opdracht uit de kolom Houd in Sneltoetsen uitgevoerd; kort drukken voert de gewone sneltoets uit. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hoeveel seconden u een toets moet vasthouden voordat de vasthoudsneltoets wordt uitgevoerd in plaats van de gewone sneltoets. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Als u de sneltoets van een gereedschap ingedrukt houdt, is dat gereedschap gekozen tot u loslaat, en daarna wordt het vorige gereedschap weer gekozen. Shows the bounding box while you move the selection or draw a shape. Toont het begrenzingskader terwijl u de selectie verplaatst of een vorm tekent. Create Trim Marks draws Japanese-style marks instead of Roman ones. Afsnijtekens maken tekent tekens in Japanse stijl in plaats van Romeinse. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c71c172e87..7b8358ef06 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4397,6 +4397,8 @@ font-technology Variable Zmienne The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kółko myszy z wciśniętym Cmd/Ctrl przewija obszar roboczy w poziomie. Dragging sideways on a numeric field's label changes the field's value. Przeciąganie w bok po etykiecie pola liczbowego zmienia wartość pola. A two-finger rotate gesture on a trackpad rotates the canvas view. Gest obrotu dwoma palcami na gładziku obraca widok obszaru roboczego. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Przytrzymanie klawisza uruchamia narzędzie lub polecenie z jego kolumny Przytrzymaj w Skrótach klawiaturowych; krótkie naciśnięcie uruchamia jego zwykły skrót. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Ile sekund trzeba przytrzymać klawisz, zanim zamiast zwykłego skrótu zostanie uruchomiony jego skrót przytrzymania. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Przytrzymanie skrótu narzędzia wybiera je do momentu puszczenia klawisza, a potem ponownie wybierane jest poprzednie narzędzie. Shows the bounding box while you move the selection or draw a shape. Pokazuje obwiednię podczas przesuwania zaznaczenia lub rysowania kształtu. Create Trim Marks draws Japanese-style marks instead of Roman ones. Utwórz znaczniki przycięcia rysuje znaczniki w stylu japońskim zamiast rzymskich. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index c55d25b29c..bc5242d47f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2597,6 +2597,8 @@ digits Malayalam Malaiala The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. A roda do mouse com Cmd/Ctrl pressionado rola a tela para os lados. Dragging sideways on a numeric field's label changes the field's value. Arrastar para os lados sobre o rótulo de um campo numérico muda o valor do campo. A two-finger rotate gesture on a trackpad rotates the canvas view. Um gesto de rotação com dois dedos no trackpad gira a visualização da tela. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Manter uma tecla pressionada executa a ferramenta ou o comando da coluna Manter pressionado em Atalhos de Teclado; um toque rápido executa o atalho habitual. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Quantos segundos uma tecla precisa ficar pressionada até que seu atalho de pressionamento longo seja executado no lugar do atalho habitual. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Manter pressionado o atalho de uma ferramenta a escolhe até você soltar, e então a ferramenta anterior é escolhida de novo. Shows the bounding box while you move the selection or draw a shape. Mostra a caixa delimitadora enquanto você move a seleção ou desenha uma forma. Create Trim Marks draws Japanese-style marks instead of Roman ones. Criar Marcas de Corte desenha marcas no estilo japonês em vez de romanas. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 8034801e32..69a9229951 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3135,6 +3135,8 @@ digits Malayalam Малаялам The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо мыши с нажатой Cmd/Ctrl прокручивает холст по горизонтали. Dragging sideways on a numeric field's label changes the field's value. Перетаскивание по подписи числового поля в сторону меняет значение поля. A two-finger rotate gesture on a trackpad rotates the canvas view. Жест поворота двумя пальцами на трекпаде поворачивает вид холста. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Удержание клавиши запускает инструмент или команду из её столбца «Удерживать» в «Сочетаниях клавиш»; короткое нажатие запускает её обычное сочетание. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Сколько секунд нужно удерживать клавишу, прежде чем вместо её обычного сочетания сработает сочетание удержания. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Пока вы удерживаете клавишу инструмента, он остаётся выбранным, а после отпускания снова выбирается предыдущий инструмент. Shows the bounding box while you move the selection or draw a shape. Показывает ограничивающую рамку, пока вы перемещаете выделение или рисуете фигуру. Create Trim Marks draws Japanese-style marks instead of Roman ones. «Создать метки подрезки» рисует метки в японском стиле вместо западных. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index df718765da..1eb7de86af 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3035,6 +3035,8 @@ digits Malayalam Malayalam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mushjulet med Cmd/Ctrl nedtryckt rullar arbetsytan i sidled. Dragging sideways on a numeric field's label changes the field's value. Att dra i sidled på ett sifferfälts etikett ändrar fältets värde. A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsgest med två fingrar på en styrplatta roterar arbetsytans vy. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Om du håller ned en tangent körs verktyget eller kommandot i dess Håll-kolumn i Kortkommandon; ett kort tryck kör dess vanliga kortkommando. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Hur många sekunder en tangent måste hållas ned innan dess hållkortkommando körs i stället för dess vanliga kortkommando. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. När du håller ned ett verktygs kortkommando är verktyget valt tills du släpper, och sedan väljs det föregående verktyget igen. Shows the bounding box while you move the selection or draw a shape. Visar avgränsningsramen medan du flyttar markeringen eller ritar en form. Create Trim Marks draws Japanese-style marks instead of Roman ones. Skapa skärmärken ritar märken i japansk stil i stället för romerska. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index e812704fd8..84d44062d5 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2872,6 +2872,8 @@ digits Malayalam Malayalam The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl basılıyken fare tekerleği tuvali yana kaydırır. Dragging sideways on a numeric field's label changes the field's value. Sayısal bir alanın etiketi üzerinde yana sürüklemek alanın değerini değiştirir. A two-finger rotate gesture on a trackpad rotates the canvas view. İzleme dörtgeninde iki parmakla döndürme hareketi tuvalin görünümünü döndürür. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Bir tuşu basılı tutmak, Klavye Kısayolları'ndaki Basılı tutun sütununda bulunan aracı veya komutu çalıştırır; kısa basış olağan kısayolunu çalıştırır. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Olağan kısayolu yerine basılı tutma kısayolunun çalışması için bir tuşun kaç saniye basılı tutulması gerektiği. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Bir aracın kısayol tuşunu basılı tutmak, tuşu bırakana kadar o aracı seçer, ardından önceki araç yeniden seçilir. Shows the bounding box while you move the selection or draw a shape. Seçimi taşırken veya bir şekil çizerken sınırlayıcı kutuyu gösterir. Create Trim Marks draws Japanese-style marks instead of Roman ones. Kesim İşaretleri Oluşturun, Roma tarzı yerine Japon tarzı işaretler çizer. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index e6187a8dff..60aea700e0 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3140,6 +3140,8 @@ digits Malayalam Малаялам The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо миші з натиснутою Cmd/Ctrl прокручує полотно по горизонталі. Dragging sideways on a numeric field's label changes the field's value. Перетягування вбік по підпису числового поля змінює значення поля. A two-finger rotate gesture on a trackpad rotates the canvas view. Жест обертання двома пальцями на трекпаді обертає вигляд полотна. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Утримання клавіші запускає інструмент або команду з її стовпця «Утримувати» в «Поєднаннях клавіш»; коротке натискання запускає її звичайне поєднання. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Скільки секунд потрібно утримувати клавішу, перш ніж замість її звичайного поєднання спрацює поєднання утримання. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Поки ви утримуєте клавішу інструмента, його вибрано, а після відпускання знову вибирається попередній інструмент. Shows the bounding box while you move the selection or draw a shape. Показує обмежувальну рамку, поки ви переміщуєте виділення або малюєте фігуру. Create Trim Marks draws Japanese-style marks instead of Roman ones. «Створити мітки підрізування» малює мітки в японському стилі замість західних. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index aec4006a04..c44d107243 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3455,6 +3455,8 @@ mark-style Japanese Kiểu Nhật The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Con lăn chuột kèm giữ Cmd/Ctrl cuộn khung vẽ sang ngang. Dragging sideways on a numeric field's label changes the field's value. Kéo sang ngang trên nhãn của một trường số sẽ thay đổi giá trị của trường. A two-finger rotate gesture on a trackpad rotates the canvas view. Cử chỉ xoay bằng hai ngón trên bàn di chuột sẽ xoay khung nhìn của khung vẽ. + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. Giữ một phím sẽ chạy công cụ hoặc lệnh trong cột Giữ của Phím tắt; nhấn nhanh sẽ chạy phím tắt thông thường của phím đó. + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. Số giây phải giữ một phím trước khi phím tắt nhấn giữ của nó chạy thay cho phím tắt thông thường. Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Giữ phím tắt của một công cụ sẽ chọn công cụ đó cho đến khi bạn thả ra, rồi công cụ trước đó được chọn lại. Shows the bounding box while you move the selection or draw a shape. Hiển thị hộp giới hạn khi bạn di chuyển vùng chọn hoặc vẽ một hình. Create Trim Marks draws Japanese-style marks instead of Roman ones. Tạo dấu cắt xén vẽ dấu kiểu Nhật thay cho kiểu La Mã. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9f824ca033..d8e06cd32d 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2999,6 +2999,8 @@ digits Malayalam 马拉雅拉姆数字 The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 滚动鼠标滚轮会横向滚动画布。 Dragging sideways on a numeric field's label changes the field's value. 在数值字段的标签上横向拖动可更改字段的值。 A two-finger rotate gesture on a trackpad rotates the canvas view. 在触控板上用双指旋转手势可旋转画布视图。 + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 按住某个键会运行键盘快捷键中其按住列的工具或命令;快速按下则运行其常规快捷键。 + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 按住某个键多少秒后,运行其按住快捷键而不是常规快捷键。 Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快捷键时选择该工具,松开后重新选择之前的工具。 Shows the bounding box while you move the selection or draw a shape. 移动所选对象或绘制形状时显示定界框。 Create Trim Marks draws Japanese-style marks instead of Roman ones. 创建裁切标记绘制日式标记,而不是西式标记。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 5404f2e9fd..5a3624ed8f 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4283,6 +4283,8 @@ digits Malayalam 馬來亞拉姆數字 The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 捲動滑鼠滾輪會橫向捲動畫布。 Dragging sideways on a numeric field's label changes the field's value. 在數值欄位的標籤上橫向拖曳可變更欄位的值。 A two-finger rotate gesture on a trackpad rotates the canvas view. 在觸控式軌跡板上以雙指旋轉手勢可旋轉畫布檢視。 + Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut. 按住某個鍵會執行鍵盤快速鍵中其按住欄的工具或命令;快速按下則執行其一般快速鍵。 + How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut. 按住某個鍵多少秒後,執行其按住快速鍵而不是一般快速鍵。 Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快速鍵時選擇該工具,放開後重新選擇之前的工具。 Shows the bounding box while you move the selection or draw a shape. 移動選取範圍或繪製形狀時顯示邊框。 Create Trim Marks draws Japanese-style marks instead of Roman ones. 建立剪裁標記繪製日式標記,而不是西式標記。 diff --git a/crates/ui-egui/src/prefs_dialog/descriptions.rs b/crates/ui-egui/src/prefs_dialog/descriptions.rs index eb8156f8dd..984597bdd8 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -40,6 +40,8 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ ("scrubNumericFields", "Dragging sideways on a numeric field's label changes the field's value."), ("trackpadRotateView", "A two-finger rotate gesture on a trackpad rotates the canvas view."), ("holdToolKeys", "Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again."), + ("holdShortcuts", "Holding a key runs the tool or command in its Hold column in Keyboard Shortcuts; a quick press runs its usual shortcut."), + ("keyHoldDelay", "How long, in seconds, a key must be held before its hold shortcut runs instead of its usual shortcut."), ("boundingBoxWhileMovingAndDrawing", "Shows the bounding box while you move the selection or draw a shape."), ("japaneseCropMarks", "Create Trim Marks draws Japanese-style marks instead of Roman ones."), ("newArtBasic", "New art takes only the fill and stroke of the selection; off, it takes the selected object's whole appearance."), From c886ab1698d82fbca0cd3e3e187b38edb3473034 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 07:19:14 -0800 Subject: [PATCH 121/247] Shortcuts: a tool key before a hold key in one frame reaches its tool first When a key the active tool takes (E with the Extend Path tool) went down before a key with a hold shortcut that was pressed and let go in the same frame, the hold key's tap ran first. A tap that chose another tool then sent the earlier key to the new tool. The hold key now goes back to the frame in that case, as it does after a chord with Cmd, Ctrl or Alt, so both keys act in order as with Hold Shortcuts off. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 35 ++++++++++++------- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 21 +++++++++++ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index b504be57d8..2c6767fb77 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -208,12 +208,22 @@ fn tool_takes(app: &mut VectorcraftApp, key: Key, text: &str) -> bool { tool_key.is_some_and(|k| app.session.tool_claims_key(k, view)) } -/// Is there a press with Cmd, Ctrl or Alt before the event at `start` that no wait took? -fn chord_before(events: &[egui::Event], start: usize, taken: &[usize]) -> bool { - events.iter().enumerate().take(start).any(|(k, e)| { - !taken.contains(&k) - && matches!(e, egui::Event::Key { key, pressed: true, modifiers: m, .. } - if !super::is_modifier(*key) && (m.command || m.ctrl || m.alt || m.mac_cmd)) +/// Is there a press before the event at `start` that no wait took and that the frame handles: one +/// with Cmd, Ctrl or Alt, or one that typed a text of a key the active tool takes ([`tool_takes`])? +fn chord_before(app: &mut VectorcraftApp, events: &[egui::Event], typed_by: &[Option<usize>], start: usize, taken: &[usize]) -> bool { + let mut before = events.iter().enumerate().take(start).filter(|(k, _)| !taken.contains(k)); + before.any(|(k, e)| match e { + egui::Event::Key { key, pressed: true, modifiers: m, .. } if !super::is_modifier(*key) => { + m.command + || m.ctrl + || m.alt + || m.mac_cmd + || typed_by + .iter() + .enumerate() + .any(|(t, by)| *by == Some(k) && matches!(events.get(t), Some(egui::Event::Text(text)) if tool_takes(app, *key, text))) + } + _ => false, }) } @@ -269,7 +279,8 @@ fn run_typed_before( /// its text from the frame, with the key's repeats that follow in the frame and their text. When a /// wait that started in this frame also ends in it, the keys typed before its key run first /// ([`run_typed_before`]), so they act in the order they went down; after a chord with Cmd, Ctrl -/// or Alt before its key, the key goes back to the frame instead ([`chord_before`]). Then a wait +/// or Alt, or a key the active tool takes, before its key, the key goes back to the frame instead +/// ([`chord_before`]). Then a wait /// whose delay has passed with the key down runs the hold shortcut. True when a result opened a /// dialog or the palette: the rest of the frame's keys are dropped and no other shortcut runs. pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { @@ -311,12 +322,12 @@ pub(super) fn intake(app: &mut VectorcraftApp, ctx: &egui::Context) -> bool { if let Some((hold, down)) = ended { let start = started.take(); // After a chord with Cmd, Ctrl or Alt pressed before it, which the frame's shortcuts - // run, the key goes back to the frame without waiting, so the frame handles it as it - // does with Hold Shortcuts off and its tap does not run before the chord. Its press, - // its repeats and their texts stay in the frame, and its later repeats reach later - // frames. + // run, or a key the active tool takes, the key goes back to the frame without + // waiting, so the frame handles it as it does with Hold Shortcuts off and its tap + // does not run before that key. Its press, its repeats and their texts stay in the + // frame, and its later repeats reach later frames. if let Some((start, before)) = start - && chord_before(&events, start, &taken) + && chord_before(app, &events, &typed_by, start, &taken) { app.hold_keys.pending = None; taken.truncate(before); diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index a2406fcf83..8502ef6091 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -424,6 +424,27 @@ fn a_chord_before_a_wait_ended_in_its_frame_runs_first() { assert!(app.hold_keys.pending.is_none()); } +/// A key the active tool takes (E with the Extend Path tool), pressed before a wait that starts and +/// ends in one frame, reaches the tool first: the key's tap, which chooses another tool, does not +/// run before it, and the frame acts as it does with Hold Shortcuts off. +#[test] +fn a_tool_key_before_a_wait_ended_in_its_frame_reaches_the_tool_first() { + let frame = |app: &mut VectorcraftApp| { + app.select_tool(vectorcraft_tools::addons::extend_path::ID); + let mut events = press(Key::E, "e", Modifiers::NONE); + events.extend(press(Key::X, "x", Modifiers::NONE)); + events.push(release(Key::X)); + Keyboard::new().frame(app, 0.0, events); + (app.session.tool_id().to_string(), fill(app)) + }; + let off = frame(&mut erolka_x(false)); + let mut app = erolka_x(true); + let on = frame(&mut app); + assert_eq!(on.0, "eyedropper", "X's tap chooses the Eyedropper after E reached the Extend Path tool"); + assert_eq!(on, off); + assert!(app.hold_keys.pending.is_none()); +} + /// After a command chord before a wait that starts and ends in one frame, the key's repeats in /// that frame and in later ones, and the text they type, reach the frame as with Hold Shortcuts /// off. From 553a31883f1da64c3e641fdef6a927ce512411ca Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 07:31:02 -0800 Subject: [PATCH 122/247] Shortcuts: the Keyboard Shortcuts search finds a row by its hold shortcut While Hold Shortcuts is on, typing a key in the search now finds the row whose Hold column shows it, as it finds a row by its shortcut. --- crates/ui-egui/src/shortcut_editor.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index b9bfe65546..ec5b94cdf1 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1972,7 +1972,8 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { Cow::Borrowed(_) => view.texts.get(i).cloned().flatten(), Cow::Owned(km) => dialog_shortcuts_with(km, &e.key, view.backtick.as_deref()), }; - if !q.is_empty() && !row_matches(e, &q, sc.as_deref()) { + let hold_text = if holds_on { hold_of(&holds, &e.key).map(|h| menus::pretty_shortcut(&h)) } else { None }; + if !q.is_empty() && !row_matches(e, &q, sc.as_deref()) && !hold_text.is_some_and(|h| h.to_lowercase().contains(&q)) { continue; } let row = ui.horizontal(|ui| { @@ -3783,6 +3784,25 @@ mod tests { assert!(texts.iter().any(|t| t.starts_with("A quick press")) && texts.iter().any(|t| t == "Tap"), "{texts:?}"); } + /// While Hold Shortcuts is on, the search finds a row by its hold shortcut as the Hold column + /// shows it; while it is off, the hold shortcut finds nothing. + #[test] + fn the_search_finds_a_row_by_its_hold_shortcut() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("shortcuts.set", json!({"id": "paint.swap", "hold": "Shift+;"})).unwrap(); + let hold = menus::pretty_shortcut("Shift+;").to_lowercase(); + let name = shown_name(&entry("paint.swap").unwrap()); + assert!(!name.to_lowercase().contains(&hold), "{name}"); + open(&mut app); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("tab".into(), json!("menu")); + d.fields.insert("query".into(), json!(hold)); + assert!(!dialog_texts(&mut app).contains(&name), "off, the hold shortcut finds nothing"); + app.ui.dialog.as_mut().unwrap().fields.insert("holdShortcuts".into(), json!(true)); + let texts = dialog_texts(&mut app); + assert!(texts.contains(&name), "{name} in {texts:?}"); + } + /// A command that needs a value is listed in the editor once the user gives it a key, but the /// command search still leaves it out: a pick gives it no value. #[test] From 1ed9337e7893e72391273427033587e9d4999381 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 07:41:45 -0800 Subject: [PATCH 123/247] Shortcuts: a wait a dialog ends drops the key's repeat in the frame it is let go When a dialog or field took the keyboard while a key with a hold shortcut waited, and the next frame held both a repeat of the key and its release, the repeat and the text it typed reached the dialog. The frame that ends the wait now drops them too. --- crates/ui-egui/src/shortcuts/hold_keys.rs | 6 ++++-- .../ui-egui/src/shortcuts/hold_keys/tests.rs | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/shortcuts/hold_keys.rs b/crates/ui-egui/src/shortcuts/hold_keys.rs index 2c6767fb77..e5cbdc15e1 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys.rs @@ -90,11 +90,13 @@ pub(super) fn guard(app: &mut VectorcraftApp, ctx: &egui::Context, focused: bool app.hold_keys.swallowed.retain(|s| s.viewport != viewport); return; } + let mut held: Vec<(Key, Option<Key>)> = app.hold_keys.swallowed.iter().filter(|s| s.viewport == viewport).map(|s| (s.key, s.physical)).collect(); + held.extend(app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport).map(|p| (p.key, p.physical))); + // A wait that ends here still drops this frame's repeats of its key, also when the frame lets + // the key go. if app.hold_keys.pending.as_ref().is_some_and(|p| p.viewport == viewport) && (blocked(app, ctx) || !app.session.prefs.hold_shortcuts) { cancel(app, ctx); } - let mut held: Vec<(Key, Option<Key>)> = app.hold_keys.swallowed.iter().filter(|s| s.viewport == viewport).map(|s| (s.key, s.physical)).collect(); - held.extend(app.hold_keys.pending.as_ref().filter(|p| p.viewport == viewport).map(|p| (p.key, p.physical))); if held.is_empty() { return; } diff --git a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs index 8502ef6091..6afc2a0002 100644 --- a/crates/ui-egui/src/shortcuts/hold_keys/tests.rs +++ b/crates/ui-egui/src/shortcuts/hold_keys/tests.rs @@ -238,6 +238,25 @@ fn a_dialog_or_presentation_mode_ends_the_wait() { } } +/// A dialog opened while a key waits does not get the key's repeat, or the text it types, from the +/// frame that also lets the key go. +#[test] +fn a_dialog_that_ends_the_wait_gets_no_repeat_from_the_frame_of_the_release() { + let mut app = erolka_x(true); + let keys = Keyboard::new(); + keys.press(&mut app, 0.0, Key::X, "x"); + assert!(app.hold_keys.pending.is_some()); + app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({}))); + let mut events = press(Key::X, "x", Modifiers::NONE); + events.push(release(Key::X)); + let left = keys.frame_left(&mut app, 0.1, events); + assert!(app.hold_keys.pending.is_none(), "the dialog ends the wait"); + assert!( + !left.iter().any(|e| matches!(e, egui::Event::Text(_) | egui::Event::Key { pressed: true, .. })), + "neither the repeat nor its text reaches the dialog: {left:?}" + ); +} + /// A new wait does not drop a wait left in another viewport unseen: that wait ends, and its key's /// repeats stay held back in its viewport. #[test] From 0586232cbf22d88c54d4823b5a9eafaca3f593ef Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 07:53:39 -0800 Subject: [PATCH 124/247] i18n: French Object Mosaic labels use a no-break space before colons The six Object Mosaic dialog labels that end in a colon now put U+00A0 before it, as the other colon rows in fr.tsv do, so french_catalog_uses_nonbreaking_prose_punctuation passes. --- crates/ui-egui/src/i18n/fr.tsv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 99dd69b285..53527e3afe 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -700,12 +700,12 @@ font-technology Variable Variables Create New {kind} Style Créer un style de {kind} Create Object Mosaic… Créer une mosaïque d’objets… Create Object Mosaic Créer une mosaïque d’objets - Current Size: Taille actuelle : - New Size: Nouvelle taille : - Tile Spacing: Espacement des carreaux : - Number of Tiles: Nombre de carreaux : - Constrain Ratio: Conserver les proportions : - Result: Résultat : + Current Size: Taille actuelle : + New Size: Nouvelle taille : + Tile Spacing: Espacement des carreaux : + Number of Tiles: Nombre de carreaux : + Constrain Ratio: Conserver les proportions : + Result: Résultat : Resize Using Percentages Redimensionner en pourcentage Delete Raster Supprimer l’image pixellisée Use Ratio Utiliser le rapport From 0a212624c10fbc5d90f37b95f9c2fc21985c0626 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 08:09:58 -0800 Subject: [PATCH 125/247] Object Mosaic: OK keeps the dialog open when the command refuses its fields OK closed the dialog whether or not object.createObjectMosaic succeeded, so a field the command refused, set through ui.dialog.set, was lost. The dialog now closes only when the command succeeds, as form::commit_preview does. --- crates/ui-egui/src/dialogs/object_mosaic.rs | 30 ++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index 08497fb3c0..eac36e9095 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -13,7 +13,7 @@ use serde_json::{Value, json}; use vectorcraft_doc::NodeKind; -use super::{DialogSpec, form, run_and_close}; +use super::{DialogSpec, form}; use crate::state::Dialog; use crate::theme::Tokens; use crate::{VectorcraftApp, widgets}; @@ -386,7 +386,9 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } /// OK: the new size worked out against the image's size as it is now, as a frame would show it. -/// A Constrain Ratio (`lock`) that is not true or false is refused, and the dialog stays open. +/// A Constrain Ratio (`lock`) that is not true or false is refused, and the dialog stays open. The +/// dialog also stays open with its fields when the command refuses them, as [`form::commit_preview`] +/// does. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { if d.fields.get("lock").is_some_and(|v| !v.is_boolean() && !v.is_null()) { return Err("`lock` must be true or false".into()); @@ -394,7 +396,11 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { let mut d = d.clone(); read_image(image_size(app), &mut d); follow_ratio(&mut d); - run_and_close(app, COMMAND, params(&d)) + let r = app.run(COMMAND, params(&d)); + if r.is_ok() { + app.ui.dialog = None; + } + r } #[cfg(test)] @@ -744,6 +750,24 @@ mod tests { } } + /// When the command refuses the dialog's fields, OK leaves the dialog open with them, so they can + /// be corrected; OK then makes the mosaic and closes it. + #[test] + fn a_refused_field_keeps_the_dialog_open() { + let mut app = app_with_image(); + open(&mut app, &json!({"width": 80})).unwrap(); + crate::dialogs::set_field(app.ui.dialog.as_mut().unwrap(), "gray".into(), json!(1)); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("gray"), "{e}"); + assert_eq!(mosaic(&app), None); + let d = app.ui.dialog.as_mut().expect("the dialog stays open"); + assert_eq!((d.f64("width", 0.0), d.fields.get("gray")), (80.0, Some(&json!(1)))); + crate::dialogs::set_field(d, "gray".into(), json!(true)); + crate::dialogs::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none()); + assert_eq!(mosaic(&app).map(|m| m.0), Some(80.0)); + } + /// True or false set after a Resize Using Percentages value the command refuses replaces it: the /// same mode as before keeps the sizes, and the other mode shows them the other way. Null is /// false, as the command reads it. OK then makes the mosaic. From 04c65a85af1e2722798331dfb5ba8244473b2039 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 08:30:51 -0800 Subject: [PATCH 126/247] Messages: app.toast shows a message over the window without stopping work `app.toast {message, level?, seconds?}` queues a short message that the desktop app shows at the window's bottom right. It closes after its time (4 seconds by default, 0.5 to 60) or when clicked. At most 5 show at once, the newest lowest; a message shows at most 6 lines with the whole text on hover, and a stack taller than the window scrolls. `level` (info, success, warning, error) sets the color of its edge. Scripts raise one with `vc.run`, MCP clients and plug-ins through the command, and an action records it as a step. The app's own code calls `Session::toast`. The command edits no document and adds no undo step; invalid values are errors. Part of #7523: the tick sound is not included. Docs: docs/mcp.md, the Automation evidence in docs/target-app-parity.md. --- crates/engine/src/cmd.rs | 2 + crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/toast.rs | 248 ++++++++++++++ crates/engine/src/lib.rs | 2 + crates/engine/src/session/documents.rs | 1 + crates/ui-egui/src/app.rs | 2 + crates/ui-egui/src/lib.rs | 3 + crates/ui-egui/src/toasts.rs | 308 ++++++++++++++++++ docs/mcp.md | 17 + docs/target-app-parity.md | 1 + 10 files changed, 585 insertions(+) create mode 100644 crates/engine/src/cmd/toast.rs create mode 100644 crates/ui-egui/src/toasts.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index c4a86dd3a5..692408f112 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -104,6 +104,7 @@ pub use textedit::effective_kerning; pub mod textstyles; pub(crate) mod textwrap; pub(crate) mod threads; +pub mod toast; pub(crate) mod typecmd; mod typemenu; mod variablecmds; @@ -333,6 +334,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(compositefonts::specs()); v.extend(fontfiles::specs()); v.extend(help::specs()); + v.extend(toast::specs()); v.extend(threads::specs()); v.extend(textwrap::specs()); v.extend(graph::specs()); diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 6a0caf4cd6..01e3e1a4e6 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -84,6 +84,7 @@ pub(super) const ALLOWED: &[&str] = &[ "addon.shapes.star", "addon.type.releasePath", "addon.type.textTweaker", + "app.toast", "appearance.addEffect", "appearance.addFill", "appearance.addStroke", diff --git a/crates/engine/src/cmd/toast.rs b/crates/engine/src/cmd/toast.rs new file mode 100644 index 0000000000..c692ad702d --- /dev/null +++ b/crates/engine/src/cmd/toast.rs @@ -0,0 +1,248 @@ +//! `app.toast`: a short message shown over the window that does not stop work and goes away by +//! itself (a toast). Scripts (`vc.run`), actions (a recorded step), MCP clients and the app's own +//! code ([`Session::toast`]) raise one. The engine queues the messages and the desktop app takes +//! them each frame ([`Session::take_toasts`]) and shows them. + +use std::collections::VecDeque; + +use serde_json::{Value, json}; + +use super::{CommandSpec, Result, always, bad, cmd}; +use crate::Session; + +const ID: &str = "app.toast"; + +/// The most characters a message has. +pub const MAX_CHARS: usize = 500; + +/// How long a message shows when `seconds` is omitted, and the shortest and longest time it may +/// show. +pub const DEFAULT_SECONDS: f64 = 4.0; +pub const MIN_SECONDS: f64 = 0.5; +pub const MAX_SECONDS: f64 = 60.0; + +/// The most messages waiting for the app to take them: past it the oldest one goes. A session +/// without a window (MCP, the command line) never takes them. +pub const MAX_QUEUED: usize = 32; + +/// What kind of news a message is, which sets its color. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum Level { + #[default] + Info, + Success, + Warning, + Error, +} + +impl Level { + pub const ALL: [Level; 4] = [Level::Info, Level::Success, Level::Warning, Level::Error]; + + /// Its `level` value. + pub fn param(self) -> &'static str { + match self { + Level::Info => "info", + Level::Success => "success", + Level::Warning => "warning", + Level::Error => "error", + } + } + + /// The level whose `level` value is `param`. + pub fn from_param(param: &str) -> Option<Level> { + Level::ALL.into_iter().find(|l| l.param() == param) + } +} + +/// A message to show. +#[derive(Clone, Debug, PartialEq)] +pub struct Toast { + pub message: String, + pub level: Level, + /// How long it shows, in seconds. + pub seconds: f64, +} + +impl Toast { + /// A message of `level` shown for [`DEFAULT_SECONDS`]. + pub fn new(message: impl Into<String>, level: Level) -> Toast { + Toast { message: message.into(), level, seconds: DEFAULT_SECONDS } + } +} + +/// The messages waiting for the app to show them. +#[derive(Clone, Debug, Default)] +pub struct Queue(VecDeque<Toast>); + +impl Session { + /// Queue `toast` for the app to show. With [`MAX_QUEUED`] waiting, the oldest one goes. + pub fn toast(&mut self, toast: Toast) { + while self.toasts.0.len() >= MAX_QUEUED { + self.toasts.0.pop_front(); + } + self.toasts.0.push_back(toast); + } + + /// Take the messages queued since the last call, oldest first. + pub fn take_toasts(&mut self) -> Vec<Toast> { + self.toasts.0.drain(..).collect() + } +} + +pub fn specs() -> Vec<CommandSpec> { + vec![cmd!( + "app.toast", + "Show Message", + [], + None, + "{message: string (1 to 500 characters, not only spaces), level?: \"info\" | \"success\" | \"warning\" | \"error\" (default \"info\"), seconds?: number 0.5 to 60 (default 4)} show `message` over the window without stopping work: it goes away after `seconds` or when clicked; messages stack at the window's bottom right, the newest lowest, at most 5 at once; edits no document; an action records it as a step → {message, level, seconds}", + always, + run + )] +} + +fn run(s: &mut Session, p: &Value) -> Result<Value> { + let toast = parse(p)?; + let r = json!({"message": &toast.message, "level": toast.level.param(), "seconds": toast.seconds}); + s.toast(toast); + Ok(r) +} + +/// The message `p` asks for; an invalid value of any key is an error. +fn parse(p: &Value) -> Result<Toast> { + let message = match p.get("message") { + Some(Value::String(m)) => m, + Some(_) => return Err(bad(ID, "`message` must be a string")), + None => return Err(bad(ID, "`message` is required")), + }; + if message.trim().is_empty() { + return Err(bad(ID, "`message` must have a character other than a space")); + } + let chars = message.chars().count(); + if chars > MAX_CHARS { + return Err(bad(ID, format!("`message` has {chars} characters; at most {MAX_CHARS} are allowed"))); + } + let level = match p.get("level") { + None => Level::default(), + Some(v) => v.as_str().and_then(Level::from_param).ok_or_else(|| { + let all: Vec<&str> = Level::ALL.iter().map(|l| l.param()).collect(); + bad(ID, format!("`level` must be one of {}", all.join(", "))) + })?, + }; + let seconds = match p.get("seconds") { + None => DEFAULT_SECONDS, + Some(v) => v + .as_f64() + .filter(|s| (MIN_SECONDS..=MAX_SECONDS).contains(s)) + .ok_or_else(|| bad(ID, format!("`seconds` must be a number from {MIN_SECONDS} to {MAX_SECONDS}")))?, + }; + Ok(Toast { message: message.clone(), level, seconds }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_message_is_queued_with_its_defaults() { + let mut s = Session::new(); + let r = s.execute(ID, &json!({"message": "Saved 3 files"})).unwrap(); + assert_eq!(r, json!({"message": "Saved 3 files", "level": "info", "seconds": 4.0})); + assert_eq!(s.take_toasts(), vec![Toast::new("Saved 3 files", Level::Info)]); + // Taken once. + assert_eq!(s.take_toasts(), vec![]); + } + + #[test] + fn level_and_seconds_are_kept() { + let mut s = Session::new(); + for level in Level::ALL { + s.execute(ID, &json!({"message": "m", "level": level.param(), "seconds": 0.5})).unwrap(); + } + s.execute(ID, &json!({"message": "long", "seconds": 60})).unwrap(); + let got: Vec<(Level, f64)> = s.take_toasts().iter().map(|t| (t.level, t.seconds)).collect(); + assert_eq!(got, vec![(Level::Info, 0.5), (Level::Success, 0.5), (Level::Warning, 0.5), (Level::Error, 0.5), (Level::Info, 60.0)]); + } + + #[test] + fn invalid_values_are_errors_and_queue_nothing() { + let mut s = Session::new(); + let long = "x".repeat(MAX_CHARS + 1); + for p in [ + json!({}), + json!({"message": 3}), + json!({"message": ""}), + json!({"message": " \n\t"}), + json!({"message": long}), + json!({"message": "m", "level": "loud"}), + json!({"message": "m", "level": 1}), + json!({"message": "m", "seconds": 0.4}), + json!({"message": "m", "seconds": 61}), + json!({"message": "m", "seconds": "4"}), + json!({"message": "m", "seconds": null}), + ] { + let e = s.execute(ID, &p).unwrap_err().to_string(); + assert!(e.contains(ID), "{p}: {e}"); + } + assert_eq!(s.take_toasts(), vec![]); + // The longest message is allowed, counted in characters, not bytes. + let most = "é".repeat(MAX_CHARS); + s.execute(ID, &json!({"message": most})).unwrap(); + assert_eq!(s.take_toasts().len(), 1); + } + + #[test] + fn the_oldest_waiting_message_goes_past_the_limit() { + let mut s = Session::new(); + for i in 0..MAX_QUEUED + 2 { + s.toast(Toast::new(format!("{i}"), Level::Info)); + } + let left: Vec<String> = s.take_toasts().into_iter().map(|t| t.message).collect(); + assert_eq!(left.len(), MAX_QUEUED); + assert_eq!(left.first().map(String::as_str), Some("2")); + assert_eq!(left.last().map(String::as_str), Some("33")); + } + + #[test] + fn a_message_is_journaled_without_an_undo_step_or_a_document() { + let mut s = Session::new(); + // No document open. + s.execute(ID, &json!({"message": "no document"})).unwrap(); + assert_eq!(s.journal.last().unwrap(), &(ID.to_string(), json!({"message": "no document"}))); + s.execute("file.new", &json!({})).unwrap(); + let undo = s.active().unwrap().history.undo.len(); + let revision = s.active().unwrap().revision; + s.execute(ID, &json!({"message": "m", "level": "success"})).unwrap(); + assert_eq!(s.journal.last().unwrap(), &(ID.to_string(), json!({"message": "m", "level": "success"}))); + assert_eq!(s.active().unwrap().history.undo.len(), undo); + assert_eq!(s.active().unwrap().revision, revision); + } + + #[test] + fn a_script_raises_a_message_with_vc_run() { + let mut s = Session::new(); + let r = s + .execute( + "script.run", + &json!({"source": "vc.run('app.toast', {message: 'Done: ' + (1 + 1), level: 'success'});", "name": "t.js", "answers": []}), + ) + .unwrap(); + assert!(r.get("error").is_none_or(Value::is_null), "{r}"); + assert_eq!(s.take_toasts(), vec![Toast::new("Done: 2", Level::Success)]); + } + + #[test] + fn a_command_batch_raises_its_messages_in_order() { + let mut s = Session::new(); + s.execute("file.new", &json!({})).unwrap(); + s.execute( + "command.batch", + &json!({"commands": [ + {"command": "app.toast", "params": {"message": "one"}}, + {"command": "app.toast", "params": {"message": "two", "level": "warning"}}, + ]}), + ) + .unwrap(); + assert_eq!(s.take_toasts(), vec![Toast::new("one", Level::Info), Toast::new("two", Level::Warning)]); + } +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 4f7532108d..424fc9f6e9 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -356,6 +356,8 @@ pub struct Session { /// Set while [`Session::tool_typed_text`] passes keyboard input to the active tool /// ([`vectorcraft_tools::ToolContext::typed_from_keyboard`]). keyboard_text: bool, + /// The messages `app.toast` and [`Session::toast`] queued for the app to show; not saved. + pub(crate) toasts: cmd::toast::Queue, } impl Default for Session { diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 4415566d13..cda550dfd1 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -148,6 +148,7 @@ impl Session { global_edit_options: Default::default(), select_similar: crate::cmd::SIMILAR[0].0, keyboard_text: false, + toasts: Default::default(), script_key: None, script_engines: crate::script::EnginesKey::new(), script_stop: vectorcraft_js::Interrupt::new(), diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index e3d2a13d64..b0d5f80020 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -161,6 +161,7 @@ impl VectorcraftApp { plugin_runs: Default::default(), placing: Default::default(), trace_runs: Default::default(), + toasts: Default::default(), recovery: Default::default(), host_modifiers: Default::default(), forwarded: Vec::new(), @@ -629,6 +630,7 @@ impl VectorcraftApp { trace_runs::show(self, &ctx); opening::show(self, &ctx); palette::show(self, &ctx); + crate::toasts::show(self, &ctx); // After every panel had its chance to draw in this pass. crate::panels::three_d::end_stale_drag(self, &ctx); if self.custom_titlebar { diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 0b8ee67183..9f3bf69197 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -79,6 +79,7 @@ pub mod sysclip; pub mod theme; pub mod thumb_worker; pub mod titlebar; +pub mod toasts; pub mod toolbar; mod tools_float; pub mod touch; @@ -291,6 +292,8 @@ pub struct VectorcraftApp { pub placing: placing::Placing, /// Image Traces running off the UI thread ([`trace_runs`]). pub trace_runs: trace_runs::TraceRuns, + /// The messages shown over the window ([`toasts`]). + pub toasts: toasts::Shown, /// Data Recovery's timer and startup question ([`recovery`]). pub recovery: recovery::Timer, /// Modifiers the keyboard holds (from the host's input), given back after synthetic input. diff --git a/crates/ui-egui/src/toasts.rs b/crates/ui-egui/src/toasts.rs new file mode 100644 index 0000000000..0d47c4e3b4 --- /dev/null +++ b/crates/ui-egui/src/toasts.rs @@ -0,0 +1,308 @@ +//! Messages that `app.toast` and the app's own code ([`vectorcraft_engine::Session::toast`]) queue, +//! shown over the window without taking the keyboard or stopping work: a stack at the window's +//! bottom right, the newest lowest. Each one goes after its time or when clicked; past +//! [`MAX_SHOWN`] the oldest goes first. A message shows at most [`MAX_ROWS`] lines, and the whole +//! text on hover; a stack taller than the window scrolls. + +use std::time::Duration; + +use vectorcraft_engine::cmd::toast::{Level, Toast}; + +use crate::VectorcraftApp; +use crate::theme::Tokens; + +/// The most messages shown at once. +pub const MAX_SHOWN: usize = 5; + +/// The widest a message is, in points; longer text wraps. +const WIDTH: f32 = 320.0; + +/// The most lines a message shows; the rest shows on hover. +const MAX_ROWS: usize = 6; + +/// The gap between the stack and the window's right and bottom edges, in points. +const MARGIN: f32 = 16.0; + +/// A message shown. +#[derive(Clone, Debug)] +pub(crate) struct Entry { + pub(crate) toast: Toast, + /// When it goes, in [`crate::clock::now_secs`] seconds. + until: f64, + id: u64, + /// Where the last pass drew it. + pub(crate) rect: Option<egui::Rect>, +} + +/// The messages shown, oldest first. +#[derive(Debug, Default)] +pub struct Shown { + pub(crate) list: Vec<Entry>, + next_id: u64, +} + +impl Shown { + /// Show `new` from `now` on, dropping the oldest past [`MAX_SHOWN`]. + fn add(&mut self, new: Vec<Toast>, now: f64) { + for toast in new { + let until = now + toast.seconds; + self.list.push(Entry { toast, until, id: self.next_id, rect: None }); + self.next_id = self.next_id.wrapping_add(1); + } + let over = self.list.len().saturating_sub(MAX_SHOWN); + self.list.drain(..over); + } + + /// Drop the messages whose time is up at `now`; the seconds until the next one's is. + fn expire(&mut self, now: f64) -> Option<f64> { + self.list.retain(|e| e.until > now); + self.list.iter().map(|e| e.until - now).reduce(f64::min) + } +} + +/// The color of a message's edge. +fn color(t: &Tokens, level: Level) -> egui::Color32 { + match level { + Level::Info => t.text_dim, + Level::Success => t.axis_y, + Level::Warning => t.warning, + Level::Error => t.error, + } +} + +/// Take the messages queued since the last pass and draw the ones shown. +pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { + show_at(app, ctx, crate::clock::now_secs()); +} + +/// [`show`] at `now`, in [`crate::clock::now_secs`] seconds. +pub(crate) fn show_at(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64) { + // Messages whose time is up go before new ones count toward the limit. + app.toasts.expire(now); + let new = app.session.take_toasts(); + app.toasts.add(new, now); + let Some(left) = app.toasts.expire(now) else { + return; + }; + // Finite and positive: every message's time is 0.5 to 60 seconds. + ctx.request_repaint_after(Duration::from_secs_f64(left.clamp(0.0, 60.0))); + let t = Tokens::get(ctx); + let corner = egui::vec2(-MARGIN, -MARGIN); + let area = egui::Area::new(egui::Id::unique("toasts")).order(egui::Order::Foreground).anchor(egui::Align2::RIGHT_BOTTOM, corner); + // A stack taller than the window scrolls, kept at its newest message. + let height = (ctx.content_rect().height() - 2.0 * MARGIN).max(0.0); + let dismissed = area + .show(ctx, |ui| { + let scroll = egui::ScrollArea::vertical().max_height(height).stick_to_bottom(true); + scroll.show(ui, |ui| stack(ui, &mut app.toasts.list, &t)).inner + }) + .inner; + if let Some(id) = dismissed { + app.toasts.list.retain(|e| e.id != id); + ctx.request_repaint(); + } +} + +/// Draw `list`, oldest first; the id of the message clicked. +fn stack(ui: &mut egui::Ui, list: &mut [Entry], t: &Tokens) -> Option<u64> { + ui.set_max_width(WIDTH); + let mut clicked = None; + for e in list { + // Each message's widgets keep its id when the messages before it go, so a press and a + // release land on the same message. + let r = ui.push_id(e.id, |ui| message(ui, e, t)).inner; + if r.clicked() { + clicked = Some(e.id); + } + e.rect = Some(r.rect); + ui.add_space(6.0); + } + clicked +} + +/// Draw one message → its response to clicks. +fn message(ui: &mut egui::Ui, e: &Entry, t: &Tokens) -> egui::Response { + let frame = egui::Frame::new() + .fill(t.panel) + .stroke(egui::Stroke::new(1.0, color(t, e.toast.level))) + .corner_radius(t.radius) + .inner_margin(egui::Margin::symmetric(10, 8)) + .show(ui, |ui| { + ui.set_width(WIDTH - 20.0); + let format = egui::TextFormat::simple(egui::TextStyle::Body.resolve(ui.style()), t.text); + let mut job = egui::text::LayoutJob::single_section(e.toast.message.clone(), format); + job.wrap.max_width = WIDTH - 20.0; + job.wrap.max_rows = MAX_ROWS; + let galley = ui.painter().layout_job(job); + let elided = galley.elided; + ui.add(egui::Label::new(galley).selectable(false)); + elided + }); + let r = frame.response.interact(egui::Sense::click()).on_hover_cursor(egui::CursorIcon::PointingHand); + // A message cut short shows in full on hover. + if frame.inner { r.on_hover_text(&e.toast.message) } else { r } +} + +#[cfg(test)] +mod tests { + use serde_json::json; + use vectorcraft_engine::Session; + + use super::*; + + fn app() -> (VectorcraftApp, egui::Context) { + crate::i18n::set_current(crate::i18n::Lang::EN); + let app = VectorcraftApp::new(Session::new(), Default::default()); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + crate::theme::apply(&ctx, crate::theme::Brightness::Dark); + (app, ctx) + } + + /// One pass at `now` with `events`; the text the pass drew. + fn pass(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64, events: Vec<egui::Event>) -> Vec<String> { + pass_in(app, ctx, now, events, 700.0) + } + + /// [`pass`] in a window `height` points tall. + fn pass_in(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64, events: Vec<egui::Event>, height: f32) -> Vec<String> { + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1000.0, height)); + let input = egui::RawInput { screen_rect: Some(screen), events, ..Default::default() }; + let mut output = ctx.run_ui(input, |ui| show_at(app, ui.ctx(), now)); + output.textures_delta.clear(); + let mut texts = Vec::new(); + for clipped in &output.shapes { + if let egui::epaint::Shape::Text(text) = &clipped.shape { + texts.push(text.galley.text().to_string()); + } + } + texts + } + + fn messages(app: &VectorcraftApp) -> Vec<&str> { + app.toasts.list.iter().map(|e| e.toast.message.as_str()).collect() + } + + #[test] + fn a_message_shows_until_its_time_is_up() { + let (mut app, ctx) = app(); + app.run("app.toast", json!({"message": "Exported 4 files", "seconds": 2})).unwrap(); + // A new area measures itself in its first pass and draws from the next. + pass(&mut app, &ctx, 10.0, vec![]); + let texts = pass(&mut app, &ctx, 10.0, vec![]); + assert!(texts.iter().any(|t| t == "Exported 4 files"), "{texts:?}"); + let rect = app.toasts.list[0].rect.unwrap(); + assert!(rect.right() <= 1000.0 - MARGIN + 0.5 && rect.bottom() <= 700.0 - MARGIN + 0.5, "{rect:?}"); + assert!(pass(&mut app, &ctx, 11.9, vec![]).iter().any(|t| t == "Exported 4 files")); + assert!(!pass(&mut app, &ctx, 12.0, vec![]).iter().any(|t| t == "Exported 4 files")); + assert!(app.toasts.list.is_empty()); + } + + #[test] + fn newer_messages_show_below_older_ones_and_the_oldest_goes_past_the_limit() { + let (mut app, ctx) = app(); + for i in 0..MAX_SHOWN + 1 { + app.session.toast(Toast::new(format!("m{i}"), Level::Info)); + } + pass(&mut app, &ctx, 0.0, vec![]); + assert_eq!(messages(&app), vec!["m1", "m2", "m3", "m4", "m5"]); + let tops: Vec<f32> = app.toasts.list.iter().map(|e| e.rect.unwrap().top()).collect(); + assert!(tops.windows(2).all(|w| w[0] < w[1]), "{tops:?}"); + } + + #[test] + fn messages_whose_time_is_up_do_not_count_toward_the_limit() { + let (mut app, ctx) = app(); + app.session.toast(Toast { seconds: 60.0, ..Toast::new("long", Level::Info) }); + for i in 0..MAX_SHOWN - 1 { + app.session.toast(Toast { seconds: 0.5, ..Toast::new(format!("short{i}"), Level::Info) }); + } + pass(&mut app, &ctx, 0.0, vec![]); + app.session.toast(Toast::new("new", Level::Info)); + pass(&mut app, &ctx, 0.5, vec![]); + assert_eq!(messages(&app), vec!["long", "new"]); + } + + #[test] + fn a_click_dismisses_only_that_message() { + let (mut app, ctx) = app(); + app.session.toast(Toast::new("first", Level::Warning)); + app.session.toast(Toast::new("second", Level::Error)); + pass(&mut app, &ctx, 0.0, vec![]); + pass(&mut app, &ctx, 0.0, vec![]); + let at = app.toasts.list[0].rect.unwrap().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + pass(&mut app, &ctx, 0.1, vec![egui::Event::PointerMoved(at)]); + pass(&mut app, &ctx, 0.2, vec![press(true)]); + pass(&mut app, &ctx, 0.3, vec![press(false)]); + assert_eq!(messages(&app), vec!["second"]); + } + + #[test] + fn a_message_that_goes_between_press_and_release_closes_no_other() { + let (mut app, ctx) = app(); + for (message, seconds) in [("top", 60.0), ("pressed", 0.5), ("bottom", 60.0)] { + app.session.toast(Toast { seconds, ..Toast::new(message, Level::Info) }); + } + pass(&mut app, &ctx, 0.0, vec![]); + pass(&mut app, &ctx, 0.0, vec![]); + let at = app.toasts.list[1].rect.unwrap().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + pass(&mut app, &ctx, 0.1, vec![egui::Event::PointerMoved(at)]); + pass(&mut app, &ctx, 0.2, vec![press(true)]); + // "pressed" goes, and "top" moves down under the pointer. + pass(&mut app, &ctx, 0.6, vec![]); + pass(&mut app, &ctx, 0.7, vec![]); + pass(&mut app, &ctx, 0.8, vec![press(false)]); + assert_eq!(messages(&app), vec!["top", "bottom"]); + } + + #[test] + fn an_action_records_a_message_and_shows_it_again_when_played() { + use crate::panels::actions::{START_RECORDING, STOP_RECORDING, play}; + let (mut app, _) = app(); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + app.run(START_RECORDING, json!({})).unwrap(); + app.run("app.toast", json!({"message": "Step done", "level": "success"})).unwrap(); + app.run(STOP_RECORDING, json!({})).unwrap(); + // The recording is the set's last action. + let last = app.ui.action_sets[0].actions.len() - 1; + let steps = &app.ui.action_sets[0].actions[last].steps; + assert_eq!(steps, &vec![("app.toast".to_string(), json!({"message": "Step done", "level": "success"}))]); + app.session.take_toasts(); + let undo = app.session.active().unwrap().history.undo.len(); + play(&mut app, 0, last).unwrap(); + assert_eq!(app.session.take_toasts(), vec![Toast::new("Step done", Level::Success)]); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo, "a message adds no undo step"); + } + + #[test] + fn a_long_message_shows_its_first_lines_and_the_stack_stays_in_the_window() { + let (mut app, ctx) = app(); + app.run("app.toast", json!({"message": "line"})).unwrap(); + app.run("app.toast", json!({"message": "line\n".repeat(100)})).unwrap(); + pass(&mut app, &ctx, 0.0, vec![]); + pass(&mut app, &ctx, 0.0, vec![]); + let (short, long) = (app.toasts.list[0].rect.unwrap(), app.toasts.list[1].rect.unwrap()); + // 100 lines would make it about 100 times as tall as a message of one line. + assert!(long.height() > short.height() && long.height() < short.height() * MAX_ROWS as f32, "{short:?} {long:?}"); + app.toasts.list.remove(0); + // Five such messages in a short window: the newest shows whole at the bottom, and none + // reaches past the window's edges. + for _ in 0..MAX_SHOWN - 1 { + app.run("app.toast", json!({"message": "line\n".repeat(100)})).unwrap(); + } + let height = 300.0; + pass_in(&mut app, &ctx, 0.0, vec![], height); + pass_in(&mut app, &ctx, 0.0, vec![], height); + let newest = app.toasts.list.last().unwrap().rect.unwrap(); + assert!(newest.top() >= MARGIN - 0.5 && newest.bottom() <= height - MARGIN + 0.5, "{newest:?}"); + assert_eq!(app.toasts.list.len(), MAX_SHOWN); + } + + #[test] + fn no_message_draws_nothing() { + let (mut app, ctx) = app(); + assert!(pass(&mut app, &ctx, 0.0, vec![]).is_empty()); + } +} diff --git a/docs/mcp.md b/docs/mcp.md index a27f99feba..12f8376324 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3157,6 +3157,23 @@ enabled while the document has a saved view. In the desktop app the views are li checked when it opens: past 25, blank or repeated names, and views without a finite centre and a positive zoom are dropped. +## Messages over the window + +`app.toast {message, level?, seconds?}` shows a short message over the desktop app's window without stopping work +→ `{message, level, seconds}`. `message` is 1 to 500 characters and not only spaces. `level` is `info` (the +default), `success`, `warning` or `error`, and sets the color of the message's edge. `seconds` is how long it shows, +0.5 to 60 (4 by default); a click on it closes it sooner. Messages stack at the window's bottom right, the newest +lowest, at most 5 at once: a sixth closes the oldest. A message shows at most 6 lines, with the whole text on hover, +and a stack taller than the window scrolls. A missing `message` or a value outside these ranges is an error, +and nothing shows. The command edits no document and adds no undo step. Scripts raise one with `vc.run('app.toast', +{...})`, a plug-in whose manifest lists `app.toast` calls it like its other commands, and an action recording records it as a step that shows the message again when the action plays. A session +without a window (MCP, `vectorcraft-cli`) keeps the last 32 messages it was given and shows none. These limits are +VectorCraft's own values. + +```json +{"name":"run_command","arguments":{"command":"app.toast","params":{"message":"Exported 4 artboards","level":"success"}}} +``` + ## Navigator panel options The Navigator panel menu's Panel Options… opens the `navigatorPanelOptions` dialog (fields `color`, `solidDashes`), diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index db61a96f73..5b5f596a9f 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -904,6 +904,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. + - Messages over the window: `app.toast {message, level?, seconds?}` shows a message at the window's bottom right that does not stop work and closes after its time (4 seconds by default) or when clicked; at most 5 show at once, the newest lowest. Scripts raise one through `vc.run`, MCP clients through the command, and an action records it as a step. The limits are VectorCraft's own values. Tests: `cmd::toast::tests` in `vectorcraft-engine`, `toasts::tests` in `vectorcraft-ui-egui`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. - Scripts: `toSource` throws a `TypeError` for a property that is not writable or not configurable, a sealed, frozen or non-extensible object or array, and an array with a read-only `length` (VectorCraft's own rule). `crates/js/src/extension_tests.rs`. From a2c91044e0651dacfd413c721f3eb0e5dd4f2d6c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 09:06:36 -0800 Subject: [PATCH 127/247] =?UTF-8?q?Layers:=20dragging=20a=20path=20into=20?= =?UTF-8?q?a=20Live=20Paint=20group=20adds=20it=20to=20the=20group=20as=20?= =?UTF-8?q?Live=20Paint=20=E2=80=BA=20Merge=20does?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A path, compound path or group of them dropped inside a Live Paint group in the Layers panel, or above or below one of its rows, now joins the group's paths as livePaint.merge adds them, in one "Merge Live Paint" undo step that selects the group. An Alt-drag adds copies, and node.move into the group does the same. With type, an image or another object among the rows, the drop is refused with Merge's message and nothing moves. A row moved into or out of the group's hidden sources makes the group's faces and edges again, keeping the paint of those that stay; with no path left the group has no faces until a path joins it again. Before, a dropped path became a plain child that cut no faces, and a source dragged out left stale faces behind. --- crates/engine/src/cmd/buildcmds.rs | 2 +- crates/engine/src/cmd/buildcmds/live_paint.rs | 130 ++++++++++++++++ crates/engine/src/cmd/layer.rs | 21 ++- crates/engine/src/tests/build.rs | 143 ++++++++++++++++++ docs/mcp.md | 8 +- docs/target-app-parity.md | 1 + 6 files changed, 299 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/buildcmds.rs b/crates/engine/src/cmd/buildcmds.rs index 65a07ceb50..f72c7d4ebb 100644 --- a/crates/engine/src/cmd/buildcmds.rs +++ b/crates/engine/src/cmd/buildcmds.rs @@ -38,7 +38,7 @@ mod shape_builder; mod trace; pub use live_paint::live_paint_gaps; -pub(crate) use live_paint::{isolated_live_paint, merge_drawn_in_isolation}; +pub(crate) use live_paint::{LivePaintMove, isolated_live_paint, merge_drawn_in_isolation}; use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge}; use shape_builder::{sb_merge, sb_regions}; pub(crate) use trace::TracePresetChanges; diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 301ff55a4b..5067f3b031 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -259,6 +259,136 @@ pub(crate) fn merge_drawn_in_isolation(s: &mut Session, g: NodeId) -> Result<boo Ok(true) } +/// Where a row sits for Live Paint: among the paths of a Live Paint group (in its sources group, +/// at any depth), directly in a Live Paint group, or neither. +#[derive(Clone, Copy, PartialEq, Eq)] +enum Spot { + Source(NodeId), + In(NodeId), + Outside, +} + +/// The [`Spot`] of a row whose parent is `parent` (None: the top level). +fn spot_in(d: &Document, parent: Option<NodeId>) -> Spot { + let Some(p) = parent else { return Spot::Outside }; + for x in d.ancestry(p).unwrap_or_default().into_iter().rev() { + let n = d.node(x); + if n.is_some_and(is_live_paint) { + return if x == p { Spot::In(x) } else { Spot::Outside }; + } + if let Some(g) = d.parent_of(x) + && d.node(g).filter(|n| is_live_paint(n)).and_then(b::sources).is_some_and(|s| s.id == x) + { + return Spot::Source(g); + } + } + Spot::Outside +} + +/// What moving rows in the Layers panel (`layer.move`, `node.move`) does to Live Paint groups. +/// Rows that go into a Live Paint group from elsewhere are added to it as `livePaint.merge` adds +/// paths. Rows that go into or leave a group's paths (its sources group) change those paths, and +/// the group's faces and edges are made again from them, keeping the paint of the faces and edges +/// that stay. Rows moved within one group's paths, or among a group's own children, change no +/// faces. +pub(crate) struct LivePaintMove { + /// The Live Paint group the rows go into, and for each row whether it joins the group's paths. + join: Option<(NodeId, Vec<bool>)>, + /// The Live Paint groups whose paths change. + rebuild: Vec<NodeId>, +} + +impl LivePaintMove { + /// Plan moving `rows` (with `copy`, copies of them) into `parent`, before anything changes. + /// Refuses rows Live Paint can't take ([`b::live_paint_takes`]) that would go among a group's + /// paths, with the message Make and Merge give. + pub(crate) fn plan(d: &Document, rows: &[NodeId], parent: Option<NodeId>, copy: bool) -> Result<Self> { + let to = spot_in(d, parent); + let from: Vec<Spot> = rows.iter().map(|r| if copy { Spot::Outside } else { spot_in(d, d.parent_of(*r)) }).collect(); + let mut rebuild = vec![]; + for f in &from { + if let Spot::Source(g) = *f + && *f != to + && !rebuild.contains(&g) + { + rebuild.push(g); + } + } + if let Spot::Source(g) = to + && from.iter().any(|f| *f != to) + && !rebuild.contains(&g) + { + rebuild.push(g); + } + let entering: Vec<NodeId> = rows.iter().zip(&from).filter(|(_, f)| **f != to).map(|(r, _)| *r).collect(); + let join = match to { + Spot::In(g) if !entering.is_empty() => Some((g, from.iter().map(|f| *f != to).collect())), + _ => None, + }; + if to != Spot::Outside { + check_live_paint_takes(d, &entering)?; + } + Ok(Self { join, rebuild }) + } + + /// Whether rows join a Live Paint group, which makes the move a "Merge Live Paint" step. + pub(crate) fn joins(&self) -> bool { + self.join.is_some() + } + + /// After the rows were moved, now `moved` (in the order [`LivePaintMove::plan`] took them), + /// make the faces and edges of the groups whose paths changed again, and add the rows that + /// joined a group to it. → `moved` with the joined rows replaced by their group, once, and + /// without the faces and edges that were made again. + pub(crate) fn finish(self, d: &mut Document, sel: &mut Selection, moved: &[NodeId]) -> Result<Vec<NodeId>> { + if self.join.is_none() && self.rebuild.is_empty() { + return Ok(moved.to_vec()); + } + for g in &self.rebuild { + rebuild_paths(d, *g)?; + } + let Some((g, mask)) = self.join else { return Ok(moved.iter().copied().filter(|r| d.node(*r).is_some()).collect()) }; + let joined = moved.iter().zip(&mask).filter(|(_, j)| **j).map(|(r, _)| *r); + let roots: Vec<NodeId> = std::iter::once(g).chain(joined).collect(); + merge_live(d, sel, &roots)?; + // `moved` holds each row once, so only the group can come twice. Faces and edges of the + // group moved along with the joining rows were made again, so they are left out. + let mut out = vec![]; + let mut listed = false; + for (r, j) in moved.iter().zip(&mask) { + if *j { + if !listed { + out.push(g); + listed = true; + } + } else if d.node(*r).is_some() { + out.push(*r); + } + } + Ok(out) + } +} + +/// Make Live Paint group `g`'s faces and edges again from the paths its sources group holds now, +/// with its Gap Options, carrying over the paint of the faces and edges that stay. With no path +/// left, the group keeps its sources group and its other children, and has no faces or edges. +fn rebuild_paths(d: &mut Document, g: NodeId) -> Result<()> { + let old = d.node(g).cloned().ok_or(EngineError::NoNode(g))?; + let sources = source_nodes(&old); + let mut n = old.clone(); + if source_shapes(&sources).0.is_empty() { + let src = b::sources(&old).cloned().ok_or(EngineError::NoNode(g))?; + set_parts(&mut n, vec![src], &[]); + } else { + let (children, _, _) = build_children(d, sources, old.gap_options().max_gap())?; + set_parts(&mut n, children, &[]); + repaint_from(&mut n, &old); + } + let mut changed = Beside::replacing(d, &[g]); + changed.put(d, g, vec![n])?; + changed.finish(d) +} + fn live_targets(s: &Session, p: &Value) -> Result<Vec<NodeId>> { let d = &s.doc()?.doc; let ids = root_ids(s, p)?; diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 83f27cdd61..ace6793b77 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -13,6 +13,7 @@ use serde_json::{Value, json}; use vectorcraft_doc::{Artboard, ArtboardSide, Document, LAYER_COLORS, LayerColor, Node, NodeId, NodeKind, Scaling}; use vectorcraft_geom::{Affine, Rect}; +use super::buildcmds::LivePaintMove; use super::{ CommandSpec, Result, Session, bad, bool_or, check_numbers, check_switches, checked_id, checked_ids_param, checked_node, checked_nodes_param, cmd, color_value, f64_or, has_doc, has_selection, ids_param, index, object_param, ok, str_param, switch_or, @@ -110,7 +111,7 @@ pub fn specs() -> Vec<CommandSpec> { "Move Rows", [], None, - "{ids|id, target, place?: \"above\"|\"below\"|\"inside\" (default inside), copy?: bool} drag rows in the Layers panel: above or below the target row (beside it, in its layer or group), or inside a layer or group (on top of its contents). Layers go only in layers or at the top level, objects in layers and groups; an object placed beside a top-level layer goes inside it. A row never goes into itself; a locked layer or group takes nothing. `copy` (Alt-drag) moves copies. Every selected object left hidden or locked, such as one moved into a hidden layer or group, is deselected (the key object too). One undo step → {ids}", + "{ids|id, target, place?: \"above\"|\"below\"|\"inside\" (default inside), copy?: bool} drag rows in the Layers panel: above or below the target row (beside it, in its layer or group), or inside a layer or group (on top of its contents). Layers go only in layers or at the top level, objects in layers and groups; an object placed beside a top-level layer goes inside it. A row never goes into itself; a locked layer or group takes nothing. `copy` (Alt-drag) moves copies. A row that goes into a Live Paint group from elsewhere joins its paths as livePaint.merge adds them, and the group is selected (paths, compound paths, groups of them and Live Paint groups; anything else is refused and nothing moves); a row that goes into or leaves a Live Paint group's paths makes the group's faces and edges again, keeping the paint of those that stay. Every selected object left hidden or locked, such as one moved into a hidden layer or group, is deselected (the key object too). One undo step → {ids} (a row that joined a Live Paint group is listed as the group)", has_doc, move_rows ), @@ -119,7 +120,7 @@ pub fn specs() -> Vec<CommandSpec> { "Reorder", [], None, - "{id, parent?: id (null = top level), index} put a row at `index` (0 = bottom) of `parent` (layers only at the top level or in layers), deselecting every selected object left hidden or locked (the key object too)", + "{id, parent?: id (null = top level), index} put a row at `index` (0 = bottom) of `parent` (layers only at the top level or in layers), deselecting every selected object left hidden or locked (the key object too); a Live Paint group or its paths take a row as layer.move does", has_doc, move_node ), @@ -794,7 +795,15 @@ fn move_rows(s: &mut Session, p: &Value) -> Result<Value> { if parent.is_some_and(|p| locked_within(d, p)) { return Err(EngineError::Other("the layer or group is locked".into())); } - let label = if copy { "Duplicate Rows" } else { "Move Rows" }; + // Rows that go into a Live Paint group join its paths, as Live Paint › Merge adds them. + let live_paint = LivePaintMove::plan(d, &ids, parent, copy)?; + let label = if live_paint.joins() { + "Merge Live Paint" + } else if copy { + "Duplicate Rows" + } else { + "Move Rows" + }; let moved = s.edit(label, |d, sel| { let nodes = if copy { let mut nodes = vec![]; @@ -829,6 +838,7 @@ fn move_rows(s: &mut Session, p: &Value) -> Result<Value> { if copy { super::typecmd::refresh_bounds_of(d, &out); } + let out = live_paint.finish(d, sel, &out)?; sel.prune(d); sel.deselect_uneditable(d); Ok(out) @@ -848,8 +858,11 @@ fn move_node(s: &mut Session, p: &Value) -> Result<Value> { if !accepts(d, parent, n) { return Err(bad(C, "layers go only at the top level or in layers, objects in layers and groups")); } - s.edit("Reorder", |d, sel| { + let live_paint = LivePaintMove::plan(d, &[id], parent, false)?; + let label = if live_paint.joins() { "Merge Live Paint" } else { "Reorder" }; + s.edit(label, |d, sel| { d.move_node(id, parent, index)?; + live_paint.finish(d, sel, &[id])?; sel.deselect_uneditable(d); Ok(()) })?; diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 553fb2fb21..ba6aaccb17 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -4978,6 +4978,149 @@ fn live_paint_isolation_adds_a_drawn_group_isolated_inside_it() { } } +/// A line from left of the [`live`] group to its right face, so it cuts the two faces left of it. +fn line_to_right_face(s: &mut Session, y: f64) -> NodeId { + let r = s.execute("path.create", &json!({"anchors": [{"x": -10, "y": y}, {"x": 105, "y": y}]})).unwrap(); + NodeId(r["id"].as_u64().unwrap()) +} + +fn undo_label(s: &Session) -> Option<String> { + s.doc().unwrap().history.undo.last().map(|e| e.label.clone()) +} + +/// Paths dragged into a Live Paint group in the Layers panel join its paths as Live Paint › Merge +/// adds them: they go among its sources and cut the faces they cross, a painted face they do not +/// cross keeps its fill, and the drop is one "Merge Live Paint" undo step that selects the group. +#[test] +fn layers_drag_adds_paths_to_a_live_paint_group() { + use vectorcraft_tools::builder::{face_at, faces, sources}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let mut s = session(); + let g = live(&mut s); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [125, 50], "color": "#00ff00"})).unwrap(); + let layer = s.doc().unwrap().doc.parent_of(g); + let (a, b) = (line_to_right_face(&mut s, 30.0), line_to_right_face(&mut s, 70.0)); + assert_eq!(s.doc().unwrap().doc.parent_of(a), layer); + let steps = s.doc().unwrap().history.undo.len(); + let r = s.execute("layer.move", &json!({"ids": [a.0, b.0], "target": g.0, "place": "inside"})).unwrap(); + assert_eq!(r["ids"], json!([g.0]), "the rows that joined are listed as the group"); + let d = s.doc().unwrap(); + assert_eq!(d.history.undo.len(), steps + 1, "both paths join in one undo step"); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint")); + assert_eq!(s.doc().unwrap().selection.objects, vec![g]); + let n = node(&s, g); + let src = sources(&n).unwrap(); + assert_eq!(src.children().unwrap().len(), 4); + for id in [a, b] { + assert_eq!(s.doc().unwrap().doc.parent_of(id), Some(src.id), "{id} joined the sources"); + } + assert_eq!(faces(&n).len(), 7, "two lines cut each of the two faces they cross in three"); + assert_eq!(face_at(&n, Point::new(125.0, 50.0)).unwrap().appearance.fill_paint(), green, "the face the lines do not cross keeps its fill"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 3); + for id in [a, b] { + assert_eq!(s.doc().unwrap().doc.parent_of(id), layer, "Undo puts {id} back where it was"); + } + s.execute("edit.redo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 7); +} + +/// An Alt-drag into a Live Paint group adds a copy and leaves the path where it was; a drop above +/// one of the group's faces, and `node.move` into the group, add the path the same way. +#[test] +fn layers_drag_copy_and_drop_beside_a_part_add_to_a_live_paint_group() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g); + let a = line_to_right_face(&mut s, 30.0); + s.execute("layer.move", &json!({"ids": [a.0], "target": g.0, "copy": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), layer, "the path itself stays"); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 5); + let src = sources(&n).unwrap().children().unwrap().clone(); + assert_eq!(src.len(), 3); + assert!(src.iter().all(|c| c.id != a), "a copy joined"); + let (face, other_face) = (faces(&n)[0].id, faces(&n)[1].id); + let b = line_to_right_face(&mut s, 70.0); + // A face dragged along is made again with the others, so only the group is listed. + let r = s.execute("layer.move", &json!({"ids": [b.0, other_face.0], "target": face.0, "place": "above"})).unwrap(); + assert_eq!(r["ids"], json!([g.0])); + assert_eq!(s.doc().unwrap().layer_rows, vec![g]); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(b), Some(sources(&n).unwrap().id), "a drop beside a face joins"); + assert_eq!(faces(&n).len(), 7); + let c = line_to_right_face(&mut s, 50.0); + s.execute("node.move", &json!({"id": c.0, "parent": g.0, "index": 0})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint")); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(c), Some(sources(&n).unwrap().id), "node.move into the group joins"); + assert_eq!(faces(&n).len(), 9); +} + +/// Dragging type, or type with a path, into a Live Paint group is refused with Make's message and +/// moves nothing, as Merge refuses it; a drop beside the group is an ordinary move. +#[test] +fn layers_drag_refuses_type_into_a_live_paint_group() { + use vectorcraft_tools::builder::faces; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g); + let a = line_to_right_face(&mut s, 30.0); + let text = NodeId(s.execute("text.create", &json!({"x": 20, "y": 20, "text": "Hi"})).unwrap()["id"].as_u64().unwrap()); + let before = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()); + for p in [json!({"ids": [a.0, text.0], "target": g.0}), json!({"ids": [text.0], "target": g.0, "copy": true})] { + let err = s.execute("layer.move", &p).unwrap_err().to_string(); + assert!(err.contains("Live Paint takes paths and compound paths"), "{err}"); + } + assert!(s.execute("node.move", &json!({"id": text.0, "parent": g.0, "index": 0})).is_err()); + assert!(s.doc().unwrap().doc == before.0, "nothing moved"); + assert_eq!(s.doc().unwrap().history.undo.len(), before.1); + s.execute("layer.move", &json!({"ids": [a.0, text.0], "target": g.0, "place": "above"})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Move Rows")); + assert_eq!(s.doc().unwrap().doc.parent_of(text), layer); + assert_eq!(faces(&node(&s, g)).len(), 3); +} + +/// A path dragged out of a Live Paint group's sources leaves its faces and edges: the group makes +/// them again from the paths left, and with none left it has no faces until a path joins it again. +/// Reordering the sources, or the group's own faces, makes nothing again. +#[test] +fn layers_drag_out_of_a_live_paint_group_makes_its_faces_again() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g).unwrap(); + let n = node(&s, g); + let src: Vec<NodeId> = sources(&n).unwrap().children().unwrap().iter().map(|c| c.id).collect(); + let face_ids: Vec<NodeId> = faces(&n).iter().map(|f| f.id).collect(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": src[1].0, "place": "above"})).unwrap(); + s.execute("layer.move", &json!({"ids": [face_ids[0].0], "target": face_ids[2].0, "place": "above"})).unwrap(); + let n = node(&s, g); + assert_eq!(sources(&n).unwrap().children().unwrap().len(), 2, "a reorder keeps the sources"); + let mut now: Vec<NodeId> = faces(&n).iter().map(|f| f.id).collect(); + now.sort(); + let mut was = face_ids.clone(); + was.sort(); + assert_eq!(now, was, "and the faces"); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": layer.0})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Move Rows")); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(src[0]), Some(layer)); + assert_eq!(sources(&n).unwrap().children().unwrap().len(), 1); + assert_eq!(faces(&n).len(), 1, "one rectangle left"); + s.execute("node.move", &json!({"id": src[1].0, "parent": layer.0, "index": 0})).unwrap(); + let n = node(&s, g); + assert!(vectorcraft_tools::builder::is_live_paint(&n), "the group stays a Live Paint group"); + assert!(sources(&n).unwrap().children().unwrap().is_empty()); + assert!(faces(&n).is_empty() && vectorcraft_tools::builder::edges(&n).is_empty()); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 1, "a path joins the empty group"); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 1); +} + /// Give Live Paint group `g` a lock, hidden state, appearance, knockout, opacity mask and /// graphic style link, and return it as it then is. fn dress_live_group(s: &mut Session, g: NodeId) -> Node { diff --git a/docs/mcp.md b/docs/mcp.md index 504256c382..4a6ddc23fa 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5374,7 +5374,13 @@ and `layerRows`, the rows highlighted in the panel. only in layers or at the top level and objects in layers and groups (an object placed beside a top-level layer goes inside it); a row never goes into itself or a row inside it, and a locked layer or group takes nothing. Dragging the selected-art square is `layer.move` with the selected objects. `node.move {id, parent?, index}` is the low-level - form with the same nesting rules; unlike `layer.move`, it also moves a row into a locked layer or group. + form with the same nesting rules; unlike `layer.move`, it also moves a row into a locked layer or group. A row that + either command puts into a Live Paint group from elsewhere (inside it, or above or below one of its rows) joins the + group's paths as `livePaint.merge` adds them, in one "Merge Live Paint" undo step, and the group is selected and + listed in `layer.move`'s `ids` in its place; paths, compound paths, groups of them and Live Paint groups can join, + and with anything else among the rows nothing moves. A row that goes into or leaves a Live Paint group's paths (its + hidden sources group) makes the group's faces and edges again, keeping the paint of those that stay; when no path is + left, the group has no faces or edges until a path joins it again. - **Buttons**: `layer.new {name?, top?, below?, …options}` (above the current layer at its level; `top` with Ctrl/Cmd; `below`, directly below the current layer at its level, with Ctrl/Cmd+Alt), `layer.newSublayer {parent?, bottom?, name?, …options}` (on top of the parent's contents; `bottom`, under them but diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 021014bf41..6d743a0f63 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1646,6 +1646,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The ignored centre-lines class measures that split on a mixed-width body scene: one disc with arms of 2, 3 and 5 px, at Stroke 6 px, traces as three stroked paths and one filled path in both the anti-aliased and hard input, with 100.0% of the arms' center samples found and 99.3% (anti-aliased) and 98.3% (hard) of the disc's pixels filled ([quality notes](image-trace-quality.md#centre-lines)). Test: `mixed_width_body_is_one_shape_traced_as_a_fill_and_strokes` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged. Object › Live Paint › Merge adds the other selected paths and Live Paint groups to the bottom selected Live Paint group ([Live Paint groups](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/live-paint-groups.html)), which keeps its id, the paint of its faces and edges, and its name, lock, visibility, transparency, appearance, opacity mask and graphic style link. Object › Live Paint › Make with a Live Paint group selected, and a Live Paint Bucket click on a selected path beside a selected Live Paint group, add the paths to that group the same way. Make, Merge and the Live Paint Bucket take paths, compound paths and groups of them; with type, an image or another object among the selection they report that it has to be converted to paths first and change nothing, as type and raster images can't go into a Live Paint group directly ([Create Live Paint groups](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/create-live-paint-groups.html)); before, such an object went among the group's hidden sources and vanished from the canvas. Evidence: `tests_build::live_paint_refuses_type_and_images_and_changes_nothing`. Paths drawn in an isolated Live Paint group join it when isolation mode ends, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes: drawing paths in the isolated group and pressing Esc adds them. `object.exitIsolation` (Esc, the Control bar and isolation bar exits, a double-click outside, the Layers panel and the canvas context menu) adds the shown, unlocked paths, compound paths and groups of them drawn in the group as Merge does, in one undo step, and `object.isolate` on a level outside the group does the same. As VectorCraft's own rules, type, images, hidden and locked objects drawn there, and groups holding one, stay in the group as they are, and Gap Options, Merge and Release keep them; an exit with nothing drawn records no undo step. Evidence: `tests::build::{live_paint_isolation_adds_drawn_paths_on_exit, live_paint_isolation_adds_only_paths_it_takes, live_paint_isolation_leaves_a_group_holding_a_locked_path, live_paint_isolation_adds_drawn_paths_when_isolating_a_level_outside, live_paint_isolation_adds_a_drawn_group_isolated_inside_it, live_paint_isolation_keeps_art_named_like_its_parts, live_paint_keeps_type_drawn_in_it_through_gap_options_merge_and_release}`. + Paths dragged into a Live Paint group in the Layers panel join it, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes for adding paths to a group; older guides ([CS6, page 192](https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=192)) say several paths can be dragged at once. A drop inside the group, or above or below one of its rows (`layer.move`, and `node.move` into the group), adds the paths, compound paths, groups of them and Live Paint groups to it as Merge does, in one "Merge Live Paint" undo step that selects the group; an Alt-drag adds copies. As VectorCraft's own rules, type, an image or another object among the dragged rows refuses the whole drop with Merge's message, and a row dragged into or out of the group's hidden sources makes its faces and edges again, keeping the paint of those that stay; with no path left the group has no faces until a path joins it. Evidence: `tests::build::{layers_drag_adds_paths_to_a_live_paint_group, layers_drag_copy_and_drop_beside_a_part_add_to_a_live_paint_group, layers_drag_refuses_type_into_a_live_paint_group, layers_drag_out_of_a_live_paint_group_makes_its_faces_again}`. With the Live Paint Bucket selected, Alt-click on vector art samples its fill, stroke and stroke weight into the paint defaults ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)). On a placed image it samples the image pixel as a solid fill with no stroke. Alt+Shift-click samples only the color under the pointer, including an intermediate gradient color or image pixels, into the active fill or stroke ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)). Neither click paints or changes the selection or selected art, and the next Bucket click paints with the sampled paint. Evidence: `tests_build::live_paint_bucket_alt_sample_paints_next_face_without_changing_selection`. Double-clicking the Live Paint Bucket opens Live Paint Bucket Options ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)): Paint Fills (on) and Paint Strokes (off) set whether a click paints faces, edges or both, Highlight turns the outline of the face or edge under the pointer on or off, and Color and Width set it (red and 4 px by default). Faces are outlined at the Width and edges at half of it, as the page says faces are highlighted with a thick line and edges with a thin line. With both on, a click paints the edge within 4 px of the pointer, else the face, and Shift switches to Paint Fills only; with one on, Shift switches to the other. The options last across tool switches and are saved with the preferences (`tool.setOption {tool: "livePaintBucket"}`). Evidence: `builder::tests::{bucket_options_choose_what_a_click_paints, bucket_options_set_the_highlight, bucket_highlights_an_edge_thinner_than_a_face}`, `dialogs::live_paint_bucket::tests::double_clicking_the_tool_opens_its_options_and_ok_sets_them`. Live Paint Bucket double-click and triple-click, as [the help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html) describes them: a double-click on a face fills it and the faces reached across edges that draw no stroke, and on an edge it paints the edges joined to it with the same stroke; a triple-click fills every face of the group that has the face's fill, or paints every edge that draws with the edge's stroke paint, each with the bucket's paint (`livePaint.fill` and `livePaint.strokeEdge` `{scope: "connected" | "samePaint", match?}`; `pointer_gesture` and `ui.pointer` take `tripleclick`). Each click paints as it arrives, as its own undo step when it changes a paint, and the paint compared is the one the face or edge had before the first of its clicks that painted it, including a click whose drag or release crossed it; a first click that made the Live Paint group counts when the face it filled is the clicked face. With Space held for the view tools, a click, double-click or triple-click paints nothing and no face or edge is outlined, and with Cmd/Ctrl held a double-click or triple-click paints nothing. Which faces and edges join and which paints match are VectorCraft's own rules. Evidence: `tests_build::{live_paint_bucket_double_click_floods_across_unstroked_edges, live_paint_bucket_double_click_floods_curved_and_narrow_faces, live_paint_bucket_double_click_floods_across_hidden_edges_and_past_gaps, live_paint_bucket_triple_click_fills_every_face_of_the_same_fill, live_paint_bucket_triple_click_after_a_release_across_an_edge_matches_the_fill_before, live_paint_bucket_triple_click_released_from_another_face_matches_the_fill_before, live_paint_bucket_triple_click_after_making_the_group_across_an_edge_matches_the_made_fill, live_paint_bucket_triple_click_after_making_the_group_under_an_unfilled_path_matches_the_made_fill, live_paint_bucket_triple_click_after_merging_across_an_edge_matches_the_face_fill, live_paint_bucket_triple_click_after_merging_two_groups_matches_the_merged_fill, live_paint_bucket_triple_click_after_a_merge_splits_a_face_matches_the_part_fill, live_paint_bucket_triple_click_after_merging_matches_the_fixed_gradient, live_paint_bucket_triple_click_after_making_the_group_matches_the_made_fill, live_paint_bucket_double_and_triple_click_paint_joined_and_same_stroke_edges, live_paint_bucket_double_click_across_a_junction_paints_the_joined_edges, live_paint_bucket_double_click_released_back_on_the_first_edge_paints_the_joined_edges, live_paint_bucket_edge_double_click_after_filling_a_face_paints_the_joined_edges, live_paint_bucket_triple_click_with_a_cmd_press_between_matches_the_fill_before, live_paint_scope_and_match_are_checked}`, `builder::tests::{bucket_double_and_triple_click_widen_what_a_click_paints, bucket_triple_click_after_making_the_group_on_another_face_matches_its_own_face, bucket_triple_click_with_a_click_on_another_face_between_matches_the_first_fill, bucket_triple_click_with_a_view_tool_press_between_matches_the_first_fill, bucket_highlights_nothing_with_space_held}`, `canvas::tests::bucket_triple_click_with_a_view_tool_press_between_matches_the_fill_before`, `tests::build::{live_paint_scoped_fill_and_stroke_skip_parts_with_the_paint, live_paint_bucket_cmd_double_and_triple_click_paint_nothing}`, `tests::livepaint::{a_triple_click_fills_every_face_of_the_same_fill, clicks_with_space_held_paint_nothing}` (MCP). From 70545c5e2ba5f993d1f369c42e11d8079409433e Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 09:57:06 -0800 Subject: [PATCH 128/247] Shapes: a very long side widget drag stops at 3 or 11 sides without overflowing sides_after adds the drag steps with saturating arithmetic, so a drag to an extreme coordinate gives 3 or 11 sides instead of an overflow. A drag whose distance is too long to measure keeps its direction and also stops at 3 or 11, and a pointer position that is not finite leaves the count and the readout as they were. --- crates/tools/src/sidewidget.rs | 56 ++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/crates/tools/src/sidewidget.rs b/crates/tools/src/sidewidget.rs index 5d338856a7..240fc5a706 100644 --- a/crates/tools/src/sidewidget.rs +++ b/crates/tools/src/sidewidget.rs @@ -80,11 +80,11 @@ pub fn over_widget(cx: &ToolContext, p: Point) -> bool { pub fn sides_after(from: u32, steps: i64) -> u32 { let (min, max) = (i64::from(MIN_SIDES), i64::from(MAX_SIDES)); let to = if from <= MAX_SIDES { - i64::from(from) + steps + i64::from(from).saturating_add(steps) } else if steps >= 0 { return from; } else { - max + 1 + steps + (max + 1).saturating_add(steps) }; to.clamp(min, max) as u32 } @@ -116,7 +116,12 @@ impl SideDrag { Some(Self { widget, bx, start: ev.pos, moved: false, began: false, sides: widget.sides, at: ev.pos }) } + /// A pointer position that is not finite leaves the count and the readout as they are. A drag + /// too long to measure counts as the most steps in its direction. pub fn drag(&mut self, cx: &ToolContext, p: Point) -> Vec<Action> { + if !p.x.is_finite() || !p.y.is_finite() { + return vec![]; + } self.at = p; if !self.moved { if p.distance(self.start) < cx.tol(3.0) { @@ -126,7 +131,11 @@ impl SideDrag { } let down = (self.bx.to_local(p).y - self.bx.to_local(self.start).y) * cx.zoom; let steps = (down / STEP_PX).trunc(); - let sides = sides_after(self.widget.sides, if steps.is_finite() { steps as i64 } else { 0 }); + if steps.is_nan() { + return vec![]; + } + // The cast saturates: an infinite count of steps becomes i64::MAX or i64::MIN. + let sides = sides_after(self.widget.sides, steps as i64); if sides == self.sides { return vec![]; } @@ -213,6 +222,47 @@ mod tests { assert_eq!(sides_after(1000, -100), 3); } + #[test] + fn the_longest_drags_stay_within_three_and_eleven() { + assert_eq!(sides_after(5, i64::MAX), 11); + assert_eq!(sides_after(5, i64::MIN), 3); + assert_eq!(sides_after(3, i64::MAX), 11); + assert_eq!(sides_after(11, i64::MAX), 11); + assert_eq!(sides_after(11, i64::MIN), 3); + assert_eq!(sides_after(40, i64::MAX), 40); + assert_eq!(sides_after(40, i64::MIN), 3); + } + + /// A drag far past the document, even one too long to measure, stops at 11 down and 3 up; a + /// pointer position that is not finite keeps the count it had. + #[test] + fn a_huge_or_invalid_drag_stays_within_three_and_eleven() { + let (d, _, s) = polygon_doc(5, Affine::translate((300.0, 300.0))); + let p = paint(); + // At zoom 1 the step count is finite and past i64; at zoom 4 the distance itself is infinite. + for zoom in [1.0, 4.0] { + let c = ToolContext { zoom, ..cx(&d, &s, &p) }; + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let far = |y: f64| Point::new(w.at.x, y); + let mut t = SelectionTool::default(); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, far(1e308)))), [11], "zoom {zoom}"); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, far(-1e308)))), [3], "zoom {zoom}"); + assert_eq!(t.pointer(&c, &ev(PointerKind::Up, far(-1e308))), vec![Action::Commit]); + } + let c = cx(&d, &s, &p); + let (w, _) = SideWidget::for_tool(&c).unwrap(); + let mut t = SelectionTool::default(); + t.pointer(&c, &ev(PointerKind::Down, w.at)); + let shown = w.at + vectorcraft_geom::Vec2::new(0.0, 24.0); + assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, shown))), [7]); + for bad in [Point::new(f64::NAN, w.at.y), Point::new(w.at.x, f64::INFINITY), Point::new(w.at.x, f64::NEG_INFINITY)] { + assert!(t.pointer(&c, &ev(PointerKind::Drag, bad)).is_empty(), "{bad:?}"); + } + assert!(t.overlays(&c).iter().any(|o| matches!(o, Overlay::Measure { p, text } if *p == shown && text == "Sides: 7"))); + assert_eq!(t.pointer(&c, &ev(PointerKind::Up, shown)), vec![Action::Commit]); + } + /// The widget sits 16 px right of the middle of the box's right side, at any zoom; only one /// whole editable live polygon shows it. #[test] From f0d4abcdcca8c56fddc58a609148a6e42f910acd Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 10:07:22 -0800 Subject: [PATCH 129/247] Live Paint: paths in a Live Paint group can't take the names Face and Edge A path directly in a Live Paint group named Face or Edge is taken for one of the group's faces or edges, so the next rebuild (Merge, Gap Options, a path dragged in or out, leaving isolation mode) drops it. layer.setProps and object.setProps now return an error when they would give either name to a path in the group that does not have it already, and a path pasted directly into the group under either name is pasted without its name. --- crates/engine/src/cmd/buildcmds.rs | 2 +- crates/engine/src/cmd/buildcmds/live_paint.rs | 38 +++++++++++ crates/engine/src/cmd/edit.rs | 1 + crates/engine/src/cmd/layer.rs | 6 +- crates/engine/src/cmd/object/commands.rs | 2 +- crates/engine/src/cmd/object/props.rs | 3 + crates/engine/src/tests/build.rs | 67 +++++++++++++++++++ crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 4 +- 32 files changed, 143 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/buildcmds.rs b/crates/engine/src/cmd/buildcmds.rs index f72c7d4ebb..0f7cac48fb 100644 --- a/crates/engine/src/cmd/buildcmds.rs +++ b/crates/engine/src/cmd/buildcmds.rs @@ -38,7 +38,7 @@ mod shape_builder; mod trace; pub use live_paint::live_paint_gaps; -pub(crate) use live_paint::{LivePaintMove, isolated_live_paint, merge_drawn_in_isolation}; +pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paint, merge_drawn_in_isolation}; use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge}; use shape_builder::{sb_merge, sb_regions}; pub(crate) use trace::TracePresetChanges; diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 502e5fb0ad..776f5f11b7 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -74,6 +74,44 @@ fn set_parts(g: &mut Node, mut parts: Vec<Arc<Node>>, gone: &[NodeId]) { } } +/// Whether a path named `name` directly in a Live Paint group is one of its faces or edges: the +/// name is [`FACE_NAME`] or [`EDGE_NAME`]. +fn part_name(name: Option<&str>) -> bool { + matches!(name, Some(FACE_NAME | EDGE_NAME)) +} + +/// Whether `n` is a path whose parent `parent` is a Live Paint group. +fn path_in_live_paint(d: &Document, parent: Option<NodeId>, n: &Node) -> bool { + n.path_data().is_some() && parent.and_then(|p| d.node(p)).is_some_and(is_live_paint) +} + +/// Clear the name of `n`, put directly in `parent`, when it is a path named like a face or an edge +/// ([`part_name`]) and `parent` is a Live Paint group, so that the group's other children +/// ([`others_in`]) keep it when its faces and edges are made again. Paste uses it. +pub(crate) fn clear_part_name(d: &Document, parent: Option<NodeId>, n: &mut Node) { + if part_name(n.name.as_deref()) && path_in_live_paint(d, parent, n) { + n.name = None; + } +} + +/// Refuse naming rows `ids` `name` when it is the name of a face or an edge ([`part_name`]) and one +/// of them is a path directly in a Live Paint group that is not named `name` already. Checked +/// before anything changes. +pub(crate) fn check_part_name(d: &Document, ids: &[NodeId], name: &str) -> Result<()> { + if !part_name(Some(name)) { + return Ok(()); + } + for id in ids { + if let Some(n) = d.node(*id) + && n.name.as_deref() != Some(name) + && path_in_live_paint(d, d.parent_of(*id), n) + { + return Err(EngineError::Other("`Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name".into())); + } + } + Ok(()) +} + /// Select `ids` alone, without an undo step, when they are not selected that way already. fn select_only(s: &mut Session, ids: &[NodeId]) -> Result<()> { let st = s.doc()?; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index fbf5deb568..e73bd65563 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1533,6 +1533,7 @@ fn paste_clip(s: &mut Session, p: &Value, mode: PasteMode, clip: &Clipboard, cho } } else { super::object::keep_pixel_aligned(&mut c, sc); + super::buildcmds::clear_part_name(d, par, &mut c); new_ids.push(d.insert(par, idx, c)?); } } diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index ae3d1fc5e1..134759a0d4 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -84,7 +84,7 @@ pub fn specs() -> Vec<CommandSpec> { "Layer Options…", ["Window", "Layers"], None, - "{ids?|id? (default: the highlighted rows, else the current layer), name? (with prefs.identifyObjectsBy xmlId: a valid XML ID, stored as the object name), visible?, locked?, template?, printable?, preview?, dimImages?: 0..100|false, color?: index 0..26|\"#rrggbb\"|preset name (a hex color with an alpha part, #rrggbbaa or #rgba, is an error)} Layer Options; rows that are not layers take name, visible and locked, and `ids` may name ruler guides (their `guide.list` id), which hide or lock on their own. Template on also locks the layer and dims its images to 50% (unless given); off unlocks it and stops dimming. One undo step", + "{ids?|id? (default: the highlighted rows, else the current layer), name? (with prefs.identifyObjectsBy xmlId: a valid XML ID, stored as the object name), visible?, locked?, template?, printable?, preview?, dimImages?: 0..100|false, color?: index 0..26|\"#rrggbb\"|preset name (a hex color with an alpha part, #rrggbbaa or #rgba, is an error)} Layer Options; rows that are not layers take name, visible and locked, and `ids` may name ruler guides (their `guide.list` id), which hide or lock on their own. Template on also locks the layer and dims its images to 50% (unless given); off unlocks it and stops dimming. A path directly in a Live Paint group can't take the name Face or Edge, which name the group's faces and edges, unless it has it already. One undo step", has_doc, set_props ), @@ -649,6 +649,10 @@ fn set_props(s: &mut Session, p: &Value) -> Result<Value> { if ids.is_empty() { return Err(bad(C, "no rows")); } + if let Some(v) = str_param(p, "name").filter(|v| !v.trim().is_empty()) { + let name = if xml_id { vectorcraft_doc::xml_id::to_object_name(v) } else { v.to_string() }; + super::buildcmds::check_part_name(&s.doc()?.doc, &ids, &name)?; + } s.edit("Layer Options", |d, sel| { for id in &ids { apply_options(d.node_mut(*id).ok_or(EngineError::NoNode(*id))?, p, xml_id); diff --git a/crates/engine/src/cmd/object/commands.rs b/crates/engine/src/cmd/object/commands.rs index 7b6f0fe783..fe9c3dd533 100644 --- a/crates/engine/src/cmd/object/commands.rs +++ b/crates/engine/src/cmd/object/commands.rs @@ -259,7 +259,7 @@ pub fn specs() -> Vec<CommandSpec> { "Object Properties", [], None, - "{ids?|id?, name?, visible?, locked? (visible: false or locked: true deselects every selected object hidden or locked after the call, the key object included), opacity?: 0..100, blend?: \"Multiply\"…, isolate?, knockout?: \"on\"|\"off\"|\"neutral\"|bool (true = on, false = neutral), knockoutShape?: bool, data?: {key: \"value\" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; document.node → attrs.data)}. On a path directly in a graph series, the graph also stores the object's opacity and blend mode, and on a series group the group's opacity, blend mode, isolate, knockout and knockoutShape (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's opacity and blend mode for every label or line of its kind", + "{ids?|id?, name?, visible?, locked? (visible: false or locked: true deselects every selected object hidden or locked after the call, the key object included), opacity?: 0..100, blend?: \"Multiply\"…, isolate?, knockout?: \"on\"|\"off\"|\"neutral\"|bool (true = on, false = neutral), knockoutShape?: bool, data?: {key: \"value\" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; document.node → attrs.data)}. On a path directly in a graph series, the graph also stores the object's opacity and blend mode, and on a series group the group's opacity, blend mode, isolate, knockout and knockoutShape (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's opacity and blend mode for every label or line of its kind. A path directly in a Live Paint group can't take the name Face or Edge, which name the group's faces and edges, unless it has it already", has_doc, set_props ), diff --git a/crates/engine/src/cmd/object/props.rs b/crates/engine/src/cmd/object/props.rs index 54ad23eb2f..f576435fe0 100644 --- a/crates/engine/src/cmd/object/props.rs +++ b/crates/engine/src/cmd/object/props.rs @@ -65,6 +65,9 @@ pub(super) fn set_props(s: &mut Session, p: &Value) -> Result<Value> { }) }; let d = &s.doc()?.doc; + if let Some(v) = str_param(p, "name") { + crate::cmd::buildcmds::check_part_name(d, &ids, v)?; + } // A graph keeps the object opacity and blend mode set on a mark of a series for the whole series, and set on a label // for its kind of label, so a value a mark or label already has still replaces the one another left on the graph. let transparency = opacity.is_some() || blend.is_some(); diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 5e84f0d99e..0a53b659d0 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -4964,6 +4964,73 @@ fn live_paint_does_not_count_art_named_like_its_parts() { } } +/// A path drawn in an isolated Live Paint group can't be named Face or Edge, the names of the +/// group's faces and edges: `object.setProps` and `layer.setProps` return an error and rename +/// nothing, so Gap Options and a path dragged into the group keep the path. A face keeps its name. +#[test] +fn live_paint_refuses_part_names_for_paths_drawn_in_it() { + use vectorcraft_tools::builder::{EDGE_NAME, FACE_NAME, faces}; + let mut s = session(); + let g = live(&mut s); + let face = faces(&node(&s, g))[0].id; + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + let a = line_across(&mut s, 50.0); + // Hidden, the path stays in the group as drawn when isolation mode ends. + s.execute("object.setProps", &json!({"id": a.0, "visible": false})).unwrap(); + let before = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()); + for name in [FACE_NAME, EDGE_NAME] { + let calls = [ + ("object.setProps", json!({"id": a.0, "name": name})), + ("layer.setProps", json!({"id": a.0, "name": name})), + ("layer.setProps", json!({"ids": [face.0, a.0], "name": name})), + ]; + for (c, p) in calls { + let err = s.execute(c, &p).unwrap_err().to_string(); + assert!(err.contains("give the path another name"), "{c} {p}: {err}"); + } + } + assert!(s.doc().unwrap().doc == before.0, "nothing was renamed"); + assert_eq!(s.doc().unwrap().history.undo.len(), before.1); + s.execute("layer.setProps", &json!({"id": face.0, "name": FACE_NAME})).unwrap(); + s.execute("object.exitIsolation", &json!({})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "the hidden path stays in the group"); + s.execute("livePaint.gapOptions", &json!({"ids": [g.0], "detect": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "Gap Options keeps the path"); + let b = line_to_right_face(&mut s, 30.0); + s.execute("layer.move", &json!({"ids": [b.0], "target": g.0, "place": "inside"})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "a path dragged in keeps it"); + assert_eq!(faces(&node(&s, g)).len(), 5); +} + +/// A path pasted into an isolated Live Paint group under the name of a face or an edge loses the +/// name, so Gap Options keeps it and it joins the group's paths when isolation mode ends. +#[test] +fn live_paint_paste_clears_part_names() { + use vectorcraft_tools::builder::{EDGE_NAME, FACE_NAME, faces, sources}; + for name in [FACE_NAME, EDGE_NAME] { + let mut s = session(); + let g = live(&mut s); + let r = rect(&mut s, 20.0, 40.0, 60.0, 20.0); + s.execute("object.setProps", &json!({"id": r.0, "name": name})).unwrap(); + s.execute("select.set", &json!({"ids": [r.0]})).unwrap(); + s.execute("edit.copy", &json!({})).unwrap(); + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + s.execute("edit.pasteInPlace", &json!({})).unwrap(); + let pasted = s.doc().unwrap().selection.objects.clone(); + assert_eq!(pasted.len(), 1); + let d = &s.doc().unwrap().doc; + assert_eq!(d.parent_of(pasted[0]), Some(g), "{name}: the paste goes into the group"); + assert_eq!(d.node(pasted[0]).unwrap().name, None, "{name}: the paste loses the name"); + assert_eq!(d.node(r).unwrap().name.as_deref(), Some(name), "the path outside keeps its name"); + s.execute("livePaint.gapOptions", &json!({"ids": [g.0], "detect": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(pasted[0]), Some(g), "{name}: Gap Options keeps the paste"); + s.execute("object.exitIsolation", &json!({})).unwrap(); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(pasted[0]), Some(sources(&n).unwrap().id), "{name}: the paste joined"); + assert!(faces(&n).len() > 3); + } +} + /// With Real-time Drawing and Editing off, a rectangle still being drawn in a Live Paint group /// isolated in a pattern tile is drawn first when Exit Isolation Mode leaves pattern editing, and /// joins the group with the tile saved. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c54311799d..3a5d7f83a3 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6111,6 +6111,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg type used as a mask in linked areas, wraparound text or a compound path doesn't clip el text usat com a màscara en àrees enllaçades, en text ajustat o en un traçat compost no retalla @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel les imatges enllaçades sense previsualització al fitxer mostren un marcador de posició fins que es trobin els seus fitxers: torneu-les a enllaçar al panell Enllaços @msg Live Paint Merge: select a Live Paint group and the paths to add Fusió de pintura interactiva: seleccioneu un grup de pintura interactiva i els traçats que voleu afegir +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` i `Edge` són els noms de les cares i les arestes d’un grup de pintura interactiva: doneu un altre nom al traçat @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pintura interactiva accepta traçats i traçats compostos: convertiu abans el text, les imatges i altres objectes a traçats @msg Live Paint: select paths or compound paths Pintura interactiva: seleccioneu traçats o traçats compostos @msg Live Paint: these paths are too degenerate to paint Pintura interactiva: aquests traçats són massa degenerats per pintar-los diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..32c47148a7 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5050,6 +5050,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg Installed plug-in {_1} Nainstalován zásuvný modul {_1} @msg Internal error: {msg} (please report this bug) Vnitřní chyba: {msg} (nahlaste prosím tuto chybu) @msg Live Paint Merge: select a Live Paint group and the paths to add Sloučit živou malbu: vyberte skupinu živé malby a cesty, které chcete přidat +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` a `Edge` jsou názvy ploch a hran skupiny živé malby: dejte cestě jiný název @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Živá malba přijímá cesty a složené cesty: text, obrazy a jiné objekty nejprve převeďte na cesty @msg Live Paint: select paths or compound paths Živá malba: vyberte cesty nebo složené cesty @msg Live Paint: these paths are too degenerate to paint Živá malba: tyto cesty jsou příliš degenerované, aby je bylo možné malovat diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 08100f593f..29376d72b8 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7286,6 +7286,7 @@ imageTrace Outline Kontur @msg Installed plug-in {_1} Installerede plug-in'en {_1} @msg Internal error: {msg} (please report this bug) Intern fejl: {msg} (meld venligst denne fejl) @msg Live Paint Merge: select a Live Paint group and the paths to add Live Paint-fletning: markér en Live Paint-gruppe og de kurver, der skal tilføjes +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` og `Edge` er navnene på fladerne og kanterne i en Live Paint-gruppe: giv kurven et andet navn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint tager kurver og sammensatte kurver: konvertér først tekst, billeder og andre objekter til kurver @msg Live Paint: select paths or compound paths Live Paint: markér kurver eller sammensatte kurver @msg Live Paint: these paths are too degenerate to paint Live Paint: disse kurver er for degenererede til at blive malet diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 10147b2d45..4336d5785e 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -4650,6 +4650,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg Installed plug-in {_1} Plug-in {_1} installiert @msg Internal error: {msg} (please report this bug) Interner Fehler: {msg} (bitte melden Sie diesen Fehler) @msg Live Paint Merge: select a Live Paint group and the paths to add Interaktiv malen – Zusammenfügen: Wählen Sie eine Interaktiv-malen-Gruppe und die hinzuzufügenden Pfade aus +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` und `Edge` benennen die Teilflächen und Kanten einer Interaktiv-malen-Gruppe: Geben Sie dem Pfad einen anderen Namen @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Interaktiv malen nimmt Pfade und zusammengesetzte Pfade an: Wandeln Sie Text, Bilder und andere Objekte zuerst in Pfade um @msg Live Paint: select paths or compound paths Interaktiv malen: Wählen Sie Pfade oder zusammengesetzte Pfade aus @msg Live Paint: these paths are too degenerate to paint Interaktiv malen: Diese Pfade sind zu entartet, um sie zu bemalen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ebf6e5684..06fb063092 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -2649,6 +2649,7 @@ liquify-list-end {0}, {1} {0} και {1} @msg Installed plug-in {_1} Εγκαταστάθηκε η επέκταση {_1} @msg Internal error: {msg} (please report this bug) Εσωτερικό σφάλμα: {msg} (παρακαλούμε αναφέρετε αυτό το σφάλμα) @msg Live Paint Merge: select a Live Paint group and the paths to add Συγχώνευση δυναμικής βαφής: επιλέξτε ομάδα δυναμικής βαφής και τις διαδρομές προς προσθήκη +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Τα `Face` και `Edge` ονομάζουν τις επιφάνειες και τις ακμές μιας ομάδας δυναμικής βαφής: δώστε άλλο όνομα στη διαδρομή @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Η δυναμική βαφή δέχεται διαδρομές και σύνθετες διαδρομές: μετατρέψτε πρώτα κείμενο, εικόνες και άλλα αντικείμενα σε διαδρομές @msg Live Paint: select paths or compound paths Δυναμική βαφή: επιλέξτε διαδρομές ή σύνθετες διαδρομές @msg Live Paint: these paths are too degenerate to paint Δυναμική βαφή: αυτές οι διαδρομές είναι πολύ εκφυλισμένες για να χρωματιστούν diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a456910a16..b8daf21a88 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4754,6 +4754,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg Installed plug-in {_1} Se instaló el plugin {_1} @msg Internal error: {msg} (please report this bug) Error interno: {msg} (por favor, informa de este error) @msg Live Paint Merge: select a Live Paint group and the paths to add Combinar pintura interactiva: selecciona un grupo de pintura interactiva y los trazados que quieres agregar +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` y `Edge` son los nombres de las caras y los bordes de un grupo de pintura interactiva: ponle otro nombre al trazado @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pintura interactiva admite trazados y trazados compuestos: convierte primero el texto, las imágenes y otros objetos en trazados @msg Live Paint: select paths or compound paths Pintura interactiva: selecciona trazados o trazados compuestos @msg Live Paint: these paths are too degenerate to paint Pintura interactiva: estos trazados están demasiado degenerados para pintarlos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index bff46fc0d7..4cadcfc6c8 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4987,6 +4987,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg Installed plug-in {_1} Asennettiin laajennus {_1} @msg Internal error: {msg} (please report this bug) Sisäinen virhe: {msg} (ilmoita tästä virheestä) @msg Live Paint Merge: select a Live Paint group and the paths to add Elävän maalauksen yhdistäminen: valitse elävän maalauksen ryhmä ja lisättävät polut +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ja `Edge` ovat elävän maalauksen ryhmän pintojen ja reunojen nimiä: anna polulle toinen nimi @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Elävä maalaus ottaa polkuja ja yhdistelmäpolkuja: muunna teksti, kuvat ja muut objektit ensin poluiksi @msg Live Paint: select paths or compound paths Elävä maalaus: valitse polkuja tai yhdistelmäpolkuja @msg Live Paint: these paths are too degenerate to paint Elävä maalaus: nämä polut ovat liian surkastuneita maalattaviksi diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..43f7417523 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -4716,6 +4716,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg Installed plug-in {_1} Module externe {_1} installé @msg Internal error: {msg} (please report this bug) Erreur interne : {msg} (merci de signaler ce bogue) @msg Live Paint Merge: select a Live Paint group and the paths to add Fusion de peinture dynamique : sélectionnez un groupe de peinture dynamique et les tracés à ajouter +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Les noms `Face` et `Edge` sont réservés aux faces et aux bords d’un groupe de peinture dynamique, choisissez un autre nom pour le tracé @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La peinture dynamique accepte les tracés et les tracés transparents : convertissez d’abord le texte, les images et les autres objets en tracés @msg Live Paint: select paths or compound paths Peinture dynamique : sélectionnez des tracés ou des tracés transparents @msg Live Paint: these paths are too degenerate to paint Peinture dynamique : ces tracés sont trop dégénérés pour être peints diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index cbfb4f51d1..dbd25b1690 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7487,6 +7487,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel फ़ाइल में कोई प्रीव्यू के साथ जुड़े चित्र एक प्लेसहोल्डर दिखाते हैं जब तक कि उनकी फ़ाइलें नहीं मिलती: उन्हें लिंक पैनल में फिर से लिंक करें @msg linked type areas past VectorCraft's limits were left out VectorCraft की सीमाओं से आगे के लिंक्ड टाइप एरिया छोड़ दिए गए @msg Live Paint Merge: select a Live Paint group and the paths to add लाइव पेंट मर्ज: जोड़ने के लिए एक लाइव पेंट समूह और पाथ सिलेक्ट करें +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` और `Edge` लाइव पेंट समूह के फेस और एज के नाम हैं: पाथ को कोई दूसरा नाम दें @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first लाइव पेंट पाथ और कंपाउंड पाथ लेता है: पहले टाइप, इमेज और अन्य ऑब्जेक्ट्स को पाथ में बदलें @msg Live Paint: select paths or compound paths लाइव पेंट: पाथ या यौगिक पाथ सिलेक्ट करें @msg Live Paint: these paths are too degenerate to paint लाइव पेंट: इन पाथ को पेंट करने के लिए बहुत अलग किया जाता है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..f05fbb7cb2 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5660,6 +5660,7 @@ liquify-list-end {0}, {1} {0} és {1} @msg line {line}: value for `{var}` must be true or false {line}. sor: a(z) `{var}` értéke csak true vagy false lehet @msg line {line}: value for `{var}` is longer than {MAX_GRAPH_CSV} bytes {line}. sor: a(z) `{var}` értéke hosszabb {MAX_GRAPH_CSV} bájtnál @msg Live Paint Merge: select a Live Paint group and the paths to add Élő festés egyesítése: jelölj ki egy élőfestés-csoportot és a hozzáadandó útvonalakat +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name A `Face` és az `Edge` az élőfestés-csoport felületeinek és éleinek neve: adj más nevet az útvonalnak @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Az élő festés útvonalakat és összetett útvonalakat fogad: előbb alakítsd útvonallá a szöveget, a képeket és a többi objektumot @msg Live Paint: select paths or compound paths Élő festés: jelölj ki útvonalakat vagy összetett útvonalakat @msg Live Paint: these paths are too degenerate to paint Élő festés: ezek az útvonalak túlságosan elfajultak a festéshez diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8f2ed3216c..5171dbeb75 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4784,6 +4784,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg Installed plug-in {_1} Plug-in installato: {_1} @msg Internal error: {msg} (please report this bug) Errore interno: {msg} (segnala questo bug) @msg Live Paint Merge: select a Live Paint group and the paths to add Fondi pittura dinamica: seleziona un gruppo di pittura dinamica e i tracciati da aggiungere +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ed `Edge` sono i nomi delle facce e dei bordi di un gruppo di pittura dinamica: assegna un altro nome al tracciato @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pittura dinamica accetta tracciati e tracciati composti: converti prima in tracciati testo, immagini e altri oggetti @msg Live Paint: select paths or compound paths Pittura dinamica: seleziona tracciati o tracciati composti @msg Live Paint: these paths are too degenerate to paint Pittura dinamica: questi tracciati sono troppo degeneri per essere dipinti diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..fdf47686cf 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4676,6 +4676,7 @@ swatch Bright Violet ビビッドバイオレット @msg the art has no bounds アートに境界がありません @msg Image Trace: the traced image is missing 画像トレース: トレース元の画像が見つかりません @msg Live Paint Merge: select a Live Paint group and the paths to add ライブペイントの結合: ライブペイントグループと、追加するパスを選択してください +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` と `Edge` はライブペイントグループの面とエッジの名前です: パスには別の名前を付けてください @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first ライブペイントで扱えるのはパスと複合パスです: テキスト、画像、その他のオブジェクトは先にパスに変換してください @msg Live Paint: select paths or compound paths ライブペイント: パスまたは複合パスを選択してください @msg Live Paint: these paths are too degenerate to paint ライブペイント: これらのパスは形状がつぶれすぎていてペイントできません diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..f68aecb9c6 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6587,6 +6587,7 @@ font-technology Variable ცვლადი @msg Installed plug-in {_1} დაინსტალირდა პლაგინი {_1} @msg Internal error: {msg} (please report this bug) შიდა შეცდომა: {msg} (გთხოვთ, შეგვატყობინოთ ამ ხარვეზის შესახებ) @msg Live Paint Merge: select a Live Paint group and the paths to add ცოცხალი შეღებვის შერწყმა: მონიშნეთ ცოცხალი შეღებვის ჯგუფი და დასამატებელი ტრაექტორიები +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` და `Edge` ცოცხალი შეღებვის ჯგუფის წახნაგებისა და კიდეების სახელებია: ტრაექტორიას სხვა სახელი დაარქვით @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first ცოცხალი შეღებვა იღებს ტრაექტორიებს და შედგენილ ტრაექტორიებს: ჯერ გადააქციეთ ტექსტი, გამოსახულებები და სხვა ობიექტები ტრაექტორიებად @msg Live Paint: select paths or compound paths ცოცხალი შეღებვა: მონიშნეთ ტრაექტორიები ან შედგენილი ტრაექტორიები @msg Live Paint: these paths are too degenerate to paint ცოცხალი შეღებვა: ეს ტრაექტორიები ზედმეტად გადაგვარებულია შესაღებად diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..9f26f64691 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4603,6 +4603,7 @@ theme Appearance 외관 @msg the art has no bounds 아트웍에 경계가 없습니다 @msg Image Trace: the traced image is missing 이미지 추적: 추적한 이미지가 없습니다 @msg Live Paint Merge: select a Live Paint group and the paths to add 라이브 페인트 병합: 라이브 페인트 그룹과 추가할 패스를 선택하세요 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face`와 `Edge`는 라이브 페인트 그룹의 면과 가장자리 이름입니다: 패스에 다른 이름을 지정하세요 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 라이브 페인트는 패스와 컴파운드 패스만 사용할 수 있습니다: 텍스트, 이미지 및 기타 개체를 먼저 패스로 변환하세요 @msg Live Paint: select paths or compound paths 라이브 페인트: 패스 또는 컴파운드 패스를 선택하세요 @msg Live Paint: these paths are too degenerate to paint 라이브 페인트: 이 패스는 퇴화되어 칠할 수 없습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..b2ffeab320 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5161,6 +5161,7 @@ imageTrace Outline Contour @msg Installed plug-in {_1} Plug-in {_1} geïnstalleerd @msg Internal error: {msg} (please report this bug) Interne fout: {msg} (meld deze bug alsjeblieft) @msg Live Paint Merge: select a Live Paint group and the paths to add Live Paint samenvoegen: selecteer een Live Paint-groep en de paden om toe te voegen +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` en `Edge` zijn de namen van de vlakken en randen van een Live Paint-groep: geef het pad een andere naam @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint neemt paden en samengestelde paden: zet tekst, afbeeldingen en andere objecten eerst om in paden @msg Live Paint: select paths or compound paths Live Paint: selecteer paden of samengestelde paden @msg Live Paint: these paths are too degenerate to paint Live Paint: deze paden zijn te gedegenereerd om te verven diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0147515ffe..cc5c471a9e 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4873,6 +4873,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg Installed plug-in {_1} Zainstalowano wtyczkę {_1} @msg Internal error: {msg} (please report this bug) Błąd wewnętrzny: {msg} (zgłoś ten błąd) @msg Live Paint Merge: select a Live Paint group and the paths to add Scal aktywne malowanie: zaznacz grupę aktywnego malowania i ścieżki do dodania +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` i `Edge` to nazwy ścian i krawędzi grupy aktywnego malowania: nadaj ścieżce inną nazwę @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Aktywne malowanie przyjmuje ścieżki i ścieżki złożone: najpierw przekształć tekst, obrazy i inne obiekty w ścieżki @msg Live Paint: select paths or compound paths Aktywne malowanie: zaznacz ścieżki lub ścieżki złożone @msg Live Paint: these paths are too degenerate to paint Aktywne malowanie: te ścieżki są zbyt zdegenerowane, aby je malować diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8201db7ab6..6562dd1fc7 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4069,6 +4069,7 @@ axis Both Ambos @msg Installed plug-in {_1} Plug-in {_1} instalado @msg Internal error: {msg} (please report this bug) Erro interno: {msg} (relate este bug) @msg Live Paint Merge: select a Live Paint group and the paths to add Mesclar Pintura dinâmica: selecione um grupo de Pintura dinâmica e os traçados a adicionar +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` e `Edge` são os nomes das faces e arestas de um grupo de Pintura dinâmica: dê outro nome ao traçado @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first A pintura dinâmica aceita traçados e traçados compostos: converta primeiro texto, imagens e outros objetos em traçados @msg Live Paint: select paths or compound paths Pintura dinâmica: selecione traçados ou traçados compostos @msg Live Paint: these paths are too degenerate to paint Pintura dinâmica: estes traçados são degenerados demais para pintar diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..9b9cffb801 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -4778,6 +4778,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg Installed plug-in {_1} Установлен модуль {_1} @msg Internal error: {msg} (please report this bug) Внутренняя ошибка: {msg} (пожалуйста, сообщите об этой ошибке) @msg Live Paint Merge: select a Live Paint group and the paths to add Объединение быстрой заливки: выделите группу быстрой заливки и контуры для добавления +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Имена `Face` и `Edge` носят грани и границы группы быстрой заливки: дайте контуру другое имя @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Быстрая заливка принимает контуры и составные контуры: сначала преобразуйте текст, изображения и другие объекты в контуры @msg Live Paint: select paths or compound paths Быстрая заливка: выделите контуры или составные контуры @msg Live Paint: these paths are too degenerate to paint Быстрая заливка: эти контуры слишком вырождены для заливки diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5c0420fcd3..da3504668b 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -4660,6 +4660,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg Installed plug-in {_1} Installerade pluginet {_1} @msg Internal error: {msg} (please report this bug) Internt fel: {msg} (rapportera gärna felet) @msg Live Paint Merge: select a Live Paint group and the paths to add Sammanfoga Live Paint: markera en Live Paint-grupp och de banor som ska läggas till +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` och `Edge` är namnen på ytorna och kanterna i en Live Paint-grupp: ge banan ett annat namn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint tar banor och sammansatta banor: konvertera först text, bilder och andra objekt till banor @msg Live Paint: select paths or compound paths Live Paint: markera banor eller sammansatta banor @msg Live Paint: these paths are too degenerate to paint Live Paint: de här banorna är för degenererade för att målas diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..0bd40bfe81 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4493,6 +4493,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msg Installed plug-in {_1} Yüklü eklenti {_1} @msg Internal error: {msg} (please report this bug) Dahili hata: {msg} (lütfen bu hatayı bildirin) @msg Live Paint Merge: select a Live Paint group and the paths to add Canlı Boyama Birleştirme: Canlı Boyama grubunu ve eklenecek yolları seçin +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ve `Edge`, Canlı Boyama grubunun yüzlerinin ve kenarlarının adlarıdır: yola başka bir ad verin @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Canlı Boyama yolları ve bileşik yolları kabul eder: önce metni, görüntüleri ve diğer nesneleri yollara dönüştürün @msg Live Paint: select paths or compound paths Canlı Boyama: yolları veya bileşik yolları seçin @msg Live Paint: these paths are too degenerate to paint Canlı Boyama: Bu yollar boyanamayacak kadar yozlaşmış diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index dbd6d2609e..6f0ed435a2 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4768,6 +4768,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg Installed plug-in {_1} Встановлено модуль {_1} @msg Internal error: {msg} (please report this bug) Внутрішня помилка: {msg} (будь ласка, повідомте про цю помилку) @msg Live Paint Merge: select a Live Paint group and the paths to add Об’єднання швидкої заливки: виділіть групу швидкої заливки та контури для додавання +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Імена `Face` і `Edge` мають грані та межі групи швидкої заливки: дайте контуру інше ім'я @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Швидка заливка приймає контури та складені контури: спершу перетворіть текст, зображення й інші об'єкти на контури @msg Live Paint: select paths or compound paths Швидка заливка: виділіть контури або складені контури @msg Live Paint: these paths are too degenerate to paint Швидка заливка: ці контури занадто вироджені для заливки diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 519c5d8f0d..62c0417ba3 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5343,6 +5343,7 @@ liquify-list-end {0}, {1} {0} và {1} @msg type used as a mask in linked areas, wraparound text or a compound path doesn't clip chữ dùng làm mặt nạ trong các vùng liên kết, chữ bao quanh hoặc đường dẫn phức không cắt xén @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel ảnh liên kết không có bản xem trước trong tệp hiển thị ô giữ chỗ cho đến khi tìm thấy tệp gốc: liên kết lại trong bảng Liên kết @msg Live Paint Merge: select a Live Paint group and the paths to add Hợp nhất tô trực tiếp: chọn nhóm tô trực tiếp và các đường dẫn để thêm +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` và `Edge` là tên của các mặt và cạnh trong nhóm tô trực tiếp: hãy đặt tên khác cho đường dẫn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Tô trực tiếp nhận đường dẫn và đường dẫn phức: hãy chuyển văn bản, hình ảnh và các đối tượng khác thành đường dẫn trước @msg Live Paint: select paths or compound paths Tô trực tiếp: chọn đường dẫn hoặc đường dẫn phức @msg Live Paint: these paths are too degenerate to paint Tô trực tiếp: các đường dẫn này quá suy biến để tô diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c6696a9ec6..4838492b55 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4390,6 +4390,7 @@ imageTrace Outline 轮廓 @msg the art has no bounds 图稿没有边界 @msg Image Trace: the traced image is missing 图像描摹:缺少所描摹的图像 @msg Live Paint Merge: select a Live Paint group and the paths to add 实时上色合并:请选择一个实时上色组以及要添加的路径 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` 和 `Edge` 是实时上色组中表面和边缘的名称:请为路径另取一个名称 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 实时上色只接受路径和复合路径:请先将文字、图像和其他对象转换为路径 @msg Live Paint: select paths or compound paths 实时上色:请选择路径或复合路径 @msg Live Paint: these paths are too degenerate to paint 实时上色:这些路径过于退化,无法上色 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..4e6e836422 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1925,6 +1925,7 @@ file-filter Templates 範本 @msg the art has no bounds 圖稿沒有邊界 @msg Image Trace: the traced image is missing 影像描圖:找不到描圖的影像 @msg Live Paint Merge: select a Live Paint group and the paths to add 即時上色合併:請選取即時上色群組和要加入的路徑 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` 和 `Edge` 是即時上色群組中表面和邊緣的名稱:請為路徑另取名稱 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 即時上色只接受路徑和複合路徑:請先將文字、影像和其他物件轉換為路徑 @msg Live Paint: select paths or compound paths 即時上色:請選取路徑或複合路徑 @msg Live Paint: these paths are too degenerate to paint 即時上色:這些路徑過度退化,無法上色 diff --git a/docs/mcp.md b/docs/mcp.md index 219b44f622..1d24ac803a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5435,7 +5435,9 @@ and `layerRows`, the rows highlighted in the panel. Paint group (`object.exitIsolation`, or `object.isolate` on a level outside it) adds the paths, compound paths and groups of them drawn in it, shown and unlocked with everything in them, to the group as `livePaint.merge` does, in one undo step; type, images and other objects stay in it as they are, and with nothing drawn no undo step is - recorded. + recorded. Face and Edge are the names of a Live Paint group's faces and edges: `layer.setProps` and + `object.setProps` return an error when they would give either name to another path directly in the group, and a + path pasted directly into the group under either name loses its name. - **Dialogs and panel state** (control channel and the app's MCP): `ui.layerOptions {ids?}` and `ui.newLayer {sublayer?}` open Layer Options (dialog `layerOptions`: name, color, template, locked, visible, printable, preview, dimImages, dimPercent; OK is one undo step; `ui.dialog.set` of `template` also sets `locked` and `dimImages`, as the From f1dba281bf5405a18bfc08b7d7114d83c24e34f8 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 10:08:30 -0800 Subject: [PATCH 130/247] Shapes: a double-click on a polygon's side widget does nothing With the Selection tool, a double-click on the side widget went on to the art under it, or left isolation mode when no art was under it. The widget now takes the double-click, as the blend widget does. --- crates/tools/src/select.rs | 4 ++++ crates/tools/src/sidewidget.rs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 898b55ca47..1373dfa2b5 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -1678,6 +1678,10 @@ impl SelectionTool { if blendwidget::over_widget(cx, p) { return vec![]; } + // A live polygon's side widget takes a plain double-click the same way. + if sidewidget::over_widget(cx, p) { + return vec![]; + } if crate::rulerguide::guide_at(cx, p).is_some() { return vec![]; } diff --git a/crates/tools/src/sidewidget.rs b/crates/tools/src/sidewidget.rs index 240fc5a706..7928238d51 100644 --- a/crates/tools/src/sidewidget.rs +++ b/crates/tools/src/sidewidget.rs @@ -360,6 +360,40 @@ mod tests { assert_eq!(sides_of(&t.pointer(&c, &ev(PointerKind::Drag, w.at - down * 13.0))), [4]); } + /// A double-click on the widget with the Selection tool does nothing: in isolation mode it does + /// not leave isolation, though no art is under the widget. + #[test] + fn a_double_click_on_the_widget_does_nothing() { + let live = LiveShape::Polygon { + radius: 100.0, + sides: 5, + xf: Affine::translate((300.0, 300.0)), + radii: vec![], + kinds: vec![], + radii_relative: false, + }; + let mut d = Document::new(800.0, 800.0); + let l = d.layers[0].id; + let id = d.alloc_id(); + let mut n = Node::path(id, live.to_path(), Appearance::default_art()); + if let NodeKind::Path { live: slot, .. } = &mut n.kind { + *slot = Some(Box::new(live)); + } + let group = d.alloc_id(); + d.insert(Some(l), 0, Node::group(group, vec![std::sync::Arc::new(n)])).unwrap(); + let mut s = Selection::default(); + s.add(id); + let p = paint(); + let c = ToolContext { isolation: Some(group), ..cx(&d, &s, &p) }; + let (w, _) = SideWidget::for_tool(&c).unwrap(); + assert!(vectorcraft_doc::hit::hit_test(&d, w.at, c.hit_options()).is_none()); + let mut t = SelectionTool::default(); + assert!(t.pointer(&c, &ev(PointerKind::DoubleClick, w.at)).is_empty()); + // Away from the widget and the art, the double-click leaves isolation. + let away = w.at + vectorcraft_geom::Vec2::new(40.0, 0.0); + assert_eq!(t.pointer(&c, &ev(PointerKind::DoubleClick, away)), vec![Action::Exec("object.exitIsolation".into(), json!({}))]); + } + /// A polygon of more than 11 sides keeps its count on a press and a drag down; the first step /// up gives 11. #[test] From 0aede64dbd7939d6713057b71fdb370d042fee19 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 10:29:05 -0800 Subject: [PATCH 131/247] Layers: a path dragged from a Live Paint group's paths into the group keeps its faces' paint Dragging one of a Live Paint group's own paths from its hidden sources into the group made the group's faces and edges again before adding the path back, so the merge read the paint from the rebuilt parts. With the path as the only source every face and edge was dropped; with others, the faces the path bounded lost their fill. The group the rows join is now made again by the merge alone, which carries the paint of the faces and edges as they were before the move. --- crates/engine/src/cmd/buildcmds/live_paint.rs | 5 +++- crates/engine/src/tests/build.rs | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 776f5f11b7..c71e1d6f32 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -382,7 +382,10 @@ impl LivePaintMove { if self.join.is_none() && self.rebuild.is_empty() { return Ok(moved.to_vec()); } - for g in &self.rebuild { + // The group the rows join is made again by the merge below, from its paths as they are now + // and with the paint of its faces and edges as they were before the move. + let join_group = self.join.as_ref().map(|(g, _)| *g); + for g in self.rebuild.iter().filter(|g| Some(**g) != join_group) { rebuild_paths(d, *g)?; } let Some((g, mask)) = self.join else { return Ok(moved.iter().copied().filter(|r| d.node(*r).is_some()).collect()) }; diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 0a53b659d0..61a4414599 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -5245,6 +5245,31 @@ fn layers_drag_out_of_a_live_paint_group_makes_its_faces_again() { assert_eq!(faces(&node(&s, g)).len(), 1); } +/// A path dragged from a Live Paint group's sources into the group itself stays among its paths, +/// and the faces it bounds keep their paint, also when it is the group's only path. +#[test] +fn layers_drag_a_source_path_into_its_own_live_paint_group_keeps_the_paint() { + use vectorcraft_tools::builder::{face_at, faces, sources}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let blue = Paint::solid(Color::from_hex("#0000ff").unwrap()); + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g).unwrap(); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [25, 50], "color": "#00ff00"})).unwrap(); + let src: Vec<NodeId> = sources(&node(&s, g)).unwrap().children().unwrap().iter().map(|c| c.id).collect(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0, "place": "inside"})).unwrap(); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(src[0]), Some(sources(&n).unwrap().id), "the path stays among the group's paths"); + assert_eq!(faces(&n).len(), 3); + assert_eq!(face_at(&n, Point::new(25.0, 50.0)).unwrap().appearance.fill_paint(), green, "the face it bounds keeps its fill"); + s.execute("layer.move", &json!({"ids": [src[1].0], "target": layer.0})).unwrap(); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [50, 50], "color": "#0000ff"})).unwrap(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0, "place": "inside"})).unwrap(); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 1); + assert_eq!(face_at(&n, Point::new(50.0, 50.0)).unwrap().appearance.fill_paint(), blue, "the only path's face keeps its fill"); +} + /// Give Live Paint group `g` a lock, hidden state, appearance, knockout, opacity mask and /// graphic style link, and return it as it then is. fn dress_live_group(s: &mut Session, g: NodeId) -> Node { From 5af51906dcac12a298d5e3a2f2711cfc40205d7c Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 11:00:58 -0800 Subject: [PATCH 132/247] Messages: a press on a message closes it when an older message goes first The click took the frame's automatic id, which follows its position among the messages, so a message pressed while an older one expired did not close on release. The click now takes an id from the message's own scope. --- crates/ui-egui/src/toasts.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/toasts.rs b/crates/ui-egui/src/toasts.rs index 0d47c4e3b4..a8bdb46be5 100644 --- a/crates/ui-egui/src/toasts.rs +++ b/crates/ui-egui/src/toasts.rs @@ -138,7 +138,9 @@ fn message(ui: &mut egui::Ui, e: &Entry, t: &Tokens) -> egui::Response { ui.add(egui::Label::new(galley).selectable(false)); elided }); - let r = frame.response.interact(egui::Sense::click()).on_hover_cursor(egui::CursorIcon::PointingHand); + // The click takes its id from the message's own scope, not from the frame's position among + // the messages, so a press survives an older message going. + let r = ui.interact(frame.response.rect, ui.scope_id().with("toast"), egui::Sense::click()).on_hover_cursor(egui::CursorIcon::PointingHand); // A message cut short shows in full on hover. if frame.inner { r.on_hover_text(&e.toast.message) } else { r } } @@ -257,6 +259,26 @@ mod tests { assert_eq!(messages(&app), vec!["top", "bottom"]); } + #[test] + fn a_message_pressed_while_an_older_one_goes_still_closes_on_release() { + let (mut app, ctx) = app(); + for (message, seconds) in [("older", 0.5), ("pressed", 60.0), ("bottom", 60.0)] { + app.session.toast(Toast { seconds, ..Toast::new(message, Level::Info) }); + } + pass(&mut app, &ctx, 0.0, vec![]); + pass(&mut app, &ctx, 0.0, vec![]); + let at = app.toasts.list[1].rect.unwrap().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + pass(&mut app, &ctx, 0.1, vec![egui::Event::PointerMoved(at)]); + pass(&mut app, &ctx, 0.2, vec![press(true)]); + // "older" goes while the button is down; the newer messages stay where they were. + pass(&mut app, &ctx, 0.6, vec![]); + assert_eq!(messages(&app), vec!["pressed", "bottom"]); + pass(&mut app, &ctx, 0.7, vec![]); + pass(&mut app, &ctx, 0.8, vec![press(false)]); + assert_eq!(messages(&app), vec!["bottom"]); + } + #[test] fn an_action_records_a_message_and_shows_it_again_when_played() { use crate::panels::actions::{START_RECORDING, STOP_RECORDING, play}; From 0e2ac0b4f938d93e156b573ccb898ddba78673e4 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 10:42:09 -0800 Subject: [PATCH 133/247] Layers: Locate Object locates the frontmost of several selected objects With several objects selected, Locate Object (and Locate Layer) now finds the one frontmost in the stacking order instead of the one selected last. Objects on different layers and sublayers compare by the layers' order, and a member selected with its group counts as in front of it. An id given to layer.locate still locates that object. --- crates/engine/src/cmd/layerpanel.rs | 5 ++-- crates/engine/src/tests/layers.rs | 37 +++++++++++++++++++++++++++++ crates/ui-egui/src/panels/layers.rs | 2 +- docs/mcp.md | 4 +++- docs/target-app-parity.md | 1 + 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/layerpanel.rs b/crates/engine/src/cmd/layerpanel.rs index 4710966004..6c84a817af 100644 --- a/crates/engine/src/cmd/layerpanel.rs +++ b/crates/engine/src/cmd/layerpanel.rs @@ -132,7 +132,7 @@ pub fn specs() -> Vec<CommandSpec> { "Locate Object", ["Window", "Layers"], None, - "{id?, layersOnly?} (default: the last selected object) highlight the object's row; the Layers panel opens the layers around it and scrolls to it → {id, ancestry: [layer…, id]}. layersOnly (default false; the panel sends true while Show Layers Only is on, as Locate Layer) highlights the innermost layer or sublayer holding the object instead, or a layer id itself → {id: layer, objectId, ancestry: [layer…]}", + "{id?, layersOnly?} (default: the frontmost selected object in the stacking order) highlight the object's row; the Layers panel opens the layers around it and scrolls to it → {id, ancestry: [layer…, id]}. layersOnly (default false; the panel sends true while Show Layers Only is on, as Locate Layer) highlights the innermost layer or sublayer holding the object instead, or a layer id itself → {id: layer, objectId, ancestry: [layer…]}", has_doc, locate ), @@ -437,7 +437,8 @@ fn locate(s: &mut Session, p: &Value) -> Result<Value> { let id = object_param(p, "id", "layer.locate")?; let layers_only = switch_or(p, "layersOnly", false, "layer.locate")?; let st = s.doc_mut()?; - let id = id.or_else(|| st.selection.objects.last().copied()).ok_or_else(|| bad("layer.locate", "nothing selected"))?; + // With no id, the frontmost selected object in the stacking order, whatever order it was selected in. + let id = id.or_else(|| st.selection.in_paint_order(&st.doc).last().copied()).ok_or_else(|| bad("layer.locate", "nothing selected"))?; let mut ancestry = st.doc.ancestry(id).ok_or(EngineError::NoNode(id))?; if layers_only { // Locate Layer: the innermost layer or sublayer holding the object (a layer locates itself). diff --git a/crates/engine/src/tests/layers.rs b/crates/engine/src/tests/layers.rs index 186c5de6c1..b7006e6159 100644 --- a/crates/engine/src/tests/layers.rs +++ b/crates/engine/src/tests/layers.rs @@ -904,6 +904,43 @@ fn locate_object_highlights_its_row() { assert!(s.execute("layer.locate", &json!({})).is_err()); } +/// With several objects selected, Locate Object finds the frontmost one in the stacking order, +/// whatever order they were selected in; an `id` still wins. +#[test] +fn locate_object_finds_the_frontmost_selected_object() { + let mut s = session(); + let (_, sub, a, g, b, c) = tree(&mut s); + let top = id(&run(&mut s, "layer.new", json!({"top": true}))); + let d = rect(&mut s, 400.0); + let locate = |s: &mut Session, ids: &[NodeId]| { + run(s, "select.set", json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})); + assert_eq!(s.doc().unwrap().selection.objects.last(), ids.last(), "selected in this order"); + run(s, "layer.locate", json!({}))["id"].clone() + }; + // In one sublayer, the group in front of the rectangle selected last. + assert_eq!(locate(&mut s, &[g, a]), json!(g.0)); + assert_eq!(s.doc().unwrap().highlighted_rows(), vec![g]); + // The sublayer sits in front of the art directly in its layer. + assert_eq!(locate(&mut s, &[a, c]), json!(a.0)); + // A higher layer wins over everything below it. + assert_eq!(locate(&mut s, &[d, b, c]), json!(d.0)); + assert_eq!(s.doc().unwrap().highlighted_rows(), vec![d]); + // A group and its member: the member paints after the group it is in. + assert_eq!(locate(&mut s, &[b, g]), json!(b.0)); + // Added one at a time, as by Shift-clicks. + run(&mut s, "select.set", json!({"ids": [d.0]})); + run(&mut s, "select.add", json!({"ids": [a.0]})); + assert_eq!(run(&mut s, "layer.locate", json!({}))["id"], d.0); + // An id still locates that object, behind the selection or not. + assert_eq!(run(&mut s, "layer.locate", json!({"id": c.0}))["id"], c.0); + assert_eq!(s.doc().unwrap().highlighted_rows(), vec![c]); + // Locate Layer takes the layer of the frontmost selected object. + run(&mut s, "select.set", json!({"ids": [d.0, a.0]})); + assert_eq!(run(&mut s, "layer.locate", json!({"layersOnly": true})), json!({"id": top.0, "objectId": d.0, "ancestry": [top.0]})); + run(&mut s, "select.set", json!({"ids": [a.0, c.0]})); + assert_eq!(run(&mut s, "layer.locate", json!({"layersOnly": true}))["id"], sub.0); +} + /// Locate Layer (`layersOnly`, sent while Show Layers Only is on) highlights the innermost layer /// or sublayer holding the object, through any groups; a layer locates itself. #[test] diff --git a/crates/ui-egui/src/panels/layers.rs b/crates/ui-egui/src/panels/layers.rs index 6e8c2648fa..2cf0808741 100644 --- a/crates/ui-egui/src/panels/layers.rs +++ b/crates/ui-egui/src/panels/layers.rs @@ -516,7 +516,7 @@ fn listed_when_opened(doc: &Document, open: &OpenRows, opts: &PanelOptions, quer rows.iter().any(|r| r.node.id == id && r.guide.is_none() && !r.spine) } -/// The active document's uid and its last selected object, the one Locate Object locates. +/// The active document's uid and its last selected object. fn last_selected(app: &VectorcraftApp) -> Option<(u64, Option<NodeId>)> { app.session.active().map(|st| (st.uid, st.selection.objects.last().copied())) } diff --git a/docs/mcp.md b/docs/mcp.md index b719d3352e..50ba6f5b60 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5413,7 +5413,9 @@ and `layerRows`, the rows highlighted in the panel. locked or nested art included, dialog `confirm` asks "Delete this layer and its artwork?" for one layer, else "Delete the selected items and their artwork?"; OK deletes the rows it asked about in that document, one undo step, and Cancel keeps them; an empty layer, a layer with only guides, and groups or objects alone are deleted at once), - `layer.locate {id?, layersOnly?}` (highlights the selected object's row; the panel opens the rows around it; + `layer.locate {id?, layersOnly?}` (highlights the selected object's row, or with several selected the row of the + one frontmost in the stacking order, whatever order they were selected in; an `id` locates that object instead; + the panel opens the rows around it; `layersOnly: true`, which the panel sends while Show Layers Only is on, as Locate Layer, highlights the innermost layer or sublayer holding the object instead, or a layer `id` itself, and returns `{id, objectId, ancestry}`) and `layer.clippingMask.toggle`. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 6bae94488f..89c8affc76 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1387,6 +1387,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur As VectorCraft's own rule, a layer color (`layer.setProps`, `layer.new`, `layer.newSublayer`) or a Live Paint Gap Preview Color (`livePaint.gapOptions`) given as a hex color with an alpha part (`#rrggbbaa` or `#rgba`) is an error and changes nothing, instead of being set without its alpha. Regression tests: `a_layer_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/layers.rs` and `a_gap_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/build.rs`. Panel Options › Locate Selected Objects (beyond Illustrator, off by default): when the last selected object changes on the canvas or by a command, the panel opens the layers and groups around it and scrolls to its row, as Locate Object does, without highlighting the row; when Show Layers Only, a search or the filter leaves the object without a row, the panel opens no rows for it and scrolls as with the option off. With Panel Options › Show Layers Only on, Locate Object is named Locate Layer and highlights the layer that holds the selected object instead of the object's own row, which that mode does not list (help page: https://helpx.adobe.com/illustrator/desktop/manage-layers/create-and-organize-layers/locate-objects-in-the-layers-panel.html). As VectorCraft's own rules, the bottom bar's button and a row's menu are renamed too, the innermost sublayer holding the object is the one highlighted, a layer row locates itself, and the panel opens the layers around it (`locate_layer_highlights_the_layer_holding_the_object` in `crates/engine/src/tests/layers.rs`, `with_show_layers_only_locate_object_becomes_locate_layer` in `crates/ui-egui/src/panels/layers/tests.rs`). + With several objects selected, Locate Object (and Locate Layer) finds the one frontmost in the stacking order, not the one selected last (help page: https://helpx.adobe.com/illustrator/desktop/manage-layers/create-and-organize-layers/locate-objects-in-the-layers-panel.html). Objects on different layers and sublayers are compared by the layers' order. As VectorCraft's own rules, a member selected along with its group counts as in front of the group, and an `id` given to `layer.locate` still wins (`locate_object_finds_the_frontmost_selected_object` in `crates/engine/src/tests/layers.rs`). - **Drawing aids:** Smart Guides and snapping (moving, with the Selection, Group Selection or Direct Selection tool, and resizing by the bounding-box handles with the Selection or Free Transform tool, Shift and Alt too: the dragged corner or side lands on the other objects' anchors and centres ("anchor", "center") or lines up with their edges and centres (a line and "align"); with Smart Guides › Spacing Guides, a moved selection that lines up with nothing along an axis lands as far from its neighbour as two other objects of its row or column are apart, or halfway between its two neighbours, the equal gaps marked; with View › Snap to Grid on, a moved selection lands on the grid instead, by whichever of its edges is nearest a gridline on each axis (the center does not snap), #740, #1816; the Rotate, Scale, Shear and Reflect tools drag from the anchor they grab and snap the pointer the same way, so a corner dragged onto another object's anchor scales exactly onto it, #482; anchors dragged with Direct Selection: the one pressed on lands on other anchors, its own path's that stay put among them, on path segments or in line with them, the others following, Shift keeps 45° steps, and with Smart Guides off Snap to Point pulls it onto anchors; the Artboard tool snaps artboards, and their bleed, to other artboards, bleeds and art, the grid or whole pixels while moving, copying and resizing them, and the Transform panel shows and edits the active artboard's X/Y/W/H; drawn points, #506: hovering shows where the press goes, the point lands on the other objects' anchors, centres and paths ("anchor", "center", "path") or lines up with their anchors, edges and centres ("align"), the Pen's on the path being drawn too, near a construction guide through the anchor before it on that guide (Preferences › Smart Guides › Construction Guides and Angles), and with Shift kept to its 45° step or a square's diagonal it slides along that way into line; the targets are gathered once per document state, from the art in the window, and the anchors, centres and lines near the pointer are found by bisection, so hovering never rescans the document), guides dragged out of the rulers (#451: they snap as moved guides do, Shift to the ruler's ticks; with the Artboard tool they are artboard guides, which run across their artboard only and move, copy and delete with it, `guide.add {artboard}`) that the Selection, Direct Selection and Group Selection tools then pick and drag (#414: the selected guides highlight and move together, Alt copies them, Shift snaps the dragged one to the ticks, otherwise it snaps to pixels, the grid or the edges, centres (so the sides' midpoints) and anchors of the art and the artboards, or with Smart Guides off Snap to Point pulls it onto anchors; Shift-clicked they join the selected art, and Shift-added art keeps them, so guides and art are selected together in either order, Delete then deleting both in one step; the arrow keys nudge them, Delete deletes them, dragging one back onto its ruler deletes it, Lock Guides and Hide Guides leave them alone; `guide.list`, `guide.select`, `guide.move` and `guide.remove` reach agents), a right-click on either ruler or the origin box to pick the document's units (the current one checked; `document.setUnits`, one undo step, #528), and Draw Normal / Behind / Inside modes. Smart Guides: a point drawn with the Pen or a shape tool, and an anchor dragged with Direct Selection, snaps to where paths and ruler guides cross, labelled "intersect" (#1658, part of #1602; a moved selection's own anchors don't, except the anchor the Selection tool grabbed it by). A selection the Selection tool grabs by one of its anchors snaps that anchor onto the other objects' paths ("path"), and where a path crosses another path or a ruler guide ("intersect"), in the order Direct Selection uses for a dragged anchor; when the anchor lands on a path, the selection's bounds do not also line up with other objects (#7411). The archived 2007 [user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=55) (page 49) says Smart Guides align the pointer of a moved object to existing paths. Snapping onto paths only when the selection was grabbed by an anchor is VectorCraft's own rule; a selection grabbed anywhere else still lines its bounds up. Tests: `select::tests::a_move_grabbed_by_an_anchor_lands_it_on_another_path`, `a_move_grabbed_by_an_anchor_lands_it_where_paths_cross` and `a_move_grabbed_by_an_anchor_lands_it_where_a_path_crosses_a_ruler_guide`. With Smart Guides › Measurement Labels on, the Line Segment tool labels the segment being drawn with its distance, angle and X and Y offsets (`D`, `Angle`, `dX`, `dY`), and the Pen, Curvature and Smart Pen tools label their rubber band the same way when Enable Rubber Band is on (#2983). A move that Shift keeps level, upright or diagonal stays on that line when it snaps, with the Selection, Group Selection or Direct Selection tool. It slides along the line until the selection lands on the grid or on whole pixels, lines up with the other objects or is spaced evenly with them, or until the line passes an anchor or crosses a ruler guide near the point the selection was grabbed by. A level or upright move snaps along its own axis only. Snap to Last Location: with Smart Guides on and Preferences › Smart Guides › Snap to Last Location on (off by default, VectorCraft's own choice), a selection moved by dragging with the Selection, Group Selection or Direct Selection tool, Shift too, goes back to where the move began while it is within Snapping Tolerance of it, labeled "last location"; an Alt copy is not pulled back onto its original, and with View › Snap to Grid or Snap to Pixel on the move snaps to the grid or to whole pixels instead (`prefs.set` key `snapToLastLocation`). The public [Smart Guides options](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html) page lists the option as snapping objects back to their previous position; the distance, the label, the copy rule and the grid and pixel rule are VectorCraft's own. Tests: `select::tests::snap_to_last_location_puts_a_move_back_where_it_began`, `select::tests::snap_to_pixel_wins_over_snap_to_last_location`, `direct::tests::snap_to_last_location_puts_a_path_moved_by_its_anchor_back`, `direct::tests::snap_to_pixel_wins_over_snap_to_last_location_for_a_path_moved_by_its_anchor`, `tests_prefs::snap_to_last_location_puts_a_dragged_square_back`. From 556e1552d8e074e5167a48b514fde7e440378147 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 10:54:33 -0800 Subject: [PATCH 134/247] Print: an overprinting gradient keeps the ink below where it puts none on PostScript plates A PostScript plate has no blending modes, so an overprinting gradient whose stops mix zero and nonzero ink of a plate was drawn whole on it, and its paper-white part knocked out the ink below. On a plate, the EPS writer now clips an overprinting gradient to where it puts the plate's ink down. Linear, radial and diamond gradients leave out the stretches between paper-white stops and the padding past a paper-white end stop. Conic gradients leave out their paper-white wedges, and freeform gradients leave out their paper-white cells (masked at Level 3, clipped at Level 2). Fills, strokes (within, along and across) and characters are covered, on process and spot plates. Where the gradient puts ink down it is drawn as before, and a gradient with ink everywhere is written unchanged. On PostScript plates, a stop or point of an overprinting gradient whose color counts as black, with up to half a percent of another ink, now puts none of that other ink down, as a solid fill of that color already does. PDF plates are unchanged. --- crates/eps/src/print.rs | 2 +- crates/eps/src/print/tests.rs | 188 +++++++++++++++++++++- crates/eps/src/scene.rs | 279 +++++++++++++++++++++++++++++++-- crates/pdf/src/print/plates.rs | 73 +++++++-- crates/pdf/src/tests/print.rs | 36 +++++ docs/target-app-parity.md | 1 + 6 files changed, 546 insertions(+), 33 deletions(-) diff --git a/crates/eps/src/print.rs b/crates/eps/src/print.rs index 0ccd7a6331..1c85e2cf9c 100644 --- a/crates/eps/src/print.rs +++ b/crates/eps/src/print.rs @@ -70,7 +70,7 @@ fn sheet(p: &PrintPage, job: &PrintJob) -> Result<(String, Vec<Page>), String> { } let opts = |region: Rect| EpsOptions { level: job.level, region, ..EpsOptions::default() }; let art_opts = opts(r); - let art = Scene::new(p.doc, &art_opts).run(); + let art = Scene::new(p.doc, &art_opts).on_plate(p.ink.is_some()).run(); // The marks' area: the drawing space the page shows (within the tile). let paper = Rect::new(0.0, 0.0, w, h); let shown = if p.view.determinant().abs() > 1e-12 { p.view.inverse().transform_rect_bbox(paper) } else { paper }; diff --git a/crates/eps/src/print/tests.rs b/crates/eps/src/print/tests.rs index 29e7ca0536..d3685ad5ab 100644 --- a/crates/eps/src/print/tests.rs +++ b/crates/eps/src/print/tests.rs @@ -1,9 +1,12 @@ //! PostScript print jobs: DSC page comments, the setup of each sheet, and a file the PostScript //! reader reads back. -use vectorcraft_color::{Color, Paint}; -use vectorcraft_doc::{Appearance, Document, Node, NodeId}; -use vectorcraft_geom::{Affine, Rect, shapes}; +use vectorcraft_color::{ + Color, Freeform, FreeformPoint, Gradient, GradientGeom, GradientKind, GradientPaint, GradientSpread, GradientStop, Paint, Swatch, +}; +use vectorcraft_doc::{Appearance, CharStyle, Document, Node, NodeId, NodeKind, StrokeGradientMode, TextObject}; +use vectorcraft_geom::{Affine, Point, Rect, Vec2, shapes}; +use vectorcraft_testkit::raster::{Image, render_region}; use super::*; @@ -110,3 +113,182 @@ fn separations_screens_flatness_negatives_and_tiles() { assert!(print(&[], &[], &job).is_err()); assert!(print(&[PrintPage { size: (f64::NAN, 1.0), ..page(&d, None) }], &[0], &job).is_err()); } + +/// A 200 × 100 pt CMYK document with spot swatch `Ink` (100% K): a rectangle over the whole page +/// painted `under`, when there is one, then `art`. +fn over(under: Option<Paint>, art: &[Node]) -> Document { + let mut d = Document::new(200.0, 100.0); + d.color_mode = vectorcraft_doc::ColorMode::Cmyk; + d.swatches.push(Swatch { name: "Ink".into(), paint: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 1.0)), global: true, spot: true }); + let layer = d.layers[0].id; + let under = under.map(|p| Node::path(NodeId(0), shapes::rectangle(Rect::new(0.0, 0.0, 200.0, 100.0)), Appearance::basic(p, Paint::None, 0.0))); + for mut n in under.into_iter().chain(art.iter().cloned()) { + n.id = d.alloc_id(); + d.insert(Some(layer), usize::MAX, n).unwrap(); + } + d +} + +/// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and as a PostScript +/// separation at `level` read back, both drawn at 1 px a point. +fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { + let area = Rect::new(0.0, 0.0, 200.0, 100.0); + let settings = serde_json::from_value(serde_json::json!({"output": {"mode": "separations"}})).unwrap(); + let plan = vectorcraft_pdf::plan(d, &vectorcraft_pdf::PrintOptions { settings, postscript: true, ..Default::default() }).unwrap(); + let i = plan.sheets.iter().find(|s| s.ink.as_ref().is_some_and(|p| p.name == ink)).and_then(|s| s.plate).unwrap(); + let plate = &plan.plates[i]; + let page = PrintPage { + doc: plate, + size: (200.0, 100.0), + view: Affine::IDENTITY, + window: None, + place: Affine::IDENTITY, + copies: &[], + area, + marks: None, + negative: false, + ink: Some((ink, 85.0, 15.0)), + }; + let out = print(&[page], &[0], &PrintJob { level, ..PrintJob::default() }).unwrap(); + assert!(level == Level::Three || !text(&out).contains("shfill"), "Level 2 has no smooth shadings"); + let back = crate::import(&out.bytes).unwrap().document; + (render_region(plate, area, 1.0), render_region(&back, area, 1.0)) +} + +/// Ink `ink`'s PostScript plate of `art` over a page of 100% `ink` (`under`), checked against the +/// plate of `art` alone: where `art` puts none of the ink down, the ink under it prints, and +/// where it puts ink down, its own amount prints. The pixels of the page where `art` alone puts +/// no ink, those of them where the ink under it does not print, and the pixels where `art` puts +/// ink down that do not print its amount. +fn keeps_the_ink_below(art: &[Node], under: &Paint, ink: &str, level: Level) -> (usize, usize, usize) { + let (alone, _) = plate_of(&over(None, art), ink, level); + let (_, printed) = plate_of(&over(Some(under.clone()), art), ink, level); + // Pixels whose neighbors all have paper (or all have ink) on the plate of `art` alone: an + // edge falls on either side of a pixel's center, and the edge of the inked part is lightest. + let around = |x: u32, y: u32, paper: bool| { + (x.saturating_sub(1)..=(x + 1).min(alone.width - 1)) + .all(|i| (y.saturating_sub(1)..=(y + 1).min(alone.height - 1)).all(|j| (alone.over_white(i, j)[0] >= 254) == paper)) + }; + let (mut paper, mut knocked_out, mut wrong) = (0, 0, 0); + for y in 0..alone.height { + for x in 0..alone.width { + let (a, p) = (alone.over_white(x, y)[0], printed.over_white(x, y)[0]); + if around(x, y, true) { + paper += 1; + knocked_out += usize::from(p > 60); + } else if around(x, y, false) { + wrong += usize::from(a.abs_diff(p) > 48); + } + } + } + (paper, knocked_out, wrong) +} + +/// A rectangle from (20, 10) to (180, 90) with `fill` and `stroke` (16 pt), each set to +/// overprint. +fn overprinting(fill: Paint, stroke: Paint) -> Node { + let mut n = Node::path(NodeId(0), shapes::rectangle(Rect::new(20.0, 10.0, 180.0, 90.0)), Appearance::basic(fill, stroke, 16.0)); + for it in &mut n.appearance.items { + *it.overprint_mut() = true; + } + n +} + +/// `stops` (offset, color) as a `kind` gradient placed at `geom`, spreading as `spread`. +fn gradient(kind: GradientKind, stops: &[(f32, Color)], geom: GradientGeom, spread: GradientSpread) -> Paint { + let stops = stops.iter().map(|(o, c)| GradientStop::new(*o, *c)).collect(); + let mut g = GradientPaint::new(Gradient { spread, repeats: 2, ..Gradient::new(kind, stops) }); + g.geom = Some(geom); + Paint::Gradient(Box::new(g)) +} + +#[test] +fn an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscript_plate() { + // Cyan in the outer stops, none from 0.3 to 0.6 (magenta only there). + let (inked, none) = (Color::cmyk(0.6, 0.3, 0.0, 0.0), Color::cmyk(0.0, 0.3, 0.0, 0.0)); + let stops = [(0.0, inked), (0.3, none), (0.6, none), (1.0, inked)]; + let c = Point::new(100.0, 50.0); + let around = GradientGeom { start: c, end: c + Vec2::new(70.0, -20.0), aspect: 0.7, focal: None }; + let across = GradientGeom { start: Point::new(30.0, 40.0), end: Point::new(170.0, 60.0), aspect: 1.0, focal: None }; + let pad = GradientSpread::Pad; + let fills = [ + ("linear", gradient(GradientKind::Linear, &stops, across, pad)), + ("radial", gradient(GradientKind::Radial, &stops, around, pad)), + ("off-center radial", gradient(GradientKind::Radial, &stops, GradientGeom { focal: Some(c + Vec2::new(-20.0, 10.0)), ..around }, pad)), + ("conic", gradient(GradientKind::Conic, &stops, around, pad)), + ("diamond", gradient(GradientKind::Diamond, &stops, around, pad)), + ("repeating linear", gradient(GradientKind::Linear, &stops, across, GradientSpread::Repeat)), + ("reflecting radial", gradient(GradientKind::Radial, &stops, around, GradientSpread::Reflect)), + // A hard edge: two stops at 0.5, the inked half first. + ("hard edge", gradient(GradientKind::Linear, &[(0.0, inked), (0.5, inked), (0.5, none), (1.0, none)], across, pad)), + // Starting and ending with no cyan, padding past both ends. + ("none at the ends", gradient(GradientKind::Linear, &[(0.2, none), (0.4, none), (0.5, inked), (0.8, none)], across, pad)), + ]; + // Many stretches with no cyan. + let many: Vec<(f32, Color)> = (0..16).map(|i| (i as f32 / 15.0, if i % 4 < 2 { inked } else { none })).collect(); + let fills = fills.into_iter().chain([("many stops", gradient(GradientKind::Linear, &many, across, pad))]); + let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)); + let cases: Vec<_> = fills.map(|(name, fill)| (name, overprinting(fill, Paint::None), cyan.clone(), "Cyan")).collect(); + assert_keeps_the_ink_below(&cases); +} + +/// [`keeps_the_ink_below`] for each of `cases` (a name, the art, the paint under it and the ink +/// of the plate) at Level 3 and Level 2, with every case that fails named. +fn assert_keeps_the_ink_below(cases: &[(&str, Node, Paint, &str)]) { + let mut failed = vec![]; + for (name, art, under, ink) in cases { + for level in [Level::Three, Level::Two] { + let (paper, knocked_out, wrong) = keeps_the_ink_below(std::slice::from_ref(art), under, ink, level); + if knocked_out + wrong >= 100 { + failed.push(format!("{name} at level {level:?}: {knocked_out} of {paper} knocked out, {wrong} of the others differ")); + } + } + } + assert!(failed.is_empty(), "{failed:#?}"); +} + +#[test] +fn overprinting_gradient_strokes_type_freeforms_and_spot_inks_keep_the_ink_below_on_postscript_plates() { + let (inked, none) = (Color::cmyk(0.6, 0.3, 0.0, 0.0), Color::cmyk(0.0, 0.3, 0.0, 0.0)); + let stops = [(0.0, inked), (0.3, none), (0.6, none), (1.0, inked)]; + let across = GradientGeom { start: Point::new(30.0, 40.0), end: Point::new(170.0, 60.0), aspect: 1.0, focal: None }; + let linear = gradient(GradientKind::Linear, &stops, across, GradientSpread::Pad); + let stroked = |mode: StrokeGradientMode| { + let mut n = overprinting(Paint::None, linear.clone()); + if let Some(st) = n.appearance.stroke_mut() { + st.gradient_mode = mode; + } + n + }; + // Type: a gradient placed on the characters' bounds. + let on_type = GradientPaint::new(Gradient::new(GradientKind::Linear, stops.iter().map(|(o, c)| GradientStop::new(*o, *c)).collect())); + let style = CharStyle { fill: Paint::Gradient(Box::new(on_type)), overprint_fill: true, size: 80.0, ..Default::default() }; + let text = Node::new(NodeId(0), NodeKind::Text(Box::new(TextObject::point(Point::new(20.0, 85.0), "HIM", style)))); + // A freeform gradient with wide spreads of pure color around its points: none of the cyan + // around the left one. + let mut freeform = GradientPaint::new(Gradient::new(GradientKind::Freeform, vec![GradientStop::new(0.0, none), GradientStop::new(1.0, inked)])); + let pure = |at: Point, c: Color| FreeformPoint { spread: 0.9, ..FreeformPoint::new(at, c) }; + let points = vec![pure(Point::new(50.0, 50.0), none), pure(Point::new(150.0, 50.0), inked)]; + freeform.freeform = Some(Freeform { points, ..Default::default() }); + // A spot ink's own plate: its tints in the outer stops, none of it from 0.3 to 0.6. + let tint = |t: f32| GradientStop { swatch: Some("Ink".into()), tint: t, ..GradientStop::new(0.0, Color::cmyk(0.0, 0.0, 0.0, t)) }; + let spot = [ + GradientStop { offset: 0.0, ..tint(0.8) }, + GradientStop::new(0.3, none), + GradientStop::new(0.6, none), + GradientStop { offset: 1.0, ..tint(0.5) }, + ]; + let mut on_spot = GradientPaint::new(Gradient::new(GradientKind::Linear, spot.to_vec())); + on_spot.geom = Some(across); + let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)); + let full = Paint::Solid { color: Color::cmyk(0.0, 0.0, 0.0, 1.0), swatch: Some("Ink".into()), tint: 1.0 }; + let cases = [ + ("stroke within", stroked(StrokeGradientMode::Within), cyan.clone(), "Cyan"), + ("stroke along", stroked(StrokeGradientMode::Along), cyan.clone(), "Cyan"), + ("stroke across", stroked(StrokeGradientMode::Across), cyan.clone(), "Cyan"), + ("type", text, cyan.clone(), "Cyan"), + ("freeform", overprinting(Paint::Gradient(Box::new(freeform)), Paint::None), cyan, "Cyan"), + ("spot", overprinting(Paint::Gradient(Box::new(on_spot)), Paint::None), full, "Ink"), + ]; + assert_keeps_the_ink_below(&cases); +} diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index 5bbb1c9fed..9aae8bb98c 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -8,6 +8,7 @@ use std::sync::Arc; use kurbo::Shape; use vectorcraft_color::{BlendMode, Color, GradientKind, GradientPaint, Paint}; +use vectorcraft_doc::overprint::is_white; use vectorcraft_doc::{ AppearanceItem, ColorMode, Document, Effect, ImageBlob, LineCap, LineJoin, Node, NodeKind, StrokeAlign, StrokeLayer, SymbolBoxes, TextObject, }; @@ -213,6 +214,14 @@ impl GradientSpace { GradientSpace::Inks(_, n) => *n, } } + + /// Whether components `c` in this space are paper white: no ink, or full light. + fn paper(&self, c: &[f32]) -> bool { + match self { + GradientSpace::Process(Space::Gray | Space::Rgb) => c.iter().all(|v| *v >= 1.0), + GradientSpace::Process(Space::Cmyk) | GradientSpace::Inks(..) => c.iter().all(|v| *v <= 0.0), + } + } } /// A gradient's stops as written: offsets from 0 to 1 and the components in its space. @@ -287,6 +296,12 @@ pub(crate) struct Scene<'a> { max_body: usize, /// Symbols and brush art being written inside one another. nest: u32, + /// The document is a separation's plate: every color is the gray of one ink's coverage + /// ([`Self::on_plate`]). + plate: bool, + /// The gradient being painted overprints on a plate: where it is paper white it puts none of + /// the plate's ink down, and the plate below it is left as it is ([`Self::inked_spans`]). + keep_below: bool, } impl<'a> Scene<'a> { @@ -315,9 +330,19 @@ impl<'a> Scene<'a> { pending: 0, max_body: MAX_BODY, nest: 0, + plate: false, + keep_below: false, } } + /// This scene drawing a separation's plate when `plate` is true: an overprinting gradient + /// paints only where it puts the plate's ink down, as an overprinting solid color that puts + /// none down is drawn as nothing on it. + pub fn on_plate(mut self, plate: bool) -> Self { + self.plate = plate; + self + } + /// This scene with a page body of at most `max` bytes. #[cfg(test)] pub fn with_max_body(mut self, max: usize) -> Self { @@ -689,13 +714,20 @@ impl<'a> Scene<'a> { self.line("q"); push_path(&mut self.body, bp); self.body.push_str(clip_op(rule)); - self.paint_area(p, bounds, bp.bounding_box()); + self.paint_overprinting(overprint, p, bounds, bp.bounding_box()); self.line("Q"); } } self.overprint_off(on); } + /// [`Self::paint_area`] for a fill or stroke that overprints when `overprint` is true. + fn paint_overprinting(&mut self, overprint: bool, p: &Paint, bounds: Rect, area: Rect) { + let keep = std::mem::replace(&mut self.keep_below, self.plate && overprint); + self.paint_area(p, bounds, area); + self.keep_below = keep; + } + /// Paint all of `area` (inside the current clip) with gradient or pattern `p`, placed on /// `bounds`. fn paint_area(&mut self, p: &Paint, bounds: Rect, area: Rect) { @@ -786,7 +818,7 @@ impl<'a> Scene<'a> { self.line("q"); push_path(&mut self.body, bp); self.line("strokepath W"); - self.paint_area(p, paint_bounds, w.reach(st, bounds)); + self.paint_overprinting(st.overprint, p, paint_bounds, w.reach(st, bounds)); self.line("Q"); } } @@ -1152,7 +1184,8 @@ impl<'a> Scene<'a> { /// Paint all of `area` (inside the current clip) with linear, radial, conic or diamond gradient /// `g`, placed on `bounds`: a smooth shading at Level 3, else stepped fills (a conic: wedges at - /// both levels; a diamond: four linear gradients, [`Self::diamond_quadrants`]). + /// both levels; a diamond: four linear gradients, [`Self::diamond_quadrants`]). Overprinting + /// on a plate, it is clipped to the levels where it puts ink down ([`Self::inked_spans`]). fn gradient(&mut self, g: &GradientPaint, bounds: Rect, area: Rect) { let geom = g.resolve(bounds); // One mixed around the hue wheel that reflects is repeated from its curve's stops, which @@ -1185,7 +1218,7 @@ impl<'a> Scene<'a> { } let (space, stops) = self.gradient_stops(&g.gradient); if !stops.windows(2).any(|w| w[1].0 > w[0].0) { - if let Some((_, c)) = stops.first() { + if let Some((_, c)) = stops.first().filter(|(_, c)| !(self.keep_below && space.paper(c))) { self.set_comps(&space, c); self.rect_fill(area); } @@ -1193,20 +1226,47 @@ impl<'a> Scene<'a> { } let space = &space; let smooth = self.o.level == Level::Three && !self.o.compatible_gradients; + let spans = if g.gradient.kind == GradientKind::Conic { None } else { self.inked_spans(space, &stops) }; match g.gradient.kind { GradientKind::Conic => self.conic_steps(&geom, area, space, &stops, &g.gradient), - GradientKind::Diamond => self.diamond_quadrants(&geom, area, space, &stops, smooth), + GradientKind::Diamond => { + // Its levels are diamonds about the center, the square's edge at 1. + let frame = geom.diamond_frame(); + if let Some(spans) = &spans { + let Some(frame) = frame else { + // Without a frame it is its last stop everywhere. + if stops.last().is_some_and(|(_, c)| !space.paper(c)) { + self.diamond_quadrants(&geom, area, space, &stops, smooth); + } + return; + }; + let level = |t: f64| (t > 0.0).then(|| frame * BezPath::from_vec(diamond(t))); + self.line("q"); + let clipped = self.clip_rings(spans, area.inflate(1.0, 1.0), level); + if clipped { + self.diamond_quadrants(&geom, area, space, &stops, smooth); + } + self.line("Q"); + return; + } + self.diamond_quadrants(&geom, area, space, &stops, smooth); + } GradientKind::Radial => { let r = geom.length().max(1e-6); let squash = geom.radial_squash(); let inv = squash.inverse(); let (f, c) = (inv * geom.focal_point(), geom.start); + let local = inv.transform_rect_bbox(area); self.line("q"); let _ = writeln!(self.body, "{} cm", ps::matrix(squash)); - if smooth { - self.shading(3, space, &[f.x, f.y, 0.0, c.x, c.y, r], &stops); - } else { - self.radial_steps(f, c, r, inv.transform_rect_bbox(area), space, &stops); + // Its levels are circles from the focal point, at 1 the circle of radius `r`. + let level = |t: f64| (t > 0.0).then(|| kurbo::Circle::new(f + (c - f) * t, r * t).to_path(0.01)); + if spans.as_ref().is_none_or(|spans| self.clip_rings(spans, local.inflate(1.0, 1.0), level)) { + if smooth { + self.shading(3, space, &[f.x, f.y, 0.0, c.x, c.y, r], &stops); + } else { + self.radial_steps(f, c, r, local, space, &stops); + } } self.line("Q"); } @@ -1215,15 +1275,121 @@ impl<'a> Scene<'a> { if s.distance(e) < 1e-9 { e = s + Vec2::new(1.0, 0.0); } - if smooth { - self.shading(2, space, &[s.x, s.y, e.x, e.y], &stops); + if let Some(spans) = &spans { + self.line("q"); + if self.clip_strips(spans, s, e, area) { + self.linear(s, e, area, space, &stops, smooth); + } + self.line("Q"); } else { - self.linear_steps(s, e, area, space, &stops); + self.linear(s, e, area, space, &stops, smooth); } } } } + /// A linear gradient from `s` to `e` over `area`: a smooth shading, else stepped fills. + fn linear(&mut self, s: Point, e: Point, area: Rect, space: &GradientSpace, stops: &[(f64, Vec<f32>)], smooth: bool) { + if smooth { + self.shading(2, space, &[s.x, s.y, e.x, e.y], stops); + } else { + self.linear_steps(s, e, area, space, stops); + } + } + + /// Where an overprinting gradient with `stops` in `space` puts ink on a plate + /// ([`Self::keep_below`]): the spans of its levels outside every stretch between two stops of + /// paper white and outside the padding past an end whose stop is paper white, in order, an + /// end padding with ink unbounded. `None` when the gradient puts ink everywhere or does not + /// overprint on a plate; empty when it puts none down. + fn inked_spans(&self, space: &GradientSpace, stops: &[(f64, Vec<f32>)]) -> Option<Vec<(f64, f64)>> { + if !self.keep_below { + return None; + } + let stretches: Vec<_> = stops.windows(2).filter(|w| w[1].0 > w[0].0).collect(); + let (first, last) = (stretches.first()?, stretches.last()?); + // The padding takes the end stop's color stepped and the end stretch's color smooth. + let before = stops.first().is_some_and(|s| space.paper(&s.1)) && space.paper(&first[0].1); + let after = stops.last().is_some_and(|s| space.paper(&s.1)) && space.paper(&last[1].1); + let mut blank: Vec<(f64, f64)> = vec![]; + let mut add = |a: f64, b: f64| match blank.last_mut() { + Some(l) if l.1 >= a => l.1 = l.1.max(b), + _ => blank.push((a, b)), + }; + if before { + add(f64::NEG_INFINITY, first[0].0); + } + for w in &stretches { + if space.paper(&w[0].1) && space.paper(&w[1].1) { + add(w[0].0, w[1].0); + } + } + if after { + add(last[1].0, f64::INFINITY); + } + if blank.is_empty() { + return None; + } + let mut inked = vec![]; + let mut from = f64::NEG_INFINITY; + for (a, b) in blank { + if a > from { + inked.push((from, a)); + } + from = b; + } + if from < f64::INFINITY { + inked.push((from, f64::INFINITY)); + } + Some(inked) + } + + /// Clip to the parts of `area` where a linear gradient from `s` to `e` has a level in `spans`: + /// a strip across the gradient for each. False, with nothing written, when no span reaches + /// into `area`. + fn clip_strips(&mut self, spans: &[(f64, f64)], s: Point, e: Point, area: Rect) -> bool { + let d = e - s; + let len = d.hypot(); + // Gradient space: x along the gradient (0 to 1), y across it in points. + let frame = Affine::new([d.x, d.y, -d.y / len, d.x / len, s.x, s.y]); + let local = frame.inverse().transform_rect_bbox(area.inflate(1.0, 1.0)); + let mut bp = BezPath::new(); + for &(a, b) in spans { + let (a, b) = (a.max(local.x0), b.min(local.x1)); + if a < b { + bp.extend((frame * Rect::new(a, local.y0, b, local.y1).to_path(0.1)).iter()); + } + } + self.clip_path(&bp, FillRule::NonZero) + } + + /// Clip to the levels in `spans` of a gradient whose level `t` is bounded by `level(t)` (a + /// closed path holding every lower level; `None` for a level without area): for each span + /// the ring between its levels, an unbounded end at `outer`, even-odd. False, with nothing + /// written, when no span has area. + fn clip_rings(&mut self, spans: &[(f64, f64)], outer: Rect, level: impl Fn(f64) -> Option<BezPath>) -> bool { + let mut bp = BezPath::new(); + for &(a, b) in spans { + let edge = if b.is_finite() { level(b) } else { Some(outer.to_path(0.1)) }; + let Some(edge) = edge else { continue }; + bp.extend(edge.iter()); + if let Some(inner) = level(a).filter(|_| a.is_finite()) { + bp.extend(inner.iter()); + } + } + self.clip_path(&bp, FillRule::EvenOdd) + } + + /// Clip to `bp` by `rule`. False, with nothing written, when `bp` is empty. + fn clip_path(&mut self, bp: &BezPath, rule: FillRule) -> bool { + if bp.elements().is_empty() { + return false; + } + push_path(&mut self.body, bp); + self.body.push_str(clip_op(rule)); + true + } + /// A conic gradient as [`CONIC_WEDGE_COUNT`] solid wedges about its center covering `area` /// (PostScript has no conic shading), each running on to the seam under the next, so no /// hairline shows between neighbors ([`vectorcraft_color::GradientGeom::conic_wedges`]). @@ -1243,7 +1409,24 @@ impl<'a> Scene<'a> { Some(w) => w[1].1.clone(), None => stops.last().map_or_else(Vec::new, |s| s.1.clone()), }; - for (pts, t) in geom.conic_wedges(area, g.conic_wedge_count(CONIC_WEDGE_COUNT), true) { + let count = g.conic_wedge_count(CONIC_WEDGE_COUNT); + // Overprinting on a plate: clipped to the wedges that put ink down, each up to the next. + let clipped = self.keep_below && { + let wedges = geom.conic_wedges(area, count, false); + let inked: Vec<_> = wedges.iter().filter(|(_, t)| !space.paper(&at(spread(*t)))).collect(); + if inked.is_empty() { + return; + } + inked.len() < wedges.len() && { + let mut bp = BezPath::new(); + for (pts, _) in inked { + bp.extend(BezPath::from_vec(polygon(pts)).iter()); + } + self.line("q"); + self.clip_path(&bp, FillRule::NonZero) + } + }; + for (pts, t) in geom.conic_wedges(area, count, true) { self.set_comps(space, &at(spread(t))); for (i, p) in pts.iter().enumerate() { push_nums(&mut self.body, &[p.x, p.y]); @@ -1251,6 +1434,9 @@ impl<'a> Scene<'a> { } self.line("closepath fill"); } + if clipped { + self.line("Q"); + } } /// A diamond gradient over `area` as four linear gradients, each clipped to a quadrant of its @@ -1442,20 +1628,68 @@ impl<'a> Scene<'a> { let field = g.freeform_on(b).model_field(spread_scale(b)); let q = |v: f32| (unit(v) * 255.0).round() as u8; let (w, h) = (u32::from(cols), u32::from(rows)); + // Overprinting on a plate: the cells of paper white put none of the ink down, so they are + // left out, as clear pixels at Level 3 and outside a clip of the other cells at Level 2. + let blank: Option<Vec<bool>> = self.keep_below.then(|| field.grid(area, cols, rows).map(|(c, _)| is_white(&Paint::solid(c))).collect()); + let blank = blank.filter(|b| b.contains(&true)); + if blank.as_ref().is_some_and(|b| !b.contains(&false)) { + return; + } + let keyed = self.o.level == Level::Three; + let clear = |i: usize, a: u8| if keyed && blank.as_ref().is_some_and(|b| b[i]) { 0 } else { a }; let image = if field.model() == Some(Model::Cmyk) || (self.cmyk && field.model() == Some(Model::Gray)) { let inks: Vec<u8> = field .grid(area, cols, rows) - .flat_map(|(color, a)| { + .enumerate() + .flat_map(|(i, (color, a))| { let [c, m, y, k] = color.to_cmyk(); - [q(c), q(m), q(y), q(k), q(a)] + [q(c), q(m), q(y), q(k), clear(i, q(a))] }) .collect(); self.encode_inks(&inks, w, h) } else { - let rgba: Vec<u8> = field.display_grid(area, cols, rows).flat_map(|(c, a)| [q(c[0]), q(c[1]), q(c[2]), q(a)]).collect(); + let rgba: Vec<u8> = + field.display_grid(area, cols, rows).enumerate().flat_map(|(i, (c, a))| [q(c[0]), q(c[1]), q(c[2]), clear(i, q(a))]).collect(); self.encode_image(&rgba, w, h) }; let Some(image) = image else { return }; + let cells = blank.filter(|_| !keyed).map(|b| { + let (cw, ch) = (area.width() / f64::from(cols), area.height() / f64::from(rows)); + let mut bp = BezPath::new(); + for (row, line) in b.chunks(usize::from(cols)).enumerate() { + let mut col = 0; + while col < line.len() { + let start = col; + while col < line.len() && !line[col] { + col += 1; + } + if col > start { + let (y0, y1) = (area.y0 + row as f64 * ch, area.y0 + (row + 1) as f64 * ch); + bp.extend(Rect::new(area.x0 + start as f64 * cw, y0, area.x0 + col as f64 * cw, y1).to_path(0.1).iter()); + } + col += 1; + } + } + bp + }); + if let Some(bp) = &cells { + // Each row's run of cells is a rectangle of five path elements, about 60 bytes. + if self.size().saturating_add(bp.elements().len().saturating_mul(12)).saturating_add(image.inline_len) > self.max_body { + self.warn(TOO_LARGE); + return; + } + self.line("q"); + self.clip_path(bp, FillRule::NonZero); + } + self.place_field(image, place); + if cells.is_some() { + self.line("Q"); + } + } + + /// Place freeform gradient image `image` on the unit square mapped by `place`, drawn from an + /// image already kept when one is encoded the same. + fn place_field(&mut self, image: ImageCode, place: Affine) { let key = image.content_key(); let found = self.fields.get(&key).and_then(|bucket| bucket.iter().copied().find(|&i| self.codes.get(i).is_some_and(|c| c.same_image(&image)))); @@ -1849,6 +2083,19 @@ fn image_code(prelude: String, dict: String, filter: &'static str, op: &'static code } +/// The closed polygon through `pts`. +fn polygon(pts: &[Point]) -> Vec<kurbo::PathEl> { + let mut els: Vec<kurbo::PathEl> = + pts.iter().enumerate().map(|(i, p)| if i == 0 { kurbo::PathEl::MoveTo(*p) } else { kurbo::PathEl::LineTo(*p) }).collect(); + els.push(kurbo::PathEl::ClosePath); + els +} + +/// The square with corners (±`t`, 0) and (0, ±`t`). +fn diamond(t: f64) -> Vec<kurbo::PathEl> { + polygon(&[Point::new(t, 0.0), Point::new(0.0, t), Point::new(-t, 0.0), Point::new(0.0, -t)]) +} + /// `a` to `b` at `t`. fn mix(a: &[f32], b: &[f32], t: f32) -> Vec<f32> { a.iter().zip(b).map(|(x, y)| x + (y - x) * t).collect() diff --git a/crates/pdf/src/print/plates.rs b/crates/pdf/src/print/plates.rs index 74102373e5..6cf3dcc289 100644 --- a/crates/pdf/src/print/plates.rs +++ b/crates/pdf/src/print/plates.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use vectorcraft_color::cms::{self, Cms, Model, ProfileKind}; use vectorcraft_color::swatch::REGISTRATION; -use vectorcraft_color::{BlendMode, Color, GradientKind, Paint}; +use vectorcraft_color::{BlendMode, Color, GradientKind, GradientStop, Paint}; use vectorcraft_doc::inks::{Link, StopPlates, inks, plates, spot_color, stop_inks, visit_node_colors}; use vectorcraft_doc::overprint::{darken_overprints, is_black_ink, is_white}; use vectorcraft_doc::{AppearanceItem, ColorMode, Document, ImageBlob, Node, NodeKind}; @@ -174,33 +174,74 @@ impl<'a> Separator<'a> { /// spot swatch, to Registration or to a swatch the document lacks: up to the half a percent of /// another ink such a black may carry counts as none. fn no_ink(&self, plate: &str, p: &Paint) -> bool { - let process = |swatch: Option<&str>| swatch.is_none_or(|n| n != REGISTRATION && self.doc.swatch(n).is_some_and(|w| !w.spot)); - let none = |c: &Color, process: bool, ink: f32| ink <= 0.0 || (self.postscript && process && ink <= 0.005 && is_black_ink(c, 1.0, false)); match p { Paint::Solid { color, swatch, tint } => { - none(color, process(swatch.as_deref()), self.ink(plate, color, swatch.as_deref().map(|s| (s, *tint)))) + self.none(color, self.process(swatch.as_deref()), self.ink(plate, color, swatch.as_deref().map(|s| (s, *tint)))) } Paint::Gradient(g) => match g.freeform.as_ref().filter(|f| g.gradient.kind == GradientKind::Freeform && !f.points.is_empty()) { - Some(f) => f.points.iter().all(|pt| none(&pt.color, true, self.ink(plate, &pt.color, None))), - None => { - !g.gradient.stops.is_empty() - && g.gradient.stops.iter().all(|s| { - let ink = self.stop_ink(plate, &s.color, s.swatch.as_deref().map(|n| (n, s.tint)), s.plates); - none(&s.color, s.plates.is_none() && process(s.swatch.as_deref()), ink) - }) - } + Some(f) => f.points.iter().all(|pt| self.point_none(plate, &pt.color)), + None => !g.gradient.stops.is_empty() && g.gradient.stops.iter().all(|s| self.stop_none(plate, s)), }, _ => false, } } + /// Whether a color linked to swatch `swatch` separates as process inks: no link, or a link + /// to a process swatch the document has, other than Registration. + fn process(&self, swatch: Option<&str>) -> bool { + swatch.is_none_or(|n| n != REGISTRATION && self.doc.swatch(n).is_some_and(|w| !w.spot)) + } + + /// Whether `ink` of color `c` (separating as process inks when `process` is true) counts as + /// none, as [`Self::no_ink`] says. + fn none(&self, c: &Color, process: bool, ink: f32) -> bool { + ink <= 0.0 || (self.postscript && process && ink <= 0.005 && is_black_ink(c, 1.0, false)) + } + + /// Whether gradient stop `s` puts none of ink `plate` down, as [`Self::no_ink`] says. + fn stop_none(&self, plate: &str, s: &GradientStop) -> bool { + let ink = self.stop_ink(plate, &s.color, s.swatch.as_deref().map(|n| (n, s.tint)), s.plates); + self.none(&s.color, s.plates.is_none() && self.process(s.swatch.as_deref()), ink) + } + + /// Whether a freeform gradient's point of color `c` puts none of ink `plate` down, as + /// [`Self::no_ink`] says. + fn point_none(&self, plate: &str, c: &Color) -> bool { + self.none(c, true, self.ink(plate, c, None)) + } + + /// On a PostScript plate, make paper white the stops and points of overprinting gradient `p` + /// that put none of ink `plate` down while others do ([`Self::no_ink`]'s rule for each): the + /// writer leaves the plate below as it is where the gradient is paper white. + fn clear_inkless_stops(&self, plate: &str, p: &mut Paint) { + let Paint::Gradient(g) = p else { return }; + if !self.postscript { + return; + } + let paper = Color::Gray { k: 0.0 }; + match g.freeform.as_mut().filter(|f| g.gradient.kind == GradientKind::Freeform && !f.points.is_empty()) { + Some(f) => { + for pt in f.points.iter_mut().filter(|pt| self.point_none(plate, &pt.color)) { + pt.color = paper; + } + } + None => { + for s in g.gradient.stops.iter_mut().filter(|s| self.stop_none(plate, s)) { + *s = GradientStop { color: paper, swatch: None, tint: 1.0, plates: None, ..s.clone() }; + } + } + } + } + /// Overprinting fills and strokes of `a`'s subtree with a Normal blending mode, and /// overprinting character fills and strokes, that put none of ink `plate` down leave its plate /// as it is: they are drawn as nothing on it (white ones with `discard_white` aside, which /// knock out). A writer without blending modes (PostScript) then keeps the ink below them, /// where it would draw their Darken as a knockout. One that puts any ink down is drawn, and on /// a PostScript plate its ink replaces the ink below, as a nonzero component of an overprinting - /// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2). + /// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2). On a + /// PostScript plate, the stops and points of such a gradient that put none of the ink down + /// become paper white ([`Self::clear_inkless_stops`]), which the writer leaves out there. fn clear_inkless_overprints(&self, plate: &str, a: &mut Arc<Node>, discard_white: bool) { let inkless = |overprint: bool, p: &Paint| overprint && !p.is_none() && !(discard_white && is_white(p)) && self.no_ink(plate, p); let n = Arc::make_mut(a); @@ -211,15 +252,21 @@ impl<'a> Separator<'a> { }; if normal && inkless(it.overprint(), it.paint()) { *it.paint_mut() = Paint::None; + } else if normal && it.overprint() { + self.clear_inkless_stops(plate, it.paint_mut()); } } if let NodeKind::Text(t) = &mut n.kind { for r in &mut t.runs { if inkless(r.style.overprint_fill, &r.style.fill) { r.style.fill = Paint::None; + } else if r.style.overprint_fill { + self.clear_inkless_stops(plate, &mut r.style.fill); } if inkless(r.style.overprint_stroke, &r.style.stroke) { r.style.stroke = Paint::None; + } else if r.style.overprint_stroke { + self.clear_inkless_stops(plate, &mut r.style.stroke); } } } diff --git a/crates/pdf/src/tests/print.rs b/crates/pdf/src/tests/print.rs index 49a34ff428..9b9c5ec92e 100644 --- a/crates/pdf/src/tests/print.rs +++ b/crates/pdf/src/tests/print.rs @@ -925,6 +925,42 @@ fn overprinting_paints_keep_their_faint_ink_on_postscript_plates() { } } +#[test] +fn a_near_black_stop_of_an_overprinting_gradient_puts_no_cyan_on_postscript_plates() { + // 0.4% cyan beside 100% K counts as black on a PostScript plate stop by stop, as a solid fill + // of it does: the cyan plate draws that stop of an overprinting gradient as paper white. A + // PDF plate and a gradient that does not overprint keep the 0.4%. + let stops = vec![GradientStop::new(0.0, Color::cmyk(0.004, 0.0, 0.0, 1.0)), GradientStop::new(1.0, Color::cmyk(0.5, 0.0, 0.0, 0.0))]; + let fade = Paint::Gradient(Box::new(GradientPaint::new(Gradient::new(GradientKind::Linear, stops)))); + let square = |x: f64, overprint: bool| { + let r = shapes::rectangle(Rect::new(x, 15.0, x + 20.0, 35.0)); + let mut n = Node::path(vectorcraft_doc::NodeId(0), r, Appearance::basic(fade.clone(), Paint::None, 0.0)); + if let Some(f) = n.appearance.fill_mut() { + f.overprint = overprint; + } + n + }; + let d = over_cyan(vec![square(10.0, true), square(40.0, false)]); + // The cyan plate's stops of each gradient, in thousandths of the ink. + let stops = |postscript: bool| { + let opts = PrintOptions { settings: settings(json!({"output": {"mode": "separations"}})), postscript, ..Default::default() }; + let p = plan(&d, &opts).unwrap(); + let mut all = vec![]; + p.plates[0].walk(|n| { + if let Some(Paint::Gradient(g)) = n.appearance.fill().map(|f| &f.paint) { + let gray = |s: &GradientStop| match s.color { + Color::Gray { k } if s.swatch.is_none() => (k * 1000.0).round(), + c => panic!("{c:?}"), + }; + all.push(g.gradient.stops.iter().map(gray).collect::<Vec<_>>()); + } + }); + all + }; + assert_eq!(stops(true), [[0.0, 500.0], [4.0, 500.0]], "PostScript: the overprinting gradient, the other"); + assert_eq!(stops(false), [[4.0, 500.0], [4.0, 500.0]], "PDF"); +} + #[test] fn overprinting_type_leaves_the_inks_below_on_separations() { let style = vectorcraft_doc::CharStyle { fill: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 1.0)), ..Default::default() }; diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..f3e39caba1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2067,6 +2067,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Desktop print transport uses `craft-print` for CUPS and modern Windows. Sheet composition, copies, separations and colour management remain in VectorCraft. The Print dialog's Media list also carries the Japanese papers — JIS B4 257 × 364 mm, JIS B5 182 × 257 mm and JIS B6 128 × 182 mm beside the ISO B4/B5 (250 × 353 and 176 × 250 mm, kept so settings and presets saved before them keep their paper), and はがき 100 × 148 mm, 往復はがき 148 × 200 mm, 封筒 長形3号 120 × 235 mm, 長形4号 90 × 225 mm, 角形2号 240 × 332 mm, 角形3号 216 × 277 mm and 四六判 127 × 188 mm; the JSON id or the dialog label names a paper, any case and spacing (`B5 (JIS)` or `b5jis`) (`crates/pdf/src/print/settings.rs`, `crates/pdf/src/tests/print.rs`). The print-preview and physical-device fidelity gaps remain, so print scores and hours are unchanged. - The Print dialog's Document Ink Options list shows an icon before each spot ink's name, and a click on it prints that one ink as process inks (on the Cyan, Magenta, Yellow and Black plates, with no plate of its own) or as a spot ink again, as [the help page](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) describes for single spot colors. Other spot inks keep their plates, and spot gradient stops and DCS images' spot plates follow each ink's choice (`print.setup {settings: {output: {inks: [{name, convertToProcess: true}]}}}`, kept with the document and in print presets; `print.preview` lists every ink as `documentInks`). These are VectorCraft's own rules: Convert All Spot Colors to Process converts every spot ink and dims the icons while keeping each ink's own choice, a converted ink's Print, Frequency and Angle are dimmed and kept, and process inks and Registration have no icon. Evidence: `print::one_spot_ink_converts_to_process_and_the_others_keep_their_plates`, `print::converting_every_spot_ink_overrides_and_keeps_each_inks_own_choice`, `print::a_spot_gradient_stop_prints_its_process_plates`, `cmykimages::a_dcs_image_converts_only_the_spot_ink_chosen`, `tests::print::a_spot_ink_converted_to_process_is_saved_and_listed_without_a_plate`, `dialogs::tests_print::a_spot_inks_icon_converts_it_to_process_and_back`. Print scores and hours are unchanged. - The Print dialog's Output section has Overprint Black under Convert All Spot Colors to Process, off by default and available with Separations ([Print color separations](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) lists it among the separation options): black art then leaves the inks under it on the other plates (`print.setup {settings: {output: {overprintBlack: true}}}`, kept with the document and in print presets). Solid 100% K or 100% gray fills, strokes and characters (to within half a percent, as Edit › Edit Colors › Overprint Black counts them), and gradients whose every stop (every color point of a freeform gradient) is, overprint; rich, RGB, Lab, spot-linked and lighter blacks are not marked, paints already set to overprint keep that setting, and only the printed copy is marked. These limits are VectorCraft's own rules. Characters set to overprint now also leave the inks below them on printed PDF plates, a type object's own fill in a PDF is drawn with its blending mode, and Edit › Edit Colors › Overprint Black counts a gradient with a stop linked to a spot swatch as a spot black, as it counts a solid one, and a freeform gradient by the color points it draws from. On a plate, an overprinting paint that puts none of that plate's ink down is drawn as nothing; on PostScript plates so is up to half a percent of another ink in a color that counts as black, and any other faint ink stays on the plate. Evidence: `print::overprint_black_keeps_the_inks_under_solid_black_on_separations`, `print::overprint_black_keeps_the_cyan_under_near_and_freeform_blacks_on_postscript_plates`, `print::overprinting_paints_keep_their_faint_ink_on_postscript_plates`, `print::overprinting_type_leaves_the_inks_below_on_separations`, `print::a_type_objects_own_black_fill_overprints_on_separations`, `tests::print::overprint_black_is_saved_with_the_setup_and_in_presets`, `overprint::tests::a_gradient_with_a_spot_linked_stop_is_black_only_with_spot`, `overprint::tests::a_freeform_gradient_is_black_when_every_point_is`. Print scores and hours are unchanged. + - On a PostScript plate, an overprinting gradient that puts the plate's ink down in some places and none in others leaves the ink below where it puts none: the stretches between stops of paper white and the padding past an end stop of paper white are clipped out of a linear, radial or diamond gradient, the wedges of paper white out of a conic one, and the cells of paper white out of a freeform one (masked at Level 3, clipped at Level 2). This holds for fills, strokes and characters, and on spot plates. Where the gradient puts ink down, its amount replaces the ink below as before. A stop or point with up to half a percent of another ink in a color that counts as black puts none down, as a solid fill of that color does. PDF plates are unchanged. These are VectorCraft's own rules. Evidence: `print::tests::an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscript_plate` and `print::tests::overprinting_gradient_strokes_type_freeforms_and_spot_inks_keep_the_ink_below_on_postscript_plates` (`vectorcraft-eps`), `tests::print::a_near_black_stop_of_an_overprinting_gradient_puts_no_cyan_on_postscript_plates`. - The Print dialog's General section (and the print preset editor) has a link button after Scale W and H, as the Custom scale has one on [the help page](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/print-documents-in-illustrator.html), where turning it off scales the width and height apart. While it is on, typing either percentage sets the other, and turning it on sets H to W. It is on for new settings, dimmed with the fields unless Scaling is Custom or a tiling choice, toggled with a click, Space or Enter, and named with its on or off state for screen readers. W and H take 1–1000% in the fields. The link is kept with the document's print settings and in print presets (`print.setup {settings: {scale: {linked}}}`); settings saved without it read it as off, so they print as before. Its default, the tiling choices and the agent rules are VectorCraft's own. Evidence: `print::the_scale_link_is_on_for_new_settings_and_off_for_a_saved_scale_without_it`, `tests::print::the_scale_link_keeps_width_and_height_equal`, `tests::print::a_scale_saved_without_the_link_keeps_its_width_and_height`, `dialogs::tests_print::the_scale_link_keeps_scale_width_and_height_equal`, `dialogs::tests_print::a_print_preset_keeps_the_scale_link`. Print scores and hours are unchanged. - A PDF, PDF-compatible `.ai` or `.ait` opened from its pages or its editing copy opens with the File Info that its XMP packet and its document information dictionary give: the title (`dc:title`, its `x-default` item first, else Info `Title`), the author, description, keywords, copyright status, notice and URL, and the created and modified dates, the XMP packet's value where both give one (`crates/pdf/src/tests/file_info.rs`, `crates/engine/src/tests/fileinfo.rs`). An SVG opens with the title of its root `<title>`. The title is File Info's alone (`DocMetadata::title`): the document's name stays the file's name with its extension, a file that gives no title leaves File Info with that name, and exports (PDF, SVG, PNG, EPS, `.ai`) and native saves carry it; changing the title in File Info sets the document's name as before (#3626). - PDF export and PDF-compatible `.ai` and `.ait` saves write the document's File Info created date as the file's creation date, or the time of writing when the document has none, and the time of writing as its modification date; the page information mark still prints the time of writing (`crates/engine/src/tests/fileinfo.rs`, `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/marks.rs`). From d360c176ea1005a0765c93127fb3520aa54ceecb Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 00:33:26 +0530 Subject: [PATCH 135/247] docs: drop shipped Dimension tool, Touch Type and Snap to Glyph from the gap lists (#8387) --- docs/gaps.md | 20 ++++++++++++-------- docs/target-app-parity.md | 17 +++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/docs/gaps.md b/docs/gaps.md index a6f6defbb0..ebf74d4f16 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing (#8387); estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -466,7 +466,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Missing:** CJK vertical composition (custom mojikumi sets and the Mojikumi Settings dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern features beyond bidi, digit types, Character Direction and Kashidas (a split caret; the Middle Eastern & South Asian composers are done, #4935), - Touch Type, Retype, Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). + Retype; optional preservation of font sizes during group scaling (#1034 enhancement). Itemized in [type-parity.md](type-parity.md). - **Impact:** professional typography and Japanese/Chinese publishing. - **Estimate:** 34–47 h (type core 14–19 h blocks beta). @@ -603,13 +603,16 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi deletes saved ones; `gradient.presets.*` commands. - **Improved (#6164):** Control bar › Snapping also exposes the existing Snap to Glyph and Alignment Guides toggles through their existing commands. Floating-panel parity remains unverified; the estimate is unchanged. -- **Missing:** the consolidated - snapping options (30.0); artboard colors in exports and print, and managing artboards from the canvas other - than locking and unlocking them from the Artboard tool's right-click menu (30.0); the Blend panel with ease - in/out and separate colour acceleration (30.7); - the Dimension tool (28.x). +- **Missing:** the rest of the snapping enhancements (29.8.1): forced snapping to the grid, showing guides while + snapping, and limiting snapping to the active artboard or to isolated objects (the Control bar's Snapping quick + access, the Smart Guides snapping tolerance, and 30.0's Snap to Tangent and Snap to Perpendicular are done; the + reworked Snap to Grid and Snap to Pixel feedback is not yet checked); artboard colors in exports and print, and + managing artboards from the canvas other than locking and unlocking them from the Artboard tool's right-click + menu (30.0); the Blend panel with ease in/out and separate colour acceleration (30.7). The Dimension tool (28.x) + is done ([dimensions.md](dimensions.md)). - **Evidence:** Adobe's 30.0 and 30.7 release announcements, see - [target-app-parity.md](target-app-parity.md#how-this-was-measured-2026-10-10). + [target-app-parity.md](target-app-parity.md#how-this-was-measured-2026-10-10); snapping: + [Snapping enhancements in Illustrator](https://community.adobe.com/announcements-651/snapping-enhancements-in-illustrator-1546614). - **Estimate:** 13–23 h. - **Estimate:** 14–24 h. @@ -902,6 +905,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | G4 and G13 Missing lists drop the shipped Touch Type (`text.touchType`), Snap to Glyph (`view.snapToGlyph`) and Dimension tool; G13's snapping entry keeps only what is still missing (#8387); estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | | 2026-11-14 | minor | Type: Middle Eastern & South Asian and Standard composers per paragraph (#4935): Paragraph panel menu, paragraph styles, `text.setFormat {composer}` and the native file; the Standard composers set Indic, Arabic and Hebrew type glyph by glyph. `.ai`, EPS and PDF files carry no composer. Scores and estimates unchanged. | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..9193764863 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Drawing tools and Type advanced rows drop the shipped Touch Type and Dimension tool from their missing items (#8387); scores and hours unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -228,8 +228,8 @@ tests and the CI gate. See [Calibration](#calibration). and Marker; 353 and 22, 94.1%, after Extrude & Bevel, Inflate and Rotate. - Engine commands: ~710 ids registered with `cmd!` across `crates/engine/src/cmd` (plus macro-generated families), and 85 UI-only commands (`UI_COMMANDS`). - - Tools: 91 in `crates/tools/src/catalog.rs`; Touch Type is listed but not implemented, and the Dimension - tool (added in Illustrator 28.x) is absent. + - Tools: 91 in `crates/tools/src/catalog.rs`; Touch Type was listed but not implemented, and the Dimension + tool (added in Illustrator 28.x) was absent; both have since shipped (#8387). - Effects catalogue (`crates/effects/src/lib.rs`): see [effects-parity.md](effects-parity.md). - Tests: 4,924 `#[test]` functions plus 40 property-test blocks (was "~2,840" in the last estimate). ~354k lines of Rust (was ~221k on 2026-10-07). @@ -252,22 +252,22 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Area | Weight | Done | Main gaps | One agent (h) | Kind | |---|---:|---:|---|---:|---| | Selection, transform & align tools | 6 | 85% | Direct Selection segment click/Delete corrected (#1278); deletion splits an ordinary contour into selected sibling objects with bounds-fitted gradients kept in place (#3380, deletion only; `crates/engine/tests/it/delete_path_pieces.rs`); open-path anchor Delete keeps gaps; Select › Start Global Edit finds the paths, compound paths and symbol instances of the selected object's shape (Appearance, Size and artboard options) and gives an edit of one to all of them in proportion, as one undo step (#3521), and on a group the groups like it, an edit inside one reaching the same object in the others (#4939), and a Shift-click on a highlighted match leaves it out; the Align panel menu's Align to Glyph Bounds › Point Text and Area Text measure type by its glyphs' ink for Align and Distribute (#4231); remaining: Free Transform/Scale/Reflect along a rotated box, Global Edit of rotated copies, transform nuances (no-op anchor Align history regression-tested, #1180 follow-up) | 4–6 | estimated; Global Edit regression-tested (`crates/engine/src/tests/globaledit.rs`; Quick Action, menu label and Escape in `panels::properties::tests::start_global_edit_quick_action_and_escape`) | -| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options, Touch Type, Dimension tool; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged | +| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 80% | Shape Builder on the reporter's file (#937: art past 4,096 segments is cut by lines again; unconfirmed on the file itself); gap detection shares Live Paint’s finder, with a 72 pt custom cap and the existing options; Live Paint Gap Options | 4–8 | estimated; Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog (lowered from 86%: open issues); compound attributes regression-tested (#1197); single-result source names survive SVG export/import (#1293), with [SVG ID semantics](https://www.w3.org/TR/SVG2/struct.html#IDAttribute) and original-shape tests; Simplify component selection and preview regression-tested (#1272); Simplify of a Direct Selection part of a path regression-tested (`tests/simplify_part.rs`); Divide open-cutting-path geometry and appearance regression-tested (#1307); the Shape Builder's edge-source grid is bounded in memory and files a segment once per cell (`planar.rs` test `rect_index_holds_a_bounded_number_of_references`); live compound shapes (Make, Alt-click, member Shape Modes, Release, Expand, saved and exported) regression-tested (#4522); Live Paint Bucket face drags, including narrow faces and one Undo, regression-tested (#6373) | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 92% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Eyedropper copies effective character dimensions across text transforms (#6404); 30.0's gradient additions are done (dither, perceptual blending, presets); freeform gradients in SVG/PDF, mixed spot/process gradients in SVG, PDF gradients mixing a spot color with RGB or Lab stops, and dithered spot gradient fills and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, which PDF export writes as images in process colors| 4–7 | estimated; Recolor model selection is available through the engine and MCP (#2520), and the dialog's color sliders (HSB, RGB, CMYK, Lab, Tint for a spot color) edit the selected row's new color in its mode, and the Edit tab's Global Adjust sliders (Saturation, Brightness, Temperature, Luminosity, -100% to 100%) change every recolored color at once (lowered from 96%: target moved); unpainted zero-width stroke restoration fixed (#1253), score and hours unchanged; Eyedropper source reads regression-tested (#1251); screen-bounded Recolor Edit chip list (#3416), score and hours unchanged; a point on a gradient mesh's outline locates on its edge on every side (#7006: `mesh_locate_takes_a_point_on_any_side_of_the_outline`, `mesh_add_line_exactly_on_the_edge_needs_no_tolerance`), score and hours unchanged; Color panel spectrum grows with the resized panel (#8005) | | Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (ten generated libraries including Tech Circuit, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media, User Defined, Other Library…, Save Brushes); Art brush Overlap and Pattern brush auto corners are done; remaining: pen pressure on macOS, Stylus Wheel, more built-in brush libraries, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | estimated; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed; evidence below; finite-arithmetic follow-up regressions and full CI passed (evidence below) | | Appearance, transparency, graphic styles, masks | 5 | 97% | raster effect reach in preview bounds | 1–2 | estimated; Transform typing, sliders, preview, and undo are covered in `crates/ui-egui/src/panels/tests_appearance.rs` | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, painter visibility); materials, light presets, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | | Type core | 9 | 80% | Auto-leading style resets are implemented; Hyphenation… and Justification… options are done (#2310, #2755), and a paragraph's Auto Leading also sets the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; remaining: Optical Margin Alignment, Middle Eastern features beyond bidi layout (the Middle Eastern & South Asian and Standard composers are done per paragraph, #4935; `.ai`/EPS/PDF files carry no composer), optional group font-size preservation; transformed character controls fixed (#1034), see [type-parity.md](type-parity.md) | 14–19 | estimated; eleven-language pattern hyphenation in both composers, with grapheme and shaping-cluster protection (#4947, `hyphen::tests` and `layout::wrapping_tests`); Sanskrit patterns pending an allowlisted source; recent-font groups in font pickers (#3515); full-name font matches regression-tested (#1258); mixed paragraph alignment indication implemented; headless regressions, full integration CI and visual review pass; localized legacy family-name fallback with loaded/catalog regressions (#2208); Fractional Widths per type object regression-tested; color emoji fonts with bitmap glyphs (`sbix`, `CBDT`) draw and export; threading ports: every selected area type and type on a path shows its in and out ports (empty, arrow, red "+"), and the Selection tool threads from either, the in port into a frame before it, and a double-click on a threaded port breaks the thread there (`threads::tests::break_splits_the_thread_and_the_story_flows_into_the_first_part`, `select::tests::a_double_click_on_a_threaded_port_breaks_the_thread`, `canvas::tests::a_double_click_on_a_threaded_out_port_breaks_the_thread`) (#2572; `select::tests::a_click_on_the_in_port_threads_into_a_frame_before_it`, `text::tests::selected_type_shows_its_ports_in_each_state`, `threads::tests::add_before_threads_the_story_from_the_new_frame_into_the_clicked_one`, live screenshot); the Glyphs panel highlights and scrolls to the character selected with the Type tool (#4908, `panels::glyphs` tests); the OpenType panel lists only `ss01`–`ss20` sets present in the selected font and uses its custom names when supplied; Type-range desktop Copy publishes styled art and keeps font family, size and color on canvas Paste after editing (#5636); paint-only Arabic harakat keep joining with conditional GDEF-mark ownership and Insert Kashidas base-letter paint (`tests::harakat`) | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), variable font axes, tab leaders, Touch Type, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), variable font axes, tab leaders, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), tab leaders, Touch Type, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), tab leaders, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; simpler contour walk, identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments, so Paths is monotone on the code-drawn sweep) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them; Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views (scores/hours unchanged) | | Live vector effects | 5 | 85% | Outline Object, SVG Filters | 4–8 | measured count 49/50 (Pathfinder 13/13 with Trap), depth estimated; Warp Options controls verified by focused checks and original-image review | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, original lighting presets, painter visibility), Revolve (Classic) with Angle, Cap, Offset and the Plastic, Diffuse, No Shading and Wireframe surfaces, the Quick Actions › Expand as Wireframes command (#6354), the Render Settings › Wireframe mode on Extrude & Bevel, Revolve, Inflate and Rotate; materials, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); Revolve (Classic) is covered by the `revolve::classic` tests and `dialogs::revolve::tests::classic_revolve_shows_its_options_and_applies_as_one_step`; Expand as Wireframes is covered by `crates/effects/src/solids/wireframe/tests.rs` and `crates/engine/src/cmd/wireframe/tests.rs`, and Render Settings › Wireframe by `crates/effects/src/solids/wireframe/tests.rs` and `crates/ui-egui/src/panels/tests_three_d.rs` (score, gaps and hours unchanged); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), variable font axes, tab leaders, Touch Type, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), tab leaders, Touch Type, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), variable font axes, tab leaders, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), tab leaders, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Raster effects (Effect Gallery) | 4 | 55% | — | — | estimated (raised from 52%: the Effect Gallery's filter thumbnails and in-dialog preview, an original landscape drawing passed through each filter, [Filter Gallery overview](https://helpx.adobe.com/photoshop/desktop/effects-filters/get-started-with-filters/filter-gallery.html), `dialogs::effect_gallery::tests::gallery_shows_thumbnails_and_an_in_dialog_preview`; the gallery itself shipped in #2883, six categories, per-filter settings, ordered stack, live canvas preview, one undo step, `stack_ok_is_one_undo_step`, `stack_preview_is_one_interaction`); measured count 57/57 (Artistic complete with Colored Pencil, Fresco, Paint Daubs, Palette Knife, Rough Pastels and Underpainting; Sketch complete with Torn Edges and Conté Crayon, `pixel::tests_sketch::conte_crayon_*`); texture redraw distances optimized (#1257), pixels verified; the score stays under 100% because the filters are original approximations; depth estimated | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) and on-canvas 9-slice guides (#5280) are done | 4–7 | estimated | | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | @@ -2783,6 +2783,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | Drawing tools and Type advanced rows drop the shipped Touch Type and Dimension tool from their missing items (#8387); scores and hours unchanged. | | 2026-11-16 | minor | Layers panel: rows or the selected-art square dragged over the list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Properties panel: while the Type tool edits text, the Character section shows the font family and style and the Variable Font button of the first selected character (or of the character before the caret), not those of the text object's first run (#8189). Evidence: `panels::properties::tests::character_section_shows_the_type_tool_selections_style`. Scores and estimates unchanged. | From 8887fc9d00046112e42577f226f59db3c2f2a0f7 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 11:14:38 -0800 Subject: [PATCH 136/247] Live Paint: leaving nested isolated Live Paint groups adds the drawn paths to each Leaving isolation mode in a Live Paint group drawn in another isolated Live Paint group, and that group too (object.exitIsolation, or object.isolate on a level outside both), now adds the drawn paths to each group, innermost first, one undo step each, so the inner group joins the outer one. Before, only the innermost group took its paths, and the inner group and the paths drawn directly in the outer group stayed beside the outer group's faces. A Live Paint group drawn in another one now counts as drawn art: its hidden sources group no longer keeps it out of the outer group. --- crates/engine/src/cmd/buildcmds.rs | 2 +- crates/engine/src/cmd/buildcmds/live_paint.rs | 17 ++++--- crates/engine/src/cmd/object/arrange.rs | 19 ++++--- crates/engine/src/cmd/object/commands.rs | 2 +- crates/engine/src/tests/build.rs | 49 +++++++++++++++++++ docs/mcp.md | 3 +- docs/target-app-parity.md | 2 +- 7 files changed, 76 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/cmd/buildcmds.rs b/crates/engine/src/cmd/buildcmds.rs index 0f7cac48fb..36e04ff23b 100644 --- a/crates/engine/src/cmd/buildcmds.rs +++ b/crates/engine/src/cmd/buildcmds.rs @@ -38,7 +38,7 @@ mod shape_builder; mod trace; pub use live_paint::live_paint_gaps; -pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paint, merge_drawn_in_isolation}; +pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paints, merge_drawn_in_isolation}; use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge}; use shape_builder::{sb_merge, sb_regions}; pub(crate) use trace::TracePresetChanges; diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index c71e1d6f32..116ea0c929 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -265,19 +265,22 @@ pub(super) fn lp_merge(s: &mut Session, p: &Value) -> Result<Value> { Ok(json!({ "id": id.0, "faces": faces, "edges": edges })) } -/// The Live Paint group whose drawn art is added when isolation mode leaves `isolated`: the innermost -/// Live Paint group that is `isolated` or holds it, such as a group drawn in an isolated Live Paint -/// group and then isolated itself. None when `isolated` is not in a Live Paint group. -pub(crate) fn isolated_live_paint(d: &Document, isolated: NodeId) -> Option<NodeId> { - d.ancestry(isolated)?.into_iter().rev().find(|id| d.node(*id).is_some_and(is_live_paint)) +/// The Live Paint groups whose drawn art can be added when isolation mode leaves `isolated`, innermost +/// first: every Live Paint group that is `isolated` or holds it, such as a group drawn in an isolated +/// Live Paint group and then isolated itself, and the group it was drawn in. Empty when `isolated` is +/// not in a Live Paint group. +pub(crate) fn isolated_live_paints(d: &Document, isolated: NodeId) -> Vec<NodeId> { + d.ancestry(isolated).unwrap_or_default().into_iter().rev().filter(|id| d.node(*id).is_some_and(is_live_paint)).collect() } /// The children of Live Paint group `g` besides its parts ([`others_in`]) that Live Paint takes /// ([`b::live_paint_takes`]) and that are shown and unlocked with everything in them, back to -/// front: the paths drawn in it in isolation mode. +/// front: the paths drawn in it in isolation mode. A Live Paint group's sources group, which is +/// always hidden, does not count. fn drawn_in(g: &Node) -> Vec<NodeId> { fn open(n: &Node) -> bool { - n.visible && !n.locked && n.children().is_none_or(|ch| ch.iter().all(|c| open(c))) + let src = b::sources(n).filter(|_| is_live_paint(n)).map(|s| s.id); + n.visible && !n.locked && n.children().is_none_or(|ch| ch.iter().filter(|c| Some(c.id) != src).all(|c| open(c))) } others_in(g).filter(|c| open(c) && b::live_paint_takes(c)).map(|c| c.id).collect() } diff --git a/crates/engine/src/cmd/object/arrange.rs b/crates/engine/src/cmd/object/arrange.rs index 17568d50b9..3700dd2e9e 100644 --- a/crates/engine/src/cmd/object/arrange.rs +++ b/crates/engine/src/cmd/object/arrange.rs @@ -371,16 +371,21 @@ pub(super) fn isolate(s: &mut Session, p: &Value) -> Result<Value> { } /// Leaving isolation mode in `isolated` for `next` (None: out of isolation mode) adds the paths drawn -/// in the Live Paint group isolation put new art in to that group, as `livePaint.merge` does, in one -/// undo step ([`crate::cmd::buildcmds::merge_drawn_in_isolation`]), unless `next` is that group or is -/// inside it; → the group when paths were added. +/// in each Live Paint group that is `isolated` or holds it to that group, as `livePaint.merge` does, +/// innermost group first, one undo step per group ([`crate::cmd::buildcmds::merge_drawn_in_isolation`]). +/// A group that `next` is or is inside is skipped, since isolation stays in it. → the outermost group +/// that paths were added to. fn add_drawn_live_paint(s: &mut Session, isolated: NodeId, next: Option<NodeId>) -> Result<Option<NodeId>> { let d = &s.doc()?.doc; - let Some(g) = crate::cmd::buildcmds::isolated_live_paint(d, isolated) else { return Ok(None) }; - if next.is_some_and(|n| d.ancestry(n).is_some_and(|a| a.contains(&g))) { - return Ok(None); + let stays = next.and_then(|n| d.ancestry(n)).unwrap_or_default(); + let left: Vec<NodeId> = crate::cmd::buildcmds::isolated_live_paints(d, isolated).into_iter().filter(|g| !stays.contains(g)).collect(); + let mut added = None; + for g in left { + if crate::cmd::buildcmds::merge_drawn_in_isolation(s, g)? { + added = Some(g); + } } - Ok(crate::cmd::buildcmds::merge_drawn_in_isolation(s, g)?.then_some(g)) + Ok(added) } pub(super) fn exit_isolation(s: &mut Session, p: &Value) -> Result<Value> { diff --git a/crates/engine/src/cmd/object/commands.rs b/crates/engine/src/cmd/object/commands.rs index fe9c3dd533..0576dc00d9 100644 --- a/crates/engine/src/cmd/object/commands.rs +++ b/crates/engine/src/cmd/object/commands.rs @@ -250,7 +250,7 @@ pub fn specs() -> Vec<CommandSpec> { "Exit Isolation Mode", [], None, - "{} leave isolation mode; leaving an isolated Live Paint group adds the paths, compound paths and groups of them drawn in it (shown and unlocked with everything in them) to the group as livePaint.merge does, in one undo step, and leaves type, images and other objects in it as they are; object.isolate on a level outside the group does the same", + "{} leave isolation mode; leaving an isolated Live Paint group adds the paths, compound paths and groups of them drawn in it (shown and unlocked with everything in them) to the group as livePaint.merge does, in one undo step, and leaves type, images and other objects in it as they are; object.isolate on a level outside the group does the same. Leaving a Live Paint group drawn in another isolated Live Paint group, and that group too, does this for each, innermost first, one undo step each", has_doc, exit_isolation ), diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 61a4414599..a3272f6fa9 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -5102,6 +5102,55 @@ fn live_paint_isolation_adds_a_drawn_group_isolated_inside_it() { } } +/// With Live Paint group `inner` made in isolated Live Paint group `outer` and then isolated itself, +/// leaving both levels (`object.exitIsolation`, or `object.isolate` on the layer) adds the path drawn +/// in `inner` to it and then `inner` and the path drawn directly in `outer` to `outer`, one undo step +/// each. Isolating `outer` from `inner` adds only `inner`'s drawn path, and `outer` keeps its own. +#[test] +fn live_paint_isolation_merges_nested_live_paint_groups_it_leaves() { + use vectorcraft_tools::builder::{faces, sources}; + for to in ["exit", "layer", "outer"] { + let mut s = session(); + let outer = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(outer).unwrap(); + s.execute("object.isolate", &json!({"id": outer.0})).unwrap(); + let a = line_across(&mut s, 50.0); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(outer)); + let inner = live(&mut s); + assert_eq!(s.doc().unwrap().doc.parent_of(inner), Some(outer), "the inner group is drawn in the outer one"); + s.execute("object.isolate", &json!({"id": inner.0})).unwrap(); + let b = line_across(&mut s, 30.0); + assert_eq!(s.doc().unwrap().doc.parent_of(b), Some(inner)); + let steps = s.doc().unwrap().history.undo.len(); + match to { + "exit" => s.execute("object.exitIsolation", &json!({})).unwrap(), + "layer" => s.execute("object.isolate", &json!({"id": layer.0})).unwrap(), + _ => s.execute("object.isolate", &json!({"id": outer.0})).unwrap(), + }; + let d = &s.doc().unwrap().doc; + if to == "outer" { + assert_eq!(s.doc().unwrap().isolation, Some(outer)); + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "only the inner group's path joins"); + let n = node(&s, inner); + assert_eq!(d.parent_of(b), Some(sources(&n).unwrap().id), "the path drawn in the inner group joined it"); + assert_eq!(d.parent_of(inner), Some(outer), "the inner group stays drawn in the outer one"); + assert_eq!(d.parent_of(a), Some(outer), "the path drawn in the outer group stays as drawn"); + continue; + } + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 2, "{to}: one undo step for each group"); + assert!(d.node(inner).is_none(), "{to}: the inner group joined the outer one"); + let n = node(&s, outer); + let src = sources(&n).unwrap().id; + assert_eq!(d.parent_of(a), Some(src), "{to}: the path drawn in the outer group joined it"); + assert!(d.ancestry(b).unwrap().contains(&src), "{to}: the path drawn in the inner group is among the outer group's paths"); + assert!(n.children().unwrap().iter().all(|c| c.id == src || c.path_data().is_some()), "{to}: only parts are left in the outer group"); + assert!(faces(&n).len() > 3, "{to}: the added paths cut the outer group's faces"); + if to == "exit" { + assert_eq!(s.doc().unwrap().selection.objects, vec![outer]); + } + } +} + /// A line from left of the [`live`] group to its right face, so it cuts the two faces left of it. fn line_to_right_face(s: &mut Session, y: f64) -> NodeId { let r = s.execute("path.create", &json!({"anchors": [{"x": -10, "y": y}, {"x": 105, "y": y}]})).unwrap(); diff --git a/docs/mcp.md b/docs/mcp.md index 1d24ac803a..30fb854f19 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5435,7 +5435,8 @@ and `layerRows`, the rows highlighted in the panel. Paint group (`object.exitIsolation`, or `object.isolate` on a level outside it) adds the paths, compound paths and groups of them drawn in it, shown and unlocked with everything in them, to the group as `livePaint.merge` does, in one undo step; type, images and other objects stay in it as they are, and with nothing drawn no undo step is - recorded. Face and Edge are the names of a Live Paint group's faces and edges: `layer.setProps` and + recorded. When the isolated Live Paint group was drawn in another isolated Live Paint group, leaving both does this + for each group, innermost first, one undo step each, so the inner group joins the outer one. Face and Edge are the names of a Live Paint group's faces and edges: `layer.setProps` and `object.setProps` return an error when they would give either name to another path directly in the group, and a path pasted directly into the group under either name loses its name. - **Dialogs and panel state** (control channel and the app's MCP): `ui.layerOptions {ids?}` and `ui.newLayer diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 47c5b83267..af36070752 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1688,7 +1688,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Create Strokes decides stroke or fill per feature, as the [help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html) describes the Strokes width: the widest feature of the image that can become a stroke. A shape wider than Stroke somewhere keeps as its area every disc wider than Stroke that fits in it, and each piece outside those discs that reaches out of them at least one and a half times its own width (and 3 px) is traced as a stroked center line, its end at the area carried to the cut so the line's cap closes the join. Corners and edge slivers stay in the area. Which pieces count as features is VectorCraft's own rule. Each line still has one width; without Fills, the area is a 1 px outline as before. Tests: `thin_features_of_a_wide_shape_are_strokes_and_its_body_a_fill`, `wide_shapes_without_thin_features_stay_one_fill` and `distances_to_seeds_equal_brute_force` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged. - The ignored centre-lines class measures that split on a mixed-width body scene: one disc with arms of 2, 3 and 5 px, at Stroke 6 px, traces as three stroked paths and one filled path in both the anti-aliased and hard input, with 100.0% of the arms' center samples found and 99.3% (anti-aliased) and 98.3% (hard) of the disc's pixels filled ([quality notes](image-trace-quality.md#centre-lines)). Test: `mixed_width_body_is_one_shape_traced_as_a_fill_and_strokes` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged. Object › Live Paint › Merge adds the other selected paths and Live Paint groups to the bottom selected Live Paint group ([Live Paint groups](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/live-paint-groups.html)), which keeps its id, the paint of its faces and edges, and its name, lock, visibility, transparency, appearance, opacity mask and graphic style link. Object › Live Paint › Make with a Live Paint group selected, and a Live Paint Bucket click on a selected path beside a selected Live Paint group, add the paths to that group the same way. Make, Merge and the Live Paint Bucket take paths, compound paths and groups of them; with type, an image or another object among the selection they report that it has to be converted to paths first and change nothing, as type and raster images can't go into a Live Paint group directly ([Create Live Paint groups](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/create-live-paint-groups.html)); before, such an object went among the group's hidden sources and vanished from the canvas. Evidence: `tests_build::live_paint_refuses_type_and_images_and_changes_nothing`. - Paths drawn in an isolated Live Paint group join it when isolation mode ends, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes: drawing paths in the isolated group and pressing Esc adds them. `object.exitIsolation` (Esc, the Control bar and isolation bar exits, a double-click outside, the Layers panel and the canvas context menu) adds the shown, unlocked paths, compound paths and groups of them drawn in the group as Merge does, in one undo step, and `object.isolate` on a level outside the group does the same. As VectorCraft's own rules, type, images, hidden and locked objects drawn there, and groups holding one, stay in the group as they are, and Gap Options, Merge and Release keep them; an exit with nothing drawn records no undo step. Evidence: `tests::build::{live_paint_isolation_adds_drawn_paths_on_exit, live_paint_isolation_adds_only_paths_it_takes, live_paint_isolation_leaves_a_group_holding_a_locked_path, live_paint_isolation_adds_drawn_paths_when_isolating_a_level_outside, live_paint_isolation_adds_a_drawn_group_isolated_inside_it, live_paint_isolation_keeps_art_named_like_its_parts, live_paint_keeps_type_drawn_in_it_through_gap_options_merge_and_release}`. + Paths drawn in an isolated Live Paint group join it when isolation mode ends, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes: drawing paths in the isolated group and pressing Esc adds them. `object.exitIsolation` (Esc, the Control bar and isolation bar exits, a double-click outside, the Layers panel and the canvas context menu) adds the shown, unlocked paths, compound paths and groups of them drawn in the group as Merge does, in one undo step, and `object.isolate` on a level outside the group does the same. As VectorCraft's own rules, type, images, hidden and locked objects drawn there, and groups holding one, stay in the group as they are, and Gap Options, Merge and Release keep them; an exit with nothing drawn records no undo step; leaving a Live Paint group drawn in another isolated Live Paint group, and that group too, adds the drawn paths to each, innermost first, one undo step each. Evidence: `tests::build::{live_paint_isolation_adds_drawn_paths_on_exit, live_paint_isolation_adds_only_paths_it_takes, live_paint_isolation_leaves_a_group_holding_a_locked_path, live_paint_isolation_adds_drawn_paths_when_isolating_a_level_outside, live_paint_isolation_adds_a_drawn_group_isolated_inside_it, live_paint_isolation_merges_nested_live_paint_groups_it_leaves, live_paint_isolation_keeps_art_named_like_its_parts, live_paint_keeps_type_drawn_in_it_through_gap_options_merge_and_release}`. Paths dragged into a Live Paint group in the Layers panel join it, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes for adding paths to a group; older guides ([CS6, page 192](https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=192)) say several paths can be dragged at once. A drop inside the group, or above or below one of its rows (`layer.move`, and `node.move` into the group), adds the paths, compound paths, groups of them and Live Paint groups to it as Merge does, in one "Merge Live Paint" undo step that selects the group; an Alt-drag adds copies. As VectorCraft's own rules, type, an image or another object among the dragged rows refuses the whole drop with Merge's message, and a row dragged into or out of the group's hidden sources makes its faces and edges again, keeping the paint of those that stay; with no path left the group has no faces until a path joins it. Evidence: `tests::build::{layers_drag_adds_paths_to_a_live_paint_group, layers_drag_copy_and_drop_beside_a_part_add_to_a_live_paint_group, layers_drag_refuses_type_into_a_live_paint_group, layers_drag_out_of_a_live_paint_group_makes_its_faces_again}`. With the Live Paint Bucket selected, Alt-click on vector art samples its fill, stroke and stroke weight into the paint defaults ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)). On a placed image it samples the image pixel as a solid fill with no stroke. Alt+Shift-click samples only the color under the pointer, including an intermediate gradient color or image pixels, into the active fill or stroke ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)). Neither click paints or changes the selection or selected art, and the next Bucket click paints with the sampled paint. Evidence: `tests_build::live_paint_bucket_alt_sample_paints_next_face_without_changing_selection`. Double-clicking the Live Paint Bucket opens Live Paint Bucket Options ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)): Paint Fills (on) and Paint Strokes (off) set whether a click paints faces, edges or both, Highlight turns the outline of the face or edge under the pointer on or off, and Color and Width set it (red and 4 px by default). Faces are outlined at the Width and edges at half of it, as the page says faces are highlighted with a thick line and edges with a thin line. With both on, a click paints the edge within 4 px of the pointer, else the face, and Shift switches to Paint Fills only; with one on, Shift switches to the other. The options last across tool switches and are saved with the preferences (`tool.setOption {tool: "livePaintBucket"}`). Evidence: `builder::tests::{bucket_options_choose_what_a_click_paints, bucket_options_set_the_highlight, bucket_highlights_an_edge_thinner_than_a_face}`, `dialogs::live_paint_bucket::tests::double_clicking_the_tool_opens_its_options_and_ok_sets_them`. From a9ff12b7b4d1def00dcb3c2b2bff650a2a0d4148 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 11:15:28 -0800 Subject: [PATCH 137/247] i18n: remove the obsolete File Info control characters rows from ten catalogs File Info refuses a value with control characters with one of two whole messages, "{k} has control characters" and "{k} has control characters or line breaks". The cs, fr, hu, ja, ka, ko, nl, ru, tr and zh-hant catalogs still had a row for the single message those two replaced, "{k} has control characters{_1}", which no message uses. The rows are removed, and a test checks that no catalog has a row for that message. --- crates/ui-egui/src/i18n/cs.tsv | 1 - crates/ui-egui/src/i18n/fr.tsv | 1 - crates/ui-egui/src/i18n/hu.tsv | 1 - crates/ui-egui/src/i18n/ja.tsv | 1 - crates/ui-egui/src/i18n/ka.tsv | 1 - crates/ui-egui/src/i18n/ko.tsv | 1 - crates/ui-egui/src/i18n/nl.tsv | 1 - crates/ui-egui/src/i18n/ru.tsv | 1 - crates/ui-egui/src/i18n/tests.rs | 13 +++++++++++++ crates/ui-egui/src/i18n/tr.tsv | 1 - crates/ui-egui/src/i18n/zh-hant.tsv | 1 - docs/target-app-parity.md | 10 +++++----- 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..6785cdde24 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9830,7 +9830,6 @@ breakText Glyphs Glyfy @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) soubory {kind} nemají průhlednost a soubor by obsahoval {what}: nejprve ji slučte (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) obrázky {kind} nelze otevřít (viz document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` není jedna z nabízených voleb -@msg {k} has control characters{_1} {k} obsahuje řídicí znaky{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} je příliš dlouhé (nejvýše {MAX_TEXT} znaků) @msg {k} must be > 0 {k} musí být > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} musí být číslo (pt) nebo délka jako "210 mm" diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..c61a166a8b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9686,7 +9686,6 @@ breakText Glyphs Glyphes @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) les fichiers {kind} n’ont pas de transparence, et le fichier aurait {what} : aplatissez-la d’abord (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) les images {kind} ne peuvent pas être ouvertes (voir document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` ne fait pas partie des choix -@msg {k} has control characters{_1} {k} contient des caractères de contrôle{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} est trop long (au plus {MAX_TEXT} caractères) @msg {k} must be > 0 {k} doit être > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} doit être un nombre (pt) ou une longueur comme "210 mm" diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..314f688a5a 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9700,7 +9700,6 @@ breakText Glyphs Glifák @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} fájlokban nincs átlátszóság, a fájlban viszont ez lenne: {what}; előbb lapítsd (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind} képek nem nyithatók meg (lásd: document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}`: nem a választási lehetőségek egyike -@msg {k} has control characters{_1} {k}: vezérlőkaraktereket tartalmaz{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k}: túl hosszú (legfeljebb {MAX_TEXT} karakter) @msg {k} must be > 0 {k}: > 0 érték kell @msg {k} must be a number (pt) or a length such as "210 mm" {k}: szám (pt) vagy hosszúság kell, például "210 mm" diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..9986726dee 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8502,7 +8502,6 @@ axis Y Axis Y 軸 @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} ファイルは透明に対応していませんが、ファイルに {what} が含まれます: 先に分割・統合してください (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind} 画像は開けません (document.formats を参照) @msg {k} `{v}` is not one of the choices {k} `{v}` は選択肢にありません -@msg {k} has control characters{_1} {k} に制御文字{_1} が含まれています @msg {k} is too long (at most {MAX_TEXT} characters) {k} が長すぎます (最大 {MAX_TEXT} 文字) @msg {k} must be > 0 {k} には 0 より大きい値を指定してください @msg {k} must be a number (pt) or a length such as "210 mm" {k} には数値 (pt)、または "210 mm" のような長さを指定してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..482fb43044 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1916,7 +1916,6 @@ @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} ფაილებს გამჭვირვალობა არ აქვს, ფაილს კი ექნებოდა: {what}: ჯერ გააბრტყელეთ (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind} გამოსახულებების გახსნა შეუძლებელია (იხ. document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` შემოთავაზებულ ვარიანტებში არ არის -@msg {k} has control characters{_1} {k} შეიცავს მმართველ სიმბოლოებს{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} ზედმეტად გრძელია (მაქსიმუმ {MAX_TEXT} სიმბოლო) @msg {k} must be > 0 {k} უნდა იყოს > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} უნდა იყოს რიცხვი (pt) ან სიგრძე, მაგალითად "210 mm" diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..cadf6768fd 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9436,7 +9436,6 @@ breakText Glyphs 글리프 @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} 파일에는 투명도가 없는데 이 파일에는 {what}이(가) 있게 됩니다: 먼저 병합하세요(object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind} 이미지는 열 수 없습니다(document.formats 참조) @msg {k} `{v}` is not one of the choices {k} `{v}`은(는) 선택 항목 중 하나가 아닙니다 -@msg {k} has control characters{_1} {k}에 제어 문자가 있습니다{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k}이(가) 너무 깁니다(최대 {MAX_TEXT}자) @msg {k} must be > 0 {k}은(는) 0보다 커야 합니다 @msg {k} must be a number (pt) or a length such as "210 mm" {k}은(는) 숫자(pt) 또는 "210 mm" 같은 길이여야 합니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..408e2df2ae 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -7683,7 +7683,6 @@ imageTrace Outline Contour @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind}-bestanden hebben geen transparantie, en het bestand zou {what} bevatten: vlak het eerst af (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind}-afbeeldingen kunnen niet worden geopend (zie document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` is geen van de keuzes -@msg {k} has control characters{_1} {k} bevat besturingstekens{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} is te lang (maximaal {MAX_TEXT} tekens) @msg {k} must be > 0 {k} moet > 0 zijn @msg {k} must be a number (pt) or a length such as "210 mm" {k} moet een getal (pt) of een lengte zoals "210 mm" zijn diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..1ea95207c7 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9815,7 +9815,6 @@ shape Open Открытый @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) в файлах {kind} нет прозрачности, а в файле оказалось бы {what}: сначала объедините прозрачность (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) изображения {kind} невозможно открыть (см. document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` не входит в число допустимых вариантов -@msg {k} has control characters{_1} {k} содержит управляющие символы{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} слишком длинно (не более {MAX_TEXT} символов) @msg {k} must be > 0 {k} должно быть > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} должно быть числом (pt) или длиной, например "210 mm" diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 97fccd9167..daad687ebe 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2517,6 +2517,19 @@ fn file_info_control_character_refusals_translate_in_every_complete_catalog() { } } +/// No catalog keeps a row for `{k} has control characters{_1}`, the single message that +/// `file.info`'s two control character refusals replaced. +#[test] +fn no_catalog_keeps_the_old_file_info_control_character_row() { + let literals = message_literals_in(&["engine"]); + let old = "{k} has control characters{_1}"; + assert!(!literals.contains(old), "the engine still makes {old:?}"); + for l in &LANGUAGES { + let (entries, _) = parse_entries(l.source); + assert!(!entries.iter().any(|(ctx, src, _)| ctx.starts_with("@msg") && src.split('|').any(|s| s == old)), "{}: {old:?}", l.code); + } +} + /// Every complete-message catalog has a row for each error that `type.compositeFonts.set`, /// `.export` and `.import`, the composite font checks behind them and the Composite Fonts dialog /// give, and translates them with the font name, the key and the class key kept, and the reason diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..cedc55f1ee 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -8883,7 +8883,6 @@ axis Y Axis Y ekseni @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} dosyalarında saydamlık yoktur ve dosyada {what} olurdu: önce düzleştirin (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) {kind} görüntüleri açılamıyor (bkz. document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` seçeneklerden biri değil -@msg {k} has control characters{_1} {k} denetim karakterleri içeriyor{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} çok uzun (en fazla {MAX_TEXT} karakter) @msg {k} must be > 0 {k} > 0 olmalıdır @msg {k} must be a number (pt) or a length such as "210 mm" {k} bir sayı (pt) veya "210 mm" gibi bir uzunluk olmalıdır diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..ce91ac2241 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9503,7 +9503,6 @@ breakText Glyphs 字符 @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) {kind} 檔案沒有透明度,而檔案中會有 {what}:請先將它平面化 (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) 無法開啟 {kind} 影像 (請參閱 document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` 不是選項之一 -@msg {k} has control characters{_1} {k} 含有控制字元{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} 過長 (最多 {MAX_TEXT} 個字元) @msg {k} must be > 0 {k} 必須 > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} 必須是數字 (pt) 或 "210 mm" 這類長度 diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..dc14aea2c6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1014,13 +1014,13 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The status bar translates the limits a plug-in run can exceed (its instruction, time and memory budgets and its output size) and the error of a plug-in removal that leaves the plug-in's grant in the plug-in store, in every language that translates every message. The untranslated-strings report also lists messages that an error or a status takes from a `&str` constant (`plugin_limit_errors_are_translated`, `message_scan_reads_messages_held_in_constants`). - The status bar translates the plug-in host's other errors (manifest, module and run checks, the output an importer, exporter or effect returns, and the approval a plug-in's permissions need) in every language that translates every message. A JSON object or array inside a message stays as written, and a message that wraps another one, such as `plug-in manifest: {0}`, is matched by its own row before a row that starts with a placeholder. The reasons inside these errors (what is wrong with a parameter's spec or dialog keys, the value a parameter needs, what is wrong with an object, stroke, paint or effect in a plug-in's output) are translated with them, and the untranslated-strings report lists the reasons the plug-in host's error helpers take (`plugin_messages_are_translated_in_every_complete_catalog`, `plugin_errors_translate_with_their_values`, `plugin_error_reasons_are_translated_with_the_error`, `message_scan_reads_plugin_helpers`, `templates_that_start_with_text_match_first`). - The status bar translates `script.run`'s refusals of `answers` in every language that translates every message: a value that is not a list, more than 10,000 answers, more than 1 MiB, an answer at an index that is not an object, does not have exactly `kind` and `value`, has a `value` its kind of dialog does not take, holds a prompt's text longer than 16 KiB or has an unknown `kind`, and `answers` given to a run in the app. The index, the counts and the code names are shown as they are, and the command's error stays in English. The untranslated-strings report also lists the refusals of `script.run`'s parameters (`script_answers_errors_are_translated`, `message_scan_reads_script_run_param_refusals`). - - The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. + - The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). A native speaker has not reviewed the wording. - A status or error message whose braces are literal, such as a plug-in's `expected {"objects": [...]}` or a command's `quotes must be {double?, single?}`, is translated only when the whole message matches its row: the row writes those braces doubled and has no placeholder, so it no longer replaces a different message that starts with the same words, such as a JSON reason `expected value at line 1 column 1`, which stays in English. A row without placeholders is found at any message length (`plain_message_keys_double_their_braces`, `literal_brace_rows_match_only_their_message`). - The status bar translates the errors a script's `File` and `Folder` objects, `vc.run`, `$.evalFile`, the `$` object's properties and functions, `alert`, `confirm` and `prompt`, `vc.document` and `vc.log` raise, the limits a run can pass, and the errors of Drop Script Engine, and the line for a run that fails (a syntax error, a thrown error, a limit, a stop or an internal error, with the script's name, the line and column, the included file it is in and the files left written), in every language that translates every message. The script's name, paths, numbers, command ids and the text a script throws itself are shown as they are. A failure with no line and column, such as an error in code `eval` compiled, is shown with one colon after the script's name (`an_error_without_a_place_names_the_script_and_kind`). A message template that names a value twice matches only when both places hold the same text, so the line for a failed run is not taken for the message inside it (`a_repeated_placeholder_matches_the_same_text`). The untranslated-strings report also lists the messages the script host's `fail`, `value` and `over` helpers take and the errors the script interpreter throws, and a constant's text comes from the file or crate that declares it, so the Scripts menu's headers are not listed as messages (`script_errors_are_translated`, `script_host_errors_are_translated`, `message_scan_reads_script_interpreter_errors`, `message_scan_reads_constants_of_the_file_and_its_crate`, `message_scan_skips_test_modules_with_any_test_cfg`). - The status bar also translates the errors the script interpreter's core throws (an unknown name, a property of `null` or `undefined`, a property that cannot be defined, assigned or deleted and the reason, a value that is not a function or a constructor, an invalid array length, an invalid assignment target), on their own and in the line for a failed run, in every language that translates every message. Names, property names (a value a message quotes in `'…'` is shown as written, like one in `"…"`, even when it matches a translated message), `null`, `undefined`, `in`, `instanceof` and the error's type (`TypeError`, `ReferenceError` and the others) are shown as they are, and a script that catches the error still reads its English message. An error about a property of `null` or `undefined` names a computed property whose name is not an object and is at most 256 units long, and otherwise says only that the script read or set a property, instead of naming an empty property (`script_interpreter_core_errors_are_translated`, `errors_about_null_and_undefined_name_the_property`, `message_scan_reads_script_interpreter_errors`). - - The Turkish catalog (`crates/ui-egui/src/i18n/tr.tsv`) has an `@msg` row for all but 41 of the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,446 `@msg` rows in all. The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. - - The Hungarian catalog (`crates/ui-egui/src/i18n/hu.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,444 `@msg` rows in all: the errors of commands, scripts, file import and export and plug-ins. The report lists 40 Hungarian messages: the composite font, justification order and connect end errors that open #7211, #7116 and #7330 translate, and two messages that no catalog has a row for. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. - - The Dutch catalog (`crates/ui-egui/src/i18n/nl.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,447 `@msg` rows in all. The report lists 41 Dutch messages: the composite font errors, the justification spacing error and the `connect` end error, which open #7211, #7116 and #7330 translate, and three unknown-parameter and range errors (``unknown parameter `{within}{key}`; {why}``, ``unknown parameter `{within}settings.{format}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`), which open #7353 rewrites so that a catalog row can match them. The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. + - The Turkish catalog (`crates/ui-egui/src/i18n/tr.tsv`) has an `@msg` row for all but 41 of the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,446 `@msg` rows in all. A native speaker has not reviewed the wording. + - The Hungarian catalog (`crates/ui-egui/src/i18n/hu.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,444 `@msg` rows in all: the errors of commands, scripts, file import and export and plug-ins. The report lists 40 Hungarian messages: the composite font, justification order and connect end errors that open #7211, #7116 and #7330 translate, and two messages that no catalog has a row for. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). A native speaker has not reviewed the wording. + - The Dutch catalog (`crates/ui-egui/src/i18n/nl.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,447 `@msg` rows in all. The report lists 41 Dutch messages: the composite font errors, the justification spacing error and the `connect` end error, which open #7211, #7116 and #7330 translate, and three unknown-parameter and range errors (``unknown parameter `{within}{key}`; {why}``, ``unknown parameter `{within}settings.{format}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`), which open #7353 rewrites so that a catalog row can match them. A native speaker has not reviewed the wording. - The Danish catalog (`crates/ui-egui/src/i18n/da.tsv`) has 1,985 more status and error message rows, 3,702 `@msg` rows in all, and the untranslated report's missing Danish messages go from 2,066 to 81: 40 that open pull requests translate, 38 that no catalog has a row for, and three unknown-parameter and range errors (``unknown parameter `{within}{key}`; {why}``, ``unknown parameter `{within}settings.{format}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`) that open #7353 rewrites so that a catalog row can match them. A native speaker has not reviewed the wording. - The Traditional Chinese catalog (`crates/ui-egui/src/i18n/zh-hant.tsv`) has an `@msg` row for the status and error messages the untranslated report (`untranslated_report`) finds in the sources, 3,438 `@msg` rows in all: the errors of commands, scripts, file import and export and plug-ins. The report lists 40 Traditional Chinese messages: open #7211, #7116 and #7330 add the rows for 38 of them, and the other 2 have no row in any catalog. A message with two placeholders in a row (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`) is still shown in English. - Localised UI: menus (in-window and native), panels, dialogs, toolbar and Preferences read from per-language catalogs (`crates/ui-egui/src/i18n`, see `docs/development.md`); Traditional Chinese (Taiwan), Simplified Chinese (mainland), Japanese, Korean, Vietnamese, German, Spanish, French, Italian, Polish, Brazilian Portuguese, Russian, Ukrainian, Georgian and Catalan ship complete, and Czech covers every menu label (and more), with system-locale detection on macOS, Windows, Linux and the web (the browser's languages, or `?lang=`), a Language preference and, on macOS, a VectorCraft ▸ Language menu. Names are never translated (fonts and their styles, layers, artboards, saved presets, user libraries, custom workspaces, recent files, plug-ins). @@ -1063,7 +1063,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The errors of the 3D effects (Extrude & Bevel, Revolve, Inflate, Rotate and their Classic forms) show in the status bar in the interface language: the art a 3D effect cannot build a solid from, invalid light, graphics and surface settings, and the notes for an object that draws no 3D faces or more wireframe edges than the limit. Each has a row in every catalog that translates all status and error messages, and the effect's name and the values in the message are translated or kept as written (`three_d_refusals_are_translated_in_every_complete_catalog`, `three_d_refusals_translate_with_their_values`). - The errors of an SVG filter that the New or Edit button of Apply SVG Filter or an `svg.filter` effect refuses show in the status bar in the interface language: XML that cannot be read, a missing or too long id, an element or event attribute a filter does not take, an image that is not a `data:` URL, and the limits on primitives, `numOctaves`, `order`, `radius`, `stdDeviation`, `kernelUnitLength`, image pixels, nesting and size. Each has a row in every catalog that translates all status and error messages, and the limits, element and attribute names and the XML parser's position are kept as written (`svg_filter_refusals_are_translated_in_every_complete_catalog`, `svg_filter_refusals_translate_with_their_values`). Items side by side in a menu show different labels in every interface language (Effect › 3D and Materials › Revolve… and Rotate… in Turkish and Bulgarian, Effect › Warp and Distort, the Pathfinder effects, the Warp styles, Window › Attributes and Properties, and the whitespace characters), and no menu item shows a command id in place of its label (`menu_items_side_by_side_have_different_labels`, `menu_items_never_show_an_id`). - The errors of the parameter checks that many commands share show in the status bar in the interface language: a value that is not a number where a number goes (`object.move` with `"dx": "60 mm"`, and `object.rotate`, `object.setBounds` and the other commands that call `check_numbers`), a missing number or index, `ids` that are not a list of object ids, an object id that is not a non-negative integer or names no object, and a date that is not Unix seconds. Each has a row in every catalog that translates all status and error messages, and in Bulgarian, Danish, Indonesian and Dutch (`shared_param_check_errors_are_translated`). - - File Info's (`file.info`) error for a value with control characters shows in the status bar in the interface language for every field: "description has control characters" for Description and Copyright Notice, which take line breaks and tabs, and "title has control characters or line breaks" for the other text fields and each keyword in a list. Each is its own message with a row in every catalog that translates all status and error messages, and the field's key stays as written (`file_info_control_character_refusals_translate_in_every_complete_catalog`, `control_characters_are_refused_with_the_field_rule`). + - File Info's (`file.info`) error for a value with control characters shows in the status bar in the interface language for every field: "description has control characters" for Description and Copyright Notice, which take line breaks and tabs, and "title has control characters or line breaks" for the other text fields and each keyword in a list. Each is its own message with a row in every catalog that translates all status and error messages, and the field's key stays as written. No catalog keeps a row for `{k} has control characters{_1}`, the single message the two replaced (`file_info_control_character_refusals_translate_in_every_complete_catalog`, `no_catalog_keeps_the_old_file_info_control_character_row`, `control_characters_are_refused_with_the_field_rule`). - A parameter schema's errors show in the status bar with what the value must be in the interface language, for every type a schema has (a number with each kind of range and with a unit, an integer and its range, true or false, a string, a list of names, an object id, a list of object ids, a color, a point, an object and a list), in every catalog that translates all status and error messages; the path, the refused value, the bounds, the unit and the names stay as the English gives them. The error for a value that is not one of its names is also translated in Bulgarian, Bosnian, Danish, Indonesian and Dutch (`parameter_schema_expected_phrases_are_translated`, `bracketed_message_parts_translate_only_as_exact_messages`). - The error for an unknown key inside an options object (`marks.ofset` in `document.exportPdf`, a format under `settings` in `document.exportForScreens`), a PDF or print setting outside its range (`marks.weight must be 0.05–2 pt (got 9)`), the raster effect resolution warning for a named object, the note that VectorCraft started again on another graphics processor and the status after a print job is sent show in the status bar in the interface language, in every catalog: each message is made with one value for the key path, the range with its unit or the object with its name, so a catalog row can match it, and the English stays as before (`messages_with_joined_values_translate_whole`). A message or catalog row with two placeholders in a row fails `message_templates_have_text_between_their_placeholders` or `bundled_catalogs_have_no_message_row_they_leave_out`, and the untranslated report counts a row the catalog cannot use as missing. - A script's error about answers in `answers` that it did not use, and Liquify's warning about the objects under the brush that it left as they were, show in the status bar in the interface language for one answer or object as well as for several, with the count's own form in each catalog that translates all status and error messages; the English the commands return stays as it was (`messages_with_one_or_several_items_translate_in_every_complete_catalog`, `unused_answers_are_counted_in_the_singular_and_the_plural`, `liquify_warns_about_one_or_several_skipped_objects`). From 2a3019fcfe082e0177dfbd667093c5c89f2c1706 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 11:17:20 -0800 Subject: [PATCH 138/247] Type: editing type set in a missing font asks to confirm first A Type tool click, or a Selection or Direct Selection double-click, on type whose story is drawn in a font that isn't available as named (a missing family, or a style its family lacks) now opens a question that names those fonts instead of starting to edit. OK starts editing with the caret where the type was clicked; Cancel leaves the document, its undo history and the selection as they were. Each new edit asks again; a click within the type being edited, or in another frame of its story, does not. The fonts the type names are not changed. The check reads only the clicked story's runs. As in text.missingFonts, it leaves out CSS generic families and names over 256 bytes; it also skips inline graphics and empty runs. The CSS generic family list moves to vectorcraft-text so both share it. The question is the missingFontEdit dialog, answered through the Type tool's missingFontEdit option. --- crates/engine/src/cmd/fontfiles.rs | 21 +--- crates/text/src/fontdb.rs | 2 +- crates/text/src/fontdb/traits.rs | 23 ++++ crates/text/src/lib.rs | 8 +- crates/tools/src/text.rs | 63 ++++++++++- crates/tools/src/text/missing.rs | 83 ++++++++++++++ crates/tools/src/text/tests.rs | 154 ++++++++++++++++++++++++++ crates/tools/src/text/tool.rs | 22 +++- crates/ui-egui/src/canvas/tests.rs | 64 +++++++++++ crates/ui-egui/src/dialogs.rs | 4 + crates/ui-egui/src/dialogs/confirm.rs | 41 +++++++ crates/ui-egui/src/dialogs/tools.rs | 5 + crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + docs/mcp.md | 12 ++ docs/target-app-parity.md | 1 + 42 files changed, 501 insertions(+), 30 deletions(-) create mode 100644 crates/tools/src/text/missing.rs diff --git a/crates/engine/src/cmd/fontfiles.rs b/crates/engine/src/cmd/fontfiles.rs index fde85dd92d..c13b256210 100644 --- a/crates/engine/src/cmd/fontfiles.rs +++ b/crates/engine/src/cmd/fontfiles.rs @@ -19,23 +19,6 @@ use crate::DocState; const MAX_FONTS: usize = 1_000; /// The longest family or style name listed or given (bytes). const MAX_NAME: usize = 256; -/// The CSS generic font families (CSS Fonts Module Level 4), which SVG and HTML files name in place -/// of a font and no font file provides; compared in any ASCII case. The list leaves out -/// `fangsong`, which is also the family name of a Chinese font (FangSong). -const GENERIC_FAMILIES: &[&str] = &[ - "serif", - "sans-serif", - "monospace", - "cursive", - "fantasy", - "system-ui", - "ui-serif", - "ui-sans-serif", - "ui-monospace", - "ui-rounded", - "math", - "emoji", -]; /// The longest folder path given (bytes). const MAX_PATH: usize = 4096; /// The most files one `text.addFontFiles` copies: as many as a search keeps. @@ -105,10 +88,10 @@ pub struct MissingFont { /// The fonts the type of `d` uses, in its layers, symbols and patterns, opacity masks included (a composite font's parts, those /// its characters are drawn in, in place of its name), that aren't available as named (sorted by family and style, each once whatever version its type names; at most 1000). CSS generic families such as `sans-serif` -/// ([`GENERIC_FAMILIES`]) and names longer than 256 bytes are left out. +/// ([`vectorcraft_text::GENERIC_FAMILIES`]) and names longer than 256 bytes are left out. pub fn missing_fonts(d: &Document) -> Vec<MissingFont> { let db = FontDb::global(); - let generic = |family: &str| GENERIC_FAMILIES.iter().any(|g| g.eq_ignore_ascii_case(family.trim())); + let generic = vectorcraft_text::is_generic_family; let mut used: Vec<(String, String)> = super::fonts::used_fonts(d).into_iter().map(|(family, style, _)| (family, style)).collect(); // Sorted by family and style: the versions type names of one face are neighbors. used.dedup(); diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 59c99f8901..ccf9a3943c 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -74,7 +74,7 @@ pub use stylistic_sets::StylisticSet; use traits::Alias; #[cfg(test)] use traits::{FaceKeys, face_names}; -pub use traits::{FontClass, FontLikeness, FontMatch, FontTraits}; +pub use traits::{FontClass, FontLikeness, FontMatch, FontTraits, GENERIC_FAMILIES, is_generic_family}; #[cfg(test)] pub(crate) use traits::{alias_lists, face_styles, on_faces_published}; pub use wanted::{WantedFont, WantedFonts}; diff --git a/crates/text/src/fontdb/traits.rs b/crates/text/src/fontdb/traits.rs index abcfe863e7..6b6ac5c87e 100644 --- a/crates/text/src/fontdb/traits.rs +++ b/crates/text/src/fontdb/traits.rs @@ -433,6 +433,29 @@ impl FontMatch { } } +/// The CSS generic font families (CSS Fonts Module Level 4), which SVG and HTML files name in place +/// of a font and no font file provides; compared in any ASCII case ([`is_generic_family`]). The +/// list leaves out `fangsong`, which is also the family name of a Chinese font (FangSong). +pub const GENERIC_FAMILIES: &[&str] = &[ + "serif", + "sans-serif", + "monospace", + "cursive", + "fantasy", + "system-ui", + "ui-serif", + "ui-sans-serif", + "ui-monospace", + "ui-rounded", + "math", + "emoji", +]; + +/// Whether `family` (surrounding spaces ignored) is one of the [`GENERIC_FAMILIES`], in any ASCII case. +pub fn is_generic_family(family: &str) -> bool { + GENERIC_FAMILIES.iter().any(|g| g.eq_ignore_ascii_case(family.trim())) +} + /// A face's (family, style) names. pub(super) fn face_names(f: &skrifa::FontRef<'_>) -> Option<(String, String)> { let family = name(f, &[StringId::TYPOGRAPHIC_FAMILY_NAME, StringId::FAMILY_NAME])?; diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index f7f5d128ba..6156c90162 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -41,10 +41,10 @@ pub use features::{ EXTRA_FEATURES, LIGATURE_TRACKING_LIMITS, MAX_FEATURE_VALUE, MAX_STYLE_FEATURES, OtFeatures, explicit_ligatures, ligatures_suppressed_by, }; pub use fontdb::{ - CompositeCoverage, FALLBACK_FAMILY, FontClass, FontDb, FontFace, FontLikeness, FontMatch, FontTraits, GlyphAlternate, GlyphCategory, - GlyphCategoryKind, GlyphOrigin, IcfMargins, JoiningPosition, LentCompositeFonts, PlatformFontFiles, RECENTLY_ADDED_WITHIN, RecentlyAdded, - StylisticSet, Substitution, SubstitutionKind, WantedFont, WantedFonts, app_font_dir, is_font_file, is_suitcase, set_app_font_dir, - set_platform_font_files, set_user_font_dirs, set_user_font_dirs_confined, style_weight, system_font_dirs, user_font_dirs, + CompositeCoverage, FALLBACK_FAMILY, FontClass, FontDb, FontFace, FontLikeness, FontMatch, FontTraits, GENERIC_FAMILIES, GlyphAlternate, + GlyphCategory, GlyphCategoryKind, GlyphOrigin, IcfMargins, JoiningPosition, LentCompositeFonts, PlatformFontFiles, RECENTLY_ADDED_WITHIN, + RecentlyAdded, StylisticSet, Substitution, SubstitutionKind, WantedFont, WantedFonts, app_font_dir, is_font_file, is_generic_family, is_suitcase, + set_app_font_dir, set_platform_font_files, set_user_font_dirs, set_user_font_dirs_confined, style_weight, system_font_dirs, user_font_dirs, }; pub use hyphen::{hyphenation_exceptions, set_hyphenation_exceptions}; pub use layout::{envelope_ink, layout_inputs, register_envelope_ink}; diff --git a/crates/tools/src/text.rs b/crates/tools/src/text.rs index 763325f90e..1bf3313904 100644 --- a/crates/tools/src/text.rs +++ b/crates/tools/src/text.rs @@ -43,10 +43,13 @@ use vectorcraft_text::{FontDb, TextLayout, edit}; use crate::guides::DrawSnap; use crate::{Action, Cursor, ImeSurrounding, Mods, Overlay, PointerEvent, PointerKind, SurroundingUnit, Tool, ToolContext, ToolKey}; +mod missing; mod plain; mod ports; mod tool; +pub use missing::MISSING_FONT_EDIT; +use missing::PendingEdit; #[cfg(test)] use plain::char_range_to_bytes; use plain::common_affixes; @@ -219,6 +222,8 @@ pub struct TypeTool { stepped: bool, /// The state at the start of each `command.batch` still running, innermost last. batches: Vec<HistoryState>, + /// The edit of type set in fonts that aren't available whose question is open ([`missing`]). + pending_edit: Option<PendingEdit>, cache: Mutex<Option<CachedLayout>>, } @@ -781,18 +786,68 @@ impl TypeTool { /// Start editing the type under `p` with the caret there → the actions (ending the previous /// edit, selecting the type); None when no type is under `p`. A click among the characters - /// edits them, whatever Type Object Selection by Path Only says. + /// edits them, whatever Type Object Selection by Path Only says. When the story of that type is + /// drawn in a font that isn't available as named and is not the story being edited, nothing + /// starts yet: the action asks the UI to open the [`MISSING_FONT_EDIT`] question, and OK starts + /// the edit ([`Self::resume_edit`]). fn edit_at(&mut self, cx: &ToolContext, p: Point) -> Option<Vec<Action>> { + self.pending_edit = None; let h = hit_test(cx.doc, p, vectorcraft_doc::hit::HitOptions { type_path_only: false, ..cx.hit_options() })?; let Some(NodeKind::Text(t)) = cx.doc.node(h.leaf).map(|n| &n.kind) else { return None }; let lay = self.layout(t); let byte = vectorcraft_text::hit_byte(&lay, t.xf.inverse() * p); + let same_story = self.editing.is_some_and(|e| cx.doc.story_of(e).contains(&h.leaf)); + if !same_story { + let fonts = missing::unavailable_fonts(cx.doc, h.leaf); + if !fonts.0.is_empty() { + let token = next_edit_session(); + self.pending_edit = Some(PendingEdit { token, revision: cx.revision, id: h.leaf, byte, accepted: false }); + self.clicks = (None, 0); + return Some(vec![Action::Dialog(MISSING_FONT_EDIT.into(), missing::question(token, h.leaf, &fonts))]); + } + } + Some(self.begin_edit(cx, h.leaf, byte, p)) + } + + /// End the previous edit and edit type `id` with the caret at `byte` (clicked at `p`), selecting + /// it → the actions. + fn begin_edit(&mut self, cx: &ToolContext, id: NodeId, byte: usize, p: Point) -> Vec<Action> { let mut out = self.finish(cx); - self.start_editing(h.leaf, byte); + self.start_editing(id, byte); self.remember(cx); self.clicks = (Some(p), 1); - out.push(Action::Exec("select.set".into(), json!({"ids": [h.leaf.0]}))); - Some(out) + out.push(Action::Exec("select.set".into(), json!({"ids": [id.0]}))); + out + } + + /// The answer to the [`MISSING_FONT_EDIT`] question whose token is `token`: OK (`ok`) lets the + /// next [`Tool::poll`] start the edit, Cancel forgets it. An answer to another question is + /// ignored. + fn answer_edit(&mut self, token: u64, ok: bool) { + let Some(e) = self.pending_edit.as_mut().filter(|e| e.token == token) else { return }; + if ok { + e.accepted = true; + } else { + self.pending_edit = None; + } + } + + /// Start the edit OK accepted: the caret goes where the type was clicked. Nothing starts when + /// the document changed since the question, or the type is gone. + fn resume_edit(&mut self, cx: &ToolContext) -> Vec<Action> { + let Some(e) = self.pending_edit.take_if(|e| e.accepted) else { return vec![] }; + if e.revision != cx.revision { + return vec![]; + } + let Some(t) = Self::text(cx, e.id) else { return vec![] }; + let text = t.plain_text(); + let mut byte = e.byte.min(text.len()); + while !text.is_char_boundary(byte) { + byte -= 1; + } + let out = self.begin_edit(cx, e.id, byte, Point::ZERO); + self.clicks = (None, 0); + out } /// The button released after a press at `start` (new type goes at `at`). While type is being diff --git a/crates/tools/src/text/missing.rs b/crates/tools/src/text/missing.rs new file mode 100644 index 0000000000..7d14d635b4 --- /dev/null +++ b/crates/tools/src/text/missing.rs @@ -0,0 +1,83 @@ +//! Type set in fonts that aren't available as named asks before it is edited: a click or a +//! double-click that would start editing it opens a question ([`MISSING_FONT_EDIT`]) instead, and +//! editing starts at the clicked place only after OK (the tool option `missingFontEdit`). The +//! fonts are those `text.missingFonts` reads, for the story of the type clicked only. + +use std::collections::BTreeSet; + +use serde_json::{Value, json}; +use vectorcraft_doc::{Document, NodeId, NodeKind, TextRun}; +use vectorcraft_text::{FontDb, FontMatch}; + +/// The dialog kind of the question, with the fields `token`, `id`, `missing` and `style` (lists of +/// "family style" names) and `more` (how many more fonts the lists leave out). +pub const MISSING_FONT_EDIT: &str = "missingFontEdit"; + +/// The most fonts the question names. +const LISTED: usize = 8; + +/// The longest family or style name checked (bytes), as `text.missingFonts` reads them. +const MAX_NAME: usize = 256; + +/// An edit of type set in fonts that aren't available, waiting for the answer to its question. +#[derive(Clone, Debug, PartialEq)] +pub(super) struct PendingEdit { + /// The question's token, which its answer names. + pub token: u64, + /// The document (its uid) and its revision when the question was asked: an answer to a + /// document since changed starts no editing. + pub revision: (u64, u64), + /// The type clicked, and the caret's byte offset there. + pub id: NodeId, + pub byte: usize, + /// OK was chosen: the next [`crate::Tool::poll`] starts editing. + pub accepted: bool, +} + +/// The fonts (family, style) run `r` is drawn in: its own, or, set in a composite font, those of +/// the parts its characters fall in. An inline graphic and an empty run draw no glyphs. +fn run_fonts(db: &FontDb, r: &TextRun) -> Vec<(String, String)> { + if r.inline.is_some() || r.text.is_empty() { + return vec![]; + } + db.composite_fonts_for(&r.style.font_family, &r.text).unwrap_or_else(|| vec![(r.style.font_family.clone(), r.style.font_style.clone())]) +} + +/// The fonts that the story of type object `id` ([`Document::story_of`]: every frame threaded with +/// it) is drawn in and that aren't available as named, each once, in the order first used, with how +/// they resolve ([`FontMatch::Missing`] or [`FontMatch::Style`]); at most [`LISTED`], with how many +/// more there are. CSS generic families and names longer than 256 bytes are left out, as +/// `text.missingFonts` leaves them out. +pub(super) fn unavailable_fonts(doc: &Document, id: NodeId) -> (Vec<(String, String, FontMatch)>, usize) { + let db = FontDb::global(); + let mut seen = BTreeSet::new(); + let mut listed = Vec::new(); + let mut more = 0; + for frame in doc.story_of(id) { + let Some(NodeKind::Text(t)) = doc.node(frame).map(|n| &n.kind) else { continue }; + for (family, style) in t.runs.iter().flat_map(|r| run_fonts(db, r)) { + if family.trim().is_empty() || vectorcraft_text::is_generic_family(&family) || family.len() > MAX_NAME || style.len() > MAX_NAME { + continue; + } + if !seen.insert((family.clone(), style.clone())) { + continue; + } + let found = db.resolve(&family, &style).map_or(FontMatch::Missing, |(_, m)| m); + if found == FontMatch::Exact { + continue; + } + if listed.len() < LISTED { + listed.push((family, style, found)); + } else { + more += 1; + } + } + } + (listed, more) +} + +/// The question's fields for `fonts` ([`unavailable_fonts`]) and the edit `token` of type `id`. +pub(super) fn question(token: u64, id: NodeId, (fonts, more): &(Vec<(String, String, FontMatch)>, usize)) -> Value { + let names = |m: FontMatch| fonts.iter().filter(|f| f.2 == m).map(|(family, style, _)| format!("{family} {style}")).collect::<Vec<_>>(); + json!({"token": token, "id": id.0, "missing": names(FontMatch::Missing), "style": names(FontMatch::Style), "more": more}) +} diff --git a/crates/tools/src/text/tests.rs b/crates/tools/src/text/tests.rs index 94063166bc..afa43778e1 100644 --- a/crates/tools/src/text/tests.rs +++ b/crates/tools/src/text/tests.rs @@ -1897,3 +1897,157 @@ fn soft_return_in_a_list_item_keeps_tab_within_the_paragraph() { let acts = key(&mut tool, &d, ToolKey::Tab, Mods::default()); assert!(acts.iter().any(|a| matches!(a, Action::Exec(cmd, p) if cmd == "text.setFormat" && p["listLevel"] == 2))); } + +/// A family no computer has. +const NO_SUCH_FAMILY: &str = "Missing Test Family 7258"; + +/// Point type at (x, 100) whose runs are `runs` (text, family, style). +fn add_styled_text(d: &mut Document, x: f64, runs: &[(&str, &str, &str)]) -> NodeId { + let id = d.alloc_id(); + let style = + |family: &str, font_style: &str| CharStyle { size: 20.0, font_family: family.into(), font_style: font_style.into(), ..Default::default() }; + let mut t = TextObject::point(Point::new(x, 100.0), "", style(runs[0].1, runs[0].2)); + t.runs = runs.iter().map(|(text, family, font_style)| TextRun::new(*text, style(family, font_style))).collect(); + d.insert(Some(d.layers[0].id), 0, Node::new(id, NodeKind::Text(Box::new(t)))).unwrap(); + id +} + +/// Where the caret before byte `b` of type `id` is drawn (document space). +fn caret_at(c: &ToolContext, id: NodeId, b: usize) -> Point { + let t = TypeTool::text(c, id).unwrap(); + let lay = vectorcraft_text::layout(FontDb::global(), t); + let (a, bb) = vectorcraft_text::caret_position(&lay, b); + let at = t.xf * a.midpoint(bb); + Point::new(at.x + 0.1, at.y) +} + +/// The question a click asked → its token and fields. +fn asked(acts: &[Action]) -> (u64, Value) { + match acts { + [Action::Dialog(kind, p)] if kind == MISSING_FONT_EDIT => (p["token"].as_u64().unwrap(), p.clone()), + _ => panic!("expected only the missing-font question: {acts:?}"), + } +} + +/// A click on type set in a family that isn't available asks first and starts no edit; OK starts +/// it with the caret where the type was clicked, and the font the type names stays as it is. +#[test] +fn a_click_on_type_in_a_missing_font_asks_before_editing() { + let mut d = Document::new(500.0, 500.0); + let id = add_styled_text(&mut d, 100.0, &[("Hello", NO_SUCH_FAMILY, "Regular")]); + let mut tool = TypeTool::new("type"); + let (sel, p) = (Selection::default(), paint()); + let c = cx(&d, &sel, &p); + let at = caret_at(&c, id, 3); + let (token, q) = asked(&click(&mut tool, &c, at.x, at.y)); + assert_eq!( + (q["id"].as_u64(), &q["missing"], &q["style"], &q["more"]), + (Some(id.0), &json!([format!("{NO_SUCH_FAMILY} Regular")]), &json!([]), &json!(0)) + ); + assert_eq!(tool.editing, None); + assert!(!tool.waiting()); + // OK: the next poll starts the edit at the clicked character. + tool.set_option("missingFontEdit", &json!({"token": token, "ok": true})); + assert!(tool.waiting()); + let acts = tool.poll(&c, false); + assert_eq!(acts, vec![Action::Exec("select.set".into(), json!({"ids": [id.0]}))]); + assert_eq!((tool.editing, tool.caret, tool.anchor), (Some(id), 3, 3)); + assert!(!tool.waiting()); + let NodeKind::Text(t) = &d.node(id).unwrap().kind else { panic!("text") }; + assert_eq!(t.runs[0].style.font_family, NO_SUCH_FAMILY); + // A click within the type being edited moves the caret without asking again. + let at = caret_at(&c, id, 1); + let acts = click(&mut tool, &c, at.x, at.y); + assert!(!acts.iter().any(|a| matches!(a, Action::Dialog(..))), "{acts:?}"); + assert_eq!((tool.editing, tool.caret), (Some(id), 1)); +} + +/// Cancel starts no edit, and the edit in progress on other type goes on; an answer that names +/// another question, or one given to a document changed since, starts nothing either. +#[test] +fn cancel_or_a_stale_answer_starts_no_edit_in_missing_fonts() { + let (mut d, first, mut tool) = editing("First"); + tool.caret = 2; + let other = add_styled_text(&mut d, 300.0, &[("Second", NO_SUCH_FAMILY, "Bold")]); + let (sel, p) = (Selection::default(), paint()); + let c = cx(&d, &sel, &p); + let at = caret_at(&c, other, 2); + let (token, _) = asked(&click(&mut tool, &c, at.x, at.y)); + assert_eq!((tool.editing, tool.caret), (Some(first), 2), "the edit in progress goes on while the question is open"); + tool.set_option("missingFontEdit", &json!({"token": token + 1, "ok": true})); + assert!(!tool.waiting(), "another question's answer"); + tool.set_option("missingFontEdit", &json!({"token": token, "ok": false})); + assert!(tool.poll(&c, false).is_empty()); + assert_eq!((tool.editing, tool.caret), (Some(first), 2)); + // OK after the document changed: nothing starts. + let (token, _) = asked(&click(&mut tool, &c, at.x, at.y)); + tool.set_option("missingFontEdit", &json!({"token": token, "ok": true})); + let changed = ToolContext { revision: (0, 1), ..cx(&d, &sel, &p) }; + assert!(tool.poll(&changed, false).is_empty()); + assert_eq!(tool.editing, Some(first)); + assert!(!tool.waiting()); +} + +/// Every new edit of such type asks again, after an earlier OK too, and a style the family lacks +/// asks as a missing family does; type in available fonts is edited at once. +#[test] +fn each_new_edit_of_type_in_unavailable_fonts_asks() { + let mut d = Document::new(500.0, 500.0); + let styled = add_styled_text(&mut d, 100.0, &[("Wide", "Source Sans 3", "Ultra Condensed Oblique 7258")]); + let plain = add_styled_text(&mut d, 300.0, &[("Plain", "Source Sans 3", "Regular")]); + let mut tool = TypeTool::new("type"); + let (sel, p) = (Selection::default(), paint()); + let c = cx(&d, &sel, &p); + let at = caret_at(&c, styled, 1); + let (token, q) = asked(&click(&mut tool, &c, at.x, at.y)); + assert_eq!((&q["missing"], &q["style"]), (&json!([]), &json!(["Source Sans 3 Ultra Condensed Oblique 7258"]))); + tool.set_option("missingFontEdit", &json!({"token": token, "ok": true})); + tool.poll(&c, false); + assert_eq!(tool.editing, Some(styled)); + // Other type in an available font is edited at once. + let to = caret_at(&c, plain, 2); + let acts = click(&mut tool, &c, to.x, to.y); + assert!(acts.contains(&Action::Exec("select.set".into(), json!({"ids": [plain.0]}))), "{acts:?}"); + assert_eq!(tool.editing, Some(plain)); + // Back to the first type: a new edit, so the question comes again. + asked(&click(&mut tool, &c, at.x, at.y)); + assert_eq!(tool.editing, Some(plain)); +} + +/// The whole story counts: type with one run in a missing font asks even when the click lands in a +/// run in an available font, and the question names each font once. +#[test] +fn a_story_with_one_run_in_a_missing_font_asks() { + let mut d = Document::new(500.0, 500.0); + let id = add_styled_text( + &mut d, + 100.0, + &[("Here ", "Source Sans 3", "Regular"), ("gone ", NO_SUCH_FAMILY, "Regular"), ("again", NO_SUCH_FAMILY, "Regular")], + ); + let mut tool = TypeTool::new("type"); + let (sel, p) = (Selection::default(), paint()); + let c = cx(&d, &sel, &p); + let at = caret_at(&c, id, 1); + let (_, q) = asked(&click(&mut tool, &c, at.x, at.y)); + assert_eq!(q["missing"], json!([format!("{NO_SUCH_FAMILY} Regular")])); + assert_eq!(tool.editing, None); +} + +/// Type set in a CSS generic family is edited without a question, and a press dropped while the +/// question is open leaves the edit in progress as it was. +#[test] +fn generic_families_and_a_dropped_press_ask_nothing_more() { + let mut d = Document::new(500.0, 500.0); + let generic = add_styled_text(&mut d, 100.0, &[("Generic", "sans-serif", "Regular")]); + let missing = add_styled_text(&mut d, 300.0, &[("Missing", NO_SUCH_FAMILY, "Regular")]); + let mut tool = TypeTool::new("type"); + let (sel, p) = (Selection::default(), paint()); + let c = cx(&d, &sel, &p); + let at = caret_at(&c, generic, 1); + let acts = click(&mut tool, &c, at.x, at.y); + assert!(acts.contains(&Action::Exec("select.set".into(), json!({"ids": [generic.0]}))), "{acts:?}"); + let to = caret_at(&c, missing, 1); + asked(&tool.pointer(&c, &PointerEvent::new(PointerKind::Down, to.x, to.y))); + assert!(tool.drop_press(&c).is_empty()); + assert_eq!(tool.editing, Some(generic)); +} diff --git a/crates/tools/src/text/tool.rs b/crates/tools/src/text/tool.rs index e18754f0ca..3beb099f3d 100644 --- a/crates/tools/src/text/tool.rs +++ b/crates/tools/src/text/tool.rs @@ -73,8 +73,12 @@ impl Tool for TypeTool { } self.clicks = (None, 0); // A press on other type edits it from there, so a drag selects its text at once, - // as it does in the type being edited. + // as it does in the type being edited. While the question about its fonts is open, + // the press does nothing more, and the edit in progress goes on. if let Some(out) = self.edit_at(cx, ev.pos) { + if self.pending_edit.is_some() { + return out; + } self.selecting = true; self.before_press = Some(before); return out; @@ -472,8 +476,16 @@ impl Tool for TypeTool { } fn deactivate(&mut self, cx: &ToolContext) -> Vec<Action> { self.prev_tool = None; + self.pending_edit = None; self.finish(cx) } + /// OK on the question about type in missing fonts started an edit the next poll begins. + fn waiting(&self) -> bool { + self.pending_edit.as_ref().is_some_and(|e| e.accepted) + } + fn poll(&mut self, cx: &ToolContext, _wait: bool) -> Vec<Action> { + self.resume_edit(cx) + } /// Editing ends when a command takes the text out of the selection (Deselect, another object /// picked in the Layers panel) or removes it. After an Undo that takes back a list typed /// characters started, the caret goes on after the characters, and after its Redo the caret @@ -537,9 +549,15 @@ impl Tool for TypeTool { } } /// `select {start, end}` / `selectAll` / `copy` (with `runs` of the selection) / - /// `commitTyping` (the caller commits the engine interaction). + /// `commitTyping` (the caller commits the engine interaction) / `missingFontEdit {token, ok}` + /// (the answer to the question about type in missing fonts; never a saved setting). fn set_option(&mut self, key: &str, v: &Value) { match key { + "missingFontEdit" => { + if let (Some(token), Some(ok)) = (v.get("token").and_then(Value::as_u64), v.get("ok").and_then(Value::as_bool)) { + self.answer_edit(token, ok); + } + } // Transient selection transferred between Type and Eyedropper; never a saved setting. "textSelection" => { if let (Some(id), Some(a), Some(b)) = ( diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index cc65044dfb..e1605132a9 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -8661,6 +8661,11 @@ fn retype_all_of_a_copied_type(ime: bool) { frame(&mut app, vec![button(at, pressed, Modifiers::NONE)]); } frame(&mut app, vec![]); + // Without Georgia on this computer, the Type tool asks first; OK starts the edit. + if app.ui.dialog.as_ref().is_some_and(|d| d.kind == crate::dialogs::confirm::MISSING_FONT_EDIT) { + crate::dialogs::confirm(&mut app).unwrap(); + frame(&mut app, vec![]); + } assert_eq!(app.session.tool_options()["editing"], json!(copy)); // 3. Select all of its text and type over it. frame(&mut app, vec![key(Key::A, true, Modifiers::COMMAND)]); @@ -8748,6 +8753,65 @@ fn double_clicking_type_with_the_direct_selection_tool_puts_the_caret_there() { assert!(!app.session.tool_wants_text()); } +/// Double-clicking type set in a family that isn't available asks before the Type tool edits it: +/// Cancel leaves the document, its undo history and the selection as they were, with nothing +/// edited; OK puts the caret where the type was clicked, and typing edits the type, which keeps +/// the family it names. +#[test] +fn double_clicking_type_in_a_missing_font_asks_before_editing() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let params = json!({"x": 100, "y": 150, "text": "Hello world", "size": 24, "font": "Missing Test Family 7258"}); + let id = app.session.execute("text.create", ¶ms).unwrap()["id"].as_u64().unwrap(); + app.session.execute("select.none", &json!({})).unwrap(); + app.select_tool("selection"); + let ctx = egui::Context::default(); + let timed = |app: &mut VectorcraftApp, time: f64, events: Vec<egui::Event>| { + let screen = egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)); + let mut out = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), time: Some(time), events, ..Default::default() }, |ui| show(app, ui)); + out.textures_delta.clear(); + }; + timed(&mut app, 0.0, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let node = |app: &VectorcraftApp| app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().clone(); + let b = node(&app).geometric_bounds().unwrap(); + let at = xf.to_screen(b.center()); + let button = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + let double_click = |app: &mut VectorcraftApp, time: f64| { + timed(app, time, vec![egui::Event::PointerMoved(at), button(true), button(false), button(true), button(false)]); + timed(app, time + 0.1, vec![]); + }; + let asking = |app: &VectorcraftApp| app.ui.dialog.as_ref().filter(|d| d.kind == crate::dialogs::confirm::MISSING_FONT_EDIT).cloned(); + double_click(&mut app, 1.0); + let d = asking(&app).expect("the question about the missing font"); + assert!(d.str("detail").contains("Missing Test Family 7258 Regular"), "{}", d.str("detail")); + assert_eq!(app.session.tool_options()["editing"], json!(null)); + // Cancel: nothing is edited, and the document, its undo history and the selection stay. + let (before, undo, selected) = + (node(&app), app.session.doc().unwrap().history.undo.len(), app.session.active().unwrap().selection.objects.clone()); + crate::dialogs::cancel(&mut app); + timed(&mut app, 1.5, vec![]); + assert_eq!(app.session.tool_options()["editing"], json!(null)); + assert!(!app.session.tool_wants_text()); + assert_eq!(node(&app), before); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo); + assert_eq!(app.session.active().unwrap().selection.objects, selected); + // A new double-click asks again; OK edits with the caret where the type was clicked. + double_click(&mut app, 3.0); + assert!(asking(&app).is_some(), "asked again"); + crate::dialogs::confirm(&mut app).unwrap(); + timed(&mut app, 3.5, vec![]); + assert!(app.ui.dialog.is_none()); + let o = app.session.tool_options(); + assert_eq!(o["editing"], json!(id)); + let caret = o["caret"].as_u64().unwrap(); + assert!((1..11).contains(&caret), "caret {caret}"); + app.session.tool_text("X", app.view_info()).unwrap(); + let NodeKind::Text(t) = &node(&app).kind else { panic!("not text") }; + assert_eq!(t.plain_text().find('X'), Some(caret as usize), "{}", t.plain_text()); + assert!(t.runs.iter().all(|r| r.style.font_family == "Missing Test Family 7258")); +} + #[test] fn escape_while_editing_in_isolation_returns_to_selection_tool_and_keeps_isolation_until_second_escape() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 9e54eb12f6..a03b772769 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -343,6 +343,7 @@ registry! { ReplaceFiles: [confirm::REPLACE_FILES] => confirm::REPLACE_FILES_SPEC, ResetPreferences: [confirm::RESET_PREFS] => confirm::RESET_PREFS_SPEC, ResetActions: [confirm::RESET_ACTIONS] => confirm::RESET_ACTIONS_SPEC, + MissingFontEdit: [confirm::MISSING_FONT_EDIT] => confirm::MISSING_FONT_EDIT_SPEC, NewSwatch: [new_swatch::KIND] => new_swatch::SPEC, NewColorGroup: [new_color_group::KIND] => new_color_group::SPEC, GraphData: [graph_data::KIND] => graph_data::SPEC, @@ -699,6 +700,9 @@ pub fn cancel(app: &mut VectorcraftApp) { if d.kind == safe_mode::STOPPED { safe_mode::cancel_stopped(app); } + if d.kind == confirm::MISSING_FONT_EDIT { + confirm::answer_missing_font_edit(app, &d, false); + } // The growth question's Cancel button is its Stop button. if d.kind == script_run::GROWTH_KIND { app.session.script_request_stop(); diff --git a/crates/ui-egui/src/dialogs/confirm.rs b/crates/ui-egui/src/dialogs/confirm.rs index 15b28c2d27..b4fd6f037e 100644 --- a/crates/ui-egui/src/dialogs/confirm.rs +++ b/crates/ui-egui/src/dialogs/confirm.rs @@ -156,6 +156,47 @@ fn reset_actions(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> app.run(crate::panels::actions::RESET, json!({ "mode": mode })) } +/// The dialog kind of the question a click or double-click asks before it edits type set in fonts +/// that aren't available as named ([`ask_missing_font_edit`]). Fields: `message`, `detail`, +/// `__token` (the Type tool's edit, which the answer names). +pub const MISSING_FONT_EDIT: &str = vectorcraft_tools::text::MISSING_FONT_EDIT; + +pub(super) const MISSING_FONT_EDIT_SPEC: DialogSpec = DialogSpec { confirm: edit_in_missing_fonts, ..SPEC }; + +/// Ask whether to edit type whose story is drawn in fonts that aren't available, which the Type +/// tool names in `p` (`token`, `missing` and `style`: "family style" names, `more`: how many more +/// there are). The detail names each font (family and style, the family's own names, which are +/// not translated). OK starts the edit where the type was clicked; Cancel and Escape start nothing. +pub(crate) fn ask_missing_font_edit(app: &mut VectorcraftApp, p: &Value) { + let names = |k: &str| p.get(k).and_then(Value::as_array).into_iter().flatten().filter_map(Value::as_str).map(str::to_string).collect::<Vec<_>>(); + let mut fonts = names("missing"); + fonts.extend(names("style")); + if p.get("more").and_then(Value::as_u64).is_some_and(|n| n > 0) { + fonts.push("…".to_string()); + } + let detail = format!("{}\n{}", fonts.join(", "), tl!("These fonts aren't available. Their text shows in another font.")); + let message = tl!("Edit type set in fonts that aren't available?"); + let fields = json!({"message": message, "detail": detail, "__token": p.get("token")}); + app.ui.dialog = Some(Dialog::new(MISSING_FONT_EDIT, fields)); +} + +/// OK on [`ask_missing_font_edit`]: closes, then the Type tool starts the edit. +fn edit_in_missing_fonts(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> { + app.ui.dialog = None; + answer_missing_font_edit(app, d, true); + Ok(Value::Null) +} + +/// Give the Type tool the answer to [`ask_missing_font_edit`]'s question `d`: with `ok` the edit +/// starts at once; without, the tool forgets it. +pub(super) fn answer_missing_font_edit(app: &mut VectorcraftApp, d: &Dialog, ok: bool) { + app.session.set_tool_option("missingFontEdit", &json!({"token": d.fields.get("__token"), "ok": ok})); + if ok { + let r = app.session.tool_poll(app.view_info(), false); + crate::canvas::apply_requests(app, r); + } +} + /// Most messages kept for later while a dialog is open ([`tell`]). const MAX_WAITING: usize = 16; diff --git a/crates/ui-egui/src/dialogs/tools.rs b/crates/ui-egui/src/dialogs/tools.rs index 6dbcfe28ce..978474c29c 100644 --- a/crates/ui-egui/src/dialogs/tools.rs +++ b/crates/ui-egui/src/dialogs/tools.rs @@ -166,6 +166,11 @@ pub fn open_tool_dialog(app: &mut VectorcraftApp, kind: &str, p: Value) { } return; } + // A click or double-click that would edit type set in fonts that aren't available. + vectorcraft_tools::text::MISSING_FONT_EDIT => { + super::confirm::ask_missing_font_edit(app, &p); + return; + } _ => return, }; app.ui.dialog = Some(d); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index bb039bb08e..29b7bf56e5 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3072,6 +3072,7 @@ digits Malayalam Малаялам How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Колко близо на екрана показалецът или влачена точка трябва да стигне до обект, за да прилепнат интелигентните водачи; разстоянието е еднакво при всеки мащаб. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Прилепва края на линеен сегмент или окръжност, начертана от центъра си, така че да докосва близка крива. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прилепва края на линеен сегмент така, че да среща близък прав сегмент под прав ъгъл. + Edit type set in fonts that aren't available? Да се редактира ли текст с шрифтове, които не са налични? Reset all preferences to their defaults? Да се нулират ли всички настройки до стойностите по подразбиране? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Стойностите по подразбиране се прилагат, когато щракнете върху ОК в Настройки. Отказ там запазва текущите ви настройки. Restore Recovered Documents Възстановяване на възстановените документи diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 99f23d313c..5854b59997 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4509,6 +4509,7 @@ font-technology Variable Varijabilni How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Koliko blizu na ekranu pokazivač ili prevučena tačka mora doći do objekta da bi ga pametne vodilice uhvatile; udaljenost je ista pri svakom zumu. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Hvata kraj segmenta linije ili krug nacrtan iz središta tako da dodiruje obližnju krivu. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hvata kraj segmenta linije tako da pod pravim uglom susreće obližnji ravni segment. + Edit type set in fonts that aren't available? Urediti tekst u fontovima koji nisu dostupni? Reset all preferences to their defaults? Vratiti sve postavke na zadane vrijednosti? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Zadane vrijednosti primjenjuju se kada kliknete U redu u Postavkama. Otkaži tamo zadržava vaše trenutne postavke. Smaller ↔ Larger Manje ↔ veće diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c54311799d..90e50fc790 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3902,6 +3902,7 @@ digits Malayalam Malaiàlam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Com d’a prop a la pantalla han d’arribar el punter o un punt arrossegat a l’art perquè les guies intel·ligents s’hi ajustin; la distància és la mateixa a qualsevol zoom. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta l’extrem d’un segment de línia, o un cercle dibuixat des del centre, perquè toqui una corba propera. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta l’extrem d’un segment de línia perquè trobi un segment recte proper en angle recte. + Edit type set in fonts that aren't available? Voleu editar el text en tipus de lletra que no estan disponibles? Reset all preferences to their defaults? Voleu restablir totes les preferències als valors predeterminats? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Els valors predeterminats s’apliquen quan feu clic a D’acord a Preferències. Cancel·la allà conserva les preferències actuals. Restore Recovered Documents Restaura els documents recuperats diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..639ce515a7 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4613,6 +4613,7 @@ font-technology Variable Variabilní How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Jak blízko na obrazovce musí ukazatel nebo tažený bod přijít ke kresbě, aby se chytrá vodítka přichytila; vzdálenost je stejná při každém zvětšení. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Přichytí konec úsečky nebo kružnici kreslenou od středu tak, aby se dotýkala blízké křivky. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Přichytí konec úsečky tak, aby se s blízkým rovným segmentem setkal v pravém úhlu. + Edit type set in fonts that aren't available? Upravit text v písmech, která nejsou k dispozici? Reset all preferences to their defaults? Obnovit všechny předvolby na výchozí hodnoty? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Výchozí hodnoty se použijí po klepnutí na OK v Předvolbách. Zrušit tam zachová vaše současné předvolby. Smaller ↔ Larger Menší ↔ Větší diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 08100f593f..bec08fbff9 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7012,6 +7012,7 @@ font-technology Variable Variable How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hvor tæt på skærmen markøren eller et trukket punkt skal komme på grafik, for at de smarte hjælpelinjer fastgør til den; afstanden er den samme ved alle zoomniveauer. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Fastgør enden af et linjesegment eller en cirkel tegnet fra midten, så den rører en nærliggende kurve. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fastgør enden af et linjesegment, så det møder et nærliggende lige segment i en ret vinkel. + Edit type set in fonts that aren't available? Rediger tekst i skrifttyper, der ikke er tilgængelige? Reset all preferences to their defaults? Nulstil alle præferencer til standard? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardværdierne anvendes, når du klikker på OK i Præferencer. Annullér der beholder dine nuværende præferencer. Smaller ↔ Larger Mindre ↔ Større diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 10147b2d45..9084a39aa4 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3124,6 +3124,7 @@ digits Malayalam Malayalam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Wie nah der Zeiger oder ein gezogener Punkt auf dem Bildschirm an Bildmaterial kommen muss, damit intelligente Hilfslinien einrasten; der Abstand ist bei jedem Zoom gleich. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Richtet das Ende eines Liniensegments oder einen von der Mitte aus gezeichneten Kreis so aus, dass er eine nahe Kurve berührt. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Richtet das Ende eines Liniensegments so aus, dass es ein nahes gerades Segment im rechten Winkel trifft. + Edit type set in fonts that aren't available? Text in Schriften bearbeiten, die nicht verfügbar sind? Reset all preferences to their defaults? Alle Voreinstellungen auf ihre Standardwerte zurücksetzen? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Die Standardwerte werden angewendet, wenn Sie in den Voreinstellungen auf OK klicken. Abbrechen dort behält Ihre aktuellen Voreinstellungen. Restore Recovered Documents Wiederhergestellte Dokumente öffnen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ebf6e5684..deed0eb790 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3942,6 +3942,7 @@ digits Malayalam Μαλαγιάλαμ How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Πόσο κοντά στην οθόνη πρέπει να φτάσει ο δείκτης ή ένα σημείο που σύρεται σε γραφικά για να προσκολληθούν οι έξυπνοι οδηγοί· η απόσταση είναι ίδια σε κάθε ζουμ. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Προσκολλά το άκρο ενός ευθύγραμμου τμήματος ή έναν κύκλο που σχεδιάζεται από το κέντρο του ώστε να αγγίζει μια κοντινή καμπύλη. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Προσκολλά το άκρο ενός ευθύγραμμου τμήματος ώστε να συναντά ένα κοντινό ευθύ τμήμα σε ορθή γωνία. + Edit type set in fonts that aren't available? Επεξεργασία κειμένου σε γραμματοσειρές που δεν είναι διαθέσιμες; Reset all preferences to their defaults? Επαναφορά όλων των προτιμήσεων στις προεπιλογές τους; The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Οι προεπιλογές εφαρμόζονται όταν κάνετε κλικ στο Εντάξει στις Προτιμήσεις. Το Ακύρωση εκεί διατηρεί τις τρέχουσες προτιμήσεις σας. Restore Recovered Documents Επαναφορά ανακτημένων εγγράφων diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a456910a16..73ecae41a9 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3162,6 +3162,7 @@ digits Malayalam Malayálam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Cuánto debe acercarse en pantalla el puntero o un punto arrastrado a la ilustración para que las guías inteligentes se ajusten a ella; la distancia es la misma con cualquier zoom. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta el extremo de un segmento de línea, o un círculo dibujado desde su centro, para que toque una curva cercana. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta el extremo de un segmento de línea para que encuentre un segmento recto cercano en ángulo recto. + Edit type set in fonts that aren't available? ¿Editar el texto en fuentes que no están disponibles? Reset all preferences to their defaults? ¿Restablecer todas las preferencias a sus valores predeterminados? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Los valores predeterminados se aplican al hacer clic en Aceptar en Preferencias. Cancelar ahí conserva sus preferencias actuales. Restore Recovered Documents Restaurar documentos recuperados diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index bff46fc0d7..5ae67e0dda 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4532,6 +4532,7 @@ font-technology Variable Muuttuvat How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Kuinka lähelle grafiikkaa osoittimen tai vedettävän pisteen on tultava näytöllä, jotta älykkäät apuviivat kohdistavat siihen; etäisyys on sama kaikilla zoomauksilla. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Kohdistaa janan pään tai keskipisteestä piirretyn ympyrän niin, että se koskettaa lähellä olevaa käyrää. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Kohdistaa janan pään niin, että se kohtaa lähellä olevan suoran segmentin suorassa kulmassa. + Edit type set in fonts that aren't available? Muokataanko tekstiä, jonka fontit eivät ole käytettävissä? Reset all preferences to their defaults? Palautetaanko kaikki asetukset oletuksiin? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Oletukset otetaan käyttöön, kun valitset Asetuksissa OK. Peruuta siellä säilyttää nykyiset asetuksesi. Smaller ↔ Larger Pienempi ↔ Suurempi diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..7bc64569cc 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3150,6 +3150,7 @@ digits Malayalam Malayalam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. La distance à l’écran à laquelle le pointeur ou un point déplacé doit approcher une illustration pour que les repères commentés s’y aimantent. Elle est la même à tous les zooms. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Aimante l’extrémité d’un segment de droite, ou un cercle tracé depuis son centre, pour qu’il touche une courbe proche. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aimante l’extrémité d’un segment de droite pour qu’il rencontre un segment droit proche à angle droit. + Edit type set in fonts that aren't available? Modifier le texte composé dans des polices non disponibles ? Reset all preferences to their defaults? Rétablir toutes les préférences à leur valeur par défaut ? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Les valeurs par défaut sont appliquées lorsque vous cliquez sur OK dans Préférences. Annuler y conserve vos préférences actuelles. Restore Recovered Documents Restaurer les documents récupérés diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c427fc527c..659d6f3477 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3130,6 +3130,7 @@ Reset all બધું રીસેટ કરો Reset all 3D settings to their defaults. બધી 3D સેટિંગ્સ ડિફોલ્ટ પર રીસેટ કરો. Reset all Revolve settings to their defaults. બધી રિવોલ્વ સેટિંગ્સ ડિફોલ્ટ પર રીસેટ કરો. + Edit type set in fonts that aren't available? ઉપલબ્ધ ન હોય તેવા ફૉન્ટમાં સેટ કરેલો ટેક્સ્ટ સંપાદિત કરીએ? Reset all preferences to their defaults? બધી પસંદગીઓ ડિફોલ્ટ પર રીસેટ કરીએ? Reset the rows to the artwork's colors પંક્તિઓ આર્ટવર્કના રંગો પર રીસેટ કરો Reset to Inverse ઊલટા પર રીસેટ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index cbfb4f51d1..7bfd7a5476 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4272,6 +4272,7 @@ antiAlias Sharp शार्प How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. स्मार्ट गाइड्स के स्नैप करने के लिए पॉइंटर या ड्रैग किया गया पॉइंट स्क्रीन पर आर्ट के कितने पास आना चाहिए; यह दूरी हर ज़ूम पर समान रहती है। Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. लाइन सेगमेंट के सिरे को, या केंद्र से ड्रॉ किए गए वृत्त को, इस तरह स्नैप करता है कि वह पास के वक्र को छुए। Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. लाइन सेगमेंट के सिरे को इस तरह स्नैप करता है कि वह पास के सीधे सेगमेंट से समकोण पर मिले। + Edit type set in fonts that aren't available? जो फ़ॉन्ट उपलब्ध नहीं हैं, उनमें सेट टेक्स्ट एडिट करें? Reset all preferences to their defaults? सभी प्रेफ़रेंसेज़ को उनके डिफ़ॉल्ट पर रीसेट करें? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. डिफ़ॉल्ट तब लागू होते हैं जब आप प्रेफ़रेंसेज़ में ठीक है पर क्लिक करते हैं। वहाँ रद्द करें आपकी मौजूदा प्रेफ़रेंसेज़ बनाए रखता है। Restore Recovered Documents पुनर्स्थापना डॉक्यूमेंट diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..fa98b5489a 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3743,6 +3743,7 @@ mark-style Japanese Japán How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Milyen közel kell a mutatónak vagy egy húzott pontnak a képernyőn a grafikához érnie, hogy az intelligens segédvonalak illesszenek; a távolság minden nagyításnál azonos. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Egy szakasz végét vagy a középpontjából rajzolt kört úgy illeszti, hogy érintse a közeli görbét. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Egy szakasz végét úgy illeszti, hogy derékszögben találkozzon egy közeli egyenes szakasszal. + Edit type set in fonts that aren't available? Szerkeszti a nem elérhető betűtípusokkal szedett szöveget? Reset all preferences to their defaults? Visszaállítja az összes beállítást az alapértékre? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Az alapértékek akkor lépnek életbe, amikor a Beállításokban az OK gombra kattint. Az ottani Mégse megtartja a jelenlegi beállításokat. Restore Recovered Documents Helyreállított dokumentumok visszaállítása diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 28ea2b5ab3..485f6b5c22 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4264,6 +4264,7 @@ font-technology Variable Variabel How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Seberapa dekat penunjuk atau titik yang diseret harus mendekati karya di layar agar panduan cerdas menjepret; jaraknya sama pada setiap zoom. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Menjepretkan ujung segmen garis, atau lingkaran yang digambar dari pusatnya, agar menyentuh kurva di dekatnya. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Menjepretkan ujung segmen garis agar bertemu segmen lurus di dekatnya pada sudut siku-siku. + Edit type set in fonts that aren't available? Edit teks dengan font yang tidak tersedia? Reset all preferences to their defaults? Atur ulang semua preferensi ke defaultnya? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Nilai default diterapkan saat Anda mengklik OK di Preferensi. Batal di sana mempertahankan preferensi Anda saat ini. Smaller ↔ Larger Lebih kecil ↔ Lebih besar diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8f2ed3216c..85cb90d85f 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3205,6 +3205,7 @@ digits Malayalam Malayalam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Quanto vicino sullo schermo il puntatore o un punto trascinato deve arrivare alla grafica perché le guide sensibili vi si aggancino; la distanza è la stessa a ogni zoom. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Aggancia l’estremità di un segmento di linea, o un cerchio disegnato dal centro, in modo che tocchi una curva vicina. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aggancia l’estremità di un segmento di linea in modo che incontri un segmento rettilineo vicino ad angolo retto. + Edit type set in fonts that aren't available? Modificare il testo in font non disponibili? Reset all preferences to their defaults? Ripristinare tutte le preferenze ai valori predefiniti? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. I valori predefiniti vengono applicati quando fai clic su OK in Preferenze. Annulla lì mantiene le preferenze attuali. Restore Recovered Documents Ripristina documenti recuperati diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..2dbb86c65e 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3182,6 +3182,7 @@ mark-style Japanese 日本式 How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. スマートガイドがスナップするために、ポインターやドラッグしたポイントが画面上でアートにどこまで近づく必要があるかです。この距離はどのズームでも同じです。 Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 直線セグメントの端、または中心から描いた円を、近くの曲線に接するようにスナップします。 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 直線セグメントの端を、近くの直線セグメントと直角に交わるようにスナップします。 + Edit type set in fonts that aren't available? 使用できないフォントのテキストを編集しますか? Reset all preferences to their defaults? すべての環境設定を初期値に戻しますか? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 初期値は環境設定で OK をクリックすると適用されます。そこでキャンセルすると現在の環境設定が保たれます。 Restored documents open unsaved: save them to keep them. 復元したドキュメントは未保存の状態で開きます。保存して残してください。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..307711cf52 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6330,6 +6330,7 @@ font-technology Variable ცვლადი How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. რამდენად ახლოს უნდა მივიდეს ეკრანზე მაჩვენებელი ან გადათრეული წერტილი გრაფიკასთან, რომ ჭკვიანმა დამხმარე ხაზებმა მიაბან; მანძილი ყველა მასშტაბზე ერთნაირია. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. ხაზის სეგმენტის ბოლოს, ან ცენტრიდან დახატულ წრეწირს, ისე აბამს, რომ ახლომდებარე მრუდს შეეხოს. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. ხაზის სეგმენტის ბოლოს ისე აბამს, რომ ახლომდებარე სწორ სეგმენტს მართი კუთხით შეხვდეს. + Edit type set in fonts that aren't available? დავარედაქტიროთ მიუწვდომელი შრიფტებით აწყობილი ტექსტი? Reset all preferences to their defaults? დავაბრუნოთ ყველა პარამეტრი ნაგულისხმევ მნიშვნელობებზე? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. ნაგულისხმევი მნიშვნელობები გამოიყენება, როცა პარამეტრებში OK-ს დააჭერთ. იქ გაუქმება ინარჩუნებს თქვენს მიმდინარე პარამეტრებს. Smaller ↔ Larger უფრო პატარა ↔ უფრო დიდი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..be8b75ec08 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3171,6 +3171,7 @@ mark-style Japanese 일본식 How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 스마트 안내선이 스냅하려면 포인터나 드래그한 점이 화면에서 아트에 얼마나 가까이 와야 하는지입니다. 이 거리는 모든 확대/축소에서 같습니다. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 선 세그먼트의 끝이나 중심에서 그린 원을 가까운 곡선에 닿도록 스냅합니다. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 선 세그먼트의 끝을 가까운 직선 세그먼트와 직각으로 만나도록 스냅합니다. + Edit type set in fonts that aren't available? 사용할 수 없는 글꼴로 설정된 문자를 편집하시겠습니까? Reset all preferences to their defaults? 모든 환경 설정을 기본값으로 재설정하시겠습니까? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 기본값은 환경 설정에서 확인을 클릭하면 적용됩니다. 그곳에서 취소를 누르면 현재 환경 설정이 유지됩니다. Restored documents open unsaved: save them to keep them. 복원된 문서는 저장되지 않은 상태로 열립니다. 보존하려면 저장하세요. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..1475c48ac9 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4886,6 +4886,7 @@ font-technology Variable Variabel How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hoe dicht de aanwijzer of een gesleept punt op het scherm bij een illustratie moet komen voordat slimme hulplijnen erop uitlijnen; de afstand is bij elke zoom gelijk. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Lijnt het einde van een lijnsegment, of een cirkel getekend vanuit het middelpunt, zo uit dat het een curve in de buurt raakt. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Lijnt het einde van een lijnsegment zo uit dat het een recht segment in de buurt onder een rechte hoek raakt. + Edit type set in fonts that aren't available? Tekst in lettertypen bewerken die niet beschikbaar zijn? Reset all preferences to their defaults? Alle voorkeuren terugzetten naar de standaardwaarden? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. De standaardwaarden worden toegepast wanneer u in Voorkeuren op OK klikt. Annuleren daar behoudt uw huidige voorkeuren. Smaller ↔ Larger Kleiner ↔ Groter diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0147515ffe..c43f81c008 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4454,6 +4454,7 @@ font-technology Variable Zmienne How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Jak blisko na ekranie wskaźnik lub przeciągany punkt musi znaleźć się przy grafice, aby inteligentne linie pomocnicze go przyciągnęły; odległość jest taka sama przy każdym powiększeniu. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Przyciąga koniec odcinka lub okrąg rysowany od środka tak, aby dotykał pobliskiej krzywej. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Przyciąga koniec odcinka tak, aby spotykał pobliski prosty segment pod kątem prostym. + Edit type set in fonts that aren't available? Edytować tekst złożony niedostępnymi czcionkami? Reset all preferences to their defaults? Przywrócić domyślne wartości wszystkich preferencji? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Wartości domyślne zostaną zastosowane po kliknięciu OK w Preferencjach. Anuluj w tym oknie zachowuje bieżące preferencje. Smaller ↔ Larger Mniejszy ↔ większy diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8201db7ab6..c112185e47 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2654,6 +2654,7 @@ digits Malayalam Malaiala How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Quão perto na tela o ponteiro ou um ponto arrastado precisa chegar da arte para que as guias inteligentes se ajustem a ela; a distância é a mesma em qualquer zoom. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Ajusta a extremidade de um segmento de linha, ou um círculo desenhado a partir do centro, para que toque uma curva próxima. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta a extremidade de um segmento de linha para que encontre um segmento reto próximo em ângulo reto. + Edit type set in fonts that aren't available? Editar o texto em fontes que não estão disponíveis? Reset all preferences to their defaults? Redefinir todas as preferências para o padrão? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Os padrões são aplicados quando você clica em OK em Preferências. Cancelar ali mantém suas preferências atuais. Restored documents open unsaved: save them to keep them. Os documentos restaurados abrem sem salvar: salve-os para mantê-los. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..d035f3c676 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3192,6 +3192,7 @@ digits Malayalam Малаялам How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Насколько близко на экране указатель или перетаскиваемая точка должны подойти к объекту, чтобы умные направляющие привязали их; расстояние одинаково при любом масштабе. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Привязывает конец отрезка или окружность, нарисованную от центра, так, чтобы она касалась ближайшей кривой. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Привязывает конец отрезка так, чтобы он встречал ближайший прямой сегмент под прямым углом. + Edit type set in fonts that aren't available? Редактировать текст, набранный недоступными шрифтами? Reset all preferences to their defaults? Сбросить все настройки до значений по умолчанию? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значения по умолчанию применяются, когда вы нажимаете ОК в окне «Настройки». Отмена там сохраняет текущие настройки. Restore Recovered Documents Восстановить восстановленные документы diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5c0420fcd3..ce7c42227b 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3092,6 +3092,7 @@ digits Malayalam Malayalam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Hur nära på skärmen pekaren eller en dragen punkt måste komma teckningen för att de smarta stödlinjerna ska fästa mot den; avståndet är detsamma vid alla zoomnivåer. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Fäster änden av ett linjesegment, eller en cirkel ritad från sin mitt, så att den rör en närliggande kurva. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fäster änden av ett linjesegment så att det möter ett närliggande rakt segment i rät vinkel. + Edit type set in fonts that aren't available? Redigera text i typsnitt som inte är tillgängliga? Reset all preferences to their defaults? Återställa alla inställningar till standard? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardvärdena verkställs när du klickar på OK i Inställningar. Avbryt där behåller dina nuvarande inställningar. Restore Recovered Documents Återställ återskapade dokument diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..9885158818 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2929,6 +2929,7 @@ digits Malayalam Malayalam How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Akıllı Kılavuzların yaslaması için işaretçinin veya sürüklenen noktanın ekranda çizime ne kadar yaklaşması gerektiği; mesafe her yakınlaştırmada aynıdır. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Bir çizgi parçasının ucunu veya merkezinden çizilen bir daireyi yakındaki bir eğriye değecek şekilde yaslar. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Bir çizgi parçasının ucunu yakındaki düz bir parçayla dik açıyla buluşacak şekilde yaslar. + Edit type set in fonts that aren't available? Mevcut olmayan yazı tiplerindeki metin düzenlensin mi? Reset all preferences to their defaults? Tüm tercihler varsayılanlarına sıfırlansın mı? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Varsayılanlar, Tercihler'de Tamam'a tıkladığınızda uygulanır. Oradaki İptal, mevcut tercihlerinizi korur. Restore Recovered Documents Kurtarılan Belgeleri Geri Yükle diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index dbd6d2609e..2827529aff 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3197,6 +3197,7 @@ digits Malayalam Малаялам How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Наскільки близько на екрані вказівник або перетягувана точка мають підійти до об’єкта, щоб розумні напрямні їх прив’язали; відстань однакова за будь-якого масштабу. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Прив’язує кінець відрізка або коло, намальоване від центру, так, щоб воно торкалося найближчої кривої. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прив’язує кінець відрізка так, щоб він зустрічав найближчий прямий сегмент під прямим кутом. + Edit type set in fonts that aren't available? Редагувати текст, набраний недоступними шрифтами? Reset all preferences to their defaults? Скинути всі налаштування до значень за промовчанням? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Значення за промовчанням застосовуються, коли ви натискаєте ОК у вікні «Налаштування». Скасувати там зберігає поточні налаштування. Restore Recovered Documents Відновити відновлені документи diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 519c5d8f0d..791cbebec8 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3512,6 +3512,7 @@ mark-style Japanese Kiểu Nhật How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. Con trỏ hoặc điểm đang kéo phải đến gần hình vẽ trên màn hình bao nhiêu để đường căn thông minh hút vào; khoảng cách này như nhau ở mọi mức thu phóng. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. Hút đầu mút của đoạn thẳng, hoặc hình tròn vẽ từ tâm, để nó chạm vào một đường cong ở gần. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hút đầu mút của đoạn thẳng để nó gặp một đoạn thẳng ở gần theo góc vuông. + Edit type set in fonts that aren't available? Chỉnh sửa văn bản dùng phông chữ không có sẵn? Reset all preferences to their defaults? Đặt lại tất cả tùy chọn về mặc định? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Giá trị mặc định được áp dụng khi bạn nhấn OK trong Tùy chọn. Hủy ở đó giữ nguyên các tùy chọn hiện tại của bạn. Restore Recovered Documents Khôi phục tài liệu đã phục hồi diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c6696a9ec6..3b82156b06 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3056,6 +3056,7 @@ digits Malayalam 马拉雅拉姆数字 How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 指针或拖动的点在屏幕上需离图稿多近,智能参考线才会吸附;该距离在任何缩放比例下都相同。 Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 吸附线段的端点或从中心绘制的圆,使其与附近的曲线相切。 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 吸附线段的端点,使其与附近的直线段成直角相交。 + Edit type set in fonts that aren't available? 要编辑使用了不可用字体的文字吗? Reset all preferences to their defaults? 将所有首选项重置为默认值? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在首选项中点击确定后才会应用默认值。在那里点击取消会保留当前首选项。 Restore Recovered Documents 恢复已恢复的文档 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..e73f2754c1 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4340,6 +4340,7 @@ digits Malayalam 馬來亞拉姆數字 How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. 指標或拖曳的點在螢幕上需離圖稿多近,智慧型參考線才會靠齊;此距離在任何縮放比例下都相同。 Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. 靠齊線段的端點或從中心繪製的圓,使其與附近的曲線相切。 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 靠齊線段的端點,使其與附近的直線段成直角相交。 + Edit type set in fonts that aren't available? 要編輯使用了無法使用之字體的文字嗎? Reset all preferences to their defaults? 要將所有偏好設定重設為預設值嗎? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 在偏好設定中按下確定後才會套用預設值。在那裡按下取消會保留目前的偏好設定。 Restore Recovered Documents 還原找回的文件 diff --git a/docs/mcp.md b/docs/mcp.md index 092faabc4c..5431d539bb 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11460,6 +11460,18 @@ Copy only fonts you own or are licensed to install. `command.batch` returns befo `text.findFontFiles {}`. `vectorcraft-cli run` stops the search when its last step ends. The web build has no Fonts folder and no folder search. +A Type tool click, or a Selection or Direct Selection double-click, that would start editing type whose story (every +frame threaded with it) is drawn in a font that isn't available as named, as `text.missingFonts` reads them, opens a +`missingFontEdit` question instead (fields `message`, `detail`, `__token`) and does not start editing. `ui.dialog.confirm` +starts the edit with the caret where the type was clicked; `ui.dialog.cancel` leaves the document, its undo history and +the selection as they were. Answering does not change the fonts the type names, install a font or open Find Font. The +question comes again for each new edit, and not for a click within the type being edited or in another frame of its +story. The Type tool's `missingFontEdit {token, ok}` option is how the question gives its answer. Commands that change +text (`text.editRange`, `text.setRangeStyle` and the others) do not ask. This follows the help page +https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html, +which describes a warning shown when text with missing fonts is double-clicked, and editing after OK. Cancel, asking +again for each edit, the Type tool's single click and the style-only case are VectorCraft's own rules. + ```json {"name":"run_command","arguments":{"command":"text.missingFonts","params":{}}} {"name":"run_command","arguments":{"command":"text.findFontFiles","params":{"folder":"/Users/me/Downloads"}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..60315d65f4 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1887,6 +1887,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur The font menu's Recently Added filter (on its own row under Font Technology) lists only the installed families added in the last 30 days, the newest at the top, as the [user guide](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=486) and the [font browser overview](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/font-options-overview.html) describe it (`vectorcraft_text::FontDb::recently_added`). It works together with the search, script, kind, Variable, ★ and Document filters, lists only the families every active filter matches, steers the closed field's wheel, and is shared by every font menu for the session like the other filters. VectorCraft's own rules: a family is dated by the creation time of its newest font file on this computer (a file the file system keeps no creation time for, or one dated in the future, does not count), the 30th day is included, families added at the same instant are in name order, the recently used families appear in that order without the Recent Fonts section, Show Similar Fonts orders only the families the filter lists, a family leaves the list when its 30 days end while the menu is open, an empty list keeps the filter on and says no fonts match, and fonts bundled with the app or loaded from documents are never listed. Measured by `font_menu::tests::the_recently_added_filter_lists_new_families_newest_first`, `font_menu::tests::the_recently_added_filter_drops_families_as_their_30_days_end`, `font_menu::tests::the_recently_added_filter_lists_a_font_installed_just_now`, `tests::recently_added::families_added_in_the_last_30_days_are_listed_newest_first`, `tests::recently_added::a_family_is_dated_by_its_newest_valid_file` and `tests::sysfonts::installed_fonts_are_recently_added_by_their_files_creation_time`. The font database looks up a name that is neither a loaded nor an installed family among the other names of the loaded and installed fonts once for each style it is asked in, and keeps the answer until fonts are added or rescanned. Laying out a story of 1,000 paragraphs set in a font that is not installed, with 400 more fonts loaded, takes a median of 56 to 71 ms instead of 409 to 507 ms on Windows 11 (`CRAFT_FONTS_DIR=<craft-fonts checkout> cargo test --release -p vectorcraft-text --lib missing_font_story_layout_timing -- --ignored --nocapture`). A font family removed while the app runs leaves the font menus when the app scans the font folders again (when its window comes to the front after a font folder changed, or Refresh Font List), also when type had used it: that type then draws in the fallback font and Find Font lists the font as missing, until the font is installed again and the folders are scanned. + Editing type set in a font that isn't available asks first: a Type tool click, or a Selection or Direct Selection double-click, on type whose story is drawn in a missing family or a style its family lacks opens a question naming those fonts, and OK starts editing where the type was clicked, as the [help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/edit-text-without-replacing-missing-fonts.html) describes for a double-click on such text. VectorCraft's own rules: Cancel leaves the document, its undo history and the selection as they were; each new edit asks again; the Type tool's single click and a style its family lacks ask too; the question does not change the fonts the type names. Tests: `text::tests::a_click_on_type_in_a_missing_font_asks_before_editing` and the tests after it (`crates/tools`), `canvas::tests::double_clicking_type_in_a_missing_font_asks_before_editing` (`crates/ui-egui`). - **Files (M4):** - PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. - PDF export and print composition use the optional shared guarded writer ([pdf-backend.md](pdf-backend.md)); app drawing and output policy and desktop printer submission remain in their existing layers. The shared reader keeps the app-owned import adapter; synthetic tests cover layer and overprint state across windows, long operands, inline images, failed decoding, document limits and incomplete tails. Empty and populated metadata key presence is regression-tested, and CI checks the immutable backend source. From e24d15c40c774b8b6182c802c1d9b305c8cc47f7 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 11:47:47 -0800 Subject: [PATCH 139/247] Tile: other panes keep their selected objects' outlines between frames Each pane other than the current document's, under Window > Arrange > Tile and in floating document windows, made and flattened the outlines of its document's selected objects on every frame, and with more points than are outlined it measured the bounds of every selected object on every frame. The pane now keeps the outline shapes by slot and makes them again when the document's revision, the document, the selection or the pane's screen mapping changes. The shapes drawn are the same as before. A pane with View > Edges off keeps none, and the outlines of panes that no longer show are dropped with the pane's other state. With every object selected, one frame of a pane's outlines with their tessellation takes 28.9 ms of CPU time in a release build instead of 40.1 ms for 20,000 rectangles, 116.7 ms instead of 197.2 ms for 20,000 ellipses, and 0.05 ms instead of 32.0 ms for 150,000 rectangles (medians of seven interleaved runs of 20 frames, pane_outlines_timing). --- crates/ui-egui/src/canvas/panes.rs | 77 +++++++-- crates/ui-egui/src/canvas/panes/tests.rs | 205 +++++++++++++++++++++++ docs/target-app-parity.md | 1 + 3 files changed, 272 insertions(+), 11 deletions(-) diff --git a/crates/ui-egui/src/canvas/panes.rs b/crates/ui-egui/src/canvas/panes.rs index e6e16ad271..d5096bb9fb 100644 --- a/crates/ui-egui/src/canvas/panes.rs +++ b/crates/ui-egui/src/canvas/panes.rs @@ -9,12 +9,12 @@ use std::collections::HashMap; use std::sync::Arc; use super::grid::LineLook; -use super::outline::{c32, node_outline, stroke_path, too_many_anchors}; +use super::outline::{c32, node_outline, to_screen_path, too_many_anchors}; use super::view::fit_zoom; use super::{ - Affine, CacheKey, Point, Rect, RulerScale, Sense, Stroke, StrokeKind, Tokens, Ui, VectorcraftApp, View, Xf, artboard_edges, backdrop, cache_key, - dim_on_canvas, frame_options, frame_ppp, frame_view, grid, guides_of, json, paint_paper, pixel_region, placed_key, plugin_key, pos2, rulers, - shows_artboards, textured_quad, vec2, view_rects, + Affine, BezPath, CacheKey, Point, Rect, RulerScale, Sense, Stroke, StrokeKind, Tokens, Ui, VectorcraftApp, View, Xf, artboard_edges, backdrop, + cache_key, dim_on_canvas, frame_options, frame_ppp, frame_view, grid, guides_of, json, paint_paper, pixel_region, placed_key, plugin_key, pos2, + rulers, shows_artboards, textured_quad, vec2, view_rects, }; use crate::doc_windows::Win; use crate::thumb_worker::ThumbWorker; @@ -42,6 +42,32 @@ pub struct Panes { /// By slot: the size of the view's area its view was last fitted to in a pane, and the zoom and /// center the fit gave. fits: HashMap<Slot, (egui::Vec2, f64, Point)>, + /// By slot: the outlines of the selected objects the pane drew last, and what they show. + outlines: HashMap<Slot, Outlines>, + /// How many times a pane's outlines were made. + outlines_made: u64, +} + +/// A pane's selected-object outlines as screen shapes, and the document revision, document, +/// selection and screen mapping they were made for. +struct Outlines { + revision: u64, + doc: usize, + selection: Vec<vectorcraft_doc::NodeId>, + affine: [f64; 6], + shapes: Vec<egui::Shape>, +} + +impl Outlines { + /// Whether these outlines show `st`'s selection through the screen mapping `affine`. + fn shows(&self, st: &vectorcraft_engine::DocState, affine: &[f64; 6]) -> bool { + self.revision == st.revision && self.doc == doc_address(st) && self.affine == *affine && self.selection == st.selection.objects + } +} + +/// The address of `st`'s document, which tells two documents with the same revision apart. +fn doc_address(st: &vectorcraft_engine::DocState) -> usize { + Arc::as_ptr(&st.doc) as usize } impl Panes { @@ -51,6 +77,7 @@ impl Panes { self.pending.clear(); self.last.clear(); self.fits.clear(); + self.outlines.clear(); } /// Upload `img`, the render `key` describes, for `slot`. @@ -220,6 +247,9 @@ pub(crate) fn tiled_area(app: &mut VectorcraftApp, ui: &mut Ui) -> bool { app.canvas.panes.clear(); } app.canvas.panes.last.clear(); + // Only the floating windows draw panes now. + let floating = &app.ui.floating; + app.canvas.panes.outlines.retain(|(u, n), _| floating.iter().any(|w| w.uid == *u && w.view == *n)); return false; } // The current window's pane is the canvas, unless it is a floating one. @@ -229,6 +259,7 @@ pub(crate) fn tiled_area(app: &mut VectorcraftApp, ui: &mut Ui) -> bool { app.canvas.panes.shown.retain(|s, _| live.contains(s)); app.canvas.panes.pending.retain(|s, _| live.contains(s)); app.canvas.panes.fits.retain(|s, _| live.contains(s)); + app.canvas.panes.outlines.retain(|s, _| live.contains(s)); // A window opened, closed, floated or docked changes the grid, and so does coming back to the // panes from one window: each window fits its new pane. if app.canvas.panes.last.iter().map(|(w, _)| *w).ne(docked.iter().copied()) { @@ -456,7 +487,9 @@ fn draw_pane(app: &mut VectorcraftApp, ui: &Ui, w: Win, cell: egui::Rect) -> boo guides_of(app, st, (&painter, &xf, &t), rect); } if app.ui.view.edges { - selected_objects(st, &painter, &xf); + selected_objects(&mut app.canvas.panes, slot, st, &painter, &xf); + } else { + app.canvas.panes.outlines.remove(&slot); } if app.ui.view.rulers && app.ui.screen_mode < 3 { rulers(ui, full, &xf, None, RulerScale::document(app.session.general_unit(), st.doc.ruler_origin_for(v.artboard)), &t); @@ -474,23 +507,45 @@ fn draw_pane(app: &mut VectorcraftApp, ui: &Ui, w: Win, cell: egui::Rect) -> boo resp.contains_pointer() && ui.input(|inp| inp.pointer.any_pressed()) } -/// The outlines of the objects selected in `st`, in their layers' colors; their bounds when they -/// have too many points to outline. -fn selected_objects(st: &vectorcraft_engine::DocState, painter: &egui::Painter, xf: &Xf) { +/// Draw the outlines of the objects selected in `st` ([`outline_shapes`]) in `slot`'s pane, from +/// the outlines `panes` kept for the slot while they show the same revision, document, selection +/// and screen mapping, and made again otherwise. +fn selected_objects(panes: &mut Panes, slot: Slot, st: &vectorcraft_engine::DocState, painter: &egui::Painter, xf: &Xf) { + let affine = xf.affine().as_coeffs(); + if !panes.outlines.get(&slot).is_some_and(|o| o.shows(st, &affine)) { + let shapes = outline_shapes(st, xf); + let kept = Outlines { revision: st.revision, doc: doc_address(st), selection: st.selection.objects.clone(), affine, shapes }; + panes.outlines.insert(slot, kept); + panes.outlines_made += 1; + } + for shape in panes.outlines.get(&slot).map_or(&[][..], |o| &o.shapes) { + painter.add(shape.clone()); + } +} + +/// The outlines of the objects selected in `st` as lines on the screen through `xf`, in their +/// layers' colors; their bounds when they have too many points to outline. +fn outline_shapes(st: &vectorcraft_engine::DocState, xf: &Xf) -> Vec<egui::Shape> { + let mut shapes = vec![]; + if st.selection.objects.is_empty() { + return shapes; + } let symbols = st.doc.symbol_boxes(); let nodes: Vec<(vectorcraft_doc::NodeId, &vectorcraft_doc::Node)> = st.selection.objects.iter().filter_map(|id| Some((*id, st.doc.node(*id)?))).collect(); let color = |id: vectorcraft_doc::NodeId| Stroke::new(1.0, c32(st.doc.layer_color(id))); + let mut stroke = |bp: &BezPath, s: Stroke| shapes.extend(to_screen_path(bp, xf).into_iter().map(|line| egui::Shape::line(line, s))); if too_many_anchors(nodes.iter().map(|(_, n)| *n)) { let bounds = nodes.iter().filter_map(|(_, n)| n.geometric_bounds_with(&symbols)).reduce(|a, b| a.union(b)); if let (Some(b), Some((id, _))) = (bounds, nodes.first()) { - stroke_path(painter, &vectorcraft_geom::shapes::rectangle(b).to_bezpath(), xf, color(*id)); + stroke(&vectorcraft_geom::shapes::rectangle(b).to_bezpath(), color(*id)); } - return; + return shapes; } for (id, n) in nodes { - stroke_path(painter, &node_outline(n, &symbols), xf, color(id)); + stroke(&node_outline(n, &symbols), color(id)); } + shapes } #[cfg(test)] diff --git a/crates/ui-egui/src/canvas/panes/tests.rs b/crates/ui-egui/src/canvas/panes/tests.rs index 03c0ce7bed..439b19b898 100644 --- a/crates/ui-egui/src/canvas/panes/tests.rs +++ b/crates/ui-egui/src/canvas/panes/tests.rs @@ -540,6 +540,132 @@ fn other_panes_draw_their_guides_and_selected_objects() { assert_ne!(layer, Color32::TRANSPARENT); } +/// The selected objects' outlines as the panes made them on every frame before they kept them, +/// to hold the kept outlines against. +fn outlines_made_each_frame(st: &vectorcraft_engine::DocState, xf: &Xf) -> Vec<Shape> { + let mut shapes = vec![]; + let symbols = st.doc.symbol_boxes(); + let nodes: Vec<(vectorcraft_doc::NodeId, &vectorcraft_doc::Node)> = + st.selection.objects.iter().filter_map(|id| Some((*id, st.doc.node(*id)?))).collect(); + let color = |id: vectorcraft_doc::NodeId| Stroke::new(1.0, c32(st.doc.layer_color(id))); + let mut stroke_path = |bp: &BezPath, s: Stroke| { + for line in to_screen_path(bp, xf) { + shapes.push(Shape::line(line, s)); + } + }; + if too_many_anchors(nodes.iter().map(|(_, n)| *n)) { + let bounds = nodes.iter().filter_map(|(_, n)| n.geometric_bounds_with(&symbols)).reduce(|a, b| a.union(b)); + if let (Some(b), Some((id, _))) = (bounds, nodes.first()) { + stroke_path(&vectorcraft_geom::shapes::rectangle(b).to_bezpath(), color(*id)); + } + return shapes; + } + for (id, n) in nodes { + stroke_path(&node_outline(n, &symbols), color(id)); + } + shapes +} + +/// The first document's pane in a tiled pair: the outlines it keeps, after checking that they +/// equal the outlines made afresh through its view and that the frame `drawn` holds them in order. +fn kept_outlines<'a>(app: &'a VectorcraftApp, ctx: &egui::Context, drawn: &[Shape]) -> &'a [Shape] { + let pane = panes(app).1[0]; + let xf = Xf::new(view_rects(app, pane, ctx.pixels_per_point()).1, &app.views[0]); + let slot = (app.session.documents()[0].uid, 1); + let kept = &app.canvas.panes.outlines.get(&slot).expect("the pane keeps its outlines").shapes; + assert_eq!(kept, &outlines_made_each_frame(&app.session.documents()[0], &xf), "the kept outlines are the ones made afresh"); + assert!(kept.is_empty() || drawn.windows(kept.len()).any(|w| w == kept.as_slice()), "the pane draws the kept outlines"); + kept +} + +/// Run `cmd` on the first document of a tiled pair, then make the second current again. +fn in_first(app: &mut VectorcraftApp, cmd: &str, args: serde_json::Value) -> serde_json::Value { + app.run("document.activate", json!({"index": 0})).unwrap(); + let out = app.session.execute(cmd, &args).unwrap(); + app.run("document.activate", json!({"index": 1})).unwrap(); + out +} + +#[test] +fn other_panes_keep_their_selected_outlines_until_the_document_selection_or_view_changes() { + let mut app = app_with(2); + app.run("document.activate", json!({"index": 1})).unwrap(); + app.run("window.arrange.tile", json!({})).unwrap(); + let ctx = egui::Context::default(); + let rect = in_first(&mut app, "shape.rectangle", json!({"x": 50, "y": 50, "width": 100, "height": 80}))["id"].clone(); + let ellipse = in_first(&mut app, "shape.ellipse", json!({"x": 200, "y": 100, "width": 90, "height": 60}))["id"].clone(); + in_first(&mut app, "select.set", json!({"ids": [rect, ellipse]})); + frame(&mut app, &ctx, vec![]); + let drawn = frame(&mut app, &ctx, vec![]); + assert!(kept_outlines(&app, &ctx, &drawn).len() >= 2, "the rectangle and the ellipse are outlined"); + let made = app.canvas.panes.outlines_made; + let drawn = frame(&mut app, &ctx, vec![]); + kept_outlines(&app, &ctx, &drawn); + assert_eq!(app.canvas.panes.outlines_made, made, "an unchanged frame draws the kept outlines"); + let changed = |app: &mut VectorcraftApp, what: &str| { + let made = app.canvas.panes.outlines_made; + let drawn = frame(app, &ctx, vec![]); + kept_outlines(app, &ctx, &drawn); + assert_eq!(app.canvas.panes.outlines_made, made + 1, "{what} makes the outlines again, once"); + let drawn = frame(app, &ctx, vec![]); + kept_outlines(app, &ctx, &drawn); + assert_eq!(app.canvas.panes.outlines_made, made + 1, "the frame after {what} draws the kept outlines"); + }; + in_first(&mut app, "select.set", json!({"ids": [ellipse]})); + changed(&mut app, "a new selection"); + in_first(&mut app, "object.move", json!({"dx": 30, "dy": -10})); + changed(&mut app, "a move"); + let layer = app.session.documents()[0].doc.layers[0].id.0; + in_first(&mut app, "layer.setProps", json!({"id": layer, "color": "#20a040"})); + changed(&mut app, "a new layer color"); + app.views[0].center.x += 25.0; + changed(&mut app, "a pan"); + app.views[0].zoom *= 1.5; + app.views[0].rotation = 20.0; + changed(&mut app, "a zoom and a turn"); + app.ui.view.edges = false; + frame(&mut app, &ctx, vec![]); + assert!(app.canvas.panes.outlines.is_empty(), "with Edges off no outlines are kept"); + app.ui.view.edges = true; + changed(&mut app, "Edges on again"); + in_first(&mut app, "select.none", json!({})); + changed(&mut app, "an empty selection"); + let drawn = frame(&mut app, &ctx, vec![]); + assert!(kept_outlines(&app, &ctx, &drawn).is_empty()); + // 30,000 rectangles have more points than the outlines are made for: the pane keeps the bounds. + let st = &app.session.documents()[0]; + let rect = st.doc.node(vectorcraft_doc::NodeId(rect.as_u64().unwrap())).cloned().unwrap(); + app.run("document.activate", json!({"index": 0})).unwrap(); + app.session + .edit("Fill", |d, _| { + let layer = d.layers[0].id; + for _ in 0..30_000 { + let mut n = rect.clone(); + n.id = d.alloc_id(); + d.insert(Some(layer), usize::MAX, n)?; + } + Ok(()) + }) + .unwrap(); + app.run("select.all", json!({})).unwrap(); + app.run("document.activate", json!({"index": 1})).unwrap(); + changed(&mut app, "selecting more points than are outlined"); + let drawn = frame(&mut app, &ctx, vec![]); + assert_eq!(kept_outlines(&app, &ctx, &drawn).len(), 1, "one rectangle around the bounds"); + app.run("window.arrange.consolidateAllWindows", json!({})).unwrap(); + frame(&mut app, &ctx, vec![]); + assert!(app.canvas.panes.outlines.is_empty(), "Consolidate All Windows forgets the outlines"); + // Panes that stop showing before their render arrives keep no outlines either. + app.run("window.arrange.tile", json!({})).unwrap(); + frame(&mut app, &ctx, vec![]); + assert_eq!(app.canvas.panes.outlines.len(), 1); + app.ui.tiled = false; + app.canvas.panes.shown.clear(); + app.canvas.panes.last.clear(); + frame(&mut app, &ctx, vec![]); + assert!(app.canvas.panes.outlines.is_empty(), "no pane shows, so no outlines are kept"); +} + #[test] fn opening_a_document_while_tiled_fits_each_document_to_its_new_pane() { let mut app = app_with(2); @@ -874,3 +1000,82 @@ fn tiled_documents_blend_translucent_art_over_their_own_paper_before_display_con assert!(differs(want, blend(s, front_paper)), "the front document's paper blends to another color"); assert!(differs(got, over(plain(s), under)), "the art converted alone shows another color"); } + +fn thread_cpu_ns() -> Option<u128> { + std::fs::read_to_string("/proc/thread-self/schedstat").ok()?.split_whitespace().next()?.parse().ok() +} + +/// Time a pane's selected-object outlines with every object of a document selected: 2,000 and +/// 20,000 rectangles, 20,000 ellipses, and 150,000 rectangles (more points than are outlined, so +/// the pane draws their bounds). Each frame is a whole egui pass that draws the outlines and the +/// tessellation of what it drew, made afresh on every frame ([`outlines_made_each_frame`]) or +/// drawn from the kept outlines ([`selected_objects`]). The sides alternate, and the median time +/// per frame of 7 runs is printed. +/// Run with `cargo test --release -p vectorcraft-ui-egui --lib pane_outlines_timing -- --ignored --nocapture`. +#[test] +#[ignore = "manual timing probe; performance depends on machine load"] +fn pane_outlines_timing() { + const FRAMES: u32 = 20; + let clock = if thread_cpu_ns().is_some() { "thread CPU time" } else { "wall-clock time" }; + eprintln!("{clock} per frame, median of 7 runs of {FRAMES} frames"); + for (count, shape) in [(2_000, "shape.rectangle"), (20_000, "shape.rectangle"), (20_000, "shape.ellipse"), (150_000, "shape.rectangle")] { + let mut app = app_with(1); + let id = app.run(shape, json!({"x": 20, "y": 20, "width": 60, "height": 40})).unwrap()["id"].as_u64().unwrap(); + let node = app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).cloned().unwrap(); + app.session + .edit("Fill", |d, _| { + let layer = d.layers[0].id; + for _ in 1..count { + let mut n = node.clone(); + n.id = d.alloc_id(); + d.insert(Some(layer), usize::MAX, n)?; + } + Ok(()) + }) + .unwrap(); + app.run("select.all", json!({})).unwrap(); + let st = app.session.active().unwrap(); + assert_eq!(st.selection.objects.len(), count); + let ctx = egui::Context::default(); + let area = egui::Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0)); + let xf = Xf { rect: area, zoom: 4.0, center: Point::new(50.0, 40.0), rot: 0.0 }; + let mut kept = Panes::default(); + let slot = (st.uid, 1); + let mut pass = |fresh: bool| { + let raw = egui::RawInput { screen_rect: Some(area), ..Default::default() }; + let out = ctx.run_ui(raw, |ui| { + let painter = ui.painter_at(area); + if fresh { + for s in outlines_made_each_frame(st, &xf) { + painter.add(s); + } + } else { + selected_objects(&mut kept, slot, st, &painter, &xf); + } + }); + ctx.tessellate(out.shapes, out.pixels_per_point).len() + }; + assert_eq!(pass(true), pass(false), "both sides draw as much"); + let mut time = |fresh: bool| { + let (cpu, wall) = (thread_cpu_ns(), std::time::Instant::now()); + for _ in 0..FRAMES { + pass(fresh); + } + let ns = thread_cpu_ns().zip(cpu).map_or_else(|| wall.elapsed().as_nanos(), |(b, a)| b - a); + ns as f64 / f64::from(FRAMES) / 1e6 + }; + let (mut fresh, mut cached) = (vec![], vec![]); + for _ in 0..7 { + fresh.push(time(true)); + cached.push(time(false)); + } + let median = |v: &mut Vec<f64>| { + v.sort_by(f64::total_cmp); + v[v.len() / 2] + }; + let shapes = kept.outlines.get(&slot).map_or(0, |o| o.shapes.len()); + eprintln!("{count} x {shape} ({shapes} lines drawn)"); + eprintln!(" made every frame: {:>9.3} ms {fresh:.3?}", median(&mut fresh)); + eprintln!(" kept: {:>9.3} ms {cached:.3?}", median(&mut cached)); + } +} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..a053e03393 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2236,6 +2236,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Control bar and task bar on large paths:** the Control bar and the contextual task bar read the first selected object in place each frame instead of copying it; the task bar copies the object only when it is a basic shape, for its Shape Properties. With one selected open path of 200,000 anchors, an idle frame with both bars shown takes 3.8 ms in a release build instead of 8.0 ms (medians of five interleaved runs). Tests: `the_control_bar_label_follows_edits_undo_documents_and_selection`, `the_task_bar_follows_the_active_document`, `the_task_bar_follows_edits_and_undo`. - **Paste of many objects:** Paste leaves pasted copies as they are when no resource has another name or color in the document and the objects link no graphic style. It looks up the pasted type in one walk of the tree. A paste and undo of 20,000 rectangles in 200 groups uses 49.2 ms of CPU time in a release build instead of 59.4 ms, and of 5,000 point type objects 25.3 ms instead of 29.4 ms (medians of seven interleaved rounds, each round the CPU time of a 61-paste run minus a 1-paste run, divided by 60). Tests: `crates/engine/tests/it/paste_many.rs`. +- **Selected objects in other panes:** under Window › Arrange › Tile and in floating document windows, each pane other than the current document's keeps the outlines of its selected objects between frames, and makes them again when its document, its selection or its view changes; with View › Edges off it keeps none. The outlines drawn are the same as before. With every object selected, a frame of a pane's outlines, tessellation included, takes 28.9 ms of CPU time in a release build instead of 40.1 ms for 20,000 rectangles, 116.7 ms instead of 197.2 ms for 20,000 ellipses, and 0.05 ms instead of 32.0 ms for 150,000 rectangles, which the pane draws as their bounds (medians of seven interleaved runs of 20 frames). Tests: `canvas::panes::tests::other_panes_keep_their_selected_outlines_until_the_document_selection_or_view_changes`; timing: `pane_outlines_timing`. - **Type drawn as glyph outlines:** under a geometry effect, in EMF and WMF export, in DXF export when it is written as outlines, flattened with Convert All Text to Outlines, and inside an envelope, type keeps its underline and strikethrough, the weight and dashes of its character strokes when it is scaled, and the placement of its gradients and patterns, as the canvas draws it. A group's or layer's own fills and strokes also paint the underline and strikethrough of the type in it. From 987f8572c4227a9b73eee24650fc0baa46b762ce Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 12:03:28 -0800 Subject: [PATCH 140/247] Print: an overprinting gradient's paper-white padding at a hard end stop keeps the ink below When two stops share an end's offset, Level 2's stepped bands pad past that end with the end stop's color and a Level 3 shading pads with the color of the stretch next to it. The plate clip now decides whether the padding is paper white by the color the painter in use draws, so a paper-white padding no longer knocks out the ink below at Level 2, and an inked one is no longer drawn over the ink below at Level 3 where the shading pads with paper white. --- crates/eps/src/print/tests.rs | 51 ++++++++++++++++++++++++++++++----- crates/eps/src/scene.rs | 17 ++++++------ docs/target-app-parity.md | 2 +- 3 files changed, 54 insertions(+), 16 deletions(-) diff --git a/crates/eps/src/print/tests.rs b/crates/eps/src/print/tests.rs index d3685ad5ab..8d2f81851c 100644 --- a/crates/eps/src/print/tests.rs +++ b/crates/eps/src/print/tests.rs @@ -156,12 +156,14 @@ fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { } /// Ink `ink`'s PostScript plate of `art` over a page of 100% `ink` (`under`), checked against the -/// plate of `art` alone: where `art` puts none of the ink down, the ink under it prints, and -/// where it puts ink down, its own amount prints. The pixels of the page where `art` alone puts -/// no ink, those of them where the ink under it does not print, and the pixels where `art` puts -/// ink down that do not print its amount. -fn keeps_the_ink_below(art: &[Node], under: &Paint, ink: &str, level: Level) -> (usize, usize, usize) { - let (alone, _) = plate_of(&over(None, art), ink, level); +/// plate of `art` alone (drawn from the print plan, or with `postscript` from its PostScript +/// plate): where `art` puts none of the ink down, the ink under it prints, and where it puts ink +/// down, its own amount prints. The pixels of the page where `art` alone puts no ink, those of +/// them where the ink under it does not print, and the pixels where `art` puts ink down that do +/// not print its amount. +fn keeps_the_ink_below(art: &[Node], under: &Paint, ink: &str, level: Level, postscript: bool) -> (usize, usize, usize) { + let (plan, own) = plate_of(&over(None, art), ink, level); + let alone = if postscript { own } else { plan }; let (_, printed) = plate_of(&over(Some(under.clone()), art), ink, level); // Pixels whose neighbors all have paper (or all have ink) on the plate of `art` alone: an // edge falls on either side of a pixel's center, and the edge of the inked part is lightest. @@ -232,13 +234,48 @@ fn an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscri assert_keeps_the_ink_below(&cases); } +#[test] +fn an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate() { + // Two stops at an end, one with cyan and one without: Level 2's bands pad with the end stop, + // Level 3's shading with the stretch next to it, so each level is checked against its own + // plate of the gradient alone. + let (inked, none) = (Color::cmyk(0.6, 0.3, 0.0, 0.0), Color::cmyk(0.0, 0.3, 0.0, 0.0)); + let ends = [ + ("none then cyan at 0", [(0.0, none), (0.0, inked), (1.0, inked)]), + ("cyan then none at 1", [(0.0, inked), (1.0, inked), (1.0, none)]), + ("cyan then none at 0", [(0.0, inked), (0.0, none), (1.0, none)]), + ("none then cyan at 1", [(0.0, none), (1.0, none), (1.0, inked)]), + ]; + let c = Point::new(100.0, 50.0); + let around = GradientGeom { start: c, end: c + Vec2::new(50.0, -10.0), aspect: 0.7, focal: None }; + let across = GradientGeom { start: Point::new(40.0, 40.0), end: Point::new(160.0, 60.0), aspect: 1.0, focal: None }; + let pad = GradientSpread::Pad; + let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)); + let shapes = [(GradientKind::Linear, across, "linear"), (GradientKind::Radial, around, "radial"), (GradientKind::Diamond, around, "diamond")]; + let mut cases = vec![]; + for (name, stops) in &ends { + for (kind, geom, shape) in shapes { + let fill = gradient(kind, stops, geom, pad); + cases.push((format!("{shape}, {name}"), overprinting(fill, Paint::None), cyan.clone(), "Cyan")); + } + } + let cases: Vec<_> = cases.iter().map(|(name, art, under, ink)| (name.as_str(), art.clone(), under.clone(), *ink)).collect(); + assert_keeps_the_ink_below_of(&cases, true); +} + /// [`keeps_the_ink_below`] for each of `cases` (a name, the art, the paint under it and the ink /// of the plate) at Level 3 and Level 2, with every case that fails named. fn assert_keeps_the_ink_below(cases: &[(&str, Node, Paint, &str)]) { + assert_keeps_the_ink_below_of(cases, false); +} + +/// [`assert_keeps_the_ink_below`], checked against the PostScript plate of each case's art alone +/// with `postscript`. +fn assert_keeps_the_ink_below_of(cases: &[(&str, Node, Paint, &str)], postscript: bool) { let mut failed = vec![]; for (name, art, under, ink) in cases { for level in [Level::Three, Level::Two] { - let (paper, knocked_out, wrong) = keeps_the_ink_below(std::slice::from_ref(art), under, ink, level); + let (paper, knocked_out, wrong) = keeps_the_ink_below(std::slice::from_ref(art), under, ink, level, postscript); if knocked_out + wrong >= 100 { failed.push(format!("{name} at level {level:?}: {knocked_out} of {paper} knocked out, {wrong} of the others differ")); } diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index 9aae8bb98c..feee718176 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -1226,7 +1226,7 @@ impl<'a> Scene<'a> { } let space = &space; let smooth = self.o.level == Level::Three && !self.o.compatible_gradients; - let spans = if g.gradient.kind == GradientKind::Conic { None } else { self.inked_spans(space, &stops) }; + let spans = if g.gradient.kind == GradientKind::Conic { None } else { self.inked_spans(space, &stops, smooth) }; match g.gradient.kind { GradientKind::Conic => self.conic_steps(&geom, area, space, &stops, &g.gradient), GradientKind::Diamond => { @@ -1299,18 +1299,19 @@ impl<'a> Scene<'a> { /// Where an overprinting gradient with `stops` in `space` puts ink on a plate /// ([`Self::keep_below`]): the spans of its levels outside every stretch between two stops of - /// paper white and outside the padding past an end whose stop is paper white, in order, an - /// end padding with ink unbounded. `None` when the gradient puts ink everywhere or does not - /// overprint on a plate; empty when it puts none down. - fn inked_spans(&self, space: &GradientSpace, stops: &[(f64, Vec<f32>)]) -> Option<Vec<(f64, f64)>> { + /// paper white and outside the padding past an end painted paper white, in order, an end + /// padding with ink unbounded. The padding takes the end stop's color when stepped and the + /// end stretch's color when `smooth` ([`Self::shading`]); the two differ when two stops share + /// the end's offset. `None` when the gradient puts ink everywhere or does not overprint on a + /// plate; empty when it puts none down. + fn inked_spans(&self, space: &GradientSpace, stops: &[(f64, Vec<f32>)], smooth: bool) -> Option<Vec<(f64, f64)>> { if !self.keep_below { return None; } let stretches: Vec<_> = stops.windows(2).filter(|w| w[1].0 > w[0].0).collect(); let (first, last) = (stretches.first()?, stretches.last()?); - // The padding takes the end stop's color stepped and the end stretch's color smooth. - let before = stops.first().is_some_and(|s| space.paper(&s.1)) && space.paper(&first[0].1); - let after = stops.last().is_some_and(|s| space.paper(&s.1)) && space.paper(&last[1].1); + let (start, end) = if smooth { (&first[0].1, &last[1].1) } else { (&stops.first()?.1, &stops.last()?.1) }; + let (before, after) = (space.paper(start), space.paper(end)); let mut blank: Vec<(f64, f64)> = vec![]; let mut add = |a: f64, b: f64| match blank.last_mut() { Some(l) if l.1 >= a => l.1 = l.1.max(b), diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index f3e39caba1..d4a4aa28b5 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2067,7 +2067,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Desktop print transport uses `craft-print` for CUPS and modern Windows. Sheet composition, copies, separations and colour management remain in VectorCraft. The Print dialog's Media list also carries the Japanese papers — JIS B4 257 × 364 mm, JIS B5 182 × 257 mm and JIS B6 128 × 182 mm beside the ISO B4/B5 (250 × 353 and 176 × 250 mm, kept so settings and presets saved before them keep their paper), and はがき 100 × 148 mm, 往復はがき 148 × 200 mm, 封筒 長形3号 120 × 235 mm, 長形4号 90 × 225 mm, 角形2号 240 × 332 mm, 角形3号 216 × 277 mm and 四六判 127 × 188 mm; the JSON id or the dialog label names a paper, any case and spacing (`B5 (JIS)` or `b5jis`) (`crates/pdf/src/print/settings.rs`, `crates/pdf/src/tests/print.rs`). The print-preview and physical-device fidelity gaps remain, so print scores and hours are unchanged. - The Print dialog's Document Ink Options list shows an icon before each spot ink's name, and a click on it prints that one ink as process inks (on the Cyan, Magenta, Yellow and Black plates, with no plate of its own) or as a spot ink again, as [the help page](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) describes for single spot colors. Other spot inks keep their plates, and spot gradient stops and DCS images' spot plates follow each ink's choice (`print.setup {settings: {output: {inks: [{name, convertToProcess: true}]}}}`, kept with the document and in print presets; `print.preview` lists every ink as `documentInks`). These are VectorCraft's own rules: Convert All Spot Colors to Process converts every spot ink and dims the icons while keeping each ink's own choice, a converted ink's Print, Frequency and Angle are dimmed and kept, and process inks and Registration have no icon. Evidence: `print::one_spot_ink_converts_to_process_and_the_others_keep_their_plates`, `print::converting_every_spot_ink_overrides_and_keeps_each_inks_own_choice`, `print::a_spot_gradient_stop_prints_its_process_plates`, `cmykimages::a_dcs_image_converts_only_the_spot_ink_chosen`, `tests::print::a_spot_ink_converted_to_process_is_saved_and_listed_without_a_plate`, `dialogs::tests_print::a_spot_inks_icon_converts_it_to_process_and_back`. Print scores and hours are unchanged. - The Print dialog's Output section has Overprint Black under Convert All Spot Colors to Process, off by default and available with Separations ([Print color separations](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) lists it among the separation options): black art then leaves the inks under it on the other plates (`print.setup {settings: {output: {overprintBlack: true}}}`, kept with the document and in print presets). Solid 100% K or 100% gray fills, strokes and characters (to within half a percent, as Edit › Edit Colors › Overprint Black counts them), and gradients whose every stop (every color point of a freeform gradient) is, overprint; rich, RGB, Lab, spot-linked and lighter blacks are not marked, paints already set to overprint keep that setting, and only the printed copy is marked. These limits are VectorCraft's own rules. Characters set to overprint now also leave the inks below them on printed PDF plates, a type object's own fill in a PDF is drawn with its blending mode, and Edit › Edit Colors › Overprint Black counts a gradient with a stop linked to a spot swatch as a spot black, as it counts a solid one, and a freeform gradient by the color points it draws from. On a plate, an overprinting paint that puts none of that plate's ink down is drawn as nothing; on PostScript plates so is up to half a percent of another ink in a color that counts as black, and any other faint ink stays on the plate. Evidence: `print::overprint_black_keeps_the_inks_under_solid_black_on_separations`, `print::overprint_black_keeps_the_cyan_under_near_and_freeform_blacks_on_postscript_plates`, `print::overprinting_paints_keep_their_faint_ink_on_postscript_plates`, `print::overprinting_type_leaves_the_inks_below_on_separations`, `print::a_type_objects_own_black_fill_overprints_on_separations`, `tests::print::overprint_black_is_saved_with_the_setup_and_in_presets`, `overprint::tests::a_gradient_with_a_spot_linked_stop_is_black_only_with_spot`, `overprint::tests::a_freeform_gradient_is_black_when_every_point_is`. Print scores and hours are unchanged. - - On a PostScript plate, an overprinting gradient that puts the plate's ink down in some places and none in others leaves the ink below where it puts none: the stretches between stops of paper white and the padding past an end stop of paper white are clipped out of a linear, radial or diamond gradient, the wedges of paper white out of a conic one, and the cells of paper white out of a freeform one (masked at Level 3, clipped at Level 2). This holds for fills, strokes and characters, and on spot plates. Where the gradient puts ink down, its amount replaces the ink below as before. A stop or point with up to half a percent of another ink in a color that counts as black puts none down, as a solid fill of that color does. PDF plates are unchanged. These are VectorCraft's own rules. Evidence: `print::tests::an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscript_plate` and `print::tests::overprinting_gradient_strokes_type_freeforms_and_spot_inks_keep_the_ink_below_on_postscript_plates` (`vectorcraft-eps`), `tests::print::a_near_black_stop_of_an_overprinting_gradient_puts_no_cyan_on_postscript_plates`. + - On a PostScript plate, an overprinting gradient that puts the plate's ink down in some places and none in others leaves the ink below where it puts none: the stretches between stops of paper white and the padding past an end that is painted paper white (with the end stop's color at Level 2 and the color of the stretch next to it in a Level 3 smooth shading, which differ when two stops share the end's offset) are clipped out of a linear, radial or diamond gradient, the wedges of paper white out of a conic one, and the cells of paper white out of a freeform one (masked at Level 3, clipped at Level 2). This holds for fills, strokes and characters, and on spot plates. Where the gradient puts ink down, its amount replaces the ink below as before. A stop or point with up to half a percent of another ink in a color that counts as black puts none down, as a solid fill of that color does. PDF plates are unchanged. These are VectorCraft's own rules. Evidence: `print::tests::an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscript_plate`, `print::tests::an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate` and `print::tests::overprinting_gradient_strokes_type_freeforms_and_spot_inks_keep_the_ink_below_on_postscript_plates` (`vectorcraft-eps`), `tests::print::a_near_black_stop_of_an_overprinting_gradient_puts_no_cyan_on_postscript_plates`. - The Print dialog's General section (and the print preset editor) has a link button after Scale W and H, as the Custom scale has one on [the help page](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/print-documents-in-illustrator.html), where turning it off scales the width and height apart. While it is on, typing either percentage sets the other, and turning it on sets H to W. It is on for new settings, dimmed with the fields unless Scaling is Custom or a tiling choice, toggled with a click, Space or Enter, and named with its on or off state for screen readers. W and H take 1–1000% in the fields. The link is kept with the document's print settings and in print presets (`print.setup {settings: {scale: {linked}}}`); settings saved without it read it as off, so they print as before. Its default, the tiling choices and the agent rules are VectorCraft's own. Evidence: `print::the_scale_link_is_on_for_new_settings_and_off_for_a_saved_scale_without_it`, `tests::print::the_scale_link_keeps_width_and_height_equal`, `tests::print::a_scale_saved_without_the_link_keeps_its_width_and_height`, `dialogs::tests_print::the_scale_link_keeps_scale_width_and_height_equal`, `dialogs::tests_print::a_print_preset_keeps_the_scale_link`. Print scores and hours are unchanged. - A PDF, PDF-compatible `.ai` or `.ait` opened from its pages or its editing copy opens with the File Info that its XMP packet and its document information dictionary give: the title (`dc:title`, its `x-default` item first, else Info `Title`), the author, description, keywords, copyright status, notice and URL, and the created and modified dates, the XMP packet's value where both give one (`crates/pdf/src/tests/file_info.rs`, `crates/engine/src/tests/fileinfo.rs`). An SVG opens with the title of its root `<title>`. The title is File Info's alone (`DocMetadata::title`): the document's name stays the file's name with its extension, a file that gives no title leaves File Info with that name, and exports (PDF, SVG, PNG, EPS, `.ai`) and native saves carry it; changing the title in File Info sets the document's name as before (#3626). - PDF export and PDF-compatible `.ai` and `.ait` saves write the document's File Info created date as the file's creation date, or the time of writing when the document has none, and the time of writing as its modification date; the page information mark still prints the time of writing (`crates/engine/src/tests/fileinfo.rs`, `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/marks.rs`). From 12f7e34f2100dc6bea4ee135b1906e6f32b465f4 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 12:06:08 -0800 Subject: [PATCH 141/247] Messages: a success token, and the docs state the plug-in and rollback rules - The success level takes a new `success` theme token (the same green) instead of the 3D axis color. - docs/mcp.md names the plug-in conditions for `vc_call`, says no step is recorded while a drag or typing is in progress, says a failed script run keeps the messages it raised, and names the headless MCP server and `vectorcraft-cli run` as the sessions without a window. Lines wrap like the rest of the file. - The params text and the error say "whitespace", which is what the check rejects. - A new test runs a script that draws, raises a message and throws: the drawing is put back and the message is kept. - The long-message test also checks that the stack stays inside the window. - The evidence line in docs/target-app-parity.md moves after the Scripts entries. --- crates/engine/src/cmd/toast.rs | 34 ++++++++++++++++++++++++++++------ crates/ui-egui/src/theme.rs | 3 +++ crates/ui-egui/src/toasts.rs | 11 +++++++---- docs/mcp.md | 14 ++++++++------ docs/target-app-parity.md | 2 +- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/crates/engine/src/cmd/toast.rs b/crates/engine/src/cmd/toast.rs index c692ad702d..bf6ed66fee 100644 --- a/crates/engine/src/cmd/toast.rs +++ b/crates/engine/src/cmd/toast.rs @@ -1,7 +1,8 @@ //! `app.toast`: a short message shown over the window that does not stop work and goes away by -//! itself (a toast). Scripts (`vc.run`), actions (a recorded step), MCP clients and the app's own -//! code ([`Session::toast`]) raise one. The engine queues the messages and the desktop app takes -//! them each frame ([`Session::take_toasts`]) and shows them. +//! itself (a toast). Scripts (`vc.run`), actions (a recorded step), MCP clients and plug-ins raise +//! one with the command, and the app's code can raise one with [`Session::toast`]. The engine +//! queues the messages and the desktop app takes them each frame ([`Session::take_toasts`]) and +//! shows them. A failed script run puts the documents back but keeps the messages it raised. use std::collections::VecDeque; @@ -22,7 +23,7 @@ pub const MIN_SECONDS: f64 = 0.5; pub const MAX_SECONDS: f64 = 60.0; /// The most messages waiting for the app to take them: past it the oldest one goes. A session -/// without a window (MCP, the command line) never takes them. +/// without a window (the headless MCP server, `vectorcraft-cli run`) never takes them. pub const MAX_QUEUED: usize = 32; /// What kind of news a message is, which sets its color. @@ -95,7 +96,7 @@ pub fn specs() -> Vec<CommandSpec> { "Show Message", [], None, - "{message: string (1 to 500 characters, not only spaces), level?: \"info\" | \"success\" | \"warning\" | \"error\" (default \"info\"), seconds?: number 0.5 to 60 (default 4)} show `message` over the window without stopping work: it goes away after `seconds` or when clicked; messages stack at the window's bottom right, the newest lowest, at most 5 at once; edits no document; an action records it as a step → {message, level, seconds}", + "{message: string (1 to 500 characters, not only whitespace), level?: \"info\" | \"success\" | \"warning\" | \"error\" (default \"info\"), seconds?: number 0.5 to 60 (default 4)} show `message` over the window without stopping work: it goes away after `seconds` or when clicked; messages stack at the window's bottom right, the newest lowest, at most 5 at once; edits no document; an action records it as a step → {message, level, seconds}", always, run )] @@ -116,7 +117,7 @@ fn parse(p: &Value) -> Result<Toast> { None => return Err(bad(ID, "`message` is required")), }; if message.trim().is_empty() { - return Err(bad(ID, "`message` must have a character other than a space")); + return Err(bad(ID, "`message` must have a character other than whitespace")); } let chars = message.chars().count(); if chars > MAX_CHARS { @@ -231,6 +232,27 @@ mod tests { assert_eq!(s.take_toasts(), vec![Toast::new("Done: 2", Level::Success)]); } + #[test] + fn a_failed_script_run_puts_the_documents_back_and_keeps_its_messages() { + let mut s = Session::new(); + s.execute("file.new", &json!({})).unwrap(); + let art = format!("{:?}", s.active().unwrap().doc.layers); + let e = s + .execute( + "script.run", + &json!({ + "source": "vc.run('shape.rectangle', {x: 0, y: 0, width: 10, height: 10}); vc.run('app.toast', {message: 'Failed: no artboard'}); throw new Error('stop');", + "name": "t.js", + "answers": [], + }), + ) + .unwrap_err() + .to_string(); + assert!(e.contains("stop"), "{e}"); + assert_eq!(format!("{:?}", s.active().unwrap().doc.layers), art, "the rectangle is put back"); + assert_eq!(s.take_toasts(), vec![Toast::new("Failed: no artboard", Level::Info)]); + } + #[test] fn a_command_batch_raises_its_messages_in_order() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index eeb00ceb62..8e4a7267bf 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -163,6 +163,8 @@ pub struct Tokens { pub error: Color32, /// Warning marks (a modified linked file). pub warning: Color32, + /// Success marks (a message of level `success`). + pub success: Color32, /// Rotation gizmo axes, also labelled X, Y and Z. pub axis_x: Color32, pub axis_y: Color32, @@ -215,6 +217,7 @@ impl Tokens { artboard_mark: hex(0x808080), error: hex(0xe34850), warning: hex(0xf0a330), + success: hex(0x45af63), axis_x: hex(0xef6058), axis_y: hex(0x45af63), axis_z: hex(0x378ef0), diff --git a/crates/ui-egui/src/toasts.rs b/crates/ui-egui/src/toasts.rs index a8bdb46be5..d1f35f6326 100644 --- a/crates/ui-egui/src/toasts.rs +++ b/crates/ui-egui/src/toasts.rs @@ -1,6 +1,6 @@ -//! Messages that `app.toast` and the app's own code ([`vectorcraft_engine::Session::toast`]) queue, -//! shown over the window without taking the keyboard or stopping work: a stack at the window's -//! bottom right, the newest lowest. Each one goes after its time or when clicked; past +//! Messages that `app.toast` or a call of [`vectorcraft_engine::Session::toast`] queues, shown +//! over the window without taking the keyboard or stopping work: a stack at the window's bottom +//! right, the newest lowest. Each one goes after its time or when clicked; past //! [`MAX_SHOWN`] the oldest goes first. A message shows at most [`MAX_ROWS`] lines, and the whole //! text on hover; a stack taller than the window scrolls. @@ -64,7 +64,7 @@ impl Shown { fn color(t: &Tokens, level: Level) -> egui::Color32 { match level { Level::Info => t.text_dim, - Level::Success => t.axis_y, + Level::Success => t.success, Level::Warning => t.warning, Level::Error => t.error, } @@ -319,6 +319,9 @@ mod tests { pass_in(&mut app, &ctx, 0.0, vec![], height); let newest = app.toasts.list.last().unwrap().rect.unwrap(); assert!(newest.top() >= MARGIN - 0.5 && newest.bottom() <= height - MARGIN + 0.5, "{newest:?}"); + // The stack scrolls inside the window instead of growing past its top. + let stack = ctx.memory(|m| m.area_rect(egui::Id::unique("toasts"))).unwrap(); + assert!(stack.top() >= MARGIN - 0.5 && stack.bottom() <= height - MARGIN + 0.5, "{stack:?}"); assert_eq!(app.toasts.list.len(), MAX_SHOWN); } diff --git a/docs/mcp.md b/docs/mcp.md index 7c67124632..c780fceb17 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3160,15 +3160,17 @@ dropped. ## Messages over the window `app.toast {message, level?, seconds?}` shows a short message over the desktop app's window without stopping work -→ `{message, level, seconds}`. `message` is 1 to 500 characters and not only spaces. `level` is `info` (the +→ `{message, level, seconds}`. `message` is 1 to 500 characters and not only whitespace. `level` is `info` (the default), `success`, `warning` or `error`, and sets the color of the message's edge. `seconds` is how long it shows, 0.5 to 60 (4 by default); a click on it closes it sooner. Messages stack at the window's bottom right, the newest lowest, at most 5 at once: a sixth closes the oldest. A message shows at most 6 lines, with the whole text on hover, -and a stack taller than the window scrolls. A missing `message` or a value outside these ranges is an error, -and nothing shows. The command edits no document and adds no undo step. Scripts raise one with `vc.run('app.toast', -{...})`, a plug-in whose manifest lists `app.toast` calls it like its other commands, and an action recording records it as a step that shows the message again when the action plays. A session -without a window (MCP, `vectorcraft-cli`) keeps the last 32 messages it was given and shows none. These limits are -VectorCraft's own values. +and a stack taller than the window scrolls. A missing `message` or a value outside these ranges is an error, and +nothing shows. The command edits no document and adds no undo step. Scripts raise one with `vc.run('app.toast', +{...})`. A plug-in calls it through `vc_call` under the conditions in [Plug-ins](#plug-ins): API level 2, the +`commands` and `doc.read` permissions, and `app.toast` in its `commandAllowlist`. An action recording records it as a +step that shows the message again when the action plays, except while a drag or typing is in progress, when no +command is recorded. A script run that fails puts the documents back, and the messages it raised still show. The headless MCP server and `vectorcraft-cli run` have no window: they keep the last 32 messages they were +given and show none. These limits are VectorCraft's own values. ```json {"name":"run_command","arguments":{"command":"app.toast","params":{"message":"Exported 4 artboards","level":"success"}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 618b0f4be4..a3497e92c5 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -905,7 +905,6 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - - Messages over the window: `app.toast {message, level?, seconds?}` shows a message at the window's bottom right that does not stop work and closes after its time (4 seconds by default) or when clicked; at most 5 show at once, the newest lowest. Scripts raise one through `vc.run`, MCP clients through the command, and an action records it as a step. The limits are VectorCraft's own values. Tests: `cmd::toast::tests` in `vectorcraft-engine`, `toasts::tests` in `vectorcraft-ui-egui`. - Scripts: Window › Script Console shows each run's `$.write` and `$.writeln` output, `vc.log` entries, uncaught error with the script's name, line and column, and a report of its time, host calls and slowest commands, keeping at most 2,048 lines and counting the lines it dropped. `script.run`'s report carries the same data, and `script.console`, `script.console.clear` and `ui.copyScriptConsole` read, clear and copy it. `crates/engine/src/tests/script_console.rs`. - Scripts: the `$` object has the other members the Dollar object page lists (https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/), from `$.about()` to `$.version`, and scripts have the global `localize(object, ...values)` (https://extendscript.docsforadobe.dev/extendscript-tools-features/localizing-extendscript-strings/), `toSource(value)` and `Object.prototype.toSource()`. Each run starts with the interface's locale, and what a script changes in `$` lasts only for that run. `crates/engine/src/tests/script_dollar.rs`, `crates/js/src/extension_tests.rs`. - Scripts: `toSource` throws a `TypeError` for a property that is not writable or not configurable, a sealed, frozen or non-extensible object or array, and an array with a read-only `length` (VectorCraft's own rule). `crates/js/src/extension_tests.rs`. @@ -922,6 +921,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Scripts: `File` and `Folder` ([File object](https://extendscript.docsforadobe.dev/file-system-access/file-object/), [Folder object](https://extendscript.docsforadobe.dev/file-system-access/folder-object/)) name files and folders by platform or URI path, with `name`, `fsName`, `absoluteURI`, `relativeURI`, `parent`, `Folder.current` and `encode`/`decode`, and read them: `exists`, `length`, the dates, `getFiles` with a mask or a function, and `open('r')` with `read`, `readln`, `readch`, `seek`, `tell` and `close`, decoding by byte order mark, `encoding`, UTF-8 or CP1252. VectorCraft's own rules: a script reads only in its own folder and below (and inside the automation read roots when they are set); any other path and a network or device path are refused before anything is looked up, and a link that leads out is refused as well (`false` or `null`, with `error` set); a file is read whole up to 8 MiB and a run reads up to 32 MiB; writing, the file dialogs and `execute` are not available yet. `crates/engine/src/tests/script_io.rs`. - Scripts: `#strict on` (and `//@strict on`) runs the script with the checks the [`$` object](https://extendscript.docsforadobe.dev/extendscript-tools-features/dollar-object/) help page gives for `$.strict`: an assignment to a read-only property throws a `TypeError`, and so does a new property on an object that takes none. VectorCraft's own rules: a getter-only property counts as read-only, the objects that take no new properties are the non-extensible ones (`Object.preventExtensions`, `seal`, `freeze`, and the frozen `vc` and `$` objects), the last `#strict` line of the script and its includes sets the whole run, a file `$.evalFile` runs keeps its own line's checks for its code, and the rest of ES5 strict mode stays with `'use strict'`. Without the line, runs are unchanged. `crates/engine/src/tests/script_include.rs` (`strict_on_*`, `strict_mode_in_eval_file_is_scoped`), `crates/js/src/interp_tests.rs` (`strict_writes_are_separate_from_es5_strict`). - Scripts folder: File › Scripts lists the `.js` and `.jsx` files of the `Scripts` folder next to the preferences, each named after its file without the extension, with each subfolder as a submenu, above Check Script… and Other Script… (https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/install-and-run-scripts.html). VectorCraft's own rules: the folder is read again when the window becomes active and when the File menu opens (in the macOS menu bar, when any of its menus opens, and the new listing shows the next time the menu opens), links are not followed, and one read stops at 2,048 entries, 512 scripts, 128 subfolders, 4 levels or 250 ms. `script.listInstalled` returns the listing. `crates/engine/src/tests/script_folder.rs`, `crates/ui-egui/src/tests/scripts_menu.rs`. + - Messages over the window: `app.toast {message, level?, seconds?}` shows a message at the window's bottom right that does not stop work and closes after its time (4 seconds by default) or when clicked; at most 5 show at once, the newest lowest. Scripts raise one through `vc.run`, MCP clients through the command, and an action records it as a step. The limits are VectorCraft's own values. Tests: `cmd::toast::tests` in `vectorcraft-engine`, `toasts::tests` in `vectorcraft-ui-egui`. - Open Recent Files under `--automation-read-root`: the control channel's `ui.menu.list` and `file.recentFiles` leave out the recent files outside the read roots, the other rows keep their ids, and `file.openRecentN` for one outside them answers `no such recent file`, as an empty slot does. `crates/ui-egui/src/tests/automation.rs`. - Saves, Export for Screens and Package under `--automation-read-root`: a save without a path leaves the document's own file out of its reply, and a save without a path known leaves out the suggested folder, when they are outside the read roots; Export for Screens into an export preset's folder outside them lists its files relative to that folder and names that folder by its name in an error, and the export settings and saved presets leave out a folder outside them when read or exported; Package's report and warnings, and Document Info's linked images, name a file outside them by its file name. A path the client gives stays in the reply. `crates/engine/src/tests/save.rs`, `crates/engine/src/cmd/fileio/tests_screens.rs`, `crates/engine/src/tests/package.rs`, `crates/ui-egui/src/tests/automation.rs`. - Errors under `--automation-read-root`: a refused save without a path and `file.revert` (also as an `action.batch` step), `script.listInstalled` and `links.relink {copy}` name the document's own file, the Scripts folder or the document's folder by its file name when it is outside the read roots, and keep the roots and the reason; `links.relink`'s copies name such a file by its file name too. A path the client gives stays whole. `crates/engine/src/tests/save.rs` (`pathless_save_rejection_hides_document_folder`), `crates/engine/src/cmd/fileio/action_batch.rs`, `crates/engine/src/tests/links.rs`, `crates/engine/src/tests/script_folder.rs`. From 5cb739a99d369d17f9e83504ec4a29f056161c2b Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze <david.machakhelidze@gmail.com> Date: Wed, 18 Nov 2026 00:11:47 +0400 Subject: [PATCH 142/247] i18n(ka): update the Georgian catalog --- crates/ui-egui/src/i18n/ka.tsv | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..5711e22ef5 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3262,7 +3262,7 @@ lighting Light სინათლე Optimize to File Size… ფაილის ზომაზე ოპტიმიზაცია… Optimize to File Size ფაილის ზომაზე ოპტიმიზაცია Desired File Size: სასურველი ფაილის ზომა: - Start With: დაწყება: + Start With: საწყისი: Use: გამოყენება: Current Settings მიმდინარე პარამეტრები Auto Select GIF/JPEG GIF/JPEG-ის ავტომატური არჩევა @@ -4834,8 +4834,8 @@ digits Malayalam მალაიალამური Collate დაკომპლექტება Composite colours are converted to it; separations separate with it when it is a CMYK profile. შედგენილი ფერები მასში გარდაიქმნება; სეპარაცია მისით ხდება, როცა ის CMYK პროფილია. Convert All Spot Colors to Process ყველა სპოტ-ფერის პროცესულად გარდაქმნა - Convert {name} to process {name}-ის პროცესულად გარდაქმნა - Keep {name} as spot {name}-ის სპოტ-ფერად დატოვება + Convert {name} to process პროცესულად გარდაქმნა: {name} + Keep {name} as spot სპოტ-ფერად დატოვება: {name} Default Printer ნაგულისხმევი პრინტერი Document Ink Options დოკუმენტის საღებავების პარამეტრები Download: ჩამოტვირთვა: @@ -6255,46 +6255,46 @@ font-technology Variable ცვლადი The angle of the axes that arrow keys move along and that Shift holds drawing and moving to. იმ ღერძების კუთხე, რომელთა გასწვრივაც ისრის კლავიშები გადაადგილებენ და რომლებზეც Shift ზღუდავს ხატვას და გადაადგილებას. The corner radius the Rounded Rectangle tool draws with; changing the radius while drawing changes this value too. კუთხის რადიუსი, რომლითაც მომრგვალებული მართკუთხედის ხელსაწყო ხატავს; ხატვისას რადიუსის შეცვლა ამ მნიშვნელობასაც ცვლის. How far right and down Paste moves the copy when it is given no position, as from a script; Paste in the app centers it in the view. რამდენად გადაწევს ჩასმა ასლს მარჯვნივ და ქვემოთ, როცა პოზიცია მითითებული არ არის, მაგალითად სკრიპტიდან; აპში ჩასმა ასლს ხედის ცენტრში სვამს. - Stops the Pen tool from deleting the anchor you click on a selected path, or adding one where you click its segment. კალმის ხელსაწყოს უკრძალავს მონიშნულ კონტურზე დაწკაპუნებული საყრდენი წერტილის წაშლას ან ახლის დამატებას იქ, სადაც მის სეგმენტზე დააწკაპუნებთ. + Stops the Pen tool from deleting the anchor you click on a selected path, or adding one where you click its segment. კალმის ხელსაწყოს უკრძალავს მონიშნულ ტრაექტორიაზე დაწკაპუნებული საყრდენი წერტილის წაშლას ან სეგმენტზე დაწკაპუნების ადგილას ახლის დამატებას. Drawing tools show a crosshair pointer instead of their icon; Caps Lock does the same while it is on. სახატავი ხელსაწყოები ხატულის ნაცვლად ჯვრისებრ მაჩვენებელს აჩვენებენ; Caps Lock იგივეს აკეთებს, სანამ ჩართულია. Shows a tip when the pointer rests on a button or field that has one. აჩვენებს მინიშნებას, როცა მაჩვენებელი ჩერდება ღილაკზე ან ველზე, რომელსაც ის აქვს. Shows a warning before a script you choose runs. აჩვენებს გაფრთხილებას თქვენ მიერ არჩეული სკრიპტის გაშვებამდე. Smooths the edges of artwork on the canvas. ტილოზე ნახატის კიდეებს აგლუვებს. - Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. მონიშვნა › იგივე › შევსების ფერი, კონტურის ფერი და შევსება და კონტური პოულობს მხოლოდ გლობალური ან სპოტ ნიმუშის იმავე ტონს და არა მის ნებისმიერ ტონს. - Shows the Home screen when no document is open; off, the window stays empty until you click Home. აჩვენებს საწყის ეკრანს, როცა არცერთი დოკუმენტი არ არის გახსნილი; გამორთვისას ფანჯარა ცარიელი რჩება, სანამ საწყის ეკრანზე არ დააწკაპუნებთ. + Select › Same › Fill Color, Stroke Color and Fill & Stroke match only the same tint of a global or spot swatch, not any tint of it. მონიშვნა › იგივე › შევსების ფერი, კონტურის ფერი და შევსება და კონტური პოულობს გლობალური ან სპოტ-ფერის ნიმუშის მხოლოდ იმავე ტონირებას და არა მის ნებისმიერ ტონირებას. + Shows the Home screen when no document is open; off, the window stays empty until you click Home. აჩვენებს საწყის ეკრანს, როცა არცერთი დოკუმენტი არ არის გახსნილი; გამორთვისას ფანჯარა ცარიელი რჩება, „საწყის ეკრანზე“ დაწკაპუნებამდე. Measures objects with their strokes and shape-changing effects for size, position and alignment; shadows, glows and blurs are not measured. ზომის, პოზიციისა და სწორების დროს ობიექტებს ზომავს კონტურებითა და ფორმის შემცვლელი ეფექტებით; ჩრდილები, ნათება და გაბუნდოვნება არ იზომება. - At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100%-იან მასშტაბზე დოკუმენტის ერთი დიუმი 72-ის ნაცვლად 96 ეკრანის პუნქტს იკავებს. - Double-clicking a group, path or image with the Selection tool opens it in isolation mode. მონიშვნის ხელსაწყოთი ჯგუფზე, კონტურზე ან გამოსახულებაზე ორჯერ დაწკაპუნება მას იზოლაციის რეჟიმში ხსნის. + At 100% zoom, one inch of the document takes 96 screen points instead of 72. 100%-იან მასშტაბზე დოკუმენტის ერთი დუიმი 72-ის ნაცვლად 96 ეკრანის პუნქტს იკავებს. + Double-clicking a group, path or image with the Selection tool opens it in isolation mode. მონიშვნის ხელსაწყოთი ჯგუფზე, ტრაექტორიაზე ან გამოსახულებაზე ორჯერ დაწკაპუნება მას იზოლაციის რეჟიმში ხსნის. Pattern fills and strokes transform with the art, unless a transform or the Transform panel's menu chooses otherwise. პატერნის შევსებები და კონტურები ნახატთან ერთად გარდაიქმნება, თუ გარდაქმნა ან გარდაქმნის პანელის მენიუ სხვას არ აირჩევს. - Live corner radii scale with the art, unless the scale chooses otherwise. დინამიკური კუთხეების რადიუსები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. - Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. კონტურის სისქე, შტრიხები და ეფექტების მანძილები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. + Live corner radii scale with the art, unless the scale chooses otherwise. ცოცხალი კუთხეების რადიუსები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. + Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. კონტურის სისქე, ტირეები და ეფექტების მანძილები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს. The mouse wheel zooms the canvas instead of scrolling it. მაუსის ბორბალი ტილოს გადახვევის ნაცვლად მასშტაბს ცვლის. While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. სანამ მაუსის ბორბლით მასშტაბირება გამორთულია, დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს. The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს. Dragging sideways on a numeric field's label changes the field's value. რიცხვითი ველის წარწერაზე გვერდულად გადათრევა ველის მნიშვნელობას ცვლის. A two-finger rotate gesture on a trackpad rotates the canvas view. ტრეკპადზე ორი თითით მობრუნების ჟესტი ტილოს ხედს აბრუნებს. - Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ხელსაწყოს მალსახმობი კლავიშის დაჭერით ხელსაწყო არჩეულია მის აშვებამდე, შემდეგ კი ისევ წინა ხელსაწყო აირჩევა. + Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. სანამ ხელსაწყოს მალსახმობ კლავიშს დაჭერილს გიჭირავთ, ეს ხელსაწყოა არჩეული; კლავიშის აშვების შემდეგ ისევ წინა ხელსაწყო აირჩევა. Shows the bounding box while you move the selection or draw a shape. აჩვენებს შემომსაზღვრელ ჩარჩოს, სანამ მონიშნულს გადაადგილებთ ან ფიგურას ხატავთ. Create Trim Marks draws Japanese-style marks instead of Roman ones. ჭრის ნიშნების შექმნა რომაულის ნაცვლად იაპონური სტილის ნიშნებს ხატავს. New art takes only the fill and stroke of the selection; off, it takes the selected object's whole appearance. ახალი ნახატი მონიშნულიდან მხოლოდ შევსებასა და კონტურს იღებს; გამორთვისას იღებს მონიშნული ობიექტის მთელ იერსახეს. Changing the width or height in the Transform panel, the Properties panel or the Control bar changes the other in proportion. სიგანის ან სიმაღლის შეცვლა გარდაქმნის პანელში, თვისებების პანელში ან მართვის ზოლში მეორესაც პროპორციულად ცვლის. - A live rectangle's properties show one Corner Radius field for all four corners; off, each corner has its own field. დინამიკური მართკუთხედის თვისებები ოთხივე კუთხისთვის კუთხის რადიუსის ერთ ველს აჩვენებს; გამორთვისას თითოეულ კუთხეს თავისი ველი აქვს. + A live rectangle's properties show one Corner Radius field for all four corners; off, each corner has its own field. ცოცხალი მართკუთხედის თვისებები ოთხივე კუთხისთვის კუთხის რადიუსის ერთ ველს აჩვენებს; გამორთვისას თითოეულ კუთხეს თავისი ველი აქვს. What edits in the Transform panel transform: the object, its pattern tiles or both; Default follows Transform Pattern Tiles. რას გარდაქმნის ცვლილებები გარდაქმნის პანელში: ობიექტს, მისი პატერნის ფილებს ან ორივეს; ნაგულისხმევი მისდევს პატერნის ფილების გარდაქმნას. - With one symbol instance selected, the Transform panel uses the symbol's registration point as its reference point. როცა სიმბოლოს ერთი ეგზემპლარია მონიშნული, გარდაქმნის პანელი სიმბოლოს რეგისტრაციის წერტილს საყრდენ წერტილად იყენებს. + With one symbol instance selected, the Transform panel uses the symbol's registration point as its reference point. როცა სიმბოლოს ერთი ეგზემპლარია მონიშნული, გარდაქმნის პანელი სიმბოლოს რეგისტრაციის წერტილს საბაზისო წერტილად იყენებს. Darkens the canvas outside the artboards while the Artboard tool is active. სანამ სამუშაო დაფის ხელსაწყო აქტიურია, სამუშაო დაფების გარეთ ტილოს აბნელებს. With Fade Region Outside Artboard on, the area outside the artboards stays dark while you drag with the Artboard tool. როცა სამუშაო დაფის გარეთ არის დაბნელება ჩართულია, სამუშაო დაფის ხელსაწყოთი გადათრევისას სამუშაო დაფების გარეთ არე ბნელი რჩება. How near, in pixels, the pointer must be to an object, anchor or handle for a click to select it. რამდენად ახლოს, პიქსელებში, უნდა იყოს მაჩვენებელი ობიექტთან, საყრდენ წერტილთან ან სახელურთან, რომ დაწკაპუნებამ ის მონიშნოს. - Whether the Selection tool's box selects objects it touches or only those fully inside; Drag Direction selects those inside on a drag to the right. E reverses it mid-drag. მონიშვნის ხელსაწყოს ჩარჩო მონიშნავს შეხებულ ობიექტებს თუ მხოლოდ სრულად შიგნით მყოფებს; გადათრევის მიმართულება მარჯვნივ გადათრევისას შიგნით მყოფებს მონიშნავს. E გადათრევისას წესს აბრუნებს. - A click selects a filled object only on its path, not inside its fill. დაწკაპუნება შევსებულ ობიექტს მხოლოდ მის კონტურზე მონიშნავს და არა შევსების შიგნით. - How near, in pixels, a point must come to an anchor or ruler guide for Snap to Point to snap it; with Smart Guides on, Smart Guides' Snapping Tolerance applies instead. რამდენად ახლოს, პიქსელებში, უნდა მივიდეს წერტილი საყრდენ წერტილთან ან სახაზავის დამხმარე ხაზთან, რომ წერტილზე მიბმამ ის მიაბას; ჩართული ჭკვიანი დამხმარე ხაზებისას მათი მიბმის დაშვება მოქმედებს. - With the Selection tool, Cmd/Ctrl-click selects the object under the selected one at the pointer; each further click goes one object deeper. მონიშვნის ხელსაწყოთი Cmd/Ctrl-დაწკაპუნება მაჩვენებელთან მონიშნული ობიექტის ქვეშ მყოფ ობიექტს მონიშნავს; ყოველი შემდეგი დაწკაპუნება ერთი ობიექტით ღრმად ჩადის. + Whether the Selection tool's box selects objects it touches or only those fully inside; Drag Direction selects those inside on a drag to the right. E reverses it mid-drag. რას მონიშნავს მონიშვნის ხელსაწყოს ჩარჩო: ყველა ობიექტს, რომელსაც ეხება, თუ მხოლოდ მთლიანად შიგნით მყოფებს; „გადათრევის მიმართულება“ შიგნით მყოფებს მარჯვნივ გადათრევისას მონიშნავს. E ამ წესს გადათრევის დროს აბრუნებს. + A click selects a filled object only on its path, not inside its fill. დაწკაპუნება შევსებულ ობიექტს მხოლოდ მის ტრაექტორიაზე მონიშნავს და არა შევსების შიგნით. + How near, in pixels, a point must come to an anchor or ruler guide for Snap to Point to snap it; with Smart Guides on, Smart Guides' Snapping Tolerance applies instead. რამდენად ახლოს, პიქსელებში, უნდა მივიდეს წერტილი საყრდენ წერტილთან ან სახაზავის დამხმარე ხაზთან, რომ წერტილზე მიბმამ ის მიაბას; როცა ჭკვიანი დამხმარე ხაზები ჩართულია, მოქმედებს მათი მიბმის დაშვება. + With the Selection tool, Cmd/Ctrl-click selects the object under the selected one at the pointer; each further click goes one object deeper. მონიშვნის ხელსაწყოთი Cmd/Ctrl-დაწკაპუნება მაჩვენებელთან მონიშნული ობიექტის ქვეშ მყოფ ობიექტს მონიშნავს; ყოველი შემდეგი დაწკაპუნება ერთი ობიექტით უფრო ღრმად ჩადის. Zoom In and Zoom Out bring the center of the selection to the middle of the view. გადიდება და დაპატარავება მონიშვნის ცენტრს ხედის შუაში გადაიტანს. - Locked and hidden artwork inside an artboard moves, scales and is copied with the artboard, as the other artwork does. სამუშაო დაფის შიგნით არსებული დაბლოკილი და დამალული ნამუშევარი სხვა ნამუშევრის მსგავსად სამუშაო დაფასთან ერთად გადაადგილდება, მასშტაბირდება და კოპირდება. + Locked and hidden artwork inside an artboard moves, scales and is copied with the artboard, as the other artwork does. სამუშაო დაფის შიგნით არსებული ჩაკეტილი და დამალული ნახატი, დანარჩენი ნახატის მსგავსად, სამუშაო დაფასთან ერთად გადაადგილდება, მასშტაბირდება და კოპირდება. The size of anchor points and direction handle ends on the canvas; larger anchors can also be picked from farther away. საყრდენი წერტილებისა და მიმართულების სახელურების ბოლოების ზომა ტილოზე; უფრო დიდი საყრდენი წერტილების აღება უფრო შორიდანაც შეიძლება. Draws the ends of direction handles as solid dots, hollow dots or larger solid dots. მიმართულების სახელურების ბოლოებს ხატავს სავსე წერტილებად, ღრუ წერტილებად ან უფრო დიდ სავსე წერტილებად. With the Direct Selection tool, the anchor under the pointer is highlighted. პირდაპირი მონიშვნის ხელსაწყოთი მაჩვენებლის ქვეშ მყოფი საყრდენი წერტილი გამოიკვეთება. - Shows direction handles when more than one anchor is selected; off, they show only while a single anchor is selected. აჩვენებს მიმართულების სახელურებს, როცა ერთზე მეტი საყრდენი წერტილია მონიშნული; გამორთულისას ისინი მხოლოდ ერთი მონიშნული საყრდენი წერტილისას ჩანს. - Corner widgets hide on corners whose angle is greater than this many degrees. კუთხის ვიჯეტები იმალება იმ კუთხეებზე, რომელთა კუთხე ამდენ გრადუსზე მეტია. + Shows direction handles when more than one anchor is selected; off, they show only while a single anchor is selected. აჩვენებს მიმართულების სახელურებს, როცა ერთზე მეტი საყრდენი წერტილია მონიშნული; გამორთვისას ისინი მხოლოდ მაშინ ჩანს, როცა ერთი საყრდენი წერტილია მონიშნული. + Corner widgets hide on corners whose angle is greater than this many degrees. კუთხის ვიჯეტები იმალება იმ კუთხეებზე, რომელთა სიდიდე ამდენ გრადუსს აღემატება. The Pen tool previews the next segment from the last anchor to the pointer before you click. კალმის ხელსაწყო დაწკაპუნებამდე აჩვენებს შემდეგ სეგმენტს ბოლო საყრდენი წერტილიდან მაჩვენებლამდე. The Curvature tool previews the curve to the pointer before you place the next point. მრუდის ხელსაწყო შემდეგი წერტილის დასმამდე აჩვენებს მრუდს მაჩვენებლამდე. The unit for new documents from built-in sizes other than pixel sizes and for opened files that record no unit; choosing one here and clicking OK also sets the active document's units. ერთეული ახალი დოკუმენტებისთვის (ჩაშენებული ზომებით, პიქსელურის გარდა) და იმ გახსნილი ფაილებისთვის, რომლებშიც ერთეული არ წერია; OK-ზე დაწკაპებისას აქტიური დოკუმენტიც ამ ერთეულს მიიღებს. @@ -6304,30 +6304,30 @@ font-technology Variable ცვლადი When on, a number typed without a unit into a field in picas is read in points. ჩართვისას პიკებში მოცემულ ველში ერთეულის გარეშე აკრეფილი რიცხვი პუნქტებში იკითხება. With XML ID, object names show as XML IDs in the Layers panel, the Variables panel and Layer Options. XML ID-ის არჩევისას ობიექტების სახელები შრეების პანელში, ცვლადების პანელსა და შრის პარამეტრებში XML ID-ებად ჩანს. Snaps drawing, moving and scaling to the grid's subdivisions, even while the grid is hidden; while it is on, Snap to Pixel does not apply. ხატვას, გადაადგილებასა და მასშტაბირებას ბადის დაყოფებზე მიაბამს, მაშინაც კი, როცა ბადე დამალულია; სანამ ჩართულია, პიქსელზე მიბმა არ მოქმედებს. - The color of guides that are not selected; an artboard with a Guide Label draws its own guides in the label's color instead. არჩეული არ მყოფი დამხმარე ხაზების ფერი; იარლიყიანი სამუშაო დაფა საკუთარ დამხმარე ხაზებს იარლიყის ფერით ხატავს. + The color of guides that are not selected; an artboard with a Guide Label draws its own guides in the label's color instead. მოუნიშნავი დამხმარე ხაზების ფერი; სამუშაო დაფა, რომელსაც დამხმარე ხაზების იარლიყი აქვს, საკუთარ დამხმარე ხაზებს იარლიყის ფერით ხატავს. Draws guides as solid lines or as dots, including the guides already in the document. დამხმარე ხაზებს უწყვეტი ხაზებით ან წერტილებით ხატავს, დოკუმენტში უკვე არსებულების ჩათვლით. With this on, guides are locked when VectorCraft starts; changing this option locks or unlocks them at once, and View › Guides › Lock Guides still changes the lock. ჩართვისას დამხმარე ხაზები VectorCraft-ის გაშვებისას ჩაკეტილია; პარამეტრის შეცვლა მათ მაშინვე კეტავს ან ხსნის, ხოლო ხედი › დამხმარე ხაზები › დამხმარე ხაზების ჩაკეტვა კვლავ ცვლის ჩაკეტვას. - With this on, holding Cmd/Ctrl as you start dragging from a ruler makes a guide on the active artboard only, or a canvas guide with the Artboard tool. ჩართვისას სახაზავიდან გადათრევის დაწყებისას დაჭერილი Cmd/Ctrl დამხმარე ხაზს მხოლოდ აქტიურ სამუშაო დაფაზე ქმნის, სამუშაო დაფის ხელსაწყოთი კი მთელი ტილოს ხაზს. - The color of the grid; the lines between major gridlines are drawn in a fainter shade of it. ბადის ფერი; მთავარ ხაზებს შორის ხაზები მისი უფრო მკრთალი ელფერით იხატება. + With this on, holding Cmd/Ctrl as you start dragging from a ruler makes a guide on the active artboard only, or a canvas guide with the Artboard tool. ჩართვისას სახაზავიდან გადათრევის დაწყებისას დაჭერილი Cmd/Ctrl დამხმარე ხაზს მხოლოდ აქტიურ სამუშაო დაფაზე ქმნის, სამუშაო დაფის ხელსაწყოთი კი — ტილოს დამხმარე ხაზს. + The color of the grid; the lines between major gridlines are drawn in a fainter shade of it. ბადის ფერი; მთავარ ხაზებს შორის ხაზები მისი უფრო მკრთალი ფერით იხატება. Draws the grid as lines, or as dots along the major gridlines at each subdivision. ბადეს ხაზებით ხატავს, ან წერტილებით მთავარი ხაზების გასწვრივ ყოველ დაყოფაზე. The distance between major gridlines, in every open document and in new ones; a VectorCraft document opens with the grid it was saved with. მთავარ ხაზებს შორის მანძილი ყველა ღია და ახალ დოკუმენტში; VectorCraft-ის დოკუმენტი იმ ბადით იხსნება, რომლითაც შეინახა. How many parts each major grid square is divided into; Snap to Grid snaps to these parts, even when the zoom hides their lines. რამდენ ნაწილად იყოფა ბადის თითოეული მთავარი კვადრატი; ბადეზე მიბმა ამ ნაწილებზე მიაბამს, მაშინაც კი, როცა მასშტაბი მათ ხაზებს მალავს. - Draws the grid behind the artwork; off, the grid is drawn over it. ბადეს ნამუშევრის უკან ხატავს; გამორთვისას ბადე მის ზემოთ იხატება. - In Pixel Preview at 600% zoom or more, the active view shows a line at the edge of every document pixel over the artwork. პიქსელების წინასწარ ნახვაში 600%-იან ან მეტ მასშტაბზე აქტიური ხედი ნამუშევრის ზემოთ დოკუმენტის თითოეული პიქსელის კიდეზე ხაზს აჩვენებს. + Draws the grid behind the artwork; off, the grid is drawn over it. ბადეს ნახატის უკან ხატავს; გამორთვისას ბადე მის ზემოთ იხატება. + In Pixel Preview at 600% zoom or more, the active view shows a line at the edge of every document pixel over the artwork. „პიქსელების წინასწარ ნახვაში“ 600%-იან ან მეტ მასშტაბზე აქტიური ხედი ნახატის ზემოთ დოკუმენტის თითოეული პიქსელის კიდეზე ხაზს აჩვენებს. The color of the tile edge and the dashed swatch bounds shown while you edit a pattern. ფილის კიდისა და ფერის ნიმუშის წყვეტილი საზღვრების ფერი, რომლებიც პატერნის რედაქტირებისას ჩანს. - Snaps drawing, moving and transforming to nearby art and shows guides and labels; Pixel Preview turns them off, and Snap to Grid snaps to the grid instead. ხატვას, გადატანასა და გარდაქმნას ახლომდებარე გრაფიკაზე აბამს და აჩვენებს დამხმარე ხაზებსა და წარწერებს; პიქსელების წინასწარი ნახვა მათ თიშავს, ბადეზე მიბმა კი მათ ნაცვლად ბადეზე აბამს. - The color of Smart Guide lines and labels. ჭკვიანი დამხმარე ხაზების ხაზებისა და წარწერების ფერი. - Shows a line along the edge or center that art lines up with; off, art still lines up without the line, and Snap to Glyph does not apply. აჩვენებს ხაზს იმ კიდის ან ცენტრის გასწვრივ, რომელსაც გრაფიკა უსწორდება; გამორთვისას გრაფიკა მაინც სწორდება ხაზის გარეშე, გლიფზე მიბმა კი არ მოქმედებს. + Snaps drawing, moving and transforming to nearby art and shows guides and labels; Pixel Preview turns them off, and Snap to Grid snaps to the grid instead. ხატვას, გადატანასა და გარდაქმნას ახლომდებარე ნახატზე აბამს და აჩვენებს დამხმარე ხაზებსა და წარწერებს; პიქსელების წინასწარი ნახვა მათ თიშავს, ბადეზე მიბმა კი მათ ნაცვლად ბადეზე აბამს. + The color of Smart Guide lines and labels. ჭკვიანი დამხმარე ხაზებისა და მათი წარწერების ფერი. + Shows a line along the edge or center that art lines up with; off, art still lines up without the line, and Snap to Glyph does not apply. აჩვენებს ხაზს იმ კიდის ან ცენტრის გასწვრივ, რომელსაც ნახატი უსწორდება; გამორთვისას ნახატი მაინც სწორდება ხაზის გარეშე, გლიფზე მიბმა კი არ მოქმედებს. With a selection tool, outlines the unselected object under the pointer in its layer color while you are not dragging. მონიშვნის ხელსაწყოთი, სანამ არ ათრევთ, მაჩვენებლის ქვეშ მყოფ მოუნიშნავ ობიექტს მისი შრის ფერით შემოხაზავს. - Shows the size or angle next to the pointer while you scale, rotate, shear or reflect art. გრაფიკის მასშტაბირების, მობრუნების, დახრის ან არეკვლისას მაჩვენებლის გვერდით აჩვენებს ზომას ან კუთხეს. + Shows the size or angle next to the pointer while you scale, rotate, shear or reflect art. ნახატის მასშტაბირების, მობრუნების, დახრის ან არეკვლისას მაჩვენებლის გვერდით აჩვენებს ზომას ან კუთხეს. While you draw, points snap to lines at the chosen Angles through the point the segment or shape starts from. ხატვისას წერტილები ებმის არჩეული კუთხის ხაზებს, რომლებიც სეგმენტის ან ფიგურის საწყის წერტილზე გადის. The set of angles the construction guides follow while Construction Guides is on. კუთხეების ნაკრები, რომელსაც სამშენებლო დამხმარე ხაზები მიჰყვება, სანამ სამშენებლო დამხმარე ხაზები ჩართულია. - Names what a point snaps to, such as an anchor, a path or an alignment; off, points snap the same way without the names. ასახელებს, რას ებმის წერტილი, მაგალითად, საყრდენ წერტილს, ტრაექტორიას ან გასწორებას; გამორთვისას წერტილები ისევე ებმის, სახელების გარეშე. - Shows distances, angles and how far art has moved next to the pointer while you draw or move it. ხატვის ან გადატანისას მაჩვენებლის გვერდით აჩვენებს მანძილებს, კუთხეებს და რამდენით გადაადგილდა გრაფიკა. - Snaps moved or resized art to the same gap as between nearby objects, and marks the equal gaps. გადატანილ ან ზომაშეცვლილ გრაფიკას აბამს იმავე შუალედზე, რაც ახლომდებარე ობიექტებს შორისაა, და ნიშნავს თანაბარ შუალედებს. - With something selected, holding Alt/Option over another object or an artboard shows the distances between it and the selection. როცა რაიმე მონიშნულია, Alt/Option-ის დაჭერა სხვა ობიექტზე ან სამუშაო დაფაზე აჩვენებს მანძილებს მასა და მონიშნულს შორის. + Names what a point snaps to, such as an anchor, a path or an alignment; off, points snap the same way without the names. ასახელებს, რას ებმის წერტილი, მაგალითად, საყრდენ წერტილს, ტრაექტორიას ან სწორებას; გამორთვისას წერტილები ისევე ებმის, სახელების გარეშე. + Shows distances, angles and how far art has moved next to the pointer while you draw or move it. ხატვის ან გადატანისას მაჩვენებლის გვერდით აჩვენებს მანძილებს, კუთხეებს და რამდენით გადაადგილდა ნახატი. + Snaps moved or resized art to the same gap as between nearby objects, and marks the equal gaps. გადატანილ ან ზომაშეცვლილ ნახატს აბამს იმავე შუალედზე, რაც ახლომდებარე ობიექტებს შორისაა, და ნიშნავს თანაბარ შუალედებს. + With something selected, holding Alt/Option over another object or an artboard shows the distances between it and the selection. როცა რამე მონიშნულია და Alt/Option დაჭერილი გიჭირავთ, მაჩვენებელი სხვა ობიექტზე ან სამუშაო დაფაზე აჩვენებს მანძილებს მასა და მონიშნულს შორის. A selection dragged back to within the Snapping Tolerance of where the drag began goes back to exactly that place; a copy does not. მონიშნული, რომელიც თრევის დაწყების ადგილიდან მიბმის დაშვების ფარგლებში დააბრუნეთ, ზუსტად იმ ადგილზე ბრუნდება; ასლი არა. - How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. რამდენად ახლოს უნდა მივიდეს ეკრანზე მაჩვენებელი ან გადათრეული წერტილი გრაფიკასთან, რომ ჭკვიანმა დამხმარე ხაზებმა მიაბან; მანძილი ყველა მასშტაბზე ერთნაირია. + How near on screen the pointer or a dragged point must come to art for Smart Guides to snap to it; the distance is the same at every zoom. რამდენად ახლოს უნდა მივიდეს ეკრანზე მაჩვენებელი ან გადათრეული წერტილი ნახატთან, რომ ჭკვიანმა დამხმარე ხაზებმა მიაბან; მანძილი ყველა მასშტაბზე ერთნაირია. Snaps the end of a line segment, or a circle drawn from its center, so that it touches a nearby curve. ხაზის სეგმენტის ბოლოს, ან ცენტრიდან დახატულ წრეწირს, ისე აბამს, რომ ახლომდებარე მრუდს შეეხოს. Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. ხაზის სეგმენტის ბოლოს ისე აბამს, რომ ახლომდებარე სწორ სეგმენტს მართი კუთხით შეხვდეს. Reset all preferences to their defaults? დავაბრუნოთ ყველა პარამეტრი ნაგულისხმევ მნიშვნელობებზე? @@ -6562,6 +6562,7 @@ font-technology Variable ცვლადი @msg Couldn't save recovery data for {title}: {e}. Copies go to {folder}, the folder set in Preferences; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder) დოკუმენტის {title} აღდგენის მონაცემების შენახვა ვერ მოხერხდა: {e}. ასლები ინახება საქაღალდეში {folder}, რომელიც პარამეტრებშია მითითებული; სხვა საქაღალდის გამოსაყენებლად მიუთითეთ პარამეტრები → ფაილების დამუშავება → მონაცემთა აღდგენა → საქაღალდე (recoveryFolder) @msg Couldn't save recovery data: {e}. Copies go to {folder}, the default recovery folder; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder) აღდგენის მონაცემების შენახვა ვერ მოხერხდა: {e}. ასლები ინახება საქაღალდეში {folder}, რომელიც აღდგენის ნაგულისხმევი საქაღალდეა; სხვა საქაღალდის გამოსაყენებლად მიუთითეთ პარამეტრები → ფაილების დამუშავება → მონაცემთა აღდგენა → საქაღალდე (recoveryFolder) @msg Couldn't save recovery data: {e}. Copies go to {folder}, the folder set in Preferences; to use another folder, set Preferences → File Handling → Data Recovery → Folder (recoveryFolder) აღდგენის მონაცემების შენახვა ვერ მოხერხდა: {e}. ასლები ინახება საქაღალდეში {folder}, რომელიც პარამეტრებშია მითითებული; სხვა საქაღალდის გამოსაყენებლად მიუთითეთ პარამეტრები → ფაილების დამუშავება → მონაცემთა აღდგენა → საქაღალდე (recoveryFolder) +@msg {saving} failed: {e} {saving} — ვერ მოხერხდა: {e} @msg Create Outlines: select text objects კონტურების შექმნა: მონიშნეთ ტექსტური ობიექტები @msg Create from Guides: the document has no artboard დამხმარე ხაზებიდან შექმნა: დოკუმენტს სამუშაო დაფა არ აქვს @msg Create from Guides: the guides make more than {MAX_PIECES} slices დამხმარე ხაზებიდან შექმნა: დამხმარე ხაზები {MAX_PIECES}-ზე მეტ ნაჭერს ქმნის @@ -7762,7 +7763,7 @@ font-technology Variable ცვლადი @msg The 3D object is too complex to export 3D ობიექტი ზედმეტად რთულია ექსპორტისთვის @msg feConvolveMatrix's order feConvolveMatrix-ის order @msg feMorphology's radius feMorphology-ის radius -@msg a blur's stdDeviation დაბინდვის stdDeviation +@msg a blur's stdDeviation გაბუნდოვნების stdDeviation @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ობიექტს არ აქვს 3D ეფექტი (ამოწევა და წაკვეთა, ბრუნვა, გაბერვა ან შემობრუნება) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` უნდა იყოს ობიექტი, რომელიც შეიცავს მხოლოდ `mode`-ს, მნიშვნელობით shaded ან wireframe @msg its 3D effect builds no solid მისი 3D ეფექტი სხეულს არ ქმნის From 3b715e97648f2af7ed4821fd6d5ec8b0e7f9f463 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 12:31:46 -0800 Subject: [PATCH 143/247] Tile: the kept pane outlines hold a weak document reference The outline cache identified its document by address, so a new document allocated at a freed document's address could show the freed document's outlines when the revision, selection and screen mapping matched. The cache now holds a Weak reference and compares it with Weak::ptr_eq, which keeps the address reserved while the outlines exist. --- crates/ui-egui/src/canvas/panes.rs | 13 +++++-------- crates/ui-egui/src/canvas/panes/tests.rs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/canvas/panes.rs b/crates/ui-egui/src/canvas/panes.rs index d5096bb9fb..935034e427 100644 --- a/crates/ui-egui/src/canvas/panes.rs +++ b/crates/ui-egui/src/canvas/panes.rs @@ -52,7 +52,9 @@ pub struct Panes { /// selection and screen mapping they were made for. struct Outlines { revision: u64, - doc: usize, + /// A weak reference to the document: while it exists, no other document can take the + /// allocation's address. + doc: std::sync::Weak<vectorcraft_doc::Document>, selection: Vec<vectorcraft_doc::NodeId>, affine: [f64; 6], shapes: Vec<egui::Shape>, @@ -61,15 +63,10 @@ struct Outlines { impl Outlines { /// Whether these outlines show `st`'s selection through the screen mapping `affine`. fn shows(&self, st: &vectorcraft_engine::DocState, affine: &[f64; 6]) -> bool { - self.revision == st.revision && self.doc == doc_address(st) && self.affine == *affine && self.selection == st.selection.objects + self.revision == st.revision && self.doc.ptr_eq(&Arc::downgrade(&st.doc)) && self.affine == *affine && self.selection == st.selection.objects } } -/// The address of `st`'s document, which tells two documents with the same revision apart. -fn doc_address(st: &vectorcraft_engine::DocState) -> usize { - Arc::as_ptr(&st.doc) as usize -} - impl Panes { /// Forget every render and pane. fn clear(&mut self) { @@ -514,7 +511,7 @@ fn selected_objects(panes: &mut Panes, slot: Slot, st: &vectorcraft_engine::DocS let affine = xf.affine().as_coeffs(); if !panes.outlines.get(&slot).is_some_and(|o| o.shows(st, &affine)) { let shapes = outline_shapes(st, xf); - let kept = Outlines { revision: st.revision, doc: doc_address(st), selection: st.selection.objects.clone(), affine, shapes }; + let kept = Outlines { revision: st.revision, doc: Arc::downgrade(&st.doc), selection: st.selection.objects.clone(), affine, shapes }; panes.outlines.insert(slot, kept); panes.outlines_made += 1; } diff --git a/crates/ui-egui/src/canvas/panes/tests.rs b/crates/ui-egui/src/canvas/panes/tests.rs index 439b19b898..d6441e08ff 100644 --- a/crates/ui-egui/src/canvas/panes/tests.rs +++ b/crates/ui-egui/src/canvas/panes/tests.rs @@ -586,6 +586,23 @@ fn in_first(app: &mut VectorcraftApp, cmd: &str, args: serde_json::Value) -> ser out } +#[test] +fn kept_outlines_do_not_show_for_a_new_document_that_takes_a_freed_documents_address() { + let affine = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]; + let st = vectorcraft_engine::DocState::new(vectorcraft_doc::Document::new(400.0, 300.0), None); + let kept = Outlines { revision: st.revision, doc: Arc::downgrade(&st.doc), selection: vec![], affine, shapes: vec![] }; + assert!(kept.shows(&st, &affine), "the outlines show the document they were made for"); + let freed = Arc::as_ptr(&st.doc); + drop(st); + let mut reused = false; + for _ in 0..64 { + let other = vectorcraft_engine::DocState::new(vectorcraft_doc::Document::new(400.0, 300.0), None); + reused |= Arc::as_ptr(&other.doc) == freed; + assert!(!kept.shows(&other, &affine), "a different document with the same revision, selection and mapping is not the one shown"); + } + assert!(!reused, "the weak reference keeps the freed document's address from being taken"); +} + #[test] fn other_panes_keep_their_selected_outlines_until_the_document_selection_or_view_changes() { let mut app = app_with(2); From 464bfe36da69fc9b81fbd9b940dbe8aa1e9482a3 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 12:24:33 -0800 Subject: [PATCH 144/247] Layers: a path dragged into a Live Paint group keeps the group's identity and paint A dropped path named "Live Paint Sources" that lands in front of the group's sources group made the group stop counting as a Live Paint group, so the drop failed. The group's own sources group now goes back in front before the paths are added. A dropped path named "Face" or "Edge" was read as one of the group's faces or edges and its paint overwrote the generated part's paint. The joining paths are now left out of the old parts. --- crates/engine/src/cmd/buildcmds/live_paint.rs | 35 +++++++++-- crates/engine/src/tests/build.rs | 58 +++++++++++++++++++ 2 files changed, 87 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 116ea0c929..411f98a9c6 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -1,8 +1,8 @@ use super::{ Appearance, AppearanceItem, Arc, Beside, Document, EDGE_NAME, EngineError, FACE_NAME, GapOptions, GapSize, LIVE_PAINT_NAME, Node, NodeId, - PathData, Point, Rect, Result, Selection, Session, SubPath, Value, b, bad, build_children, edge_near, face_at, finite, fit_to_old_edge, ids_json, - is_live_paint, json, number_or, object_param, paint_from, po, point_param, repaint_from, replace_roots, root_ids, source_nodes, source_shapes, - switch_or, + PathData, Point, Rect, Result, SOURCES_NAME, Selection, Session, SubPath, Value, b, bad, build_children, edge_near, face_at, finite, + fit_to_old_edge, ids_json, is_live_paint, json, number_or, object_param, paint_from, po, point_param, repaint_from, replace_roots, root_ids, + source_nodes, source_shapes, switch_or, }; /// `options` as stored on a Live Paint group: none for the defaults. @@ -187,11 +187,16 @@ fn merge_live(d: &mut Document, sel: &mut Selection, roots: &[NodeId]) -> Result .ok_or_else(|| EngineError::Other("Live Paint Merge: select a Live Paint group and the paths to add".into()))?; check_live_paint_takes(d, roots)?; let old = d.node(target).cloned().ok_or(EngineError::NoNode(target))?; + // The rows that join are children of the group already when Merge runs after a drag, and a joining + // path named like a face or an edge is not one of the group's parts. + let mut old_parts = old.clone(); + if let Some(ch) = old_parts.children_mut() { + ch.retain(|c| !roots.contains(&c.id)); + } // Paint to carry over: (point inside face, paint) for faces that draw; edges are matched to the // old edges below. let keep_faces: Vec<(Point, Carried)> = - b::faces(&old).iter().filter(|f| draws(f)).filter_map(|f| Some((po::interior_point(f.path_data()?)?, Carried::of(f)))).collect(); - let old_parts = old.clone(); + b::faces(&old_parts).iter().filter(|f| draws(f)).filter_map(|f| Some((po::interior_point(f.path_data()?)?, Carried::of(f)))).collect(); let mut sources = source_nodes(&old); // The objects drawn in the other Live Paint groups besides their parts stay in the merged group. let mut others = vec![]; @@ -335,6 +340,9 @@ fn spot_in(d: &Document, parent: Option<NodeId>) -> Spot { pub(crate) struct LivePaintMove { /// The Live Paint group the rows go into, and for each row whether it joins the group's paths. join: Option<(NodeId, Vec<bool>)>, + /// The Live Paint group the rows go among the children of, with its sources group as it is + /// before the move. + keep_sources: Option<(NodeId, NodeId)>, /// The Live Paint groups whose paths change. rebuild: Vec<NodeId>, } @@ -369,7 +377,11 @@ impl LivePaintMove { if to != Spot::Outside { check_live_paint_takes(d, &entering)?; } - Ok(Self { join, rebuild }) + let keep_sources = match to { + Spot::In(g) => d.node(g).and_then(b::sources).map(|s| (g, s.id)), + _ => None, + }; + Ok(Self { join, keep_sources, rebuild }) } /// Whether rows join a Live Paint group, which makes the move a "Merge Live Paint" step. @@ -382,6 +394,17 @@ impl LivePaintMove { /// joined a group to it. → `moved` with the joined rows replaced by their group, once, and /// without the faces and edges that were made again. pub(crate) fn finish(self, d: &mut Document, sel: &mut Selection, moved: &[NodeId]) -> Result<Vec<NodeId>> { + // A moved object named like the sources group may now sit before it, where a lookup by name + // finds the object first. The group's own sources group goes back in front. + if let Some((g, src)) = self.keep_sources { + let ch = d.children_mut(Some(g))?; + if let Some(at) = ch.iter().position(|c| c.id == src) + && ch[..at].iter().any(|c| c.name.as_deref() == Some(SOURCES_NAME)) + { + let s = ch.remove(at); + ch.insert(0, s); + } + } if self.join.is_none() && self.rebuild.is_empty() { return Ok(moved.to_vec()); } diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index a3272f6fa9..8a63bf659d 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -5198,6 +5198,64 @@ fn layers_drag_adds_paths_to_a_live_paint_group() { assert_eq!(faces(&node(&s, g)).len(), 7); } +/// A path named like a Live Paint group's sources group joins the group when it is dragged in, in +/// front of the sources group or behind it: the group keeps its own sources group and the path +/// goes among its paths. +#[test] +fn layers_drag_of_a_path_named_like_the_sources_group_joins_a_live_paint_group() { + use vectorcraft_tools::builder::{SOURCES_NAME, faces, sources}; + for index in [0, 99] { + let mut s = session(); + let g = live(&mut s); + let a = line_to_right_face(&mut s, 30.0); + s.execute("object.setProps", &json!({"id": a.0, "name": SOURCES_NAME})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": index})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint"), "index {index}"); + let n = node(&s, g); + let src = sources(&n).unwrap(); + assert!(src.children().is_some(), "index {index}: the sources group is a group"); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(src.id), "index {index}: the path joined the sources"); + assert_eq!(faces(&n).len(), 5, "index {index}"); + } +} + +/// An object drawn in a Live Paint group and named like its sources group can be moved ahead of the +/// sources group: the group keeps its own sources group and stays a Live Paint group. +#[test] +fn layers_reorder_of_an_object_named_like_the_sources_group_keeps_the_live_paint_group() { + use vectorcraft_tools::builder::{SOURCES_NAME, is_live_paint, sources}; + let mut s = session(); + let g = live(&mut s); + let real = sources(&node(&s, g)).unwrap().id; + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + let a = line_across(&mut s, 50.0); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g)); + s.execute("object.setProps", &json!({"id": a.0, "name": SOURCES_NAME})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": 0})).unwrap(); + let n = node(&s, g); + assert!(is_live_paint(&n)); + assert_eq!(sources(&n).unwrap().id, real); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "the object stays where it was drawn"); +} + +/// A path named `Face` that is dragged into a Live Paint group is not one of its faces: the face it +/// covers keeps its own fill. +#[test] +fn layers_drag_of_a_path_named_face_does_not_repaint_the_group() { + use vectorcraft_tools::builder::{face_at, faces}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let mut s = session(); + let g = live(&mut s); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [25, 50], "color": "#00ff00"})).unwrap(); + let a = rect(&mut s, 0.0, 0.0, 50.0, 100.0); + set_fill(&mut s, a, Color::rgb(0.0, 0.0, 1.0)); + s.execute("object.setProps", &json!({"id": a.0, "name": "Face"})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": 99})).unwrap(); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 3); + assert_eq!(face_at(&n, Point::new(25.0, 50.0)).unwrap().appearance.fill_paint(), green); +} + /// An Alt-drag into a Live Paint group adds a copy and leaves the path where it was; a drop above /// one of the group's faces, and `node.move` into the group, add the path the same way. #[test] From 24a37f8ba33f1850cc7272eae15561d14cc116f1 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:20:06 +0530 Subject: [PATCH 145/247] =?UTF-8?q?M7/G4:=20Type=20=E2=80=BA=20Retype,=20p?= =?UTF-8?q?hase=201=20(#4934)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type.retype turns selected outlined text back into live point text when each glyph shape is exactly a glyph of a loaded font, a font the document uses or a family named in fonts: the same up to uniform scale, rotation and translation. Matched glyphs map back to characters through the cmap and become point text in that font and size at the same baseline and turn, one object per line, with the first glyph's fill and stroke, in one undo step. Shapes that match no font stay and are reported. Matching (vectorcraft_text::retype) samples each contour at equal steps of arc length and fits a similarity transform; it is bounded (faces, glyphs, path elements, contours) and panic-free. Near matches, the ranked font list, installed fonts not yet loaded and images are phase 2. --- crates/engine/src/cmd.rs | 2 + crates/engine/src/cmd/retype.rs | 293 ++++++++++++++++++++ crates/engine/src/cmd/retype_tests.rs | 120 ++++++++ crates/text/src/fontdb/lookup.rs | 6 + crates/text/src/lib.rs | 1 + crates/text/src/retype.rs | 384 ++++++++++++++++++++++++++ docs/gaps.md | 5 +- docs/roadmap.md | 5 +- docs/target-app-parity.md | 19 +- docs/type-parity.md | 5 +- 10 files changed, 827 insertions(+), 13 deletions(-) create mode 100644 crates/engine/src/cmd/retype.rs create mode 100644 crates/engine/src/cmd/retype_tests.rs create mode 100644 crates/text/src/retype.rs diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index c4a86dd3a5..4fec3f90bd 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -105,6 +105,7 @@ pub mod textstyles; pub(crate) mod textwrap; pub(crate) mod threads; pub(crate) mod typecmd; +mod retype; mod typemenu; mod variablecmds; pub(crate) mod views; @@ -321,6 +322,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(pathops::specs()); v.extend(compoundshape::specs()); v.extend(typecmd::specs()); + v.extend(retype::specs()); v.extend(menucmds::specs()); v.extend(live::specs()); v.extend(colorcmds::specs()); diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs new file mode 100644 index 0000000000..a5f3b98bde --- /dev/null +++ b/crates/engine/src/cmd/retype.rs @@ -0,0 +1,293 @@ +//! Type › Retype (#4934), phase 1: outlined text whose glyph shapes are glyphs of a font the app +//! has becomes live point text again, in that font and size, at the same baseline. +//! +//! Behaviour follows the public description of Illustrator's Retype +//! (<https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html>, +//! <https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html>): +//! select outlined text and Retype finds the fonts that match it, from the fonts on the device among +//! others, for use as live text. Illustrator ranks candidate fonts in a panel; this phase is local +//! and exact instead, and sets the text itself, as #4934 asks. Each selected glyph shape (a path or compound +//! path, inside groups too) is compared with the glyphs of the candidate fonts +//! ([`vectorcraft_text::retype`]), the same up to uniform scale, rotation and translation. Matched +//! glyphs map back to characters through the font's cmap and are rebuilt as point text, one object +//! per line of glyphs, with the first glyph's fill and stroke. Shapes that match no font stay as +//! they are and are reported. Near matches (another version of the font, simplified outlines, +//! merged glyphs) and images are phase 2. + +use std::sync::Arc; + +use kurbo::{BezPath, Point, Vec2}; +use serde_json::{Value, json}; +use vectorcraft_doc::{Appearance, CharStyle, Document, Node, NodeId, NodeKind, TextObject}; +use vectorcraft_text::FontDb; +use vectorcraft_text::retype::{GlyphMatch, RetypeIndex}; + +use super::edit::selected_roots; +use super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_selected_path}; + +/// At most this many shapes are compared. +const MAX_PIECES: usize = 2048; +/// Groups deeper than this are not looked into. +const MAX_DEPTH: usize = 16; +/// Extra families named by `fonts`. +const MAX_FONT_PARAMS: usize = 32; + +pub fn specs() -> Vec<CommandSpec> { + vec![cmd!( + "type.retype", + "Retype", + ["Type"], + None, + "{fonts?: [family…]} turn the selected outlined text (glyph paths and compound paths, inside groups too) back into live point text: each shape is matched against the glyphs of the fonts the app has loaded, the document's fonts and the families in fonts, the same up to uniform scale, rotation and translation (exact matches only); matched glyphs become point text in that font and size at the same baseline, one object per line, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are → {ids (the new type), texts, fonts: [{family, style, size}], unmatched: [id…]}; an error when no shape matches", + has_selected_path, + retype + )] +} + +/// A shape to match: a path or compound path, in document space. +struct Piece { + id: NodeId, + path: BezPath, + appearance: Appearance, +} + +fn collect(n: &Node, depth: usize, out: &mut Vec<Piece>) { + if out.len() >= MAX_PIECES || depth > MAX_DEPTH { + return; + } + match &n.kind { + NodeKind::Group { children, clip: false } => { + for c in children { + collect(c, depth + 1, out); + } + } + NodeKind::Path { path, clipping: false, guide: false, .. } => { + out.push(Piece { id: n.id, path: path.to_bezpath(), appearance: (*n.appearance).clone() }) + } + NodeKind::Compound { children, .. } => { + let mut path = BezPath::new(); + for c in children { + if let NodeKind::Path { path: p, .. } = &c.kind { + path.extend(p.to_bezpath()); + } + } + out.push(Piece { id: n.id, path, appearance: (*n.appearance).clone() }); + } + _ => {} + } +} + +/// The faces to match against: the families in `fonts`, the document's fonts, then every loaded face. +fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec<Arc<vectorcraft_text::FontFace>> { + let mut families: Vec<String> = fonts.iter().take(MAX_FONT_PARAMS).cloned().collect(); + d.walk(|n| { + if let NodeKind::Text(t) = &n.kind { + for r in &t.runs { + if !families.contains(&r.style.font_family) && families.len() < vectorcraft_text::retype::MAX_FACES { + families.push(r.style.font_family.clone()); + } + } + } + }); + let mut faces = vec![]; + for f in &families { + for style in db.styles(f) { + if let Some(face) = db.face(f, &style) { + faces.push(face); + } + } + } + faces.extend(db.loaded_faces()); + faces +} + +/// One line of retyped glyphs. +struct Line { + pieces: Vec<NodeId>, + text: String, + face: Arc<vectorcraft_text::FontFace>, + scale: f64, + angle: f64, + origin: Point, + end: Point, + appearance: Appearance, +} + +impl Line { + fn dir(&self) -> Vec2 { + Vec2::new(self.angle.cos(), self.angle.sin()) + } + + /// Does glyph `m` continue this line (same font, size and turn, on its baseline, after its end)? + fn continues(&self, m: &GlyphMatch) -> bool { + let size = self.scale * self.face.units_per_em(); + let d = m.origin - self.origin; + let dir = self.dir(); + let across = d.cross(dir).abs(); + m.face.id() == self.face.id() + && (m.scale - self.scale).abs() <= self.scale * 0.005 + && (m.angle - self.angle).abs() < 1e-3 + && across < size * 0.05 + && (m.origin - self.end).dot(dir) > -size * 0.25 + } + + fn push(&mut self, id: NodeId, m: &GlyphMatch) { + // A gap wider than half a space before the glyph is spaces the outlines left no shape for. + let dir = self.dir(); + let gap = (m.origin - self.end).dot(dir); + let space = space_advance(&self.face) * self.scale; + if space > 0.0 && gap > space * 0.5 { + let n = ((gap / space).round() as usize).clamp(1, 64); + self.text.extend(std::iter::repeat_n(' ', n)); + } + self.text.push(m.ch); + self.pieces.push(id); + self.end = m.origin + dir * (m.face.advance(m.gid) * m.scale); + } +} + +fn space_advance(face: &vectorcraft_text::FontFace) -> f64 { + face.mapped_chars().iter().find(|(c, _)| *c == ' ').map(|(_, g)| face.advance(*g)).unwrap_or(0.0) +} + +fn new_line(id: NodeId, m: &GlyphMatch, appearance: &Appearance) -> Line { + let dir = Vec2::new(m.angle.cos(), m.angle.sin()); + Line { + pieces: vec![id], + text: m.ch.to_string(), + face: m.face.clone(), + scale: m.scale, + angle: m.angle, + origin: m.origin, + end: m.origin + dir * (m.face.advance(m.gid) * m.scale), + appearance: appearance.clone(), + } +} + +fn retype(s: &mut Session, p: &Value) -> Result<Value> { + const C: &str = "type.retype"; + let fonts: Vec<String> = match p.get("fonts") { + None | Some(Value::Null) => vec![], + Some(Value::Array(a)) => { + a.iter().map(|v| v.as_str().map(str::to_owned).ok_or_else(|| bad(C, "fonts must be a list of family names"))).collect::<Result<_>>()? + } + Some(_) => return Err(bad(C, "fonts must be a list of family names")), + }; + let roots = selected_roots(s)?; + let db = FontDb::global(); + let (lines, unmatched) = { + let d = &s.doc()?.doc; + let mut pieces = vec![]; + for r in &roots { + if let Some(n) = d.node(*r) { + collect(n, 0, &mut pieces); + } + } + if pieces.is_empty() { + return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); + } + let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts)); + let found: Vec<Vec<GlyphMatch>> = pieces.iter().map(|pc| index.matches(&pc.path)).collect(); + // The face most shapes match, so a glyph several fonts share is set in the same font as + // the glyphs around it. + let mut votes: Vec<(u32, usize)> = vec![]; + for m in found.iter().flatten() { + match votes.iter_mut().find(|(f, _)| *f == m.face.id()) { + Some(v) => v.1 += 1, + None => votes.push((m.face.id(), 1)), + } + } + let rank = |face: u32| votes.iter().find(|(f, _)| *f == face).map_or(0, |v| v.1); + let mut lines: Vec<Line> = vec![]; + let mut unmatched = vec![]; + for (pc, ms) in pieces.iter().zip(&found) { + // Earlier matches win ties: they are the closer fits. + let best = ms.iter().enumerate().max_by_key(|(i, m)| (rank(m.face.id()), std::cmp::Reverse(*i))).map(|(_, m)| m); + let Some(m) = best else { + unmatched.push(pc.id); + continue; + }; + match lines.last_mut() { + Some(l) if l.continues(m) => l.push(pc.id, m), + _ => lines.push(new_line(pc.id, m, &pc.appearance)), + } + } + (lines, unmatched) + }; + if lines.is_empty() { + return Err(EngineError::Other(format!("Retype: no selected shape matches a glyph of an available font ({} checked)", unmatched.len()))); + } + let system_layout = s.doc()?.doc.setup.system_layout; + let made = s.edit("Retype", |d, sel| { + let mut ids = vec![]; + let mut emptied = vec![]; + for l in &lines { + let Some(first) = l.pieces.first() else { continue }; + let (par, idx, _) = d.position(*first).ok_or(EngineError::NoNode(*first))?; + let style = CharStyle { + font_family: l.face.family.clone(), + font_style: l.face.style.clone(), + size: l.scale * l.face.units_per_em(), + fill: l.appearance.fill_paint(), + stroke: l.appearance.stroke_paint(), + stroke_width: l.appearance.stroke_width(), + ..Default::default() + }; + let mut t = TextObject::point(l.origin, &l.text, style); + if l.angle != 0.0 { + t.xf *= kurbo::Affine::rotate(l.angle); + } + t.para = super::create::new_type_para(); + t.system_layout = system_layout; + super::typecmd::refresh_bounds(&mut t); + let id = d.alloc_id(); + d.insert(par, idx, Node::new(id, NodeKind::Text(Box::new(t))))?; + for pc in &l.pieces { + if let Some((Some(parent), _, _)) = d.position(*pc) { + emptied.push(parent); + } + d.remove(*pc)?; + } + ids.push(id); + } + // A group left holding only the new type (Create Outlines' group) gives way to it, unless + // the group has transparency, effects, a mask or a name of its own, which then keep + // applying to the type inside it. A group left empty goes. + emptied.sort_unstable(); + emptied.dedup(); + for g in emptied { + let Some(n) = d.node(g) else { continue }; + let NodeKind::Group { children, clip: false } = &n.kind else { continue }; + let plain = n.opacity == 1.0 + && n.blend == vectorcraft_color::BlendMode::Normal + && *n.appearance == Appearance::default() + && n.name.is_none() + && n.extras().mask.is_none(); + let only_type = children.iter().all(|c| ids.contains(&c.id)); + if children.is_empty() { + d.remove(g)?; + } else if plain && only_type { + let kids: Vec<Arc<Node>> = children.clone(); + let (par, idx, _) = d.position(g).ok_or(EngineError::NoNode(g))?; + d.remove(g)?; + for (i, k) in kids.into_iter().enumerate() { + d.insert(par, idx + i, (*k).clone())?; + } + } + } + let mut keep: Vec<NodeId> = roots.iter().copied().filter(|r| d.node(*r).is_some()).collect(); + keep.extend(&ids); + sel.set(keep); + Ok(ids) + })?; + Ok(json!({ + "ids": made.iter().map(|i| i.0).collect::<Vec<_>>(), + "texts": lines.iter().map(|l| l.text.clone()).collect::<Vec<_>>(), + "fonts": lines.iter().map(|l| json!({"family": l.face.family, "style": l.face.style, "size": l.scale * l.face.units_per_em()})).collect::<Vec<_>>(), + "unmatched": unmatched.iter().map(|i| i.0).collect::<Vec<_>>(), + })) +} + +#[cfg(test)] +#[path = "retype_tests.rs"] +mod tests; diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs new file mode 100644 index 0000000000..6ed12289f4 --- /dev/null +++ b/crates/engine/src/cmd/retype_tests.rs @@ -0,0 +1,120 @@ +use serde_json::json; +use vectorcraft_doc::{NodeId, NodeKind, TextObject}; + +use crate::Session; + +fn session() -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 600, "height": 400})).unwrap(); + s +} + +/// Point text, outlined: the id of the outlines' group. +fn outlined(s: &mut Session, p: serde_json::Value) -> u64 { + let id = s.execute("text.create", &p).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap() +} + +fn text_of(s: &Session, id: u64) -> TextObject { + let NodeKind::Text(t) = &s.doc().unwrap().doc.node(NodeId(id)).unwrap().kind else { panic!("text object") }; + (**t).clone() +} + +fn near(a: f64, b: f64, tol: f64) -> bool { + (a - b).abs() <= tol +} + +#[test] +fn outlined_point_text_retypes_to_the_same_text_font_size_and_place() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "Retype me, 42!", "size": 36, "font": "Source Sans 3", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["Retype me, 42!"]), "{r}"); + assert_eq!(r["unmatched"], json!([])); + let id = r["ids"][0].as_u64().unwrap(); + let t = text_of(&s, id); + assert_eq!(t.plain_text(), "Retype me, 42!"); + let st = t.first_style(); + assert_eq!((st.font_family.as_str(), st.font_style.as_str()), ("Source Sans 3", "Regular")); + assert!(near(st.size, 36.0, 0.01), "size {}", st.size); + let o = t.xf.translation(); + assert!(near(o.x, 40.0, 0.01) && near(o.y, 100.0, 0.01), "baseline start {o:?}"); + // The outlines are gone, in one undo step that brings them back. + let d = &s.doc().unwrap().doc; + assert!(d.node(NodeId(g)).is_none(), "the emptied group goes"); + s.execute("edit.undo", &json!({})).unwrap(); + let d = &s.doc().unwrap().doc; + assert!(d.node(NodeId(g)).is_some() && d.node(NodeId(id)).is_none()); +} + +#[test] +fn turned_bold_and_serif_type_keeps_its_font_and_angle() { + let mut s = session(); + let a = outlined(&mut s, json!({"x": 100, "y": 200, "text": "Bold", "size": 24, "font": "Source Sans 3", "style": "Bold", "rotation": 30})); + let b = outlined(&mut s, json!({"x": 300, "y": 80, "text": "Serif", "size": 18, "font": "Source Serif 4", "style": "Regular"})); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["Bold", "Serif"]), "{r}"); + let ids: Vec<u64> = r["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect(); + let bold = text_of(&s, ids[0]); + assert_eq!(bold.first_style().font_style, "Bold"); + assert!(near(bold.first_style().size, 24.0, 0.01)); + // text.create turns as kurbo does: compare the turn the new type has with the old one's. + let turned = kurbo::Affine::translate((100.0, 200.0)) * vectorcraft_geom::rotate_deg(30.0); + for (x, y) in bold.xf.as_coeffs().iter().zip(turned.as_coeffs()) { + assert!(near(*x, y, 1e-3), "{:?} vs {:?}", bold.xf, turned); + } + let serif = text_of(&s, ids[1]); + assert_eq!(serif.first_style().font_family, "Source Serif 4"); + assert!(near(serif.first_style().size, 18.0, 0.01)); +} + +#[test] +fn a_drawn_shape_is_reported_and_left_alone() { + let mut s = session(); + let rect = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 80, "height": 40})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [rect]})).unwrap(); + let before = s.doc().unwrap().doc.clone(); + let e = s.execute("type.retype", &json!({})).unwrap_err().to_string(); + assert!(e.contains("no selected shape matches"), "{e}"); + assert!(s.doc().unwrap().doc == before, "nothing changes"); + assert!(s.execute("type.retype", &json!({"fonts": "Source Sans 3"})).is_err(), "fonts is a list"); +} + +#[test] +fn mixed_selection_retypes_the_glyphs_and_keeps_the_rest() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "Mix", "size": 30})); + let rect = s.execute("shape.rectangle", &json!({"x": 10, "y": 200, "width": 80, "height": 40})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [g, rect]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["Mix"])); + assert_eq!(r["unmatched"], json!([rect])); + let d = &s.doc().unwrap().doc; + assert!(matches!(d.node(NodeId(rect)).unwrap().kind, NodeKind::Path { .. }), "the rectangle stays"); +} + +#[test] +fn two_words_keep_their_space() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 20, "y": 60, "text": "two words", "size": 20})); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["two words"])); +} + +#[test] +fn craft_fonts_glyphs_retype_too() { + let Some(f) = vectorcraft_text::CRAFT_FONTS.iter().find(|f| f.is_japanese()) else { + eprintln!("skipped: built without craft-fonts (set CRAFT_FONTS_DIR to a craft-fonts checkout to run it)"); + return; + }; + let mut s = session(); + let g = outlined(&mut s, json!({"x": 20, "y": 60, "text": "漢字です", "size": 20, "font": f.family, "style": f.style})); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({"fonts": [f.family]})).unwrap(); + assert_eq!(r["texts"], json!(["漢字です"]), "{r}"); + assert_eq!(r["fonts"][0]["family"], json!(f.family)); +} diff --git a/crates/text/src/fontdb/lookup.rs b/crates/text/src/fontdb/lookup.rs index 27302aed2f..ef394cb079 100644 --- a/crates/text/src/fontdb/lookup.rs +++ b/crates/text/src/fontdb/lookup.rs @@ -368,6 +368,12 @@ impl FontDb { loaded.or_else(|| self.instance_by_id(id)) } + /// The faces loaded so far (the bundled fonts and the installed ones type has used), in load + /// order. Installed fonts that nothing has asked for yet are not among them. + pub fn loaded_faces(&self) -> Vec<Arc<FontFace>> { + self.read_faces().clone() + } + /// The face of character style `st`: [`Self::face_version`] of its font, instanced at its /// Variable Font settings ([`Self::instance`]). pub fn style_face(&self, st: &vectorcraft_doc::CharStyle) -> Option<Arc<FontFace>> { diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index f7f5d128ba..4e84f5ecd4 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -26,6 +26,7 @@ mod justify; mod kashida; mod kept; mod layout; +pub mod retype; mod shape; #[cfg(not(target_arch = "wasm32"))] mod suitcase; diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs new file mode 100644 index 0000000000..6b3d07ec73 --- /dev/null +++ b/crates/text/src/retype.rs @@ -0,0 +1,384 @@ +//! Retype's glyph matching (Type › Retype, #4934): which glyph of which loaded font an outlined +//! glyph's shape is, the same up to uniform scale, rotation and translation. +//! +//! Phase 1 is exact matching only: a shape matches a glyph when, after the best similarity +//! transform (a Procrustes fit over points sampled at equal steps of arc length along each +//! contour), the leftover distance is a tiny fraction of the shape's size. That holds for outlines +//! made from a font the app has (Create Outlines' output, and other apps' that keep each glyph's +//! contours whole and in the font's order). Near matches (other versions of a font, hinted or +//! simplified outlines, faux styles, glyphs merged into one path) are left unmatched; fuzzy +//! identification is phase 2. + +use std::collections::HashMap; +use std::sync::Arc; + +use kurbo::{BezPath, CubicBez, Line, ParamCurve, ParamCurveArclen, PathEl, PathSeg, Point, QuadBez, Shape}; + +use crate::{FontDb, FontFace}; + +/// At most this many faces are indexed. +pub const MAX_FACES: usize = 96; +/// At most this many encoded characters of one face are indexed (in code point order). +pub const MAX_GLYPHS_PER_FACE: usize = 65_536; +/// At most this many glyphs are indexed in all: faces past it are left out. +pub const MAX_GLYPHS: usize = 262_144; +/// Shapes with more path elements than this are not matched. +pub const MAX_ELEMENTS: usize = 4096; +/// Shapes (and glyphs) with more contours than this are not matched. +const MAX_CONTOURS: usize = 48; +/// Points sampled along each contour. +const SAMPLES: usize = 32; +/// The largest leftover distance (root mean square over the samples) for a match, as a fraction of +/// the shape's spread about its centre. +const TOLERANCE: f64 = 2e-3; +/// How far apart two shapes' spread-to-length ratios may be and still be compared. +const INVARIANT_SLACK: f64 = 0.02; + +/// One glyph an outlined shape matched. +#[derive(Clone)] +pub struct GlyphMatch { + pub face: Arc<FontFace>, + pub gid: u32, + /// The character the face's cmap maps to the glyph (the lowest, when several do). + pub ch: char, + /// Document units per font unit: the font size is `scale` × units per em. + pub scale: f64, + /// The glyph's turn, radians (as [`kurbo::Affine::rotate`] turns). + pub angle: f64, + /// Where the glyph's origin (its baseline start) lies. + pub origin: Point, + /// The leftover distance, relative to the shape's spread. + pub residual: f64, +} + +/// A shape reduced for matching: points along each contour, centred. +struct Signature { + contours: usize, + /// Centred points, [`SAMPLES`] per contour. + pts: Vec<Point>, + centre: Point, + /// Root mean square distance of the points from the centre. + spread: f64, + /// `spread` / the total contour length: unchanged by scale, turn and move. + invariant: f64, +} + +struct Entry { + face: usize, + gid: u32, + ch: char, + sig: Signature, +} + +/// The glyphs of a set of faces, ready to match shapes against. +pub struct RetypeIndex { + faces: Vec<Arc<FontFace>>, + entries: Vec<Entry>, + /// Entry indices by contour count, sorted by invariant. + buckets: HashMap<usize, Vec<usize>>, +} + +impl RetypeIndex { + /// Index the outline glyphs of `faces` (the first [`MAX_FACES`], each face once). + pub fn build(db: &FontDb, faces: impl IntoIterator<Item = Arc<FontFace>>) -> Self { + let mut kept: Vec<Arc<FontFace>> = vec![]; + for f in faces { + if kept.len() >= MAX_FACES { + break; + } + if !kept.iter().any(|k| k.id() == f.id()) { + kept.push(f); + } + } + let mut entries = vec![]; + for (fi, face) in kept.iter().enumerate() { + if entries.len() >= MAX_GLYPHS { + break; + } + // One entry per glyph, under the lowest character that maps to it. + let mut by_gid: HashMap<u32, char> = HashMap::new(); + for &(c, gid) in face.mapped_chars().iter().take(MAX_GLYPHS_PER_FACE) { + if c.is_whitespace() || c.is_control() { + continue; + } + by_gid.entry(gid).and_modify(|e| *e = (*e).min(c)).or_insert(c); + } + let mut gids: Vec<(u32, char)> = by_gid.into_iter().collect(); + gids.sort_unstable(); + for (gid, ch) in gids { + let outline = db.outline(face, gid); + if let Some(sig) = signature(&outline) { + entries.push(Entry { face: fi, gid, ch, sig }); + } + } + } + let mut buckets: HashMap<usize, Vec<usize>> = HashMap::new(); + for (i, e) in entries.iter().enumerate() { + buckets.entry(e.sig.contours).or_default().push(i); + } + for list in buckets.values_mut() { + list.sort_by(|a, b| { + let (x, y) = (entries.get(*a).map_or(0.0, |e| e.sig.invariant), entries.get(*b).map_or(0.0, |e| e.sig.invariant)); + x.total_cmp(&y) + }); + } + RetypeIndex { faces: kept, entries, buckets } + } + + /// The faces indexed. + pub fn faces(&self) -> &[Arc<FontFace>] { + &self.faces + } + + /// How many glyphs are indexed. + pub fn len(&self) -> usize { + self.entries.len() + } + + pub fn is_empty(&self) -> bool { + self.entries.is_empty() + } + + /// The glyphs `shape` (in document space) is, the closest one per face, closest first; empty + /// when it is no glyph of the indexed faces. + pub fn matches(&self, shape: &BezPath) -> Vec<GlyphMatch> { + let Some(sig) = signature(shape) else { return vec![] }; + let Some(list) = self.buckets.get(&sig.contours) else { return vec![] }; + let lo = sig.invariant * (1.0 - INVARIANT_SLACK); + let hi = sig.invariant * (1.0 + INVARIANT_SLACK); + let start = list.partition_point(|i| self.entries.get(*i).is_some_and(|e| e.sig.invariant < lo)); + let mut best: HashMap<usize, GlyphMatch> = HashMap::new(); + for i in list.iter().skip(start) { + let Some(e) = self.entries.get(*i) else { continue }; + if e.sig.invariant > hi { + break; + } + let Some((z, residual)) = fit(&e.sig, &sig) else { continue }; + if residual > TOLERANCE { + continue; + } + let Some(face) = self.faces.get(e.face) else { continue }; + // The glyph's origin is (0, 0) in font units: it lands at centre − z·glyph centre. + let gc = mul(z, e.sig.centre); + let origin = Point::new(sig.centre.x - gc.x, sig.centre.y - gc.y); + let m = GlyphMatch { face: face.clone(), gid: e.gid, ch: e.ch, scale: z.0.hypot(z.1), angle: z.1.atan2(z.0), origin, residual }; + match best.get(&e.face) { + Some(b) if b.residual < m.residual || (b.residual == m.residual && b.ch <= m.ch) => {} + _ => { + best.insert(e.face, m); + } + } + } + let mut out: Vec<(usize, GlyphMatch)> = best.into_iter().collect(); + out.sort_by(|a, b| a.1.residual.total_cmp(&b.1.residual).then(a.0.cmp(&b.0))); + out.into_iter().map(|(_, m)| m).collect() + } +} + +/// Complex multiply: `z` (a scaled turn) applied to `p`. +fn mul(z: (f64, f64), p: Point) -> Point { + Point::new(z.0 * p.x - z.1 * p.y, z.1 * p.x + z.0 * p.y) +} + +/// The scaled turn `z` that best takes glyph `g`'s points onto shape `s`'s (both centred), and the +/// leftover distance relative to the shape's spread; `None` for degenerate shapes. +fn fit(g: &Signature, s: &Signature) -> Option<((f64, f64), f64)> { + if g.pts.len() != s.pts.len() || g.pts.is_empty() { + return None; + } + let (mut re, mut im, mut gg) = (0.0, 0.0, 0.0); + for (a, b) in g.pts.iter().zip(&s.pts) { + // Σ s · conj(g) + re += b.x * a.x + b.y * a.y; + im += b.y * a.x - b.x * a.y; + gg += a.x * a.x + a.y * a.y; + } + if gg <= 0.0 || !gg.is_finite() { + return None; + } + let z = (re / gg, im / gg); + let mut res = 0.0; + for (a, b) in g.pts.iter().zip(&s.pts) { + let p = mul(z, *a); + res += (p.x - b.x).powi(2) + (p.y - b.y).powi(2); + } + let n = s.pts.len() as f64; + let rel = (res / n).sqrt() / s.spread; + rel.is_finite().then_some((z, rel)) +} + +/// `path`'s contours as segments, the closing line included; `None` past the size caps. +fn contours(path: &BezPath) -> Option<Vec<Vec<PathSeg>>> { + if path.elements().len() > MAX_ELEMENTS { + return None; + } + let mut out: Vec<Vec<PathSeg>> = vec![]; + let mut cur: Vec<PathSeg> = vec![]; + let (mut start, mut last) = (Point::ZERO, Point::ZERO); + let mut flush = |cur: &mut Vec<PathSeg>, start: Point, last: Point| { + if last.distance(start) > 0.0 { + cur.push(PathSeg::Line(Line::new(last, start))); + } + if !cur.is_empty() { + out.push(std::mem::take(cur)); + } + }; + for el in path.elements() { + match *el { + PathEl::MoveTo(p) => { + flush(&mut cur, start, last); + start = p; + last = p; + } + PathEl::LineTo(p) => { + cur.push(PathSeg::Line(Line::new(last, p))); + last = p; + } + PathEl::QuadTo(a, p) => { + cur.push(PathSeg::Quad(QuadBez::new(last, a, p))); + last = p; + } + PathEl::CurveTo(a, b, p) => { + cur.push(PathSeg::Cubic(CubicBez::new(last, a, b, p))); + last = p; + } + PathEl::ClosePath => { + flush(&mut cur, start, last); + last = start; + } + } + } + flush(&mut cur, start, last); + (out.len() <= MAX_CONTOURS).then_some(out) +} + +fn signature(path: &BezPath) -> Option<Signature> { + let bounds = path.bounding_box(); + let size = bounds.width().hypot(bounds.height()); + if !size.is_finite() || size <= 0.0 { + return None; + } + let accuracy = size * 1e-6; + let mut pts = vec![]; + let mut total = 0.0; + let mut contours_n = 0; + for c in contours(path)? { + let lens: Vec<f64> = c.iter().map(|s| s.arclen(accuracy)).collect(); + let len: f64 = lens.iter().sum(); + // A contour with no length (a lone move) draws nothing. + if !(len > size * 1e-9) || !len.is_finite() { + continue; + } + total += len; + contours_n += 1; + let (mut si, mut before) = (0usize, 0.0); + for k in 0..SAMPLES { + let at = len * k as f64 / SAMPLES as f64; + while si + 1 < c.len() && before + lens.get(si).copied().unwrap_or(0.0) < at { + before += lens.get(si).copied().unwrap_or(0.0); + si += 1; + } + let (Some(seg), Some(l)) = (c.get(si), lens.get(si)) else { return None }; + let t = if *l > 0.0 { seg.inv_arclen((at - before).clamp(0.0, *l), accuracy) } else { 0.0 }; + pts.push(seg.eval(t)); + } + } + if pts.is_empty() { + return None; + } + let n = pts.len() as f64; + let centre = Point::new(pts.iter().map(|p| p.x).sum::<f64>() / n, pts.iter().map(|p| p.y).sum::<f64>() / n); + for p in &mut pts { + *p = Point::new(p.x - centre.x, p.y - centre.y); + } + let spread = (pts.iter().map(|p| p.x * p.x + p.y * p.y).sum::<f64>() / n).sqrt(); + if !(spread > 0.0) || !spread.is_finite() { + return None; + } + Some(Signature { contours: contours_n, pts, centre, spread, invariant: spread / total }) +} + +#[cfg(test)] +mod tests { + use super::*; + use kurbo::Affine; + + fn letter() -> BezPath { + // A hand-made "P"-like shape: an outer contour and a counter. + let mut p = BezPath::new(); + p.move_to((0.0, 0.0)); + p.line_to((0.0, -700.0)); + p.curve_to((300.0, -700.0), (450.0, -600.0), (450.0, -480.0)); + p.quad_to((450.0, -300.0), (120.0, -300.0)); + p.line_to((120.0, 0.0)); + p.close_path(); + p.move_to((120.0, -600.0)); + p.line_to((120.0, -400.0)); + p.quad_to((330.0, -400.0), (330.0, -500.0)); + p.quad_to((330.0, -600.0), (120.0, -600.0)); + p.close_path(); + p + } + + #[test] + fn a_shape_matches_itself_scaled_turned_and_moved() { + let g = signature(&letter()).unwrap(); + let xf = Affine::translate((300.0, 200.0)) * Affine::rotate(0.4) * Affine::scale(0.024); + let s = signature(&(xf * letter())).unwrap(); + let (z, res) = fit(&g, &s).unwrap(); + assert!(res < 1e-6, "{res}"); + assert!((z.0.hypot(z.1) - 0.024).abs() < 1e-9); + assert!((z.1.atan2(z.0) - 0.4).abs() < 1e-9); + let origin = s.centre - mul(z, g.centre).to_vec2(); + assert!(origin.distance(Point::new(300.0, 200.0)) < 1e-6, "{origin:?}"); + } + + #[test] + fn lines_written_as_curves_still_match() { + // Paths store lines as cubics with handles on their anchors, or the closing line explicitly. + let mut alt = BezPath::new(); + alt.move_to((0.0, 0.0)); + alt.curve_to((0.0, 0.0), (0.0, -700.0), (0.0, -700.0)); + alt.curve_to((300.0, -700.0), (450.0, -600.0), (450.0, -480.0)); + alt.extend([PathEl::QuadTo((450.0, -300.0).into(), (120.0, -300.0).into())]); + alt.line_to((120.0, 0.0)); + alt.line_to((0.0, 0.0)); + alt.close_path(); + alt.move_to((120.0, -600.0)); + alt.line_to((120.0, -400.0)); + alt.quad_to((330.0, -400.0), (330.0, -500.0)); + alt.quad_to((330.0, -600.0), (120.0, -600.0)); + alt.close_path(); + let (_, res) = fit(&signature(&letter()).unwrap(), &signature(&alt).unwrap()).unwrap(); + assert!(res < 1e-6, "{res}"); + } + + #[test] + fn another_shape_does_not_match() { + let mut o = BezPath::new(); + o.extend(kurbo::Circle::new((200.0, -350.0), 300.0).path_elements(0.1)); + let mut box_ = BezPath::new(); + box_.extend(kurbo::Rect::new(0.0, -700.0, 450.0, 0.0).path_elements(0.1)); + let (a, b) = (signature(&o).unwrap(), signature(&box_).unwrap()); + assert!(fit(&a, &b).is_none_or(|(_, r)| r > TOLERANCE)); + } + + #[test] + fn degenerate_and_hostile_shapes_give_none() { + assert!(signature(&BezPath::new()).is_none()); + let mut dot = BezPath::new(); + dot.move_to((5.0, 5.0)); + dot.close_path(); + assert!(signature(&dot).is_none()); + let mut nan = BezPath::new(); + nan.move_to((f64::NAN, 0.0)); + nan.line_to((1.0, 1.0)); + assert!(signature(&nan).is_none()); + let mut huge = BezPath::new(); + huge.move_to((0.0, 0.0)); + for i in 0..(MAX_ELEMENTS + 1) { + huge.line_to((i as f64, (i % 7) as f64)); + } + assert!(signature(&huge).is_none()); + } +} diff --git a/docs/gaps.md b/docs/gaps.md index a6f6defbb0..a4e0dcd57a 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** minor (Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -466,7 +466,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Missing:** CJK vertical composition (custom mojikumi sets and the Mojikumi Settings dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern features beyond bidi, digit types, Character Direction and Kashidas (a split caret; the Middle Eastern & South Asian composers are done, #4935), - Touch Type, Retype, Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). + Touch Type, Retype beyond exact matches of available fonts (phase 1 is in, #4934; near matches, the ranked font list and text in images remain), Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). Itemized in [type-parity.md](type-parity.md). - **Impact:** professional typography and Japanese/Chinese publishing. - **Estimate:** 34–47 h (type core 14–19 h blocks beta). @@ -902,6 +902,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | G4 type: Retype phase 1 (#4934), `type.retype` for outlined text that exactly matches an available font; near matches, the ranked font list and images remain. Scores and estimates unchanged | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | | 2026-11-14 | minor | Type: Middle Eastern & South Asian and Standard composers per paragraph (#4935): Paragraph panel menu, paragraph styles, `text.setFormat {composer}` and the native file; the Standard composers set Indic, Arabic and Hebrew type glyph by glyph. `.ai`, EPS and PDF files carry no composer. Scores and estimates unchanged. | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 258b86d04a..d9c3f7cb65 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -163,7 +163,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | -| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | +| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box | 2–4 | | M9 | Live effects (+ 3D & Materials) | 🟡 2D effects done incl. Effect → Pathfinder, Color Adjustments and Document Raster Effects Settings; PDF export warns when the pixel cap lowers raster-effect resolution; Artistic › Colored Pencil, Cutout, Dry Brush, Film Grain, Fresco, Neon Glow, Paint Daubs, Palette Knife, Poster Edges, Rough Pastels, Smudge Stick, Sponge, Underpainting and Watercolor and Sketch › Halftone Pattern, Bas Relief, Charcoal, Conté Crayon, Photocopy, Stamp, Torn Edges and Water Paper done (57/57 Photoshop filters); Revolve with automatic smooth vector shading, default-on circular caps and continuous rims, Extrude & Bevel, Inflate and Rotate with one to ten colored directional lights and four original lighting presets; SVG Filters, remaining raster effects and 3D materials and shadows pending | 81–130 | | M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG `<pattern>`/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, ten generated libraries including Tech Circuit, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | @@ -212,6 +212,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | M7/G4: Retype phase 1 (#4934): `type.retype` turns outlined text that exactly matches an available font back into point text. Scores and estimates unchanged | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | PDF import: fill and stroke rendering (text rendering modes 2 and 6) draws all the glyphs of a text-showing operator (`Tj`, `TJ`, `'`, `"`) filled, then the same glyphs stroked, so a word shown at once came in as two type objects: a stroke-only copy over a fill-only one. Each stroke is now matched, in order, to the glyph filled with the same placement (where, how large, how wide, slanted and turned) in the same font with the same text on the line, and only that glyph takes the stroke, so the word comes in as one type object, filled and stroked; glyphs stroked with another join part way through still split into runs of their own, and stroked type over no filled glyph (modes 1 and 5) stays stroke only (#8015; `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e9fc9a6820..0a663b7ea4 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -259,15 +259,15 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Appearance, transparency, graphic styles, masks | 5 | 97% | raster effect reach in preview bounds | 1–2 | estimated; Transform typing, sliders, preview, and undo are covered in `crates/ui-egui/src/panels/tests_appearance.rs` | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, painter visibility); materials, light presets, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | | Type core | 9 | 80% | Auto-leading style resets are implemented; Hyphenation… and Justification… options are done (#2310, #2755), and a paragraph's Auto Leading also sets the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; remaining: Optical Margin Alignment, Middle Eastern features beyond bidi layout (the Middle Eastern & South Asian and Standard composers are done per paragraph, #4935; `.ai`/EPS/PDF files carry no composer), optional group font-size preservation; transformed character controls fixed (#1034), see [type-parity.md](type-parity.md) | 14–19 | estimated; eleven-language pattern hyphenation in both composers, with grapheme and shaping-cluster protection (#4947, `hyphen::tests` and `layout::wrapping_tests`); Sanskrit patterns pending an allowlisted source; recent-font groups in font pickers (#3515); full-name font matches regression-tested (#1258); mixed paragraph alignment indication implemented; headless regressions, full integration CI and visual review pass; localized legacy family-name fallback with loaded/catalog regressions (#2208); Fractional Widths per type object regression-tested; color emoji fonts with bitmap glyphs (`sbix`, `CBDT`) draw and export; threading ports: every selected area type and type on a path shows its in and out ports (empty, arrow, red "+"), and the Selection tool threads from either, the in port into a frame before it, and a double-click on a threaded port breaks the thread there (`threads::tests::break_splits_the_thread_and_the_story_flows_into_the_first_part`, `select::tests::a_double_click_on_a_threaded_port_breaks_the_thread`, `canvas::tests::a_double_click_on_a_threaded_out_port_breaks_the_thread`) (#2572; `select::tests::a_click_on_the_in_port_threads_into_a_frame_before_it`, `text::tests::selected_type_shows_its_ports_in_each_state`, `threads::tests::add_before_threads_the_story_from_the_new_frame_into_the_clicked_one`, live screenshot); the Glyphs panel highlights and scrolls to the character selected with the Type tool (#4908, `panels::glyphs` tests); the OpenType panel lists only `ss01`–`ss20` sets present in the selected font and uses its custom names when supplied; Type-range desktop Copy publishes styled art and keeps font family, size and color on canvas Paste after editing (#5636); paint-only Arabic harakat keep joining with conditional GDEF-mark ownership and Insert Kashidas base-letter paint (`tests::harakat`) | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), variable font axes, tab leaders, Touch Type, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), variable font axes, tab leaders, Touch Type, Retype beyond exact matches of available fonts | 20–28 | estimated; Retype phase 1 (`type.retype`, exact glyph matches, #4934); upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), tab leaders, Touch Type, Retype | 20–28 | estimated; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (ruby, mojikumi), tab leaders, Touch Type, Retype beyond exact matches of available fonts | 20–28 | estimated; Retype phase 1 (`type.retype`, exact glyph matches, #4934); upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type (Graphic / Movie Clip) and 9-slice guides (drawn and draggable during symbol editing, #5280) and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) are done | 4–7 | estimated; Blend panel Type and Ramp control step easing with a separate color Shift (#2539); Blend Options retains spacing and orientation; polynomial curves are original approximations; interactive selected mirror axis implemented; bounding-box handles take priority over the axis line (focused regression and native checks passed; full CI blocked by an unrelated text test); #2544 spine Anchor Point conversion and picking regression-tested | | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; simpler contour walk, identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments, so Paths is monotone on the code-drawn sweep) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them; Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views (scores/hours unchanged) | | Live vector effects | 5 | 85% | Outline Object, SVG Filters | 4–8 | measured count 49/50 (Pathfinder 13/13 with Trap), depth estimated; Warp Options controls verified by focused checks and original-image review | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, original lighting presets, painter visibility), Revolve (Classic) with Angle, Cap, Offset and the Plastic, Diffuse, No Shading and Wireframe surfaces, the Quick Actions › Expand as Wireframes command (#6354), the Render Settings › Wireframe mode on Extrude & Bevel, Revolve, Inflate and Rotate; materials, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); Revolve (Classic) is covered by the `revolve::classic` tests and `dialogs::revolve::tests::classic_revolve_shows_its_options_and_applies_as_one_step`; Expand as Wireframes is covered by `crates/effects/src/solids/wireframe/tests.rs` and `crates/engine/src/cmd/wireframe/tests.rs`, and Render Settings › Wireframe by `crates/effects/src/solids/wireframe/tests.rs` and `crates/ui-egui/src/panels/tests_three_d.rs` (score, gaps and hours unchanged); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), variable font axes, tab leaders, Touch Type, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | -| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), tab leaders, Touch Type, Retype | 20–28 | estimated; No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), variable font axes, tab leaders, Touch Type, Retype beyond exact matches of available fonts | 20–28 | estimated; Retype phase 1 (`type.retype`, exact glyph matches, #4934); No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | +| Type advanced (CJK, spelling, Touch Type, Retype) | 4 | 50% | CJK vertical composition (mojikumi), tab leaders, Touch Type, Retype beyond exact matches of available fonts | 20–28 | estimated; Retype phase 1 (`type.retype`, exact glyph matches, #4934); No Break keeps marked characters on one line; upright fallback for fullwidth `!` / `?` regression-tested; score and hours unchanged | | Raster effects (Effect Gallery) | 4 | 55% | — | — | estimated (raised from 52%: the Effect Gallery's filter thumbnails and in-dialog preview, an original landscape drawing passed through each filter, [Filter Gallery overview](https://helpx.adobe.com/photoshop/desktop/effects-filters/get-started-with-filters/filter-gallery.html), `dialogs::effect_gallery::tests::gallery_shows_thumbnails_and_an_in_dialog_preview`; the gallery itself shipped in #2883, six categories, per-filter settings, ordered stack, live canvas preview, one undo step, `stack_ok_is_one_undo_step`, `stack_preview_is_one_interaction`); measured count 57/57 (Artistic complete with Colored Pencil, Fresco, Paint Daubs, Palette Knife, Rough Pastels and Underpainting; Sketch complete with Torn Edges and Conté Crayon, `pixel::tests_sketch::conte_crayon_*`); texture redraw distances optimized (#1257), pixels verified; the score stays under 100% because the filters are original approximations; depth estimated | | Symbols, blends, envelopes, Repeat, perspective | 5 | 88% | remaining: dynamic symbols' `.ai` round trip, further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), envelope Anti-Alias/Preserve Shape, 9-slice guides outside the art; Symbol Options › Registration, Export Type and Symbol Type (dynamic on-canvas fill/stroke including gradient/pattern, opacity and blend, #4938) and on-canvas 9-slice guides (#5280) are done | 4–7 | estimated | | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | @@ -528,10 +528,10 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Appearance, transparency, graphic styles, masks | 5 | 98% | Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); raster effect reach in preview bounds (flattener presets apply in PDF, EPS and print) | 1–2 | | Live vector effects | 5 | 85% | Outline Object, Pathfinder Hard/Soft Mix and Trap (since done: #3061, #3063, #3785), SVG Filters, Transform Patterns and Scale Strokes & Effects on a fill's or stroke's own Transform effect | 6–10 | | 3D and Materials | 4 | ~25% | Initial Revolve, Extrude & Bevel, Inflate and Rotate, with simple lighting; materials, light presets, shadows, ray tracing, Rotate (Classic), Map Art and more complete visibility remain | 25–45 | -| Type advanced | 4 | 50% | CJK composition for vertical type (ruby, mojikumi beyond Line-end Punctuation Half Width — the other sets (and their paragraph-start bracket and indent rules), custom kinsoku sets (beyond Hard, Soft and None) and the Mojikumi Settings dialog —, manual tate-chu-yoko), tab leaders, Touch Type, Retype; vertical point/area/path type and Type Orientation have initial support (beyond parity, not scored: inline symbols in text) | 20–28 | +| Type advanced | 4 | 50% | CJK composition for vertical type (ruby, mojikumi beyond Line-end Punctuation Half Width — the other sets (and their paragraph-start bracket and indent rules), custom kinsoku sets (beyond Hard, Soft and None) and the Mojikumi Settings dialog —, manual tate-chu-yoko), tab leaders, Touch Type, Retype beyond exact matches of available fonts (phase 1, #4934); vertical point/area/path type and Type Orientation have initial support (beyond parity, not scored: inline symbols in text) | 20–28 | | Raster effects (Effect Gallery, Document Raster Effects Settings) | 4 | 35% | ~36 Photoshop-style filters (Artistic, Brush Strokes, Sketch, Stylize) and Texturizer's Load Texture (since done, see the area table above, as is the Effect Gallery, #2883); Document Raster Effects Settings, raster effects in PDF, the pixel-filter pipeline, Radial Blur, Smart Blur (Normal, Edge Only and Overlay Edge), Unsharp Mask, Glowing Edges, Distort (Diffuse Glow, Glass, Ocean Ripple), Pixelate (Color Halftone, Crystallize, Mezzotint, Pointillize), Texture (Craquelure, Grain, Mosaic Tiles, Patchwork, Stained Glass, Texturizer) and Video (De-Interlace, NTSC Colors) are done | 8–14 | | 3D and Materials | 4 | ~25% | Initial Revolve, Extrude & Bevel, Inflate and Rotate, with simple lighting and four original lighting presets; materials, shadows, ray tracing, Rotate (Classic), Map Art and more complete visibility remain | 25–45 | -| Type advanced | 4 | 50% | CJK composition for vertical type (mojikumi beyond Line-end Punctuation Half Width — the other sets (and their paragraph-start bracket and indent rules), custom kinsoku sets (beyond Hard, Soft and None) and the Mojikumi Settings dialog —, manual tate-chu-yoko is done, its up/down settings remain; No Break is done), tab leaders, Touch Type, Retype; vertical point/area/path type and Type Orientation have initial support (beyond parity, not scored: inline symbols in text) | 20–28 | +| Type advanced | 4 | 50% | CJK composition for vertical type (mojikumi beyond Line-end Punctuation Half Width — the other sets (and their paragraph-start bracket and indent rules), custom kinsoku sets (beyond Hard, Soft and None) and the Mojikumi Settings dialog —, manual tate-chu-yoko is done, its up/down settings remain; No Break is done), tab leaders, Touch Type, Retype beyond exact matches of available fonts (phase 1, #4934); vertical point/area/path type and Type Orientation have initial support (beyond parity, not scored: inline symbols in text) | 20–28 | | Type core | 9 | 80% | Middle Eastern features beyond bidi layout, Paragraph Direction, digit types and Kashidas (editable bidirectional SVG text, a split caret where directions meet; the Middle Eastern & South Asian composers are done, #4935, but `.ai`/EPS/PDF files carry no composer); paint-only harakat keep joining with conditional GDEF-mark colour ownership, but fonts without GDEF mark classes and some AAT/`morx` ligatures can still leave marks painted as their letters; Every-line Composer fidelity for justified and ragged text (available per object; mixed type sizes in a paragraph still break single-line in non-rectangular area type and with text wrap), Optical Margin Alignment, paragraph spacing limit for vertically justified area type, hidden characters, paragraph attributes in the Type tool's copy and paste (the characters keep their styles, the paragraphs take the destination's), mixed-value display in the Paragraph panel for a selection across differing paragraphs, partial selection of type-area anchors by marquee, optional font-size preservation during group scaling (scaled character controls fixed in #1034). Hyphenation and Justification options, Fractional Widths, System Layout, styled Type-range canvas Paste (#5636), and pattern hyphenation for eleven Indian languages with grapheme/cluster protection (#4947) are done; Sanskrit automatic patterns remain pending an allowlisted source | 14–19 | | Symbols, blends, envelopes, Repeat, perspective | 5 | 90% | further built-in symbol libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons and Weather Icons are done), dynamic symbols' `.ai` round trip, envelope Anti-Alias/Preserve Shape output and warp point editing, brush interpolation in blends (M8 fidelity pass done); Symbol Options › Registration and Export Type and on-canvas dynamic part paint (gradient/pattern, opacity, blend) are done; symbol editing shows draggable 9-slice guides (#5280), while guides outside the artwork remain unsupported | 4–7 | | Image Trace, graphs, image tools | 3 | 72% | graph Column designs (Graph Design, Marker designs and series colours set with Group Selection are done), Create Object Mosaic, per-feature stroke/fill choice and varying widths in Image Trace's Create Strokes (Vector Halftone and the Image Trace View modes, Palette and Create Strokes are done) | 6–10 | @@ -2719,6 +2719,10 @@ Edit Custom Dictionary followed (2026-11-10), as the same page's "Edit the custo Check Spelling followed (2026-11-15): Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) opens a modal dialog displaying the unrecognized word in its sentence context ("Not in Dictionary"), a list of suggestions with selection or double-click to replace into the "Change to" field, and action buttons: "Ignore" (skips current word), "Ignore All" (skips word in active document, `text.spelling.ignoreAll`), "Change" (replaces word in 1-step undo, `text.editRange`), "Change All" (replaces all occurrences in a single undo step via `command.batch`), "Add to Dictionary" (`text.spelling.addWord`), and "Done" / "Cancel". Supports keyboard navigation (Tab between controls, Enter to Change or Done, Escape to close) (#4936; `crates/ui-egui/src/dialogs/check_spelling.rs`). Spell check is complete. +## Retype, phase 1 (2026-11-18) + +The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Near matches, the ranked font list, installed fonts not yet loaded and images remain (phase 2). + ## Control bar: Paragraph section while type is selected (2026-11-06) With type selected, the Control bar shows a Paragraph: link and the Align left, Align center and Align right buttons after its Character controls, as the public documentation has the Control panel format paragraphs while the Type tool is in use, with a way to the Paragraph panel ([Paragraph panel overview](https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html)), and its alignment buttons align text as the Paragraph panel's do ([Align text](https://helpx.adobe.com/illustrator/using/align-text.html)). A button aligns the selected type (`text.setStyle {justify}`, one undo step) and the shared alignment shows selected; the link opens the Paragraph panel in a popover under it, as Character: opens the Character panel. Keeping to the three alignments that don't justify is our choice, for the bar's room; the popover has all seven. Short of room the bar leaves controls out from its right end: the inline X/Y/W/H fields, the Distribute and Align buttons, area type's vertical alignment, then these buttons and last the link, keeping room for the Transform link; on a 1536 pt bar with one point type object, the buttons show (pinned by a headless test, #5372). @@ -2783,6 +2787,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | Type advanced: Retype phase 1 (`type.retype`, #4934), exact matches of available fonts become point text again; evidence added; near matches, the ranked font list and images remain; score and hours unchanged | | 2026-11-16 | minor | Layers panel: rows or the selected-art square dragged over the list show the copy cursor while Alt is held, as the drop then copies, and the grabbing hand otherwise (#8217). Scores and estimates unchanged. | | 2026-11-16 | minor | Gradient panel: the strip under the ramp, where a click adds a stop, shows the white arrow with a plus on Windows and X11, where the system copy cursor showed as the plain arrow (#8241). Scores and estimates unchanged. | | 2026-11-16 | minor | Properties panel: while the Type tool edits text, the Character section shows the font family and style and the Variable Font button of the first selected character (or of the character before the caret), not those of the text object's first run (#8189). Evidence: `panels::properties::tests::character_section_shows_the_type_tool_selections_style`. Scores and estimates unchanged. | diff --git a/docs/type-parity.md b/docs/type-parity.md index 458788b1b6..5bf888b952 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -1,6 +1,6 @@ # Type parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (modal Check Spelling dialog: Edit › Spelling › Check Spelling…, `ui.checkSpelling`, #4936; spell check complete; previously minor: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; `.ai` and EPS files do not carry the choice; scores and estimates unchanged; previously minor: kerning at the Type tool's caret at the start of a line sets the space before the character after it, #5111; previously minor: type's strokes in an envelope paint along its bent glyph outlines at their own weight, Distort Appearance on or off, as users' `.ai` files draw them, #6644; previously minor: a centred or right-aligned line of tracked type is aligned without the tracking after its last character, as the page of users' `.ai` files aligns it, #6610; previously minor: tracking and manual kerning in horizontally scaled type are thousandths of the em as the Horizontal Scale draws it, as the page of users' `.ai` files spaces such type; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: Direct Selection shows and drags the direction handles of type on a path's path, #3565; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas base-letter paint; scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: right-aligned area type sets the text after a line's last tab against the right edge; a soft return in justified type no longer keeps its line from being justified; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: modal Check Spelling dialog: Edit › Spelling › Check Spelling…, `ui.checkSpelling`, #4936; spell check complete; previously minor: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; `.ai` and EPS files do not carry the choice; scores and estimates unchanged; previously minor: kerning at the Type tool's caret at the start of a line sets the space before the character after it, #5111; previously minor: type's strokes in an envelope paint along its bent glyph outlines at their own weight, Distort Appearance on or off, as users' `.ai` files draw them, #6644; previously minor: a centred or right-aligned line of tracked type is aligned without the tracking after its last character, as the page of users' `.ai` files aligns it, #6610; previously minor: tracking and manual kerning in horizontally scaled type are thousandths of the em as the Horizontal Scale draws it, as the page of users' `.ai` files spaces such type; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: Direct Selection shows and drags the direction handles of type on a path's path, #3565; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas base-letter paint; scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: right-aligned area type sets the text after a line's last tab against the right edge; a soft return in justified type no longer keeps its line from being justified; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen) · **Target:** Adobe Illustrator 2026 (30.x) Glyphs review (#6084): a positional variant no supported feature draws is accepted as a glyph choice. Entire Font respects the selection's variable axes and font version; the default cell can reset an unlisted choice without GSUB alternates. Contextual choices use the supplying face, including fallback. Feature-only boundaries preserve ligature clusters and Arabic mark attachment. Encoded characters insert unchanged except Arabic presentation forms with a joining base letter; normalization reports success only after insertion succeeds. Latest follow-up regressions await runtime verification. Scores and estimates unchanged. @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | missing | Illustrator's uses a cloud model | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), the ranked list of matching fonts with previews, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | @@ -89,6 +89,7 @@ Character Styles menu New/Redefine and footer New capture the first selected cha | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | Retype phase 1 (#4934): `type.retype` turns outlined glyphs that exactly match an available font back into point text (font, size, baseline, turn, paint), reporting the shapes it cannot match; the Retype row is now partial. Scores and estimates unchanged | | 2026-11-15 | minor | Check Spelling dialog (#4936): Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) modal dialog with sentence context, suggestions, Ignore, Ignore All, Change, Change All, Add to Dictionary, Done/Cancel, keyboard navigation, and one-step Undo/Redo; spell check complete. Scores and estimates unchanged. | | 2026-11-14 | minor | Paragraph composers (#4935): `text.setFormat {composer}` and paragraph styles take `singleLine` and `everyLine` (the Middle Eastern & South Asian composers, what all type used and the default) and `standardSingleLine` and `standardEveryLine`, which break lines the same way and set a complex script (Indic, Arabic, Hebrew) glyph by glyph as the font maps its characters, with no conjuncts, reordering, marks placed or joining forms. The choice is per paragraph, saved in the native file only when it is not Every-line, and not written to `.ai`, EPS or PDF files, whose composer setting this app has no recorded format for. Scores and estimates unchanged. Tests `tests::composers`. | | 2026-11-12 | minor | Glyphs review (#6084): validate contextual glyph choices against their supplying face, including fallback and overflow; keep feature-only boundaries inside ligatures and Arabic mark clusters while retaining drawing-attribute splits; preserve insertion failures instead of reporting normalization success. Deterministic engine, shaping and panel regression sources added; ligature range assertions use the fixture's unencoded glyph identity. Runtime proof pending. Scores and estimates unchanged. | From a3bdb2871fbb73a465b3e4bb5c20c5d7b480aa07 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 12:58:21 -0800 Subject: [PATCH 146/247] EMF/WMF: export checks the chosen artboards before turning raster effects into images An EMF or WMF export with an empty or non-finite artboard among the chosen ones, or with no artboard to write, turned the document's raster effects into images before the writer refused it. The engine now checks the artboards first with the writer's own rule (vectorcraft_metafile::check_regions) and refuses with the same messages, "the export region is empty" and "the document has no artboard", without that work. Exports that go ahead write the same bytes. --- crates/engine/src/cmd/fileio/metafile.rs | 18 +++++- .../engine/src/cmd/fileio/tests_metafile.rs | 59 +++++++++++++++++++ crates/metafile/src/lib.rs | 15 ++++- docs/target-app-parity.md | 1 + 4 files changed, 89 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/fileio/metafile.rs b/crates/engine/src/cmd/fileio/metafile.rs index e9e1e882a7..3012f7c238 100644 --- a/crates/engine/src/cmd/fileio/metafile.rs +++ b/crates/engine/src/cmd/fileio/metafile.rs @@ -19,6 +19,18 @@ pub(super) const OPTIONS: &[FormatOption] = &[super::ARTBOARD, super::ARTBOARDS, /// Encode `doc` as `kind`: the chosen artboard (default the first), or with `use_artboards` one /// picture per chosen artboard (default all). pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>, kind: Kind) -> Result<Encoded> { + encode_flattening(doc, p, use_artboards, kind, crate::flatten_raster_effects) +} + +/// [`encode`] with `flatten` turning raster effects into images. The chosen artboards are checked +/// first, so an export that is refused does not call `flatten`. +pub(super) fn encode_flattening( + doc: &Document, + p: &Value, + use_artboards: Option<bool>, + kind: Kind, + flatten: impl FnOnce(&Document) -> Option<Document>, +) -> Result<Encoded> { let f = super::format(kind.id()).ok_or_else(|| bad(C, "no metafile format"))?; let pick: ArtboardPick = super::encode::options(f, p)?; let n = doc.artboards.len(); @@ -26,12 +38,16 @@ pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>, kin Some(true) => pick.resolve(n).map_err(|e| bad(C, e))?.unwrap_or_else(|| (0..n).collect()), _ => vec![pick.one(n).map_err(|e| bad(C, e))?], }; + if boards.is_empty() { + return Err(bad(C, "the document has no artboard")); + } let rects = boards .iter() .map(|&b| doc.artboards.get(b).map(|a| a.rect).ok_or_else(|| bad(C, format!("no artboard {}", b + 1)))) .collect::<Result<Vec<_>>>()?; + vectorcraft_metafile::check_regions(&rects).map_err(|e| bad(C, e))?; // Raster effects (shadows, glows, blurs) as images, as PDF export does. - let flat = crate::flatten_raster_effects(doc); + let flat = flatten(doc); let src = flat.as_ref().unwrap_or(doc); let outs = vectorcraft_metafile::export_regions(src, &rects, kind).map_err(|e| bad(C, e))?; let mut enc = Encoded::default(); diff --git a/crates/engine/src/cmd/fileio/tests_metafile.rs b/crates/engine/src/cmd/fileio/tests_metafile.rs index b02d16508b..941db4fe07 100644 --- a/crates/engine/src/cmd/fileio/tests_metafile.rs +++ b/crates/engine/src/cmd/fileio/tests_metafile.rs @@ -95,6 +95,65 @@ fn raster_effects_are_written_as_images() { assert!(kinds.contains(&114), "the shadow is an image with transparency"); } +/// An export refused for an empty or non-finite artboard among the chosen ones, or for no +/// artboard, gives the same error as before and turns no raster effect into an image; an export +/// that goes ahead does so once, and writes what `document.export` writes. +#[test] +fn a_refused_export_turns_no_raster_effects_into_images() { + use vectorcraft_geom::Rect; + use vectorcraft_metafile::Kind; + let mut s = two_boards(); + let id = s.execute("shape.rectangle", &json!({"x": 50, "y": 50, "width": 30, "height": 30})).unwrap()["id"].clone(); + s.execute("effect.apply", &json!({"effect": "stylize.dropShadow", "ids": [id]})).unwrap(); + let doc = s.doc().unwrap().doc.as_ref().clone(); + let run = |doc: &vectorcraft_doc::Document, p: Value, kind: Kind| { + let mut calls = 0; + let r = super::metafile::encode_flattening(doc, &p, Some(true), kind, |d| { + calls += 1; + crate::flatten_raster_effects(d) + }); + (r.map(|e| e.files).map_err(|e| e.to_string()), calls) + }; + for kind in [Kind::Emf, Kind::Wmf] { + let (files, calls) = run(&doc, json!({}), kind); + assert_eq!(calls, 1, "{kind:?}"); + let files = files.unwrap(); + assert_eq!(files.len(), 2, "{kind:?}"); + let r = s.execute("document.export", &json!({"format": kind.id(), "useArtboards": true})).unwrap(); + let written: Vec<Vec<u8>> = r["files"].as_array().unwrap().iter().map(b64).collect(); + assert_eq!(files.into_iter().map(|(_, b)| b).collect::<Vec<_>>(), written, "{kind:?}"); + // The first artboard is fine; the second is empty, or has a corner that isn't finite. + let x = doc.artboards[0].rect.x1 + 10.0; + for empty in [Rect::new(x, 0.0, x, 100.0), Rect::new(0.0, 0.0, f64::NAN, 100.0), Rect::new(0.0, 0.0, 100.0, f64::INFINITY)] { + let mut bad_doc = doc.clone(); + bad_doc.artboards[1].rect = empty; + for p in [json!({}), json!({"artboards": [0, 1]}), json!({"artboards": [1]})] { + let (files, calls) = run(&bad_doc, p.clone(), kind); + let e = files.err().unwrap_or_default(); + assert!(e.contains("the export region is empty"), "{kind:?} {p}: {e}"); + assert_eq!(calls, 0, "{kind:?} {p}"); + } + } + // Reversed corners are an artboard like any other. + let mut flipped = doc.clone(); + let r1 = flipped.artboards[1].rect; + flipped.artboards[1].rect = Rect::new(r1.x1, r1.y1, r1.x0, r1.y0); + let (files, calls) = run(&flipped, json!({}), kind); + assert_eq!((files.map(|f| f.len()), calls), (Ok(2), 1), "{kind:?}"); + // No artboard to write. + let mut none = doc.clone(); + none.artboards.clear(); + let (files, calls) = run(&none, json!({}), kind); + let e = files.err().unwrap_or_default(); + assert!(e.contains("the document has no artboard"), "{kind:?}: {e}"); + assert_eq!(calls, 0, "{kind:?}"); + } + // Through the command, the refusal reads as it did. + std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc).artboards[1].rect = Rect::new(0.0, 0.0, 0.0, 100.0); + let e = s.execute("document.export", &json!({"format": "emf", "useArtboards": true})).unwrap_err().to_string(); + assert!(e.contains("the export region is empty"), "{e}"); +} + /// Two placed images whose pixel data can't be decoded are left out of an EMF or WMF, and /// `warnings` holds the note raster exports give, once, without naming either image's key. #[test] diff --git a/crates/metafile/src/lib.rs b/crates/metafile/src/lib.rs index c4a84aa8e6..802d662818 100644 --- a/crates/metafile/src/lib.rs +++ b/crates/metafile/src/lib.rs @@ -83,14 +83,23 @@ pub fn export(doc: &Document, region: Rect, kind: Kind) -> Result<Output, String Ok(export_regions(doc, &[region], kind)?.pop().unwrap_or_default()) } +/// The error [`export_regions`] returns for `regions`, without writing anything: a region whose +/// corners are not all finite, or that has no width or no height, is empty. Corners in either +/// order are allowed. +pub fn check_regions(regions: &[Rect]) -> Result<(), String> { + let empty = |r: Rect| ![r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) || r.width() <= 0.0 || r.height() <= 0.0; + if regions.iter().any(|r| empty(r.abs())) { + return Err("the export region is empty".into()); + } + Ok(()) +} + /// Write the visible art of `doc` over each of `regions` as `kind`, one metafile per region in the /// same order, each as [`export`] writes it over that region. The live effects are applied once /// for all of them. When any region is empty, nothing is written and the result is an error. pub fn export_regions(doc: &Document, regions: &[Rect], kind: Kind) -> Result<Vec<Output>, String> { + check_regions(regions)?; let regions: Vec<Rect> = regions.iter().map(|r| r.abs()).collect(); - if regions.iter().any(|r| ![r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) || r.width() <= 0.0 || r.height() <= 0.0) { - return Err("the export region is empty".into()); - } if regions.is_empty() { return Ok(Vec::new()); } diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ee682dfcf7..ce8be8bb98 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1825,6 +1825,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Live effects inside a symbol's art (geometry effects, color adjustments and the rest that export bakes) are written where each instance places the art in PDF, print, EPS and DXF, as the canvas draws them: the art is placed first and its effects are applied after, so an instance that scales its art does not scale the distance a Transform effect moves it. Symbols nested in the art, a dynamic symbol instance's own paint changes and the stain an instance's fill gives its art are kept, and the art is stained before its effects apply. A linked instance's PDF link covers its art where the effects draw it. A symbol whose art holds itself stops at the nesting limit, and the symbols' own art keeps its effects. An instance stays an instance in these exports when the objects its art makes once baked (the copies a Transform effect makes included) would take the export's placed symbol art past 16,000,000 objects, or when its baked art would draw deeper than the 128 levels a document may draw; these are VectorCraft's own limits. Art baked for an instance that then stays an instance still counts toward that limit, and while an instance's art bakes, the art's own objects are held in the limit for the instances nested in it. Instances the export leaves out (hidden ones, those in hidden groups, on template layers, and on hidden layers or layers that do not print when the export leaves those out) are not placed and do not count toward that limit. Before, these exports wrote the art without its effects (effects `bake::placing_symbols_bakes_their_art_where_each_instance_places_it`, `placing_symbols_reaches_the_art_of_nested_instances`, `placing_a_symbol_that_holds_itself_stops`, `placing_symbols_keeps_dynamic_instances_changes`, `placing_symbols_keeps_the_instances_stain`, `placing_symbols_counts_the_baked_art`, `placing_symbols_counts_nested_art_once`, `placing_symbols_holds_the_outer_art_while_it_bakes`, `placing_symbols_counts_the_art_it_drops`, `placing_symbols_counts_art_dropped_for_depth_against_later_baked_art`, `placing_symbols_keeps_the_baked_art_within_the_drawn_depth`, `placing_symbols_skips_instances_the_export_leaves_out`; doc `depth::tests::drawn_heights_measure_objects_outside_the_layers`; PDF, print, EPS and DXF `symbol_art_effects_are_written_where_they_draw`, `symbol_art_effects_print_where_they_draw`; PDF `a_stained_instance_keeps_its_stain_when_its_art_has_effects`, `a_linked_instance_keeps_its_link_when_its_art_has_effects`). EMF, WMF and SVG export write the same symbol art the same way: an instance of a symbol whose art, or the art of a symbol nested in it, has such effects is written as that art placed by the instance and then baked, so a square that a Transform effect moves 100 pt right draws 100 pt right of where the instance places it at any scale or rotation, and art the effect moves onto the artboard is written. EMF and SVG clip 9-slice cells and WMF does not, as each places other instances. In SVG those instances use no `<symbol>`, and instances of symbols without such effects still share one; named objects in a symbol's art take no ids there, as in an instance with its own copy of the art, so two instances do not write the same id; with Hidden Layers on, hidden instances are placed too and written hidden. An SVG instance nested in another instance's art is shared through `<use>` only when the transform it is drawn with, the outer instances' included, keeps the shared art as the canvas draws it, so a nested stroke keeps its weight in a scaled instance. Preserve Editing still embeds the document with its live effects. Before, these exports wrote the art without its effects (metafile `tests::import::symbol_art_effects_are_written_where_they_draw`; SVG `symbols_layers::symbol_art_effects_are_written_where_the_canvas_draws_them`, `a_kept_hidden_instance_is_written_with_its_symbols_effects`, `instances_written_as_their_art_give_its_names_no_id`, `a_nested_instance_is_shared_only_under_the_transform_it_is_drawn_with`; effects `bake::placing_symbols_skips_instances_the_export_leaves_out`). EMF and WMF export with Use Artboards applies the document's live effects once for all the chosen artboards instead of once for each, and writes the same files byte for byte (metafile `tests::export_regions_writes_what_each_region_writes_alone`; `export_regions_perf` times it). + EMF and WMF export checks the chosen artboards before it turns raster effects into images: an empty or non-finite artboard, or no artboard at all, is refused with the same message without that work (engine `fileio::tests_metafile::a_refused_export_turns_no_raster_effects_into_images`). When an export bakes a symbol instance with geometry effects inside the art of another such instance, it counts the art the inner instance bakes to, the copies its symbol's effects make included, against the 262,144 objects of symbol art one export bakes that way; it counted only the symbol's art before its effects. An instance whose baked art would pass that count stays an instance with its effects, and the art baked for it still counts against the instances after it. These are VectorCraft's own limits (effects `bake::nested_reshape_counts_baked_art`, `nested_reshape_refusal_keeps_its_work_counted`, `nested_reshape_refused_siblings_bake_once`, `nested_reshape_counts_successful_descendants_once`). A raster effect (Drop Shadow, Outer Glow, Gaussian Blur and the other effects that paint pixels) on a symbol instance's topmost fill draws on each filled shape of the symbol's art, and one on its topmost stroke draws on each stroked shape, after any geometry effects listed before it, under the same rules as geometry effects: only a visible fill or stroke with an opacity above 0 counts, a group's own fills and strokes in the art take the effect, and an instance inside the art passes it on. Each shape gets its own shadow or glow, which is VectorCraft's own rule. The canvas, Use Preview Bounds and the drawn bounds, SVG and PDF export draw it, and Object › Expand Appearance is enabled for such an instance and makes the effect an image at the document's raster effects resolution, in one undo step (engine `expand::a_symbol_instance_fill_shadow_shadows_its_filled_art`, `a_symbol_instance_stroke_shadow_shadows_only_its_stroked_art`, `a_symbol_instance_fill_shadow_follows_the_fill_offset_before_it`, `a_nested_symbol_instance_takes_the_outer_fill_shadow`, `export_draws_a_symbol_instance_fill_shadow`). Existing documents with a raster effect on a symbol instance's fill or stroke draw differently: before, the effect drew nothing. Object › Expand Appearance turns a symbol instance whose topmost fill or stroke has only raster effects into its art as well, with the effect's image under the art (a shadow or glow) or in its place (a blur, feather or inner glow). A symbol instance inside the art whose topmost fill or stroke has a geometry or raster effect, its own or one the outer instance passes on, becomes its art and image the same way, and so do the instances in that art, within the nesting and symbol art limits; an instance of a missing symbol stays an instance. One Expand Appearance makes at most 1,024 images of raster effects, holding 256 megapixels in all (VectorCraft's own limits); an object or instance whose image would go past them stays as it is, with its raster effects, and the result reports how many with `rasterLeft` and a warning. Within those limits no live instance or raster effect is left from those effects, so the result no longer changes with the symbols; an instance left by the image limits still follows its symbol. The help page <https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/expand-objects.html> describes Expand Appearance turning appearance attributes into objects, and the help page <https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/vector-and-raster-effects.html> describes expanding an effect into permanent raster data; expanding nested instances this way is VectorCraft's own rule (engine `expand::a_nested_instance_fill_shadow_becomes_an_image_when_the_outer_art_expands`, `an_outer_fill_shadow_expands_the_instance_and_reaches_the_nested_art`, `a_nested_instance_fill_blur_becomes_an_image_when_the_outer_art_expands`, `a_hidden_nested_instance_fill_shadow_makes_no_image`, `a_nested_instance_of_a_missing_symbol_stays_an_instance`, `nested_instance_raster_effects_stop_at_the_image_limit`). Before, an instance whose fill or stroke had only a shadow or glow stayed an instance over the image, and a raster effect on an instance in the art stayed live. From ec27c42af7c9fa53b67524225eea8982b03ea394 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:32:53 +0530 Subject: [PATCH 147/247] docs: G13 keeps the partial Snapping panel, unchecked rotated-object snapping and one estimate (#8387) --- docs/gaps.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/gaps.md b/docs/gaps.md index ebf74d4f16..dc7824e2db 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing (#8387); estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h); estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) ## Feature submission evidence @@ -604,17 +604,18 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Improved (#6164):** Control bar › Snapping also exposes the existing Snap to Glyph and Alignment Guides toggles through their existing commands. Floating-panel parity remains unverified; the estimate is unchanged. - **Missing:** the rest of the snapping enhancements (29.8.1): forced snapping to the grid, showing guides while - snapping, and limiting snapping to the active artboard or to isolated objects (the Control bar's Snapping quick - access, the Smart Guides snapping tolerance, and 30.0's Snap to Tangent and Snap to Perpendicular are done; the - reworked Snap to Grid and Snap to Pixel feedback is not yet checked); artboard colors in exports and print, and + snapping, and limiting snapping to the active artboard or to isolated objects; the Snapping panel is partial + (the Control bar's Snapping quick access exists, but there is no View › Snapping submenu and floating-panel + parity is unverified, see [ui-parity.md](ui-parity.md)). The Smart Guides snapping tolerance and 30.0's Snap to + Tangent and Snap to Perpendicular are done. Not yet checked: snapping to the endpoints, midpoints and centers of + rotated objects, and the reworked Snap to Grid and Snap to Pixel feedback. Also missing: artboard colors in exports and print, and managing artboards from the canvas other than locking and unlocking them from the Artboard tool's right-click menu (30.0); the Blend panel with ease in/out and separate colour acceleration (30.7). The Dimension tool (28.x) is done ([dimensions.md](dimensions.md)). - **Evidence:** Adobe's 30.0 and 30.7 release announcements, see [target-app-parity.md](target-app-parity.md#how-this-was-measured-2026-10-10); snapping: [Snapping enhancements in Illustrator](https://community.adobe.com/announcements-651/snapping-enhancements-in-illustrator-1546614). -- **Estimate:** 13–23 h. -- **Estimate:** 14–24 h. +- **Estimate:** 13–23 h (estimated; a duplicate 14–24 h line is removed). ## G14 Pen hardware beyond Windows pressure @@ -905,7 +906,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | G4 and G13 Missing lists drop the shipped Touch Type (`text.touchType`), Snap to Glyph (`view.snapToGlyph`) and Dimension tool; G13's snapping entry keeps only what is still missing (#8387); estimates unchanged. | +| 2026-11-18 | minor | G4 and G13 Missing lists drop the shipped Touch Type (`text.touchType`), Snap to Glyph (`view.snapToGlyph`) and Dimension tool; G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h, a duplicate 14–24 h line removed); estimates unchanged. | | 2026-11-16 | minor | Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged. | | 2026-11-14 | minor | Type: Middle Eastern & South Asian and Standard composers per paragraph (#4935): Paragraph panel menu, paragraph styles, `text.setFormat {composer}` and the native file; the Standard composers set Indic, Arabic and Hebrew type glyph by glyph. `.ai`, EPS and PDF files carry no composer. Scores and estimates unchanged. | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | From 75d9d61ce99346add6bb01997923d5afa4a12ebb Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:36:38 +0530 Subject: [PATCH 148/247] M7/G4: rustfmt the retype module declaration (#4934) --- crates/engine/src/cmd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 4fec3f90bd..e0fe77ecda 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -101,11 +101,11 @@ mod textedit; mod xmlattrs; pub use textedit::effective_kerning; +mod retype; pub mod textstyles; pub(crate) mod textwrap; pub(crate) mod threads; pub(crate) mod typecmd; -mod retype; mod typemenu; mod variablecmds; pub(crate) mod views; From 957712ca718d027b3d646f56cb08ef7c4cce168a Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:48:38 +0530 Subject: [PATCH 149/247] M7/G4: retype float checks without negated comparisons (#4934) --- crates/text/src/retype.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 6b3d07ec73..9e3f2a3ec4 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -266,7 +266,7 @@ fn signature(path: &BezPath) -> Option<Signature> { let lens: Vec<f64> = c.iter().map(|s| s.arclen(accuracy)).collect(); let len: f64 = lens.iter().sum(); // A contour with no length (a lone move) draws nothing. - if !(len > size * 1e-9) || !len.is_finite() { + if !len.is_finite() || len <= size * 1e-9 { continue; } total += len; @@ -292,7 +292,7 @@ fn signature(path: &BezPath) -> Option<Signature> { *p = Point::new(p.x - centre.x, p.y - centre.y); } let spread = (pts.iter().map(|p| p.x * p.x + p.y * p.y).sum::<f64>() / n).sqrt(); - if !(spread > 0.0) || !spread.is_finite() { + if !spread.is_finite() || spread <= 0.0 { return None; } Some(Signature { contours: contours_n, pts, centre, spread, invariant: spread / total }) From 978000411ad1eed1262480e299bdcee96eef9b50 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 13:19:25 -0800 Subject: [PATCH 150/247] Eraser: the tip preview sets the Angle and Roundness by dragging Eraser Tool Options now show the Blob Brush's tip preview under the Roundness rows. A drag on the arrowhead sets the Angle and a drag that starts on a black dot sets the Roundness, within the Eraser's 1% to 100% for the drag and for the Roundness slider's keys. The fields show the new values, OK sets the tool's options and Cancel leaves them as they were. The Blob Brush's preview becomes one function for both tools, taking the tool's lowest Roundness. --- crates/ui-egui/src/dialogs/freehand.rs | 57 ++++++++++---------- crates/ui-egui/src/dialogs/freehand/tests.rs | 27 ++++++++-- crates/ui-egui/src/dialogs/tests.rs | 56 +++++++++++++++++++ docs/target-app-parity.md | 1 + 4 files changed, 108 insertions(+), 33 deletions(-) diff --git a/crates/ui-egui/src/dialogs/freehand.rs b/crates/ui-egui/src/dialogs/freehand.rs index 356810005c..9988c1ebc7 100644 --- a/crates/ui-egui/src/dialogs/freehand.rs +++ b/crates/ui-egui/src/dialogs/freehand.rs @@ -280,6 +280,7 @@ fn body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { variation: (0.0, 100.0), }; varied(ui, d, &roundness, &Variation::ALL); + tip_preview(ui, d, roundness.range.0); size_rows(ui, d, &Variation::ALL); } else { if d.fields.contains_key("angle") { @@ -291,7 +292,7 @@ fn body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } } if d.str("tool") == "blobBrush" { - blob_tip_preview(ui, d); + tip_preview(ui, d, 0.0); } // The Eraser's Size rows are above. if !eraser && d.fields.contains_key("sizeMode") { @@ -331,26 +332,26 @@ fn body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { false } -/// Side of the Blob Brush tip preview's square, in points. +/// Side of the Blob Brush's and the Eraser's tip preview square, in points. const TIP_PREVIEW: f32 = 64.0; -/// Half the length of the Blob Brush tip in its preview, in points. +/// Half the length of the tip in its preview, in points. const TIP_LONG: f32 = 18.0; /// How far from a Roundness dot of the tip preview a press still takes the dot, in points. const TIP_DOT_REACH: f32 = 8.0; -/// The Blob Brush's tip preview: a square with the tip at its Angle and Roundness, a line with an -/// arrowhead along its long axis and a black dot at each end of its short axis, and beside it three -/// dabs of the tip, the middle one darker. A click or a drag that starts on a dot sets the -/// Roundness from the pointer's distance from the center along the short axis -/// ([`blob_tip_roundness_at`]) until the release, inside the square or out of it, and gives the +/// The Blob Brush's and the Eraser's tip preview: a square with the tip at its Angle and +/// Roundness, a line with an arrowhead along its long axis and a black dot at each end of its short +/// axis, and beside it three dabs of the tip, the middle one darker. A click or a drag that starts +/// on a dot sets the Roundness from the pointer's distance from the center along the short axis +/// ([`tip_roundness_at`]) until the release, inside the square or out of it, and gives the /// Roundness slider the keyboard focus. A click or a drag that starts anywhere else in the square /// points the Angle at the pointer and gives the Angle slider the focus. Screen readers get the /// square as the Angle slider and then the Roundness slider, and their keys step the Angle within -/// -180° to 180° and the Roundness within 0% to 100% as a dialog slider's do +/// -180° to 180° and the Roundness within `min_roundness` to 100% as a dialog slider's do /// ([`widgets::stepped_area`]). -fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { +fn tip_preview(ui: &mut egui::Ui, d: &mut Dialog, min_roundness: f64) { let t = Tokens::get(ui.ctx()); let (rect, _) = ui.allocate_exact_size(egui::vec2(CONTENT_W, TIP_PREVIEW), egui::Sense::hover()); let square = egui::Rect::from_min_size(rect.min, egui::vec2(TIP_PREVIEW, TIP_PREVIEW)); @@ -359,7 +360,7 @@ fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { // Whether the press that started this click or drag was on a dot: it is kept until the release. let on_dot = response.id.with("on-dot"); let near_dot = |p: egui::Pos2, d: &Dialog| { - blob_tip_dots(center, d.f64("angle", 0.0), d.f64("roundness", 100.0)).iter().any(|dot| dot.distance(p) <= TIP_DOT_REACH) + tip_dots(center, d.f64("angle", 0.0), d.f64("roundness", 100.0)).iter().any(|dot| dot.distance(p) <= TIP_DOT_REACH) }; let mut started = ui.data(|m| m.get_temp::<bool>(on_dot)); if started.is_none() && response.is_pointer_button_down_on() { @@ -383,7 +384,7 @@ fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { if let Some((p, _)) = widgets::pointer_phase(&response) { let delta = p - center; if dot_drag { - d.fields.insert("roundness".into(), json!(blob_tip_roundness_at(delta, d.f64("angle", 0.0)))); + d.fields.insert("roundness".into(), json!(tip_roundness_at(delta, d.f64("angle", 0.0), min_roundness))); } else if delta.length_sq() > 1.0 { d.fields.insert("angle".into(), json!(f64::from((-delta.y).atan2(delta.x)).to_degrees().round())); } @@ -406,13 +407,13 @@ fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { if dot_drag && (response.drag_started() || response.clicked()) { widgets::focus_by_pointer(ui, roundness.id); } - let shown = widgets::SliderValue::field(d.f64("roundness", 100.0), 0.0..=100.0, "%", 0); + let shown = widgets::SliderValue::field(d.f64("roundness", 100.0), min_roundness..=100.0, "%", 0); if let Some(r) = widgets::stepped_area(ui, &roundness, tl!("Roundness"), Some(shown)) { d.fields.insert("roundness".into(), json!(r)); } - let (u, v) = blob_tip_axes(d.f64("angle", 0.0)); + let (u, v) = tip_axes(d.f64("angle", 0.0)); let long = TIP_LONG; - let short = long * blob_tip_short_ratio(d.f64("roundness", 100.0)); + let short = long * tip_short_ratio(d.f64("roundness", 100.0)); let dab = |center: egui::Pos2, color: egui::Color32| { let points = (0..32) .map(|i| { @@ -427,7 +428,7 @@ fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { let arrowhead = vec![center + u * 28.0, center + u * 22.0 + v * 3.0, center + u * 22.0 - v * 3.0]; painter.add(egui::Shape::convex_polygon(arrowhead, t.accent, egui::Stroke::NONE)); // Black with a white rim, so a dot shows on the tip and on the square in either theme. - for dot in blob_tip_dots(center, d.f64("angle", 0.0), d.f64("roundness", 100.0)) { + for dot in tip_dots(center, d.f64("angle", 0.0), d.f64("roundness", 100.0)) { painter.circle(dot, 3.0, egui::Color32::BLACK, egui::Stroke::new(1.0, egui::Color32::WHITE)); } let strip = square.right() + 2.5 * long; @@ -438,7 +439,7 @@ fn blob_tip_preview(ui: &mut egui::Ui, d: &mut Dialog) { /// The tip preview's long axis on screen at Angle `angle` (degrees, y down: a positive angle tilts /// it up to the right), and its short axis. -fn blob_tip_axes(angle: f64) -> (egui::Vec2, egui::Vec2) { +fn tip_axes(angle: f64) -> (egui::Vec2, egui::Vec2) { let a = angle.clamp(-180.0, 180.0).to_radians(); let u = egui::vec2(a.cos() as f32, -a.sin() as f32); (u, egui::vec2(-u.y, u.x)) @@ -446,23 +447,23 @@ fn blob_tip_axes(angle: f64) -> (egui::Vec2, egui::Vec2) { /// The two Roundness dots of the tip preview centered on `center`: the ends of the tip's short /// axis at Angle `angle` and Roundness `roundness`. -fn blob_tip_dots(center: egui::Pos2, angle: f64, roundness: f64) -> [egui::Pos2; 2] { - let (_, v) = blob_tip_axes(angle); - let short = v * (TIP_LONG * blob_tip_short_ratio(roundness)); +fn tip_dots(center: egui::Pos2, angle: f64, roundness: f64) -> [egui::Pos2; 2] { + let (_, v) = tip_axes(angle); + let short = v * (TIP_LONG * tip_short_ratio(roundness)); [center + short, center - short] } -/// The Roundness, in whole percent from 0 to 100, that a dot of the tip preview dragged to `offset` -/// from the preview's center gives at Angle `angle`: the distance along the tip's short axis, on -/// either side of the center, as a percentage of half the tip's length. -fn blob_tip_roundness_at(offset: egui::Vec2, angle: f64) -> f64 { - let (_, v) = blob_tip_axes(angle); - (f64::from(offset.dot(v).abs() / TIP_LONG) * 100.0).round().clamp(0.0, 100.0) +/// The Roundness, in whole percent from `min` to 100, that a dot of the tip preview dragged to +/// `offset` from the preview's center gives at Angle `angle`: the distance along the tip's short +/// axis, on either side of the center, as a percentage of half the tip's length. +fn tip_roundness_at(offset: egui::Vec2, angle: f64, min: f64) -> f64 { + let (_, v) = tip_axes(angle); + (f64::from(offset.dot(v).abs() / TIP_LONG) * 100.0).round().clamp(min, 100.0) } /// The preview tip's short axis as a fraction of its long axis: Roundness in percent, with 0 -/// percent drawn as 0.1 percent, the minimum the brush draws with. -fn blob_tip_short_ratio(roundness: f64) -> f32 { +/// percent drawn as 0.1 percent, the minimum the Blob Brush draws with. +fn tip_short_ratio(roundness: f64) -> f32 { (roundness.clamp(0.0, 100.0) as f32 / 100.0).max(0.001) } diff --git a/crates/ui-egui/src/dialogs/freehand/tests.rs b/crates/ui-egui/src/dialogs/freehand/tests.rs index 4feb5436b3..6e8532dba8 100644 --- a/crates/ui-egui/src/dialogs/freehand/tests.rs +++ b/crates/ui-egui/src/dialogs/freehand/tests.rs @@ -32,7 +32,12 @@ fn blob_tip_fields_confirm_and_cancel() { fn the_tip_preview_is_as_flat_as_the_tip_the_brush_draws() { for roundness in [-5.0, 0.0, 0.05, 0.1, 1.0, 50.0, 100.0, 120.0] { let drawn = vectorcraft_tools::draw2::blob_tip(0.0, roundness).as_coeffs()[3] as f32; - assert!((blob_tip_short_ratio(roundness) - drawn).abs() < 1e-6, "roundness {roundness}: drawn {drawn}"); + assert!((tip_short_ratio(roundness) - drawn).abs() < 1e-6, "roundness {roundness}: drawn {drawn}"); + } + // The Eraser's Roundness runs from 1% to 100%, where its tip and the Blob Brush's are the same. + for roundness in [1.0, 2.0, 50.0, 100.0] { + let drawn = vectorcraft_tools::draw2::eraser_tip(0.0, roundness).as_coeffs()[3] as f32; + assert!((tip_short_ratio(roundness) - drawn).abs() < 1e-6, "Eraser roundness {roundness}: drawn {drawn}"); } } @@ -43,23 +48,35 @@ fn the_tip_preview_is_as_flat_as_the_tip_the_brush_draws() { #[test] fn a_roundness_dot_sets_its_distance_along_the_short_axis() { for angle in [0.0, 30.0, 90.0, -135.0, 180.0] { - let (u, v) = blob_tip_axes(angle); + let (u, v) = tip_axes(angle); for (along, want) in [(0.0, 0.0), (4.5, 25.0), (-9.0, 50.0), (18.0, 100.0), (-18.0, 100.0), (40.0, 100.0), (-400.0, 100.0)] { for sideways in [0.0, 7.0, -30.0] { - assert_eq!(blob_tip_roundness_at(v * along + u * sideways, angle), want, "angle {angle}, {along} along, {sideways} sideways"); + assert_eq!(tip_roundness_at(v * along + u * sideways, angle, 0.0), want, "angle {angle}, {along} along, {sideways} sideways"); } } let center = egui::pos2(32.0, 32.0); for roundness in [0.0, 1.0, 37.0, 50.0, 99.0, 100.0] { - let [a, b] = blob_tip_dots(center, angle, roundness); + let [a, b] = tip_dots(center, angle, roundness); assert!(((a - center) + (b - center)).length() < 1e-4, "the dots face each other across the center"); for dot in [a, b] { - assert_eq!(blob_tip_roundness_at(dot - center, angle), roundness, "angle {angle}"); + assert_eq!(tip_roundness_at(dot - center, angle, 0.0), roundness, "angle {angle}"); } } } } +/// With the Eraser's 1% minimum, a Roundness dot dragged to the center or near it gives 1%, and +/// any farther distance gives the same Roundness as with no minimum. +#[test] +fn a_roundness_dot_keeps_the_eraser_at_one_percent_or_more() { + for angle in [0.0, 45.0, -90.0] { + let (u, v) = tip_axes(angle); + for (along, want) in [(0.0, 1.0), (0.05, 1.0), (-0.1, 1.0), (0.18, 1.0), (0.36, 2.0), (-9.0, 50.0), (30.0, 100.0)] { + assert_eq!(tip_roundness_at(v * along + u * 5.0, angle, 1.0), want, "angle {angle}, {along} along"); + } + } +} + /// The labels the open dialog paints. fn painted(app: &mut VectorcraftApp) -> String { crate::tests_labels::painted_text(app, |app, ui| super::super::show(app, ui.ctx())) diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index 4f619584e9..486bdce02d 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -2887,6 +2887,62 @@ fn a_drag_on_a_blob_brush_tip_dot_sets_the_roundness() { assert_eq!(values(&app), (46.0, 1.0), "Tab goes on to the Roundness slider"); } +/// The Eraser Tool Options show the same tip preview as the Blob Brush, with the Angle and +/// Roundness sliders for screen readers. A drag on the arrowhead sets only the Angle, and a drag on +/// a black dot sets only the Roundness, which stays within the Eraser's 1% to 100% for a drag and +/// for the keys. The fields show the new values, OK sets the tool's options to them, and Cancel +/// leaves the options as they were. +#[test] +fn the_eraser_tip_preview_sets_the_angle_and_roundness_by_dragging() { + use egui::Key::{ArrowDown, Home}; + use egui::Modifiers as M; + let mut app = app(); + app.run("tool.options", json!({"tool": "eraser"})).unwrap(); + let values = |app: &VectorcraftApp| { + let d = app.ui.dialog.as_ref().expect("Eraser Tool Options is open"); + (d.f64("angle", f64::NAN), d.f64("roundness", f64::NAN)) + }; + let mut f = Frames::new(); + f.run(&mut app, vec![]); + let out = f.run(&mut app, vec![]); + let (_, value, text) = slider_node(&out, "Angle"); + assert_eq!((value, text.as_deref()), (Some(0.0), Some("0°"))); + let (_, value, text) = slider_node(&out, "Roundness"); + assert_eq!((value, text.as_deref()), (Some(100.0), Some("100%"))); + let center = f.control(&mut app, "Angle", egui::accesskit::Role::Slider); + // At 0° the arrowhead points right, 22 pt to 28 pt from the center. + f.drag(&mut app, center + egui::vec2(25.0, 0.0), egui::vec2(-5.0, -20.0)); + assert_eq!(values(&app), (45.0, 100.0), "the arrowhead dragged up to the right"); + // At 45° and 100% the dots are 18 pt from the center, up to the left and down to the right. + let v = egui::vec2(1.0, 1.0).normalized(); + f.drag(&mut app, center + v * 18.0, -v * 9.0); + assert_eq!(values(&app), (45.0, 50.0), "the dot dragged half way to the center"); + f.drag(&mut app, center + v * 9.0, -v * 9.0); + assert_eq!(values(&app), (45.0, 1.0), "the dot dragged to the center stops at 1%"); + f.key(&mut app, ArrowDown, M::NONE); + f.key(&mut app, Home, M::NONE); + assert_eq!(values(&app), (45.0, 1.0), "the keys stop at 1%"); + let out = f.run(&mut app, vec![]); + assert_eq!(slider_node(&out, "Roundness").2.as_deref(), Some("1%")); + let d = app.ui.dialog.as_mut().expect("Eraser Tool Options is open"); + d.fields.insert("roundness".into(), json!(30)); + let out = f.run(&mut app, vec![]); + assert_eq!(slider_node(&out, "Roundness").2.as_deref(), Some("30%"), "the preview follows the field"); + confirm(&mut app).unwrap(); + let o = app.session.tool_options_of("eraser"); + assert_eq!((o["angle"].as_f64(), o["roundness"].as_f64()), (Some(45.0), Some(30.0))); + app.run("tool.options", json!({"tool": "eraser"})).unwrap(); + let mut f = Frames::new(); + f.run(&mut app, vec![]); + f.run(&mut app, vec![]); + let center = f.control(&mut app, "Angle", egui::accesskit::Role::Slider); + f.drag(&mut app, center + egui::vec2(18.0, 18.0), egui::vec2(2.0, 2.0)); + assert_eq!(values(&app), (-45.0, 30.0), "the drag points the Angle down to the right"); + app.ui.dialog = None; + let o = app.session.tool_options_of("eraser"); + assert_eq!((o["angle"].as_f64(), o["roundness"].as_f64()), (Some(45.0), Some(30.0)), "Cancel keeps the options"); +} + /// Screen readers can set the Blob Brush tip preview's Angle to a number: the slider offers the /// set-value action, a fraction rounds to the whole degrees the field shows, a number past -180° to /// 180° sets the nearer end, the last request in a frame wins, and a value that is not a finite diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 8399ba6488..df6e4671d9 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1273,6 +1273,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Eraser Tool Options has Angle and Roundness besides Size, as [Erase paths using the Eraser tool](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/erase-paths-using-eraser-tool.html) describes: the Eraser's tip is an ellipse Size across, its long axis at Angle and its short axis Roundness percent of the long one, and a drag with a tip that is not round shows the outline of the area it erases (`path.eraseRegion` `angle` and `roundness`). `path.eraseRegion` refuses an Angle outside −180° to 180° and a Roundness outside 1% to 100% with an error and leaves the document unchanged; a key left out or null takes its default (0° and 100%). The help page gives no range for the two options, so the ranges are VectorCraft's own values. `path.split` refuses a `t` outside 0 to 1 in the same way. Eraser Tool Options gives Angle, Roundness and Size each a menu of Fixed, Random, Pressure, Tilt, Bearing and Rotation with a Variation field, as the same page describes: the tip varies by up to the Variation either way, Random once per drag and the others with what the pen reads at each point of the drag, and the tip outline at the pointer follows the pen while it erases. The outline of the area a drag shows takes, at each step, the tip the pen's readings give halfway along it, with a Random value shown as the value itself, and a mouse drag erases at the set values (`path.eraseRegion` `angleMode`, `roundnessMode`, `sizeMode` and their variations). + Eraser Tool Options show the Blob Brush's tip preview under the Roundness rows. A drag on the arrowhead turns the Angle, and a drag that starts on a black dot moves it toward the center for a flatter tip or away from it for a rounder one, as the Eraser tool options section of the [help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=133) describes; the fields show the new values, and OK keeps them. The drag's mapping and the Angle and Roundness sliders are the Blob Brush preview's, which are VectorCraft's own, with the Eraser's Roundness range of 1% to 100% for the drag and the keys. The preview shows the set Angle and Roundness, not a Random or pen-driven variation of them. Regression tests: `dialogs::tests::the_eraser_tip_preview_sets_the_angle_and_roundness_by_dragging`, `dialogs::freehand::tests::a_roundness_dot_keeps_the_eraser_at_one_percent_or_more`. The outline a Blob Brush or Eraser drag shows is built a bounded amount per frame, so a long stroke does not slow the canvas: each frame takes at most 256 new points of the drag and outlines again only the pieces of up to 32 segments they change, and the parts of a piece's outline inside the rest of the area are removed a limited amount at a time. While work is left, the canvas draws again with the pointer still, the points not outlined yet show as a thin line, and the tip shows at the pointer. When the tip varies with the pen (Size set to Pressure, or an Eraser mode that follows the pen), each step is its own piece and the outline also shows only the edge of the whole area. The release sends the whole stroke as before (`path.blob`, `path.eraseRegion`). The settled part of that outline is kept in paths of up to 64 pieces each. A path is shared from one frame to the next until a piece in it changes, and the canvas keeps the triangles it drew the path with while the view stays the same, so a frame does not copy, flatten or tessellate a settled path again; a pan, zoom or rotation draws each one once more. This is VectorCraft's own rule. The line that a drag of more than 64 segments shows with a round Eraser tip, the Knife, the Path Eraser or the Pencil with Live preview off is kept the same way, in pieces of 64 segments: a frame builds again only the last piece, and the Knife's dashes run on from one piece to the next. With the Eraser's Size set to a mode that follows the pen, each step of such a drag is kept as its own path and a frame builds only a new step. A smoothing drag's band is kept until it changes. The canvas still copies the kept triangles of every piece into each frame. - **Transform:** Rotate, Reflect, Scale, Shear (click or Alt-click snaps the reference point to anchors and centres; Alt-click opens the tool's dialog, and a drag with Alt down at the release, from the press or pressed mid-drag, transforms a copy), Reshape, Free Transform (free and perspective distort and shear, switched by the keys held during a handle drag). From 90b37ad2694bfc09455c51c0888d6227e92ccde0 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 03:02:33 +0530 Subject: [PATCH 151/247] M7/G4: retype keeps paint order, groups, transparency and font version (#4934) An unmatched shape between glyphs ends the line, so the type after it is still painted over it. Glyphs of different groups, paint or transparency never share a line, and the new type takes the glyphs' own opacity and blend mode. The type names the font version that matched. The glyph budget holds inside a face too. --- crates/engine/src/cmd/retype.rs | 58 +++++++++++++++++++-------- crates/engine/src/cmd/retype_tests.rs | 48 ++++++++++++++++++++++ crates/text/src/retype.rs | 4 ++ 3 files changed, 94 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index a5f3b98bde..395ce33b23 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -47,23 +47,28 @@ pub fn specs() -> Vec<CommandSpec> { /// A shape to match: a path or compound path, in document space. struct Piece { id: NodeId, + /// The group holding it (`None` for a selected shape at the top): glyphs of different + /// groups, which may composite differently, never share a line. + parent: Option<NodeId>, path: BezPath, appearance: Appearance, + /// The shape's own transparency, which the new type takes. + opacity: f32, + blend: vectorcraft_color::BlendMode, } -fn collect(n: &Node, depth: usize, out: &mut Vec<Piece>) { +fn collect(n: &Node, parent: Option<NodeId>, depth: usize, out: &mut Vec<Piece>) { if out.len() >= MAX_PIECES || depth > MAX_DEPTH { return; } + let piece = |path: BezPath| Piece { id: n.id, parent, path, appearance: (*n.appearance).clone(), opacity: n.opacity, blend: n.blend }; match &n.kind { NodeKind::Group { children, clip: false } => { for c in children { - collect(c, depth + 1, out); + collect(c, Some(n.id), depth + 1, out); } } - NodeKind::Path { path, clipping: false, guide: false, .. } => { - out.push(Piece { id: n.id, path: path.to_bezpath(), appearance: (*n.appearance).clone() }) - } + NodeKind::Path { path, clipping: false, guide: false, .. } => out.push(piece(path.to_bezpath())), NodeKind::Compound { children, .. } => { let mut path = BezPath::new(); for c in children { @@ -71,7 +76,7 @@ fn collect(n: &Node, depth: usize, out: &mut Vec<Piece>) { path.extend(p.to_bezpath()); } } - out.push(Piece { id: n.id, path, appearance: (*n.appearance).clone() }); + out.push(piece(path)); } _ => {} } @@ -111,6 +116,9 @@ struct Line { origin: Point, end: Point, appearance: Appearance, + parent: Option<NodeId>, + opacity: f32, + blend: vectorcraft_color::BlendMode, } impl Line { @@ -118,13 +126,18 @@ impl Line { Vec2::new(self.angle.cos(), self.angle.sin()) } - /// Does glyph `m` continue this line (same font, size and turn, on its baseline, after its end)? - fn continues(&self, m: &GlyphMatch) -> bool { + /// Does glyph `m` of shape `pc` continue this line (same group, paint and transparency, same + /// font, size and turn, on its baseline, after its end)? + fn continues(&self, pc: &Piece, m: &GlyphMatch) -> bool { let size = self.scale * self.face.units_per_em(); let d = m.origin - self.origin; let dir = self.dir(); let across = d.cross(dir).abs(); - m.face.id() == self.face.id() + pc.parent == self.parent + && pc.appearance == self.appearance + && pc.opacity == self.opacity + && pc.blend == self.blend + && m.face.id() == self.face.id() && (m.scale - self.scale).abs() <= self.scale * 0.005 && (m.angle - self.angle).abs() < 1e-3 && across < size * 0.05 @@ -150,17 +163,20 @@ fn space_advance(face: &vectorcraft_text::FontFace) -> f64 { face.mapped_chars().iter().find(|(c, _)| *c == ' ').map(|(_, g)| face.advance(*g)).unwrap_or(0.0) } -fn new_line(id: NodeId, m: &GlyphMatch, appearance: &Appearance) -> Line { +fn new_line(pc: &Piece, m: &GlyphMatch) -> Line { let dir = Vec2::new(m.angle.cos(), m.angle.sin()); Line { - pieces: vec![id], + pieces: vec![pc.id], text: m.ch.to_string(), face: m.face.clone(), scale: m.scale, angle: m.angle, origin: m.origin, end: m.origin + dir * (m.face.advance(m.gid) * m.scale), - appearance: appearance.clone(), + appearance: pc.appearance.clone(), + parent: pc.parent, + opacity: pc.opacity, + blend: pc.blend, } } @@ -180,7 +196,7 @@ fn retype(s: &mut Session, p: &Value) -> Result<Value> { let mut pieces = vec![]; for r in &roots { if let Some(n) = d.node(*r) { - collect(n, 0, &mut pieces); + collect(n, None, 0, &mut pieces); } } if pieces.is_empty() { @@ -200,17 +216,21 @@ fn retype(s: &mut Session, p: &Value) -> Result<Value> { let rank = |face: u32| votes.iter().find(|(f, _)| *f == face).map_or(0, |v| v.1); let mut lines: Vec<Line> = vec![]; let mut unmatched = vec![]; + // An unmatched shape between glyphs ends the line: the type after it is painted after it. + let mut open = false; for (pc, ms) in pieces.iter().zip(&found) { // Earlier matches win ties: they are the closer fits. let best = ms.iter().enumerate().max_by_key(|(i, m)| (rank(m.face.id()), std::cmp::Reverse(*i))).map(|(_, m)| m); let Some(m) = best else { unmatched.push(pc.id); + open = false; continue; }; match lines.last_mut() { - Some(l) if l.continues(m) => l.push(pc.id, m), - _ => lines.push(new_line(pc.id, m, &pc.appearance)), + Some(l) if open && l.continues(pc, m) => l.push(pc.id, m), + _ => lines.push(new_line(pc, m)), } + open = true; } (lines, unmatched) }; @@ -227,6 +247,8 @@ fn retype(s: &mut Session, p: &Value) -> Result<Value> { let style = CharStyle { font_family: l.face.family.clone(), font_style: l.face.style.clone(), + // The version that matched, when two of the family and style are loaded. + font_version: (!l.face.version.is_empty()).then(|| l.face.version.clone()), size: l.scale * l.face.units_per_em(), fill: l.appearance.fill_paint(), stroke: l.appearance.stroke_paint(), @@ -241,7 +263,11 @@ fn retype(s: &mut Session, p: &Value) -> Result<Value> { t.system_layout = system_layout; super::typecmd::refresh_bounds(&mut t); let id = d.alloc_id(); - d.insert(par, idx, Node::new(id, NodeKind::Text(Box::new(t))))?; + let mut node = Node::new(id, NodeKind::Text(Box::new(t))); + // The glyphs' own transparency (the group's, kept, still applies over it). + node.opacity = l.opacity; + node.blend = l.blend; + d.insert(par, idx, node)?; for pc in &l.pieces { if let Some((Some(parent), _, _)) = d.position(*pc) { emptied.push(parent); diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 6ed12289f4..af91b8442d 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -118,3 +118,51 @@ fn craft_fonts_glyphs_retype_too() { assert_eq!(r["texts"], json!(["漢字です"]), "{r}"); assert_eq!(r["fonts"][0]["family"], json!(f.family)); } + +fn children_of(s: &Session, g: u64) -> Vec<u64> { + s.doc().unwrap().doc.node(NodeId(g)).unwrap().children().unwrap().iter().map(|c| c.id.0).collect() +} + +#[test] +fn a_shape_between_glyphs_ends_the_line_so_paint_order_holds() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let rect = s.execute("shape.rectangle", &json!({"x": 30, "y": 60, "width": 80, "height": 50})).unwrap()["id"].as_u64().unwrap(); + // The rectangle goes between A and B, inside the outlines' group. + s.edit("test", |d, _| { + let n = d.node(NodeId(rect)).unwrap().clone(); + d.remove(NodeId(rect))?; + d.insert(Some(NodeId(g)), 1, n)?; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["A", "B"]), "{r}"); + assert_eq!(r["unmatched"], json!([rect])); + let ids: Vec<u64> = r["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect(); + assert_eq!(children_of(&s, g), vec![ids[0], rect, ids[1]], "A under the rectangle, B over it"); +} + +#[test] +fn glyphs_of_different_groups_and_transparency_stay_apart() { + let mut s = session(); + let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "ab", "size": 20})); + let b = outlined(&mut s, json!({"x": 120, "y": 100, "text": "cd", "size": 20})); + let first_d = children_of(&s, b)[1]; + s.edit("test", |d, _| { + d.node_mut(NodeId(b)).unwrap().opacity = 0.5; + d.node_mut(NodeId(first_d)).unwrap().opacity = 0.25; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["ab", "c", "d"]), "same baseline, other group; d has its own opacity: {r}"); + let ids: Vec<u64> = r["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect(); + let d = &s.doc().unwrap().doc; + assert!(d.node(NodeId(a)).is_none(), "a plain group gives way to its type"); + assert_eq!(d.node(NodeId(b)).unwrap().opacity, 0.5, "the half-transparent group stays"); + assert_eq!(children_of(&s, b), vec![ids[1], ids[2]]); + assert_eq!(s.doc().unwrap().doc.node(NodeId(ids[2])).unwrap().opacity, 0.25, "the glyph's own opacity carries over"); +} diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 9e3f2a3ec4..5a1894e2d0 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -106,6 +106,10 @@ impl RetypeIndex { let mut gids: Vec<(u32, char)> = by_gid.into_iter().collect(); gids.sort_unstable(); for (gid, ch) in gids { + // The budget holds inside a face too: no glyph is loaded past it. + if entries.len() >= MAX_GLYPHS { + break; + } let outline = db.outline(face, gid); if let Some(sig) = signature(&outline) { entries.push(Entry { face: fi, gid, ch, sig }); From 1b1f60ba8c04a57eaad6fabfc250f7ce22d5d937 Mon Sep 17 00:00:00 2001 From: dotCooCoo <RobertLeeLW@gmail.com> Date: Tue, 17 Nov 2026 13:27:17 -0800 Subject: [PATCH 152/247] SVG Options: Show in Browser opens the SVG in the default browser The SVG export options on the help page list a Show in browser option beside Show Code, which displays the image in the default web browser: https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-file-format-options-in-illustrator.html SVG Options gets a Show in Browser button beside Show Code. It writes the SVG of the dialog's current, unconfirmed choices for one page (the selection's crop under Export Selection, otherwise the first artboard the options choose) to a new folder inside "VectorCraft SVG Preview" in the system's temporary folder and opens it (file.export.svg.browser). The dialog stays open, the choices are not remembered, and nothing is written to the chosen file. The folder follows Save for Web's preview folders: a private folder per preview, and folders an hour old are removed; each kind removes only its own. The button is disabled on the web build, and control and MCP requests are refused, as Save for Web's Preview in Browser is. Show Code and Show in Browser share one encoding step, so Show Code changes in two ways. A range that OK refuses now shows OK's error: before, Show Code showed the first artboard's code for a range it could not read, and the first artboard named for a range such as "1, 9" when the document has no artboard 9. A range naming one missing artboard was already an error, with a different message. From Save As or Save a Copy, both keep hidden layers, as the save does. A document with no artboards shows the bounds of its art. --- crates/mcp/src/ui_catalog.rs | 6 + crates/ui-egui/src/dialogs/save_for_web.rs | 46 ++-- crates/ui-egui/src/dialogs/svg_options.rs | 300 ++++++++++++++++++--- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/io.rs | 2 +- crates/ui-egui/src/io/export.rs | 2 +- crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/state.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 6 + docs/control-protocol.md | 2 +- docs/mcp.md | 3 +- docs/target-app-parity.md | 1 + 39 files changed, 345 insertions(+), 54 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index b6da21331e..0d5769f1cf 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -143,6 +143,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} opens SVG Options; with params = document.export {path?, svg?: {…SVG options}, range?…} (a .svgz path writes it gzipped)", ), + ( + "file.export.svg.browser", + "Show in Browser", + "", + "{svg?: {…SVG options}, exportSelection?} SVG Options' Show in Browser: write the SVG of one page (with exportSelection the selection's crop, else the first artboard the options choose) and its linked images to a new temporary folder and open it in the default browser (desktop; refused for control and MCP requests) → {path, warnings}", + ), ("file.export.png", "Export As PNG…", "", "{path?, …document.export options}; no path: pick the file, then PNG Options"), ( "file.exportForScreens", diff --git a/crates/ui-egui/src/dialogs/save_for_web.rs b/crates/ui-egui/src/dialogs/save_for_web.rs index 589d1dfdce..bfe21b8482 100644 --- a/crates/ui-egui/src/dialogs/save_for_web.rs +++ b/crates/ui-egui/src/dialogs/save_for_web.rs @@ -237,29 +237,41 @@ pub(crate) fn browser_preview(app: &mut VectorcraftApp, p: &Value) -> Result<Val #[cfg(not(target_arch = "wasm32"))] const PREVIEW_KEEP: std::time::Duration = std::time::Duration::from_secs(3600); +/// The folder Save for Web's browser previews go to inside the system's temporary folder. +const ROOT: &str = "VectorCraft Save for Web"; + /// The folder a browser preview goes to: a new one for each preview, in the system's temporary -/// folder ([`preview_folder_in`]). -#[cfg(not(target_arch = "wasm32"))] +/// folder ([`temp_folder_under`]). fn temp_folder() -> Result<String, String> { - preview_folder_in(&std::env::temp_dir(), PREVIEW_KEEP) + temp_folder_under(ROOT) } -/// The name of a folder that a preview made in the temporary folder, beside a `VectorCraft Save -/// for Web` it couldn't use, before the process id and the count. +/// A new folder for a browser preview in the system's temporary folder, under the folder named +/// `root` ([`preview_folder_under`]). #[cfg(not(target_arch = "wasm32"))] -const BESIDE: &str = "VectorCraft Save for Web "; +pub(super) fn temp_folder_under(root: &str) -> Result<String, String> { + preview_folder_under(&std::env::temp_dir(), root, PREVIEW_KEEP) +} -/// A new folder for a browser preview in the temporary folder `tmp`: inside `VectorCraft Save for -/// Web` ([`preview_folder`]), or, when that folder can't be used, directly in `tmp`, named -/// [`BESIDE`] followed by the process id and a count. The log says why the shared folder wasn't -/// used. Each preview first removes the folders of that name in `tmp` last changed `keep` or longer -/// ago ([`remove_old`]). -#[cfg(not(target_arch = "wasm32"))] +/// A new folder for a Save for Web browser preview in the temporary folder `tmp` +/// ([`preview_folder_under`] with `VectorCraft Save for Web`). +#[cfg(all(test, not(target_arch = "wasm32")))] pub(super) fn preview_folder_in(tmp: &std::path::Path, keep: std::time::Duration) -> Result<String, String> { - remove_old(tmp, BESIDE, keep); - preview_folder(&tmp.join("VectorCraft Save for Web"), keep).or_else(|e| { - log::warn!("vectorcraft: Preview in Browser can't use {e}, so the preview goes to a new folder of its own"); - new_folder(tmp, BESIDE) + preview_folder_under(tmp, ROOT, keep) +} + +/// A new folder for a browser preview in the temporary folder `tmp`: inside the folder named `root` +/// ([`preview_folder`]), or, when that folder can't be used, directly in `tmp`, named `root`, a +/// space, the process id and a count. The log says why the shared folder wasn't used. Each preview +/// first removes the folders of that name in `tmp` last changed `keep` or longer ago +/// ([`remove_old`]). Previews under one `root` never remove the folders of another. +#[cfg(not(target_arch = "wasm32"))] +pub(super) fn preview_folder_under(tmp: &std::path::Path, root: &str, keep: std::time::Duration) -> Result<String, String> { + let beside = format!("{root} "); + remove_old(tmp, &beside, keep); + preview_folder(&tmp.join(root), keep).or_else(|e| { + log::warn!("vectorcraft: a browser preview can't use {e}, so the preview goes to a new folder of its own"); + new_folder(tmp, &beside) }) } @@ -381,7 +393,7 @@ fn is_preview_name(name: &std::ffi::OsStr, prefix: &str) -> bool { } #[cfg(target_arch = "wasm32")] -fn temp_folder() -> Result<String, String> { +pub(super) fn temp_folder_under(_: &str) -> Result<String, String> { Err("no file system here".into()) } diff --git a/crates/ui-egui/src/dialogs/svg_options.rs b/crates/ui-egui/src/dialogs/svg_options.rs index 13586ae3e1..c185a3d5cb 100644 --- a/crates/ui-egui/src/dialogs/svg_options.rs +++ b/crates/ui-egui/src/dialogs/svg_options.rs @@ -1,16 +1,19 @@ //! SVG Options (Export As SVG, Save As / Save a Copy to .svg): profile, styling, fonts, images, //! object ids, decimals, encoding, minify, responsive, embedded fonts, artboards (export) or //! editing data (save), and a read-only view of the code. OK remembers the choices for next time and runs the export or save command with -//! them as `svg: {…}`. +//! them as `svg: {…}`. Show in Browser (`file.export.svg.browser`) writes the SVG the choices give +//! to a temporary folder and opens it in the default browser, leaving the dialog open. +use std::borrow::Cow; use std::sync::Arc; use serde_json::{Map, Value, json}; +use vectorcraft_engine::cmd::fileio; use super::DialogSpec; use crate::state::Dialog; use crate::theme::{self, Tokens}; -use crate::{VectorcraftApp, widgets}; +use crate::{VectorcraftApp, io, widgets}; pub(super) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("SVG Options").into(), @@ -26,6 +29,12 @@ pub(super) const SPEC: DialogSpec = DialogSpec { /// `Dialog::kind` of this dialog. pub const KIND: &str = "svgOptions"; +/// The UI command of the dialog's Show in Browser button. +pub const BROWSER: &str = "file.export.svg.browser"; + +/// The folder in the system's temporary folder that Show in Browser's previews go to. +const PREVIEW_ROOT: &str = "VectorCraft SVG Preview"; + /// What OK does: Export As SVG, Save As or Save a Copy. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Mode { @@ -196,8 +205,16 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } ui.add_space(10.0); let show = d.bool("showCode"); - if widgets::secondary_button(ui, if show { tl!("Hide Code") } else { tl!("Show Code") }).clicked() { - d.fields.insert("showCode".into(), json!(!show)); + let mut browser = false; + ui.horizontal(|ui| { + if widgets::secondary_button(ui, if show { tl!("Hide Code") } else { tl!("Show Code") }).clicked() { + d.fields.insert("showCode".into(), json!(!show)); + } + let b = ui.add_enabled(!io::is_web(app), |ui: &mut egui::Ui| widgets::secondary_button(ui, tl!("Show in Browser"))); + browser = b.on_disabled_hover_text(tl!("Needs the desktop app")).clicked(); + }); + if browser && let Err(e) = app.run(BROWSER, preview_params(d)) { + app.status(e); } if show { ui.add_space(6.0); @@ -269,6 +286,102 @@ fn artboards(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { }); } +/// The SVG options the dialog `d`'s OK writes with: [`options`], with hidden layers kept (not +/// displayed) when OK saves, as a save keeps them unless told otherwise. +fn written_options(d: &Dialog) -> Value { + let mut o = options(d); + if Mode::of(d) != Mode::Export + && let Some(m) = o.as_object_mut() + { + m.entry("hiddenLayers").or_insert(json!(true)); + } + o +} + +/// The params of [`BROWSER`] for the dialog `d`: the SVG options OK writes with +/// ([`written_options`]), and `exportSelection` when Export Selection opened it. +fn preview_params(d: &Dialog) -> Value { + super::export_as::exported(d, json!({ "svg": written_options(d) })) +} + +/// The SVG file that the SVG options `svg` write for one page of the document `st`, and the +/// document it is drawn from. With `selection` (Export Selection) the page is the selection alone, +/// cropped to it. Otherwise it is the first artboard the options choose, checked against the +/// document's artboards as OK checks them, or what the options write without artboards (also for +/// a document that has none). Linked scripts and images are checked against the read roots in +/// force first. +fn encode_page<'a>( + st: &'a vectorcraft_engine::DocState, + svg: &Value, + selection: bool, +) -> Result<(Cow<'a, vectorcraft_doc::Document>, fileio::Encoded), String> { + let mut opts = svg.clone(); + if let Some(o) = opts.as_object_mut() { + if selection { + // Export Selection writes one crop, without artboards to choose. + for k in fileio::ARTBOARD_PARAMS.iter().chain(&["useArtboards"]) { + o.remove(*k); + } + } else if st.doc.artboards.is_empty() { + for k in fileio::ARTBOARD_PARAMS { + o.remove(k); + } + } else { + let pick: fileio::ArtboardPick = serde_json::from_value(Value::Object(o.clone())).map_err(|e| e.to_string())?; + if let Some(first) = pick.resolve(st.doc.artboards.len())?.and_then(|v| v.first().copied()) { + for k in fileio::ARTBOARD_PARAMS { + o.remove(k); + } + o.insert("artboard".into(), json!(first)); + } + } + } + let params = json!({ "svg": opts }); + fileio::check_linked_scripts("document.export", "svg", st, ¶ms).map_err(|e| e.to_string())?; + let doc = if selection { + Cow::Owned(fileio::selection_doc(st, "document.exportSelection", false).map_err(|e| e.to_string())?.0) + } else { + Cow::Borrowed(&*st.doc) + }; + fileio::check_linked_images("document.export", "svg", st, &doc, ¶ms).map_err(|e| e.to_string())?; + let enc = fileio::encode_all(&doc, "svg", ¶ms).map_err(|e| e.to_string())?; + Ok((doc, enc)) +} + +/// `file.export.svg.browser {svg?, exportSelection?}` (SVG Options' Show in Browser): the SVG file +/// that the SVG options `svg` write for one page ([`encode_page`]), written with its linked images +/// to a new folder inside `VectorCraft SVG Preview` in the system's temporary folder and opened in +/// the default browser (desktop) → `{path, warnings}`. Nothing is written to the chosen +/// destination, and the document, its path and the remembered choices are left as they were. +/// When the export has warnings, the status bar shows them as [`io::report_saved`] shows a save's +/// notes. Nothing opens when a check, the encoding or a write fails. +pub(crate) fn browser_preview(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> { + if io::is_web(app) { + return Err("no file system here".into()); + } + app.refuse_automation(BROWSER)?; + let (selection, p) = io::take_selection(p)?; + let svg = p.get("svg").cloned().unwrap_or_else(|| json!({})); + let (path, warnings) = { + let st = app.session.active().ok_or("no document")?; + let stem = fileio::file_stem(&st.doc.title); + let (doc, enc) = encode_page(st, &svg, selection)?; + let dir = super::save_for_web::temp_folder_under(PREVIEW_ROOT)?; + let target = format!("{dir}/{}.svg", super::save_for_web::preview_name(&stem)); + let named = enc.named(&doc, &target); + for (p, bytes) in &named { + io::write_to(&mut app.services, p, bytes)?; + } + (named.first().map_or(target, |(p, _)| p.clone()), enc.notes()) + }; + app.open_url(&io::file_url(&path)); + let r = json!({ "path": path, "warnings": warnings }); + if !warnings.is_empty() { + io::report_saved(app, &path, &r); + } + Ok(r) +} + /// The SVG the current options write for the first chosen artboard, or under Export Selection for /// the selection alone, cropped to it (read-only, selectable), encoded again only when the /// options, the document or the selection change. @@ -276,19 +389,7 @@ fn code_view(app: &VectorcraftApp, ui: &mut egui::Ui, d: &Dialog) { let t = Tokens::get(ui.ctx()); let Some(st) = app.session.active() else { return }; let selection = d.bool(super::export_as::SELECTION_FIELD); - let mut opts = options(d); - if let Some(o) = opts.as_object_mut() { - if selection { - // Export Selection writes one crop, without artboards to choose. - for k in vectorcraft_engine::cmd::fileio::ARTBOARD_PARAMS.iter().chain(&["useArtboards"]) { - o.remove(*k); - } - } else if let Some(r) = o.remove("range") { - // The first artboard of the range (or the first one). - let first = r.as_str().and_then(|r| r.split([',', '-', '\u{2013}']).next()).and_then(|n| n.trim().parse::<usize>().ok()); - o.insert("artboard".into(), json!(first.map_or(0, |n| n.saturating_sub(1)))); - } - } + let opts = written_options(d); // One cached text, replaced when the document, the options or the selection change. let key = egui::Id::unique("svg-code"); // The read roots in force and the document's folder decide whether the text may be shown. @@ -299,27 +400,15 @@ fn code_view(app: &VectorcraftApp, ui: &mut egui::Ui, d: &Dialog) { Some((_, c)) => c, None => { const MAX: usize = 200_000; - let params = json!({ "svg": opts }); - let encoded = vectorcraft_engine::cmd::fileio::check_linked_scripts("document.export", "svg", st, ¶ms).and_then(|()| { - let selected; - let doc = if selection { - selected = vectorcraft_engine::cmd::fileio::selection_doc(st, "document.exportSelection", false)?.0; - &selected - } else { - &st.doc - }; - vectorcraft_engine::cmd::fileio::check_linked_images("document.export", "svg", st, doc, ¶ms)?; - vectorcraft_engine::cmd::fileio::encode_all(doc, "svg", ¶ms) - }); - let mut text = match encoded { + let mut text = match encode_page(st, &opts, selection) { // Shown as text whatever the file's encoding. - Ok(enc) => enc + Ok((_, enc)) => enc .files .into_iter() .next() .map(|(_, b)| vectorcraft_svg::text_of(&b).map_or_else(|_| String::from_utf8_lossy(&b).into_owned(), |t| t.into_owned())) .unwrap_or_default(), - Err(e) => e.to_string(), + Err(e) => e, }; if text.len() > MAX { let cut = (0..=MAX).rev().find(|i| text.is_char_boundary(*i)).unwrap_or(0); @@ -389,6 +478,153 @@ mod tests { String::from_utf8(w.borrow()[i].1.clone()).unwrap() } + type Opened = Rc<RefCell<Vec<String>>>; + + /// [`app`] whose browser records each URL it is asked to open. + fn browsing(picked: &str) -> (VectorcraftApp, Written, Opened) { + let (mut app, written) = app(picked); + let opened = Opened::default(); + let o = opened.clone(); + app.services.open_url = Some(Box::new(move |u: &str| o.borrow_mut().push(u.to_string()))); + (app, written, opened) + } + + /// Show in Browser for the open dialog's current choices, as its button runs it. + fn show_in_browser(app: &mut VectorcraftApp) -> Result<Value, String> { + let p = preview_params(app.ui.dialog.as_ref().expect("SVG Options open")); + app.run(BROWSER, p) + } + + /// Show in Browser writes the SVG of the dialog's current, unconfirmed choices for the first + /// artboard of the range to a new temporary folder and opens that file once. The dialog stays + /// open, nothing is remembered, and OK then writes the same SVG to the chosen file. + #[test] + fn show_in_browser_opens_what_ok_writes_without_confirming() { + let (mut app, written, opened) = browsing("/tmp/out.svg"); + app.run("file.export.svg", Value::Null).unwrap(); + frame(&mut app); + let f = &mut app.ui.dialog.as_mut().unwrap().fields; + f.insert("decimals".into(), json!(1)); + f.insert("allArtboards".into(), json!(false)); + f.insert("range".into(), json!("2")); + let remembered = app.ui.svg_options.clone(); + let r = show_in_browser(&mut app).unwrap_or_else(|e| panic!("{e}")); + let path = r["path"].as_str().unwrap().to_string(); + assert!(path.contains("/VectorCraft SVG Preview/") && path.ends_with("/Untitled-1.svg"), "{path}"); + assert_eq!(*opened.borrow(), [io::file_url(&path)]); + assert_eq!(written.borrow().len(), 1); + assert_eq!(written.borrow()[0].0, path); + assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some(KIND), "the dialog stays open"); + assert_eq!(app.ui.svg_options, remembered, "nothing is remembered"); + assert!(app.session.active().unwrap().path.is_none()); + frame(&mut app); + super::super::confirm(&mut app).unwrap(); + assert_eq!(written.borrow()[1].0, "/tmp/out.svg"); + assert_eq!(text(&written, 0), text(&written, 1), "the preview is the file OK writes"); + assert_eq!(opened.borrow().len(), 1); + } + + /// A range the document has no artboard for is refused, as OK refuses it: nothing is written + /// or opened, and the dialog stays open. + #[test] + fn show_in_browser_refuses_a_range_the_document_lacks() { + let (mut app, written, opened) = browsing("/tmp/out.svg"); + app.run("file.export.svg", Value::Null).unwrap(); + let f = &mut app.ui.dialog.as_mut().unwrap().fields; + f.insert("allArtboards".into(), json!(false)); + f.insert("range".into(), json!("5")); + assert!(show_in_browser(&mut app).is_err()); + assert!(written.borrow().is_empty() && opened.borrow().is_empty()); + assert!(app.ui.dialog.is_some()); + } + + /// Under Export Selection the preview is the selection alone, cropped to it, as OK writes it. + #[test] + fn show_in_browser_under_export_selection_shows_the_selection() { + let (mut app, written, opened) = browsing("/tmp/selection.svg"); + app.run("shape.rectangle", json!({"x": 70, "y": 40, "width": 20, "height": 20})).unwrap(); + app.run("document.exportSelection", Value::Null).unwrap(); + assert!(app.ui.dialog.as_ref().unwrap().bool(super::super::export_as::SELECTION_FIELD)); + show_in_browser(&mut app).unwrap_or_else(|e| panic!("{e}")); + super::super::confirm(&mut app).unwrap(); + assert_eq!(written.borrow()[1].0, "/tmp/selection.svg"); + assert_eq!(text(&written, 0), text(&written, 1)); + assert_eq!(text(&written, 0).matches("<rect").count(), 1, "{}", text(&written, 0)); + assert_eq!(opened.borrow().len(), 1); + } + + /// From Save As, the preview leaves the document's path and unsaved state alone, and OK still + /// saves to the chosen file. + #[test] + fn show_in_browser_from_save_as_leaves_the_document_unsaved() { + let (mut app, written, opened) = browsing("/tmp/doc.svg"); + app.run("file.saveAs", Value::Null).unwrap(); + let dirty = app.session.active().unwrap().is_dirty(); + show_in_browser(&mut app).unwrap_or_else(|e| panic!("{e}")); + let st = app.session.active().unwrap(); + assert_eq!((st.path.as_deref(), st.is_dirty()), (None, dirty)); + assert_eq!(opened.borrow().len(), 1); + super::super::confirm(&mut app).unwrap(); + assert_eq!(written.borrow()[1].0, "/tmp/doc.svg"); + assert_eq!(app.session.active().unwrap().path.as_deref(), Some("/tmp/doc.svg")); + } + + /// From Save As, a hidden layer is in the preview, kept hidden, as the save keeps it. The two + /// differ only in the title: the save takes it from the file's name, the preview from the + /// document's. + #[test] + fn show_in_browser_from_save_as_keeps_hidden_layers_as_the_save_does() { + let (mut app, written, _) = browsing("/tmp/doc.svg"); + let notes = app.run("layer.new", json!({"name": "Notes"})).unwrap()["id"].clone(); + app.run("shape.ellipse", json!({"x": 60, "y": 10, "width": 20, "height": 20})).unwrap(); + app.run("layer.setProps", json!({"id": notes, "visible": false})).unwrap(); + app.run("file.saveAs", Value::Null).unwrap(); + show_in_browser(&mut app).unwrap_or_else(|e| panic!("{e}")); + super::super::confirm(&mut app).unwrap(); + assert!(text(&written, 0).contains("id=\"Notes\""), "{}", text(&written, 0)); + assert_eq!(text(&written, 0).replace("<title>Untitled-1", "doc"), text(&written, 1)); + } + + /// A document with no artboards is previewed by the bounds of its art, as the SVG writer + /// writes it, rather than refused for its artboard range. + #[test] + fn show_in_browser_previews_a_document_without_artboards() { + let (mut app, written, opened) = browsing("/tmp/out.svg"); + app.run("file.export.svg", Value::Null).unwrap(); + std::sync::Arc::make_mut(&mut app.session.doc_mut().unwrap().doc).artboards.clear(); + show_in_browser(&mut app).unwrap_or_else(|e| panic!("{e}")); + assert_eq!(vectorcraft_testkit::svg_shapes(&text(&written, 0)), 1, "{}", text(&written, 0)); + assert_eq!(opened.borrow().len(), 1); + } + + /// The web build has no file to open, and a control or MCP request may not open another app: + /// both are refused before anything is written or opened. + #[test] + fn show_in_browser_is_refused_on_the_web_and_for_automation() { + let (mut app, written, opened) = browsing("/tmp/out.svg"); + app.run("file.export.svg", Value::Null).unwrap(); + app.ui.answering_control = true; + assert!(show_in_browser(&mut app).unwrap_err().contains("opens another app")); + app.ui.answering_control = false; + app.services.download = Some(Box::new(|_: &str, _: &[u8]| Ok(()))); + assert!(show_in_browser(&mut app).is_err()); + assert!(written.borrow().is_empty() && opened.borrow().is_empty()); + } + + /// SVG previews have their own folder: making one removes only old SVG preview folders and + /// leaves Save for Web's alone. + #[test] + fn svg_preview_folders_leave_save_for_web_previews_alone() { + let tmp = vectorcraft_testkit::temp_dir("svg-preview-folders"); + let web = super::super::save_for_web::preview_folder_in(&tmp, std::time::Duration::from_secs(3600)).unwrap(); + let old = super::super::save_for_web::preview_folder_under(&tmp, PREVIEW_ROOT, std::time::Duration::from_secs(3600)).unwrap(); + let new = super::super::save_for_web::preview_folder_under(&tmp, PREVIEW_ROOT, std::time::Duration::ZERO).unwrap(); + assert!(new.contains("/VectorCraft SVG Preview/"), "{new}"); + assert!(std::path::Path::new(&web).is_dir(), "Save for Web's preview is kept"); + assert!(!std::path::Path::new(&old).exists(), "the old SVG preview is removed"); + assert!(std::path::Path::new(&new).is_dir()); + } + #[test] fn export_as_svg_opens_the_options_and_remembers_them() { let (mut app, written) = app("/tmp/out.svg"); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index bb039bb08e..ec502dda1c 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3430,6 +3430,7 @@ digits Malayalam Малаялам Show Brush Size Показване на размера на четката Show Center Показване на център Show Code Показване на код + Show in Browser Показване в браузър Show Color Groups Показване на цътни групи Show Color Swatches Показване на цветни образци Show Corner Widget Показване на уиджета за ъгъл diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 99f23d313c..a8cc3a9928 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -3238,6 +3238,7 @@ antiAlias Sharp Oštro Preserve Editing Capabilities Očuvaj mogućnosti uređivanja Responsive Responzivno Show Code Prikaži kod + Show in Browser Prikaži u pregledniku Style Attributes Atributi stila Style Attributes (Entity References) Atributi stila (reference entiteta) Styling: Stilizovanje: diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c54311799d..fb29a07a52 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4469,6 +4469,7 @@ digits Malayalam Malaiàlam Show Center Mostra el centre Show Center Mark Mostra la marca del centre Show Code Mostra el codi + Show in Browser Mostra al navegador Show Color Groups Mostra els grups de colors Show Color Swatches Mostra les mostres de color Show Corner Widget Mostra el giny de cantonada diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..785c7e3473 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3322,6 +3322,7 @@ antiAlias Sharp Ostré Preserve Editing Capabilities Zachovat možnosti úprav Responsive Responzivní Show Code Zobrazit kód + Show in Browser Zobrazit v prohlížeči Style Attributes Atributy stylu Style Attributes (Entity References) Atributy stylu (odkazy na entity) Styling: Stylování: diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 08100f593f..a2718fa359 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -5795,6 +5795,7 @@ antiAlias Sharp Skarp Preserve Editing Capabilities Bevar redigeringsfunktioner Responsive Responsiv Show Code Vis kode + Show in Browser Vis i browser Style Attributes Stilattributter Style Attributes (Entity References) Stilattributter (enhedsreferencer) Styling: Styling: diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 10147b2d45..761255c76b 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3496,6 +3496,7 @@ digits Malayalam Malayalam Show Brush Size Pinselgröße anzeigen Show Center Mittelpunkt anzeigen Show Code Code einblenden + Show in Browser Im Browser anzeigen Show Color Groups Farbgruppen einblenden Show Color Swatches Farbfelder einblenden Show Corner Widget Ecken-Widget einblenden diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ebf6e5684..62fc0cb6e2 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4177,6 +4177,7 @@ digits Malayalam Μαλαγιάλαμ Show Brush Size Εμφάνιση μεγέθους πινέλου Show Center Εμφάνιση κέντρου Show Code Εμφάνιση κώδικα + Show in Browser Εμφάνιση στο πρόγραμμα περιήγησης Show Color Groups Εμφάνιση ομάδων χρωμάτων Show Color Swatches Εμφάνιση δειγμάτων χρωμάτων Show Corner Widget Εμφάνιση στοιχείου γωνιών diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a456910a16..cdc2d11756 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3532,6 +3532,7 @@ digits Malayalam Malayálam Show Brush Size Mostrar tamaño del pincel Show Center Mostrar centro Show Code Mostrar código + Show in Browser Mostrar en el navegador Show Color Groups Mostrar grupos de colores Show Color Swatches Mostrar muestras de color Show Corner Widget Mostrar widget de esquina diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index bff46fc0d7..d1a2a0bdbe 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -3266,6 +3266,7 @@ antiAlias Sharp Terävä Preserve Editing Capabilities Säilytä muokkausominaisuudet Responsive Responsiivinen Show Code Näytä koodi + Show in Browser Näytä selaimessa Style Attributes Tyyliattribuutit Style Attributes (Entity References) Tyyliattribuutit (entiteettiviittaukset) Styling: Tyylit: diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..1f5602d0eb 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3520,6 +3520,7 @@ digits Malayalam Malayalam Show Brush Size Afficher la taille de la forme Show Center Afficher le centre Show Code Afficher le code + Show in Browser Afficher dans le navigateur Show Color Groups Afficher les groupes de couleurs Show Color Swatches Afficher les nuances de couleur Show Corner Widget Afficher le widget d’angle diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c427fc527c..9b777e7543 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3663,6 +3663,7 @@ Show Center કેન્દ્ર બતાવો Show Center Mark કેન્દ્ર ચિહ્ન બતાવો Show Code કોડ બતાવો + Show in Browser બ્રાઉઝરમાં બતાવો Show Corner Widget કોર્નર વિજેટ બતાવો Show Cross Hairs ક્રોસ હેર બતાવો Show East Asian Options પૂર્વ એશિયન વિકલ્પો બતાવો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index cbfb4f51d1..efc6b79dcb 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4792,6 +4792,7 @@ antiAlias Sharp शार्प Show Center केंद्र दिखाएँ Show Center Mark शो सेंटर मार्क Show Code कोड दिखाएं + Show in Browser ब्राउज़र में दिखाएँ Show color bars रंग सलाखों दिखाएँ Show brightness and hue on wheel व्हील पर ब्राइटनेस और ह्यू दिखाएँ Show saturation and hue on wheel व्हील पर सैचुरेशन और ह्यू दिखाएँ diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..741252cbcc 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -4184,6 +4184,7 @@ mark-style Japanese Japán Show Brush Size Ecsetméret megjelenítése Show Center Középpont megjelenítése Show Code Kód megjelenítése + Show in Browser Megjelenítés böngészőben Show Color Groups Színcsoportok megjelenítése Show Color Swatches Színes színminták megjelenítése Show Corner Widget Sarokfogantyú megjelenítése diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 28ea2b5ab3..03622ea4c3 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3047,6 +3047,7 @@ antiAlias Sharp Tajam Preserve Editing Capabilities Pertahankan kemampuan pengeditan Responsive Responsif Show Code Tampilkan kode + Show in Browser Tampilkan di browser Style Attributes Atribut gaya Style Attributes (Entity References) Atribut gaya (referensi entitas) Styling: Penataan gaya: diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8f2ed3216c..5b8f661ec2 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3577,6 +3577,7 @@ digits Malayalam Malayalam Show Brush Size Mostra dimensione pennello Show Center Mostra centro Show Code Mostra codice + Show in Browser Mostra nel browser Show Color Groups Mostra gruppi colori Show Color Swatches Mostra campioni colore Show Corner Widget Mostra widget angolo diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..1a07fa59f2 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3391,6 +3391,7 @@ mark-style Japanese 日本式 Show Brush Size ブラシサイズを表示 Show Center 中心を表示 Show Code コードを表示 + Show in Browser ブラウザーで表示 Show East Asian Options 東アジアのオプションを表示 Show Find Field 検索フィールドを表示 Show Font Names in English フォント名を英語で表示 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..4f9ba3a354 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5136,6 +5136,7 @@ antiAlias Sharp მკვეთრი Preserve Editing Capabilities რედაქტირების შესაძლებლობების შენარჩუნება Responsive ადაპტური Show Code კოდის ჩვენება + Show in Browser ბრაუზერში ჩვენება Style Attributes სტილის ატრიბუტები Style Attributes (Entity References) სტილის ატრიბუტები (ერთეულის მიმართვები) Styling: სტილი: diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..580e38a041 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3380,6 +3380,7 @@ mark-style Japanese 일본식 Show Brush Size 브러시 크기 표시 Show Center 중심 표시 Show Code 코드 표시 + Show in Browser 브라우저에서 보기 Show East Asian Options 동아시아 옵션 표시 Show Find Field 찾기 필드 표시 Show Font Names in English 글꼴 이름을 영어로 표시 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..ac8d6ace3b 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -3669,6 +3669,7 @@ antiAlias Sharp Scherp Preserve Editing Capabilities Bewerkbaarheid behouden Responsive Responsive Show Code Code weergeven + Show in Browser Tonen in browser Style Attributes Stijlattributen Style Attributes (Entity References) Stijlattributen (entiteitsverwijzingen) Styling: Stijl: diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0147515ffe..5fa7d6e783 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3207,6 +3207,7 @@ antiAlias Sharp Ostre Preserve Editing Capabilities Zachowaj możliwości edycji Responsive Responsywny Show Code Pokaż kod + Show in Browser Pokaż w przeglądarce Style Attributes Atrybuty stylu Style Attributes (Entity References) Atrybuty stylu (odwołania do encji) Styling: Stylizacja: diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8201db7ab6..9fa8563f5d 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2975,6 +2975,7 @@ digits Malayalam Malaiala Show Brush Size Mostrar Tamanho do Pincel Show Center Mostrar Centro Show Code Mostrar Código + Show in Browser Mostrar no Navegador Show Corner Widget Mostrar Widget de Canto Show East Asian Options Mostrar Opções do Leste Asiático Show Edges Mostrar Bordas diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..e4909daf38 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3564,6 +3564,7 @@ digits Malayalam Малаялам Show Brush Size Показать размер кисти Show Center Показать центр Show Code Показать код + Show in Browser Показать в браузере Show Color Groups Показать цветовые группы Show Color Swatches Показать цветовые образцы Show Corner Widget Показать угловой виджет diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5c0420fcd3..5d24908f97 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3450,6 +3450,7 @@ digits Malayalam Malayalam Show Brush Size Visa penselstorlek Show Center Visa mittpunkt Show Code Visa kod + Show in Browser Visa i webbläsare Show Color Groups Visa färggrupper Show Color Swatches Visa färgrutor Show Corner Widget Visa hörnwidget diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..65df6b999c 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3322,6 +3322,7 @@ digits Malayalam Malayalam Show Brush Size Fırça Boyutunu Göster Show Center Gösteri Merkezi Show Code Kodu Göster + Show in Browser Tarayıcıda Göster Show Color Groups Renk Gruplarını Göster Show Color Swatches Renk Örneklerini Göster Show Corner Widget Köşe Widget'ını Göster diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index dbd6d2609e..e71983925d 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3569,6 +3569,7 @@ digits Malayalam Малаялам Show Brush Size Показати розмір пензля Show Center Показати центр Show Code Показати код + Show in Browser Показати у браузері Show Color Groups Показати групи кольорів Show Color Swatches Показати колірні зразки Show Corner Widget Показати кутовий віджет diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 519c5d8f0d..143f008bf0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3934,6 +3934,7 @@ mark-style Japanese Kiểu Nhật Show Brush Size Hiện kích thước cọ Show Center Hiện tâm Show Code Hiện mã + Show in Browser Hiện trong trình duyệt Show Color Groups Hiện nhóm màu Show Color Swatches Hiện mẫu màu Show Corner Widget Hiện widget góc diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c6696a9ec6..a97191f13c 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3392,6 +3392,7 @@ digits Malayalam 马拉雅拉姆数字 Show Brush Size 显示画笔大小 Show Center 显示中心点 Show Code 显示代码 + Show in Browser 在浏览器中显示 Show Color Groups 显示颜色组 Show Color Swatches 显示颜色色板 Show Corner Widget 显示转角 Widget diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..e9ed5469be 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4710,6 +4710,7 @@ digits Malayalam 馬來亞拉姆數字 Show Brush Size 顯示筆刷大小 Show Center 顯示中心點 Show Code 顯示程式碼 + Show in Browser 在瀏覽器中顯示 Show Color Groups 顯示顏色群組 Show Color Swatches 顯示顏色色票 Show Corner Widget 顯示轉角 Widget diff --git a/crates/ui-egui/src/io.rs b/crates/ui-egui/src/io.rs index a2b1cbebab..a42ce0a656 100644 --- a/crates/ui-egui/src/io.rs +++ b/crates/ui-egui/src/io.rs @@ -24,7 +24,7 @@ mod tests_read_only_save; pub use export::{EXPORT_CANCELLED, cancel_exports, export, export_for_screens, export_pdf, hide_exports, reveal, save_command_output}; pub(crate) use export::{ EXPORT_SELECTION, export_files, exported_with_notes, file_url, open_in_app, open_original, reveal_path, run_to_file, save_command_output_named, - selection_path, + selection_path, take_selection, }; pub(crate) use open::report_installed; pub(crate) use open::{EXPORT_PRESETS, import_presets, open_notes, open_with_on, opened, opened_after_notice, show_opened}; diff --git a/crates/ui-egui/src/io/export.rs b/crates/ui-egui/src/io/export.rs index 32733d855c..18fbe487f7 100644 --- a/crates/ui-egui/src/io/export.rs +++ b/crates/ui-egui/src/io/export.rs @@ -15,7 +15,7 @@ pub(crate) const EXPORT_SELECTION: &str = "exportSelection"; /// `params` without [`EXPORT_SELECTION`], and whether it asked for the selection. A selection /// export writes one page, the selection's crop, so the artboard choices are left out too. -fn take_selection(params: &Value) -> Result<(bool, Value), String> { +pub(crate) fn take_selection(params: &Value) -> Result<(bool, Value), String> { let mut p = params.clone(); let Some(o) = p.as_object_mut() else { return Ok((false, p)) }; match o.remove(EXPORT_SELECTION) { diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index b4e1c668ac..6118aed51f 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -219,6 +219,7 @@ fn run_ui_part2(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option io::export(app, Some("svg"), s("path"), p), + "file.export.svg.browser" => crate::dialogs::svg_options::browser_preview(app, p), "file.exportForScreens" if p.as_object().is_none_or(|o| o.is_empty()) => { crate::dialogs::open_export_for_screens(app); Ok(Value::Null) diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index d4dda4698b..7df83ac0f3 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -317,7 +317,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { "ui.packageDialog" | "docInfo.save" => app.session.active().is_some(), "ui.batchDialog" => !app.ui.action_sets.is_empty() && app.ui.action_sets.iter().any(|s| !s.actions.is_empty()), "ui.epsOptionsDialog" => app.session.active().is_some(), - "file.saveForWeb" | "file.saveForWeb.browser" => app.session.active().is_some(), + "file.saveForWeb" | "file.saveForWeb.browser" | "file.export.svg.browser" => app.session.active().is_some(), "file.exportSelection" => app.session.active().is_some_and(|d| !d.selection.is_empty()), "css.copy" | "css.exportFile" => app.session.active().is_some(), "print.printerSetup" => app.services.print.as_ref().is_some_and(|s| s.has_setup()), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 677b804720..8d03abfb51 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -144,6 +144,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} opens SVG Options; with params = document.export {path?, svg?: {…SVG options}, range?…} (a .svgz path writes it gzipped)", ), + ( + "file.export.svg.browser", + "Show in Browser", + "", + "{svg?: {…SVG options}, exportSelection?} SVG Options' Show in Browser: write the SVG of one page (with exportSelection the selection's crop, else the first artboard the options choose) and its linked images to a new temporary folder and open it in the default browser (desktop; refused for control and MCP requests) → {path, warnings}", + ), ("file.export.png", "Export As PNG…", "", "{path?, …document.export options}; no path: pick the file, then PNG Options"), ( "file.exportForScreens", diff --git a/docs/control-protocol.md b/docs/control-protocol.md index adac088a13..9b59d81647 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -112,7 +112,7 @@ the two can still win that race. | `ui.dialog.*` on `gradientStop` | `{field: "color" \| "opacity" \| "location", value}` | double-clicking a stop on the Gradient tool's annotator opens its popover (fields `index`, `x`, `y`, `tab`); set `color` (hex), `opacity` or `location` (percentages) and `ui.dialog.confirm` to apply them to the selected stop. `gradient.selectStop {index}` picks the stop the annotator, the panels and Delete/←/→ (`ui.key`) act on | | `engine.execute` `ui.savePdfDialog` | `{path?, preset?, range?, …document.exportPdf options}` | opens the Save PDF dialog (`file.export.pdf` with no params opens it too). Its fields are the `document.exportPdf` options: set `compatibility` with `ui.dialog.set {field: "compatibility", value: "1.5"}`, a whole section with `{field: "compression", value: {…}}`, the artboards with `__allArtboards: false` and `range`, the visible section with `__section` (General, Compression, Marks and Bleeds, Output, Advanced, Security, Summary). `useArtboards: false` opens it for one page of the visible art's bounds, as Export As with Use Artboards off does: the dialog has no Artboards section and its `__artBounds` field is true. `ui.dialog.confirm` writes `path` (else asks for one), returns `{path, bytes, warnings}` and opens the file when `viewAfterSaving` is set. With `useArtboards: false` it writes the page as `app.export` does and returns `{path, warnings}`, or `{background: true, status}` while Background Export writes it | | `file.save` / `file.saveAs` / `file.saveCopy` / `file.saveAsTemplate` (via `engine.execute`) | `{path?, format?, options?, svg?}` | Save writes the document's own file in its own format (a document opened from or saved as SVG/PDF saves as that again; the result's `warnings` say what the format loses). With `path` the file is written at once (Save As or a Copy to an SVG path without SVG options first opens SVG Options, below). Without one (never saved, a converted older file, Save As, a Copy, a Template) the app shows a save panel with one file type per save format (`vectorcraft`, `template`, `pdf`, `svg`, `svgz`, `ai`; for a Template, `template` and `ait`), then the format's options: SVG opens the `svgOptions` dialog (below; returns `{"pending": "svgOptions", "path"}`), PDF the `savePdf` dialog (its `__save` field names the save command); `ui.dialog.confirm` finishes the save. A name typed in the panel without the file type's extension gets it, and a name the panel returns with the extension of a format the panel does not list has it replaced (in a native save, `card.png` and `card.ait` are saved as `card.vectorcraft`, and `notes.v2`, whose extension names no format, is saved as `notes.v2.vectorcraft`); when a file of that name exists, which the panel did not ask about, the save (and every export or other write through a save panel) answers `cancelled` and opens a `replaceFile` dialog (fields `message`, `detail`, `path`): `ui.dialog.confirm` writes that file, `ui.dialog.cancel` writes nothing. A save or export that writes other files beside that path (a file per artboard, linked images, image maps) checks them before it writes anything: when any of them exists, it writes nothing and opens a `replaceFiles` dialog (fields `message`, `detail` (each file's name when there are several), `files`, `__command`, `__params`; the reply is `{"pending": "replaceFiles"}`, or comes once a Background Save or Export ends): `ui.dialog.confirm` runs the save or export again and replaces them, `ui.dialog.cancel` writes nothing; a dialog open when a background job asks stays open, and the question follows it. A save does not ask about the files the document's last Save or Save As in this session wrote. On the web a `saveOptions` dialog (fields `path`, `format`) first names the file and picks the format. `file.formatOptions {format?}` reads the options a save would use. `file.revert` opens a `confirm` dialog (`{"pending": "confirm"}`); `ui.dialog.confirm` reloads the saved file in the same tab. Location refusals return `READ_ONLY_LOCATION: ` without a fallback panel for automation; see [Save location errors](#save-location-errors). | -| SVG Options (`engine.execute` of `file.export.svg`, `file.saveAs`, `file.saveCopy`) | `{}` / `{path?, svg?: {…}}` | `file.export.svg` without params, and Save As or Save a Copy to an `.svg`/`.svgz` path without SVG options, open the `svgOptions` dialog (`ui.dialog.set` its fields: `styling`, `outlineText`, `images`, `objectIds`, `decimals`, `minify`, `responsive`, `fewerTspans`, `metadata`, `preserveEditing`, `useArtboards`, `allArtboards`, `range`, `showCode`, `profile` (`svg11`/`tiny12`), `encoding` (`utf8`/`utf16`/`latin1`), `embedFonts`; `ui.dialog.confirm` exports or saves and remembers the choices). With `svg: {…}` (the `document.formats` SVG options) they run directly. `app.save {path?, svg?}` takes the same options; a document saved as SVG saves as SVG again with the same options | +| SVG Options (`engine.execute` of `file.export.svg`, `file.saveAs`, `file.saveCopy`) | `{}` / `{path?, svg?: {…}}` | `file.export.svg` without params, and Save As or Save a Copy to an `.svg`/`.svgz` path without SVG options, open the `svgOptions` dialog (`ui.dialog.set` its fields: `styling`, `outlineText`, `images`, `objectIds`, `decimals`, `minify`, `responsive`, `fewerTspans`, `metadata`, `preserveEditing`, `useArtboards`, `allArtboards`, `range`, `showCode`, `profile` (`svg11`/`tiny12`), `encoding` (`utf8`/`utf16`/`latin1`), `embedFonts`; `ui.dialog.confirm` exports or saves and remembers the choices). The dialog's Show in Browser button (`file.export.svg.browser`) writes the SVG of the current choices for one page to a temporary folder and opens it in the default browser, leaving the dialog open; a request through `engine.execute` is refused because it opens another app. With `svg: {…}` (the `document.formats` SVG options) they run directly. `app.save {path?, svg?}` takes the same options; a document saved as SVG saves as SVG again with the same options | | `engine.execute` `file.place` | `{paths?}` / `{path \| name+dataBase64, …file.place params}` | with no file, picks files and opens the `place` dialog; with `paths`, opens it for them (fields `files`, `link`, `template`, `replace`; `__replace` says whether Replace applies, `__info` describes each file). `ui.dialog.confirm` places one file centered in the view (or in place of the selected object) and loads the place cursor with several (`file.place.queue`). In the desktop app the dialog reads its files off the UI thread: `__info` is empty until they are read, `ui.dialog.confirm` returns `{background: true, status}`, `ui.inspect` lists the files still being read in `placing`, and the file is placed (or the cursor loaded) once it is read. With a file, it runs `file.place` centered in the view, at once. Files dropped on the window with no document open open. On the web, files dropped on the canvas are placed at the drop point (linked; Shift embeds) and files dropped off it (the tab bar) open, as in Illustrator; desktop drops carry no pointer position, so documents (native, SVG, PDF, `.ai`, EPS, DXF, EMF/WMF) open as tabs of their own and pictures and text are placed in the middle of the view. Swatch libraries and color books (`.vcswatches`, `.gpl`, `.ase`, `.acb`), graphic style libraries (`.vcstyles`), Libraries panel files (`.vclibrary`), presets (`.vcflattener`, `.vcpdfpresets`, `.vcprintpresets`, `.vcperspective`, `.vcexportpresets`), plug-ins (`.wasm`) and shortcut sets (`.kys`, in Import Shortcut Set) open wherever they are dropped, as File › Open opens them. With the cursor loaded (`ui.inspect` → `tool: "place"`, `toolOptions: {count, current, name, names}`), `ui.pointer` clicks and drags place files (in the desktop app each file is read off the UI thread and placed once it is read, and `ui.inspect` lists it in `placing` until then) and `ui.key` ←/→/↑/↓ and Escape cycle and discard them | | `app.export` raster options | `{path?, format: png \| jpg \| webp, ppi?, width?, height?, background?, antiAlias?, interlaced?, quality?}` | `ppi` sets the pixel size (72 = one pixel per point) and is stored in PNG and JPEG files (WebP files store no resolution); `width` or `height` sets the size of each file in pixels instead (`width` wins), and PNG and JPEG files store the resolution that results; `background` is `transparent`, `white`, `black` or `"#rrggbb"`; `antiAlias` is `none`, `art` or `type` (text snapped to pixels); `interlaced` writes an Adam7 PNG. The PNG Options dialog (`pngOptions`; `jpgOptions` / `webpOptions` for the other raster formats) has the same fields: fill them with `ui.dialog.set` and press OK with `ui.dialog.confirm` | | `app.export` JPEG options | `{path?, format: jpg, quality?: 0–100, colorModel?: rgb \| cmyk \| gray, method?: baseline \| optimized \| progressive, scans?: 3–5, embedIcc?, imageMap?: none \| client \| server}` | `cmyk` writes ink amounts in the working CMYK space (CMYK colours keep their inks; RGB ones are separated with the colour settings); `embedIcc` (default true) embeds sRGB, the working CMYK profile or a grey profile, generated by the CMS; `imageMap` also writes `.html` (client-side ``) or `.map` (NCSA) beside the image for the objects with a URL and an Image Map shape (`attributes.set`), returned in `linked`. The `jpgOptions` dialog has these fields too (`quality` is shown 0–10; a CMYK document defaults to `cmyk`) | diff --git a/docs/mcp.md b/docs/mcp.md index 4c1b661f42..31be1bbd75 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -244,7 +244,8 @@ the suite) keep the agent to the folders you give it: `export`), `document.exportSelection`, `document.exportForScreens` and `assets.export` (before the folder is made or any row is written), `document.save`, `file.save`, `file.saveAs` and `file.saveCopy` (also a save without a path of a document whose own format is SVG or SVGZ), `file.exportAs`, and the SVG Options dialog's - Show Code. The same error refuses, before any file is written, every output that carries the native document, + Show Code. The dialog's Show in Browser (`file.export.svg.browser`) runs the same checks, and a control or MCP + request for it is refused before it writes a file, since it opens another app. The same error refuses, before any file is written, every output that carries the native document, which holds the link: a native file or template, an EPS file, a `.ai` or `.ait` file of every artboard (not a legacy version 7 `.ai` file; a save of a `.ai` file always has every artboard), a PDF of every artboard with Preserve Editing on (also from `document.exportPdf`), and `file.package` (also when a linked native document, diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..7a790d6ec0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -891,6 +891,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Export for Screens with Include Bleed: a PDF row's page keeps the artboard as its TrimBox and puts the bleed around it once as the BleedBox (a 100 pt artboard with a 9 pt document bleed gives a 100 pt TrimBox in a 118 pt BleedBox, in one file per artboard, a single file and the Full Document), so printer's marks line up with the artboard's edge. The bleed is the row's own (zero included, which a PDF/X row warns about), else the document's when the row sets none and its PDF preset gives none or a bleed of 0; raster, SVG and EPS rows still write the grown artboard. Tests: `fileio::tests_screens::include_bleed_pdf_pages_trim_at_the_artboard` and `include_bleed_pdfx_rows_do_not_warn_about_the_bleed`. - Export for Screens refuses `pdfs: "single"` with `assets`, `layers` or `selection: "each"`, whose files each hold one item's art, instead of writing the first item alone as one PDF named after the document; `pdfs: "multiple"` writes a PDF of each item, and the selection as one file writes one PDF either way. The rule is VectorCraft's own. Tests: `fileio::tests_screens::single_file_pdfs_are_refused_for_assets_layers_and_each_object`. - Save for Web: Preview in Browser writes each preview's page and images to a folder of its own inside `VectorCraft Save for Web` in the system's temporary folder. A later preview, from the same app or another one running, does not overwrite an earlier one. Each preview first removes the preview folders there that are an hour old or older and, on Linux, macOS and FreeBSD, belong to the current user; it leaves other files and folders alone. The folders a preview makes there are open to their owner only on those systems. When `VectorCraft Save for Web` is a link or is not a folder, or on those systems belongs to another user or can be written by other users, the preview goes to a new folder of its own in the temporary folder, which a later preview removes once it is an hour old (`file.saveForWeb.browser`). + - SVG Options: Show in Browser opens the SVG in the default web browser, beside Show Code, which shows the code instead; the SVG export options on the help page (https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-file-format-options-in-illustrator.html) list both. VectorCraft writes the SVG of the dialog's current choices for one page to a new folder inside `VectorCraft SVG Preview` in the system's temporary folder, which is kept and cleaned up as Save for Web's previews are, and the dialog stays open without remembering the choices or writing the chosen file. The page is VectorCraft's own choice: under Export Selection the selection's crop, otherwise the first artboard the options choose, and a range the document does not have is an error. The web build disables the button, and control and MCP requests for `file.export.svg.browser` are refused. `crates/ui-egui/src/dialogs/svg_options.rs` (`show_in_browser_opens_what_ok_writes_without_confirming`, `show_in_browser_is_refused_on_the_web_and_for_automation`, `svg_preview_folders_leave_save_for_web_previews_alone`). - Save for Web: Optimize to File Size… opens rows for a desired file size in K, Start With (Current Settings, Auto Select GIF/JPEG) and, with slices, Use (Total of All Slices, Each Slice, Current Slice); OK takes the settings whose files fit and shows the size found, or says that no setting tried fits ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=395)). The search lowers JPEG quality or palette colors (GIF then lossy) and encodes at most 32 trial settings; Auto Select chooses GIF for transparent art or art of at most 256 colors and JPEG otherwise. The slices share one setting, so every Use choice changes all of them (`webExport.optimizeToFileSize`). Scores and estimates are unchanged. - Save for Web: while Alt (Option on macOS) is held, the dialog's Cancel button reads Reset, which puts the remembered settings back on the document's active artboard and leaves the dialog open (`ui.dialogReset`). - Export for Screens, Save for Web (slice images, and files named after the document's title) and the Libraries panel name files with the characters Windows does not allow written as `-` and with a `-` after a Windows device name such as `CON`, on every platform (`document.exportForScreens`, `document.exportForWeb`, `library.create`). From cc759b0135df204899d229c92d031e2e2312656a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 13:44:53 -0800 Subject: [PATCH 153/247] Document Setup: the Transparency tab previews the grid A checkered box to the right of Grid Size and Grid Colors shows the grid the dialog holds before OK: the chosen square size and the two colors, the first in the top-left square. It is drawn with the canvas's own transparency grid tile and cell size, through the same display profile, so it matches the canvas for every size and color pair. It changes nothing in the document, and Simulate Colored Paper and View > Show Transparency Grid do not change it. A grid value the dialog cannot read shows as the document's setting. The canvas's tile code now takes the colors and a cache key, so the dialog's tile is cached apart from the canvas's. --- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/grid.rs | 19 ++- crates/ui-egui/src/dialogs/document_setup.rs | 165 +++++++++++++++++++ docs/target-app-parity.md | 1 + 4 files changed, 182 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 70c8834c2d..a7cc04f216 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -52,7 +52,7 @@ use fill::{fill_view, polygon_area}; #[cfg(test)] use grid::ruler_rects; use grid::{LineLook, PIXEL_GRID, PIXEL_GRID_ZOOM, checker, clip_segment, grid, ruler_input, rulers, rulers_hidden, textured_quad, view_bounds}; -pub(crate) use grid::{RulerScale, checker_texture, ruler_label, ruler_origin_dragging}; +pub(crate) use grid::{RulerScale, checker_texture, checker_tile, ruler_label, ruler_origin_dragging}; #[cfg(test)] pub(crate) use grid::{TRANSPARENCY_GRID, vertical_label_height}; use home::home; diff --git a/crates/ui-egui/src/canvas/grid.rs b/crates/ui-egui/src/canvas/grid.rs index 84adb0d861..21353fc529 100644 --- a/crates/ui-egui/src/canvas/grid.rs +++ b/crates/ui-egui/src/canvas/grid.rs @@ -11,20 +11,31 @@ pub(crate) fn checker_texture( setup: &vectorcraft_doc::DocSetup, display: Option<&vectorcraft_color::cms::display::DisplayTransform>, ) -> (egui::TextureHandle, f32) { - let colors = setup.grid_colors.map(|c| crate::display_profile::color32(display, crate::panels::c32(&c))); // A tile of its own with a display profile, so a preview drawn in sRGB beside the canvas // doesn't make the canvas's tile again each frame. let id = egui::Id::unique("transparency-grid-tile").with(display.is_some()); + (checker_tile(ctx, setup.grid_colors, display, id), setup.grid_size.cell()) +} + +/// The transparency grid's 2 × 2-cell tile in the colors `grid_colors` (the first in the top-left +/// and bottom-right cells), converted into the display profile `display` when there is one, and +/// cached under `id` until the colors change. +pub(crate) fn checker_tile( + ctx: &egui::Context, + grid_colors: [vectorcraft_color::Color; 2], + display: Option<&vectorcraft_color::cms::display::DisplayTransform>, + id: egui::Id, +) -> egui::TextureHandle { + let colors = grid_colors.map(|c| crate::display_profile::color32(display, crate::panels::c32(&c))); let cached = ctx.data(|d| d.get_temp::<([Color32; 2], egui::TextureHandle)>(id)).filter(|(c, _)| *c == colors); - let tex = cached.map(|(_, t)| t).unwrap_or_else(|| { + cached.map(|(_, t)| t).unwrap_or_else(|| { let [a, b] = colors; let img = egui::ColorImage::new([2, 2], vec![a, b, b, a]); let opts = egui::TextureOptions { wrap_mode: egui::TextureWrapMode::Repeat, ..egui::TextureOptions::NEAREST }; let t = ctx.load_texture(TRANSPARENCY_GRID, img, opts); ctx.data_mut(|d| d.insert_temp(id, (colors, t.clone()))); t - }); - (tex, setup.grid_size.cell()) + }) } /// Name of the transparency grid's texture. diff --git a/crates/ui-egui/src/dialogs/document_setup.rs b/crates/ui-egui/src/dialogs/document_setup.rs index f1fa79018c..f6feea4f91 100644 --- a/crates/ui-egui/src/dialogs/document_setup.rs +++ b/crates/ui-egui/src/dialogs/document_setup.rs @@ -180,9 +180,58 @@ fn grid_color_box_id(index: usize) -> egui::Id { egui::Id::unique(("grid-color-box", index)) } +/// The size of the Transparency tab's grid preview, in points. +const GRID_PREVIEW: egui::Vec2 = egui::vec2(112.0, 72.0); + +/// The grid size and the two colors the grid preview shows for the dialog's fields `fields`, read +/// as `document.setup` reads them (a preset name or two colors): a field that is missing or not a +/// valid value shows as `setup`, the document's setting. +fn preview_grid(fields: &Map, setup: &vectorcraft_doc::DocSetup) -> (GridSize, [vectorcraft_color::Color; 2]) { + let size = fields.get("gridSize").and_then(Value::as_str).and_then(GridSize::parse).unwrap_or(setup.grid_size); + let colors = match fields.get("gridColors") { + Some(Value::String(name)) => GRID_COLOR_PRESETS.iter().find(|(n, _)| n.eq_ignore_ascii_case(name)).map(|(_, pair)| *pair), + Some(Value::Array(a)) if a.len() == 2 => a.iter().map(vectorcraft_engine::cmd::color_value).collect::>>().map(|c| [c[0], c[1]]), + _ => None, + }; + (size, colors.unwrap_or(setup.grid_colors)) +} + +/// The checkered preview of the grid the dialog's Grid Size and Grid Colors hold, drawn with the +/// canvas's transparency grid tile and cell size: the first color in the top-left cell. It goes +/// beside the rows that start at `top`, against the right edge, or below them when they leave no +/// room. It shows the grid whatever Simulate Colored Paper and View › Show Transparency Grid are, +/// and changes nothing in the document. +fn grid_preview(app: &VectorcraftApp, ui: &mut egui::Ui, d: &Dialog, top: f32) { + let t = Tokens::get(ui.ctx()); + let fallback = vectorcraft_doc::DocSetup::default(); + let setup = app.session.active().map_or(&fallback, |st| &st.doc.setup); + let (size, colors) = preview_grid(&d.fields, setup); + let right = ui.max_rect().right(); + let rect = if ui.min_rect().right() + 16.0 + GRID_PREVIEW.x <= right { + egui::Rect::from_min_size(egui::pos2(right - GRID_PREVIEW.x, top), GRID_PREVIEW) + } else { + ui.add_space(4.0); + ui.allocate_exact_size(GRID_PREVIEW, egui::Sense::hover()).0 + }; + let resp = ui.interact(rect, grid_preview_id(), egui::Sense::hover()); + resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Image, true, tl!("Transparency Grid"))); + let display = app.display_profile.transform(app.session.prefs.monitor_profile_display); + let id = egui::Id::unique("document-setup-grid-preview").with(display.is_some()); + let tile = crate::canvas::checker_tile(ui.ctx(), colors, display.as_deref(), id); + let uv = egui::Rect::from_min_max(egui::Pos2::ZERO, (rect.size() / (2.0 * size.cell())).to_pos2()); + ui.painter().image(tile.id(), rect, uv, egui::Color32::WHITE); + ui.painter().rect_stroke(rect, 0.0, egui::Stroke::new(1.0, t.input_border), egui::StrokeKind::Outside); +} + +/// The id of the Transparency tab's grid preview. +fn grid_preview_id() -> egui::Id { + egui::Id::unique("grid-preview") +} + fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { let t = Tokens::get(ui.ctx()); widgets::subheader(ui, tl!("Transparency Grid")); + let top = ui.cursor().top(); let sizes: Vec<(&str, &str)> = GridSize::ALL.iter().map(|g| (g.id(), g.label())).collect(); choice(ui, d, "gridSize", tl!("Grid Size:"), &sizes); let colors: Vec = d @@ -239,6 +288,7 @@ fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { ui.add_space(10.0); } }); + grid_preview(app, ui, d, top); if let Some((i, c)) = pick { *d = super::color_picker::over_list_entry(d, "gridColors", i, c); } @@ -792,4 +842,119 @@ mod tests { assert_eq!(app.session.active().unwrap().doc.setup.grid_colors, LIGHT.map(hex)); assert_eq!(undo_steps(&app), 0); } + + /// The grid preview Document Setup draws, in a fresh context: its rect, the texture + /// coordinates of its bottom-right corner (two cells per unit) and the tile's four pixels. + fn grid_preview(app: &mut VectorcraftApp) -> (Rect, egui::Vec2, Vec) { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + crate::theme::apply(&ctx, Default::default()); + let (mut mesh, mut pixels) = (None, None); + for _ in 0..3 { + let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 900.0))), ..Default::default() }; + let mut out = ctx.run_ui(raw, |ui| crate::dialogs::show(app, ui.ctx())); + let tiles: Vec = + ctx.tex_manager().read().allocated().filter(|(_, m)| m.name == crate::canvas::TRANSPARENCY_GRID).map(|(id, _)| *id).collect(); + for (id, deltas) in &out.textures_delta.set { + if tiles.contains(id) + && let Some(d) = deltas.last() + { + let egui::ImageData::Color(img) = &d.image; + pixels = Some(img.pixels.clone()); + } + } + out.textures_delta.clear(); + mesh = out.shapes.iter().find_map(|c| match &c.shape { + egui::Shape::Mesh(m) if tiles.contains(&m.texture_id) => Some(m.clone()), + _ => None, + }); + } + let mesh = mesh.unwrap_or_else(|| panic!("no grid preview")); + let uv = mesh.vertices.iter().fold(vec2(0.0, 0.0), |a, v| a.max(v.uv.to_vec2())); + (mesh.calc_bounds(), uv, pixels.unwrap_or_else(|| panic!("no tile"))) + } + + /// The tile's pixels for the grid colors `a` and `b`: `a` in the top-left and bottom-right cells. + fn tile(a: &str, b: &str) -> Vec { + let c = |h| crate::panels::c32(&hex(h)); + vec![c(a), c(b), c(b), c(a)] + } + + /// The Transparency tab shows a checkered preview of the grid its Grid Size and Grid Colors + /// hold before OK: the canvas's cells, the first color in the top-left cell. Simulate Colored + /// Paper leaves it checkered, and neither it nor Cancel changes the document. + #[test] + fn the_transparency_tab_previews_the_pending_grid_size_and_colors() { + let (mut app, _) = transparency_tab(); + let (rect, uv, pixels) = grid_preview(&mut app); + assert_eq!(rect.size(), super::GRID_PREVIEW); + assert_eq!((uv, pixels), (rect.size() / 16.0, tile(LIGHT[0], LIGHT[1])), "Medium, Light"); + for (size, cell) in [("small", 4.0), ("large", 16.0)] { + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("gridSize".into(), json!(size)); + d.fields.insert("gridColors".into(), json!(["#ff0000", "#0000ff"])); + let (rect, uv, pixels) = grid_preview(&mut app); + assert_eq!((uv, pixels), (rect.size() / (2.0 * cell), tile("#ff0000", "#0000ff")), "{size}"); + } + app.ui.dialog.as_mut().unwrap().fields.insert("simulatePaper".into(), json!(true)); + let (rect, uv, pixels) = grid_preview(&mut app); + assert_eq!((uv, pixels), (rect.size() / 32.0, tile("#ff0000", "#0000ff")), "Simulate Colored Paper"); + let st = app.session.active().unwrap(); + assert_eq!((st.doc.setup.grid_size, st.doc.setup.grid_colors), (vectorcraft_doc::GridSize::Medium, LIGHT.map(hex))); + assert_eq!(undo_steps(&app), 0); + crate::dialogs::cancel(&mut app); + assert!(app.ui.dialog.is_none()); + let st = app.session.active().unwrap(); + assert_eq!( + (st.doc.setup.grid_size, st.doc.setup.grid_colors, st.doc.setup.simulate_paper), + (vectorcraft_doc::GridSize::Medium, LIGHT.map(hex), false) + ); + assert_eq!(undo_steps(&app), 0); + } + + /// The grid preview sits beside Grid Size, Grid Colors and the color boxes, inside the dialog, + /// and covers none of the tab's text or color boxes. + #[test] + fn the_grid_preview_sits_beside_the_grid_rows() { + let (mut app, ctx) = transparency_tab(); + let texts = dialog_frame(&mut app, &ctx, vec![]); + let (rect, _, _) = grid_preview(&mut app); + let label = texts.iter().find(|(t, _)| t == "Grid Size:").unwrap_or_else(|| panic!("no Grid Size: {texts:?}")).1; + assert!(rect.top() <= label.bottom() && rect.left() > label.right(), "{rect:?} beside {label:?}"); + for (text, r) in &texts { + assert!(!r.intersects(rect), "{text:?} at {r:?} under the preview {rect:?}"); + } + for i in 0..2 { + let r = ctx.read_response(super::grid_color_box_id(i)).unwrap().rect; + assert!(!r.intersects(rect), "box {i} at {r:?} under the preview {rect:?}"); + } + // The dialog's content is 540 points wide from its heading's left edge. + let left = texts.iter().find(|(t, _)| t == "Document Setup").unwrap_or_else(|| panic!("no heading: {texts:?}")).1.left(); + assert!(rect.right() <= left + 540.0 + 0.5, "{rect:?} inside the dialog from {left}"); + } + + /// A grid size or color pair the dialog holds that is not a valid value shows as the + /// document's setting. + #[test] + fn the_grid_preview_shows_the_document_setting_for_a_bad_field() { + let setup = vectorcraft_doc::DocSetup { + grid_size: vectorcraft_doc::GridSize::Large, + grid_colors: [hex("#111111"), hex("#222222")], + ..Default::default() + }; + let fields = |v: serde_json::Value| v.as_object().unwrap().clone(); + for bad in [ + json!({}), + json!({"gridSize": "huge", "gridColors": ["#ff0000"]}), + json!({"gridSize": 3, "gridColors": ["#ff0000", "zz"]}), + json!({"gridColors": "Plaid"}), + json!({"gridColors": ["#ff0000", "#00ff00", "#0000ff"]}), + ] { + assert_eq!(super::preview_grid(&fields(bad.clone()), &setup), (setup.grid_size, setup.grid_colors), "{bad}"); + } + let good = fields(json!({"gridSize": "small", "gridColors": ["#ff0000", "#0000ff"]})); + assert_eq!(super::preview_grid(&good, &setup), (vectorcraft_doc::GridSize::Small, [hex("#ff0000"), hex("#0000ff")])); + let preset = fields(json!({"gridColors": "blue"})); + assert_eq!(super::preview_grid(&preset, &setup), (vectorcraft_doc::GridSize::Large, [hex("#ffffff"), hex("#c4dcff")])); + } } diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 233b38249e..14cb17daaa 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -811,6 +811,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Document Setup modal handoff:** Document Setup → Edit Artboards applies valid settings, closes the dialog and activates the Artboard tool. Pointer-click tests cover successful handoff, invalid settings, OK, Cancel and Undo in `dialogs/document_setup.rs`. - **Document Setup › Transparency grid color boxes:** a click on either color box beside Grid Colors opens the Color Picker on that color, as [the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/view-transparency-in-artworks.html) describes choosing a custom color for each of the grid's two alternating squares. The picker's OK sets only that color in the dialog, Grid Colors then names the pair (Custom unless it matches one of VectorCraft's presets), and Document Setup's OK applies it in one undo step; the picker's Cancel leaves both colors as they were. With the keyboard on a box, Enter or Space opens the picker. The keyboard handling and staging the color until Document Setup's OK are VectorCraft's own. Tests: `a_grid_color_box_opens_the_color_picker_and_its_ok_sets_that_color` and the other grid color tests in `dialogs/document_setup.rs`. +- **Document Setup › Transparency grid preview:** a checkered box to the right of Grid Size and Grid Colors shows the grid they hold before OK, as [the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/view-transparency-in-artworks.html) describes a larger sample of the chosen square size and colors beside those settings. It is drawn with the canvas's transparency grid tile and cell size, through the same display profile, with the first color in the top-left square, and it changes nothing in the document. Its 112 × 72 point size, showing the grid whatever Simulate Colored Paper and View › Show Transparency Grid are, and showing the document's setting for a value the dialog cannot read are VectorCraft's own. Tests: `the_transparency_tab_previews_the_pending_grid_size_and_colors` and the other grid preview tests in `dialogs/document_setup.rs`. - **Document Setup › Color:** a Color tab shows the document color mode (RGB Color or CMYK Color), a Convert to CMYK or Convert to RGB box for a mode change (cleared: the colors keep their numbers), and the RGB and CMYK profiles assigned to the document, with a working-space entry for none. OK runs `edit.assignProfile` and then `file.documentColorMode` with the dialog's other changes in one `command.batch`, and the document's changes are one undo step. An unchanged Color tab adds no color commands, and Cancel, or OK with nothing changed, records no undo step. A Color tab field with a value of the wrong kind is an error, and the dialog stays open. The tab is VectorCraft's own layout; File › Document Color Mode and Edit › Assign Profile… stay as they are. Tests in `dialogs/document_setup.rs`. - **Assign Profile's three choices:** the Assign rows of Edit › Assign Profile… (the Separations panel's Color Settings section) offer Don't Color Manage This Document, the working space of the document's color mode (Working RGB or Working CMYK, with its name) and Profile with the other profiles of that kind, as [Assign or remove a color profile](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=150) lists them. They act on the profile of the document's color mode: an RGB document's RGB profile, a CMYK document's CMYK profile; the other model's profile stays as it is (VectorCraft's own rule; Document Setup › Color sets both). Picking the working space assigns its profile, which stays when the working space changes later. A choice the document already has runs nothing. Tests in `panels/separations.rs`. - **Canvas through the display's profile on Windows and X11:** Preferences › Performance › Use Monitor Profile for Canvas (on by default) converts the canvas's art, artboard paper and transparency grid from sRGB into the ICC profile of the display that shows most of the main window, after any proof, as the help page describes the monitor's profile translating the document's colors for the monitor ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=151)). Windows gives the display's default profile, and a display with Advanced Color on is left to Windows ([Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/wcs/advanced-color-icc-profiles)); X11 gives colord's profile for the output or the `_ICC_PROFILE` property. macOS converts the window itself, and a Wayland session stays sRGB. `ui.inspect` reports `displayProfile`. Tests in `color/src/cms/display.rs`, `ui-egui/src/display_profile.rs` and `canvas::tests::the_canvas_is_drawn_through_the_display_profile_while_the_preference_is_on`. From c064a899fd7eff5dd61bfb41a66839fc1ab77b07 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 13:47:14 -0800 Subject: [PATCH 154/247] Layers: a drag into or out of a nested Live Paint group's paths remakes the groups that hold it A Live Paint group among another group's paths gives that group its faces and edges. A row moved into or out of the inner group's paths now also makes the faces and edges of every Live Paint group that holds it among its paths again, innermost first, so the outer group no longer keeps faces and edges from the paths as they were. --- crates/engine/src/cmd/buildcmds/live_paint.rs | 46 ++++++++++++++++--- crates/engine/src/tests/build.rs | 34 ++++++++++++++ 2 files changed, 73 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 411f98a9c6..02ba081477 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -331,12 +331,27 @@ fn spot_in(d: &Document, parent: Option) -> Spot { Spot::Outside } +/// The Live Paint groups that hold Live Paint group `g` among their paths (in their sources group, +/// at any depth), innermost first. +fn enclosing_live_paints(d: &Document, g: NodeId) -> Vec { + let mut out = vec![]; + let mut at = g; + while let Spot::Source(o) = spot_in(d, d.parent_of(at)) { + if out.contains(&o) { + break; + } + out.push(o); + at = o; + } + out +} + /// What moving rows in the Layers panel (`layer.move`, `node.move`) does to Live Paint groups. /// Rows that go into a Live Paint group from elsewhere are added to it as `livePaint.merge` adds /// paths. Rows that go into or leave a group's paths (its sources group) change those paths, and /// the group's faces and edges are made again from them, keeping the paint of the faces and edges -/// that stay. Rows moved within one group's paths, or among a group's own children, change no -/// faces. +/// that stay, and so are those of every Live Paint group that holds a changed group among its +/// paths. Rows moved within one group's paths, or among a group's own children, change no faces. pub(crate) struct LivePaintMove { /// The Live Paint group the rows go into, and for each row whether it joins the group's paths. join: Option<(NodeId, Vec)>, @@ -411,13 +426,30 @@ impl LivePaintMove { // The group the rows join is made again by the merge below, from its paths as they are now // and with the paint of its faces and edges as they were before the move. let join_group = self.join.as_ref().map(|(g, _)| *g); - for g in self.rebuild.iter().filter(|g| Some(**g) != join_group) { - rebuild_paths(d, *g)?; + // A Live Paint group among another group's paths gives that group its faces and edges, so + // the groups holding a changed group among their paths are made again too, innermost first. + let mut groups: Vec = vec![]; + for g in self.rebuild.iter().copied().chain(join_group) { + for x in std::iter::once(g).chain(enclosing_live_paints(d, g)) { + if !groups.contains(&x) { + groups.push(x); + } + } + } + groups.sort_by_cached_key(|g| std::cmp::Reverse(d.ancestry(*g).map_or(0, |a| a.len()))); + let joined: Vec = match &self.join { + Some((_, mask)) => moved.iter().zip(mask).filter(|(_, j)| **j).map(|(r, _)| *r).collect(), + None => vec![], + }; + for g in groups { + if Some(g) == join_group { + let roots: Vec = std::iter::once(g).chain(joined.iter().copied()).collect(); + merge_live(d, sel, &roots)?; + } else if d.node(g).is_some() { + rebuild_paths(d, g)?; + } } let Some((g, mask)) = self.join else { return Ok(moved.iter().copied().filter(|r| d.node(*r).is_some()).collect()) }; - let joined = moved.iter().zip(&mask).filter(|(_, j)| **j).map(|(r, _)| *r); - let roots: Vec = std::iter::once(g).chain(joined).collect(); - merge_live(d, sel, &roots)?; // `moved` holds each row once, so only the group can come twice. Faces and edges of the // group moved along with the joining rows were made again, so they are left out. let mut out = vec![]; diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 8a63bf659d..d1cd00c524 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -5377,6 +5377,40 @@ fn layers_drag_a_source_path_into_its_own_live_paint_group_keeps_the_paint() { assert_eq!(face_at(&n, Point::new(50.0, 50.0)).unwrap().appearance.fill_paint(), blue, "the only path's face keeps its fill"); } +/// A Live Paint group among another Live Paint group's paths gives it faces and edges: a path +/// dragged into or out of the inner group's paths, or from the outer group's paths into the inner +/// group's, makes the inner group's faces and edges again and then the outer group's. +#[test] +fn layers_drag_into_a_nested_live_paint_group_makes_the_outer_group_again() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let outer = live(&mut s); + let inner = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(outer).unwrap(); + let first_source = |s: &Session, g: NodeId| sources(&node(s, g)).unwrap().children().unwrap()[0].id; + let into = |s: &mut Session, row: NodeId, g: NodeId| { + let target = first_source(s, g); + s.execute("layer.move", &json!({"ids": [row.0], "target": target.0, "place": "above"})).unwrap(); + }; + into(&mut s, inner, outer); + assert_eq!(s.doc().unwrap().doc.parent_of(inner), Some(sources(&node(&s, outer)).unwrap().id)); + let plain = faces(&node(&s, outer)).len(); + let a = line_to_right_face(&mut s, 30.0); + into(&mut s, a, inner); + assert_eq!(faces(&node(&s, inner)).len(), 5); + let cut = faces(&node(&s, outer)).len(); + assert!(cut > plain, "a path joining the inner group cuts the outer group's faces: {cut} faces, {plain} before"); + s.execute("layer.move", &json!({"ids": [a.0], "target": layer.0})).unwrap(); + assert_eq!(faces(&node(&s, inner)).len(), 3); + assert_eq!(faces(&node(&s, outer)).len(), plain, "a path leaving the inner group leaves the outer group's faces"); + into(&mut s, a, outer); + assert_eq!(faces(&node(&s, outer)).len(), cut); + into(&mut s, a, inner); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(sources(&node(&s, inner)).unwrap().id)); + assert_eq!(faces(&node(&s, inner)).len(), 5); + assert_eq!(faces(&node(&s, outer)).len(), cut, "the outer group is made after the inner one"); +} + /// Give Live Paint group `g` a lock, hidden state, appearance, knockout, opacity mask and /// graphic style link, and return it as it then is. fn dress_live_group(s: &mut Session, g: NodeId) -> Node { From 322cc6049f0d83ca2aad213c1d492dd81ddb196e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 13:51:14 -0800 Subject: [PATCH 155/247] i18n: French Find and Replace match count avoids a colon without a no-break space --- crates/ui-egui/src/i18n/fr.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 96d05a0ab9..d24a320e5e 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1285,7 +1285,7 @@ font-technology Variable Variables Check Hidden Layers Vérifier les calques masqués Check Locked Layers Vérifier les calques verrouillés @msg No matches found Aucune occurrence trouvée -@msg Matches replaced: {n} Occurrences remplacées : {n} +@msg Matches replaced: {n} Occurrences remplacées ({n}) @msg no match of `find` at bytes {_1}..{_2} of object {_3} aucune occurrence de `find` aux octets {_1}..{_2} de l’objet {_3} Find Font Rechercher une police Find Font… Rechercher une police… From 11f1a28d1cbb957cece8a9010a06f353cc0d21e7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 14:16:36 -0800 Subject: [PATCH 156/247] Document Setup: grid color boxes read a preset name When Grid Colors held a preset name, the color boxes and hex fields were empty, a box opened the Color Picker on white, and the picker's OK failed with "no such color". A list shorter than two colors failed the same way, and typing a hex while a preset name was set lost the other color. The boxes, hex fields and Grid Colors menu now read the field as document.setup does (a preset name in any letter case, or two colors), showing the document's pair when it holds neither. Before a box opens the picker, a field that is not two colors is written as that pair, so the picker's OK sets one entry. --- crates/ui-egui/src/dialogs/document_setup.rs | 64 +++++++++++++++++--- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/dialogs/document_setup.rs b/crates/ui-egui/src/dialogs/document_setup.rs index f6feea4f91..410b554f77 100644 --- a/crates/ui-egui/src/dialogs/document_setup.rs +++ b/crates/ui-egui/src/dialogs/document_setup.rs @@ -188,12 +188,19 @@ const GRID_PREVIEW: egui::Vec2 = egui::vec2(112.0, 72.0); /// valid value shows as `setup`, the document's setting. fn preview_grid(fields: &Map, setup: &vectorcraft_doc::DocSetup) -> (GridSize, [vectorcraft_color::Color; 2]) { let size = fields.get("gridSize").and_then(Value::as_str).and_then(GridSize::parse).unwrap_or(setup.grid_size); + (size, grid_colors(fields, setup)) +} + +/// The two grid colors the dialog's fields `fields` hold, read as `document.setup` reads +/// `gridColors` (a preset name, in any letter case, or two colors): a field that is missing or not +/// a valid value gives `setup`'s colors, the document's setting. +fn grid_colors(fields: &Map, setup: &vectorcraft_doc::DocSetup) -> [vectorcraft_color::Color; 2] { let colors = match fields.get("gridColors") { Some(Value::String(name)) => GRID_COLOR_PRESETS.iter().find(|(n, _)| n.eq_ignore_ascii_case(name)).map(|(_, pair)| *pair), Some(Value::Array(a)) if a.len() == 2 => a.iter().map(vectorcraft_engine::cmd::color_value).collect::>>().map(|c| [c[0], c[1]]), _ => None, }; - (size, colors.unwrap_or(setup.grid_colors)) + colors.unwrap_or(setup.grid_colors) } /// The checkered preview of the grid the dialog's Grid Size and Grid Colors hold, drawn with the @@ -234,15 +241,17 @@ fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { let top = ui.cursor().top(); let sizes: Vec<(&str, &str)> = GridSize::ALL.iter().map(|g| (g.id(), g.label())).collect(); choice(ui, d, "gridSize", tl!("Grid Size:"), &sizes); - let colors: Vec = d - .fields - .get("gridColors") - .and_then(Value::as_array) - .map(|a| a.iter().map(|c| c.as_str().unwrap_or("").to_string()).collect()) - .unwrap_or_default(); + // The pair the field holds as a preset name or two colors, or the document's pair when it holds + // neither, so each box and hex field shows a color and the picker and hex fields set an entry of + // a two-color list. + let colors: Vec = { + let fallback = vectorcraft_doc::DocSetup::default(); + let setup = app.session.active().map_or(&fallback, |st| &st.doc.setup); + grid_colors(&d.fields, setup).iter().map(vectorcraft_color::Color::to_hex).collect() + }; let preset = GRID_COLOR_PRESETS .iter() - .find(|(_, pair)| colors.len() == 2 && colors.iter().zip(pair).all(|(h, c)| h.eq_ignore_ascii_case(&c.to_hex()))) + .find(|(_, pair)| colors.iter().zip(pair).all(|(h, c)| h.eq_ignore_ascii_case(&c.to_hex()))) .map_or("Custom", |(n, _)| n); let names: Vec<&str> = GRID_COLOR_PRESETS.iter().map(|(n, _)| *n).chain(["Custom"]).collect(); widgets::label_row(ui, tl!("Grid Colors:"), LABEL, |ui| { @@ -252,7 +261,7 @@ fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { }); // The two colours (the first is also the paper colour): editing either makes them Custom. A // click on a color's box, or Space or Enter with the keyboard on it, opens the Color Picker on - // that color (white when its hex is not a color), and the picker's OK sets that color. + // that color, and the picker's OK sets that color. let mut pick = None; widgets::label_row(ui, "", LABEL, |ui| { for i in 0..2 { @@ -281,7 +290,6 @@ fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { } if let Some(c) = widgets::hex_field_named(ui, ("grid-color", i), Some(&name), hex).and_then(|h| vectorcraft_color::Color::from_hex(&h)) { let mut v = colors.clone(); - v.resize(2, "#ffffff".into()); v[i] = c.to_hex(); d.fields.insert("gridColors".into(), json!(v)); } @@ -290,6 +298,12 @@ fn transparency(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { }); grid_preview(app, ui, d, top); if let Some((i, c)) = pick { + // A preset name or a field that is not two colors becomes the pair the boxes show, so the + // picker's OK has an entry to set. + let entries = d.fields.get("gridColors").and_then(Value::as_array); + if !entries.is_some_and(|a| a.len() == 2 && a.iter().all(|c| vectorcraft_engine::cmd::color_value(c).is_some())) { + d.fields.insert("gridColors".into(), json!(colors)); + } *d = super::color_picker::over_list_entry(d, "gridColors", i, c); } ui.add_space(4.0); @@ -821,6 +835,36 @@ mod tests { } } + /// When Grid Colors holds a preset name (in any letter case) or a list that is not two colors, + /// the boxes and hex fields show the preset's pair or the document's, a box opens the Color + /// Picker on its color, and the picker's OK sets only that entry of a two-color list. + #[test] + fn a_grid_color_box_opens_on_a_preset_name_or_a_short_list() { + for (field, index, opens, kept, name) in [ + (json!("Blue"), 1, "#c4dcff", "#ffffff", "Blue"), + (json!("purple"), 0, "#ffffff", "#e2c9ff", "Purple"), + (json!(["#ff0000"]), 1, "#cccccc", "#ffffff", "Light"), + ] { + let (mut app, ctx) = transparency_tab(); + app.ui.dialog.as_mut().unwrap().fields.insert("gridColors".into(), field.clone()); + dialog_frame(&mut app, &ctx, vec![]); + let texts: Vec = dialog_frame(&mut app, &ctx, vec![]).into_iter().map(|(t, _)| t).collect(); + for shown in [name, opens.trim_start_matches('#'), kept.trim_start_matches('#')] { + assert!(texts.iter().any(|t| t.eq_ignore_ascii_case(shown)), "{field}: no {shown} in {texts:?}"); + } + click_grid_box(&mut app, &ctx, index); + assert_picker_over_setup(&app, opens, &field.to_string()); + app.ui.dialog.as_mut().unwrap().fields.insert("color".into(), json!("#00ff00")); + crate::dialogs::confirm(&mut app).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + let mut pair = [hex(kept); 2]; + pair[index] = hex("#00ff00"); + assert_eq!((d.kind.as_str(), dialog_grid(d)), (super::KIND, pair.to_vec()), "{field}"); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(app.session.active().unwrap().doc.setup.grid_colors, pair, "{field}"); + } + } + /// The picker's OK sets nothing when the dialog under it has no such color or is gone: it is /// an error, and the picker stays open. #[test] From 4847ebd85002790eef4fd13787e762de81f4354e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 14:27:27 -0800 Subject: [PATCH 157/247] i18n: drop rows main already has The merge with main left rows in es.tsv that main already carries; main's rows stay. --- crates/ui-egui/src/i18n/es.tsv | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index d2836c539e..f85029e3e7 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -8191,16 +8191,11 @@ breakText Glyphs Glifos @msg an XPath step is missing falta un paso XPath @msg an image couldn't be decoded and is missing from the picture no se pudo descodificar una imagen y falta en la imagen resultante @msg an image of {w} × {h} pixels is too large to convert (at most {_1} pixels) una imagen de {w} × {h} píxeles es demasiado grande para convertirla (como máximo {_1} píxeles) -@msg apply was called on a value that is not a function se llamó a apply con un valor que no es una función @msg area type in a thread cannot use Dynamic Text: {frames} el texto de área en un enlace no puede usar Texto dinámico: {frames} -@msg array literal too long literal de matriz demasiado largo -@msg assignment to a constant binding asignación a un enlace constante @msg at least one row that isn't excluded needs a weight above 0 al menos una fila que no esté excluida necesita un peso mayor que 0 @msg blend must be a mode name blend debe ser el nombre de un modo @msg both sides of an XPath | must select nodes ambos lados de un | de XPath deben seleccionar nodos @msg canceled cancelado -@msg cannot convert the object to a primitive value no se puede convertir el objeto en un valor primitivo -@msg cannot convert undefined or null to an object no se puede convertir undefined o null en un objeto @msg character dimensions cannot be represented with the source text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de origen @msg character dimensions cannot be represented with the target text transform las dimensiones de los caracteres no se pueden representar con la transformación del texto de destino @msg continuation must be an array of path chunks continuation debe ser una lista de fragmentos de trazado @@ -8218,7 +8213,6 @@ breakText Glyphs Glifos @msg give `xml`, one SVG element indica `xml`, un elemento SVG @msg give exactly one of `path`, `data` and `dataBase64` indica exactamente uno de `path`, `data` y `dataBase64` @msg give index or indexes, not both indica index o indexes, no ambos -@msg give one element indica un elemento @msg give opacity or blend indica opacity o blend @msg handler at {_1} expects {_2} values but its range starts with {d} el controlador en {_1} espera {_2} valores, pero su rango empieza con {d} @msg handler depth too large profundidad de controlador demasiado grande @@ -8233,7 +8227,6 @@ breakText Glyphs Glifos @msg instruction out of range instrucción fuera de rango @msg instruction {pc} ({op}) pops below the stack la instrucción {pc} ({op}) extrae por debajo de la pila @msg instruction {pc} reached with stack depths {seen} and {d} se llegó a la instrucción {pc} con profundidades de pila {seen} y {d} -@msg invalid array length longitud de matriz no válida @msg invalid group grupo no válido @msg invalid object id {v}: expected a non-negative integer id de objeto no válido {v}: se esperaba un entero no negativo @msg invalid regular expression flag '{_1}' indicador de expresión regular no válido '{_1}' @@ -8327,7 +8320,6 @@ breakText Glyphs Glifos @msg the XPath name functions need a node-set las funciones de nombre de XPath necesitan un conjunto de nodos @msg the XPath prefix {shown} is not bound to a namespace el prefijo XPath {shown} no está vinculado a un espacio de nombres @msg the XPath variable ${shown} is not bound la variable XPath ${shown} no está vinculada -@msg the argument list is not an object la lista de argumentos no es un objeto @msg the artwork is too large for EPS: what follows 256 MB of PostScript was left out la ilustración es demasiado grande para EPS: se omitió lo que sigue a 256 MB de PostScript @msg the bitmaps hold more pixels than one file may los mapas de bits contienen más píxeles de los que puede tener un archivo @msg the code runs past its last instruction el código continúa más allá de su última instrucción @@ -8342,7 +8334,6 @@ breakText Glyphs Glifos @msg the document's swatches hold {_1} colors; the document reduction takes at most 255 las muestras del documento contienen {_1} colores; la reducción del documento acepta como máximo 255 @msg the file isn't valid SVG: {e} el archivo no es un SVG válido: {e} @msg the file names no plate el archivo no nombra ninguna plancha -@msg the function's prototype is not an object el prototipo de la función no es un objeto @msg the guide is hidden or locked la guía está oculta o bloqueada @msg the library's file is outside the read roots el archivo de la biblioteca está fuera de las raíces de lectura @msg the method needs an XML value el método necesita un valor XML @@ -8353,14 +8344,10 @@ breakText Glyphs Glifos @msg the position table does not match the instructions la tabla de posiciones no coincide con las instrucciones @msg the prompt's text is longer than {MAX_PROMPT_BYTES} bytes el texto del prompt ocupa más de {MAX_PROMPT_BYTES} bytes @msg the radix must be between 2 and 36 la base debe estar entre 2 y 36 -@msg the right side of 'in' is not an object el lado derecho de 'in' no es un objeto -@msg the right side of 'instanceof' is not a function el lado derecho de 'instanceof' no es una función @msg the selected art is nested more than {MAX_DEPTH} levels deep la ilustración seleccionada está anidada a más de {MAX_DEPTH} niveles de profundidad @msg the selected art is too large to measure la ilustración seleccionada es demasiado grande para medirla @msg the selection has no outlines to weed around la selección no tiene contornos alrededor de los que pelar @msg the value bind was called on is not a function el valor con el que se llamó a bind no es una función -@msg the value is not a constructor el valor no es un constructor -@msg the value is not a function el valor no es una función @msg the value is not a valid XML name el valor no es un nombre XML válido @msg the value is not an XML attribute name el valor no es un nombre de atributo XML @msg the value is not an XML name el valor no es un nombre XML @@ -8382,7 +8369,6 @@ breakText Glyphs Glifos @msg toSource: the value has too many entries toSource: el valor tiene demasiadas entradas @msg toSource: the value is nested too deep toSource: el valor está anidado a demasiada profundidad @msg toString is not a function toString no es una función -@msg too many arguments demasiados argumentos @msg too many quantifiers demasiados cuantificadores @msg unknown OpenType feature `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; prefix - to turn off; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom and aalt take an alternate's number as `tag=N` with N from 0 to {_1}, as `salt=2`) función OpenType desconocida `{t}` (liga, calt, dlig, smcp, frac, onum, tnum, ordn, swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom, aalt; antepón - para desactivarla; swsh, ss01–ss20, salt, titl, pnum, lnum, sups, subs, numr, dnom y aalt aceptan el número de una alternativa como `tag=N` con N entre 0 y {_1}, como `salt=2`) @msg unknown dither `{d}` (diffusion, pattern, noise or none) tramado desconocido `{d}` (diffusion, pattern, noise o none) @@ -8860,7 +8846,6 @@ breakText Glyphs Glifos @msg composer must be "singleLine" or "everyLine" composer debe ser "singleLine" o "everyLine" @msg compound shapes take paths, compound paths, groups, compound shapes, type, blends and envelopes las formas compuestas aceptan trazados, trazados compuestos, grupos, formas compuestas, texto, fusiones y envolventes @msg compound {_1} must contain exactly one open path to join el compuesto {_1} debe contener exactamente un trazado abierto para unir -@msg connect end must be "start" or "end" el extremo de connect debe ser "start" o "end" @msg connect needs a path other than the one extended connect necesita un trazado distinto del que se extiende @msg connect needs id connect necesita id @msg connect path has no open end el trazado de connect no tiene ningún extremo abierto From 95615a56f575841eb0a6931a063ff782171d9b8c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 14:33:21 -0800 Subject: [PATCH 158/247] Docs: Spanish message counts after the merge of main --- docs/localization-parity.md | 2 +- docs/target-app-parity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/localization-parity.md b/docs/localization-parity.md index 10603d9d72..df5fffcde9 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -30,7 +30,7 @@ Chinese by `imachus`). Georgian and the original Gujarati catalog are recorded a |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all (3,554 `@msg` and 48 `@msgplural` rows, counted 2026-11-13: the untranslated report lists 55 missing messages for it, which open #7116, #7211, #7330, #7378 and #7405 translate) | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,556 `@msg` and 49 `@msgplural` rows, counted 2026-11-14: the untranslated report lists 145 messages without a Spanish row, 33 in its own section and 112 that every checked language lacks) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,731 `@msg` and 51 `@msgplural` rows, counted 2026-11-17: the untranslated report lists 145 messages without a Spanish row, 33 in its own section and 112 that every checked language lacks) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; the untranslated report on main `f793044f83` (2026-11-14) lists 676 missing rows for it: 608 in its own section and 68 that every checked language lacks | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, and a word-sense pass on short labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | reported missing rows, native review, layout and web font | | Gujarati | `gu` | 4,673 rows (2026-11-14): original 4,286 unchanged; all 387 additions contributor-reviewed and approved | menus and dialogs; status/error messages partial | installed Gujarati fonts on desktop; optional `Gujr` craft-fonts fallback; no Gujarati face in the pinned CI/release fonts or web startup list | original catalog reviewed by a native speaker; all 387 later additions approved by the contributor, with 11 wording corrections | contributor-reviewed catalog | remaining messages and a bundled Gujarati web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 7a073c5c4b..83c9499969 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1009,7 +1009,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Hindi messages its catalog lacked (2026-11-14): 116 status and error messages that the Hindi catalog did not translate, among them the image export, color profile, swatch exchange, color book, DXF, PDF knockout group, Revolve and 3D messages, have Hindi rows; the translations are VectorCraft's own and await native review; scores and estimates unchanged. - Hindi English words (2026-11-13): 264 rows no longer keep English words in their sentences, repeat a parameter's name in Hindi or garble them, among them "unknown align", which now names the alignment; lists of accepted values such as `(left|right|top|bottom)` stay as their English writes them; two tests check every row; native review remains; scores and estimates unchanged. - Message field names and values (2026-11-13): 49 status and error messages in the Hindi, Bulgarian, Danish, Indonesian, Dutch, Brazilian Portuguese, Swedish and Turkish catalogs keep the field names in brackets, such as `[subpath, anchor]`, and the values an `unknown` message lists, such as `(points, lines)`, as their English writes them; a test checks every catalog; scores and estimates unchanged. - - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,802 of the 1,842 status and error messages the untranslated report listed for it; 38 are the composite font, select-a-path and justification order errors that open #7211, #7214 and #7116 translate, and the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. + - Spanish messages (2026-11-13): the Spanish (`es`) catalog has an `@msg` row for 1,840 of the 1,842 status and error messages the untranslated report listed for it; 38 of them are the composite font, select-a-path and justification order errors that #7211, #7214 and #7116 translated, now on `main`, and the other two put two placeholders side by side, which a catalog row can't match, and stay in English; the rows keep their placeholders, backticked names, quoted values and command ids; native review remains; scores and estimates unchanged. - Italian messages (2026-11-13): the Italian catalog (`it`) has 1,802 more status and error message rows, and the untranslated report's missing Italian messages go from 1,842 to 40; the translations are VectorCraft's own and await native review; scores and estimates unchanged. See [localization-parity.md](localization-parity.md). - Italian messages no catalog had (2026-11-13): the Italian catalog has 126 more `@msg` rows, 3,560 in all: the image export, color profile, color book, swatch exchange file, DXF and DWG import, 3D and Revolve, script and zip errors that no other catalog translates yet, and the Banner Hems and Grommets, parameter range and recovery save messages that other catalogs translate. The untranslated report lists 54 Italian messages, which open #7116, #7211, #7378 and #7405 translate; scores and estimates unchanged. - Window › Help Bar shows or hides the tool-help strip at the bottom of the window apart from the status bar (`window.helpBar`). Each setting is kept with the UI preferences and in saved workspaces, and Presentation Mode hides both bars. Layouts saved before the setting existed show the Help Bar where they show the status bar (`help_bar_toggle_is_independent_and_saved_in_workspaces`, `help_bar_and_status_bar_render_independently`, `legacy_help_bar_visibility_follows_each_layouts_status_bar`, `a_help_bar_setting_the_file_lacks_is_saved`). From f4608d1e906e0f1048a0e576a5a4fcacb7bb1043 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 14:38:36 -0800 Subject: [PATCH 159/247] Docs: Spanish untranslated counts after the merge of main --- docs/localization-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/localization-parity.md b/docs/localization-parity.md index df5fffcde9..e32b1ec118 100644 --- a/docs/localization-parity.md +++ b/docs/localization-parity.md @@ -30,7 +30,7 @@ Chinese by `imachus`). Georgian and the original Gujarati catalog are recorded a |---|---|---|---|---|---|---|---| | English | `en` | source, 100% | all | Latin | — | full | — | | Simplified Chinese (Mandarin) | `zh-hans` | 5,102 rows, 791 of them `@msg` (counted 2026-10-21): menus, `tl!` literals and messages complete when counted | all (3,554 `@msg` and 48 `@msgplural` rows, counted 2026-11-13: the untranslated report lists 55 missing messages for it, which open #7116, #7211, #7330, #7378 and #7405 translate) | CJK UI font from craft-fonts (BIZ UDPGothic) when embedded, else a system font; IME with marked text at the caret; vertical type partial ([type-parity.md](type-parity.md)) | no | full | — (review) | -| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,731 `@msg` and 51 `@msgplural` rows, counted 2026-11-17: the untranslated report lists 145 messages without a Spanish row, 33 in its own section and 112 that every checked language lacks) | Latin | no | full | — (review) | +| Spanish | `es` | 4,009 / 4,020 (99.7%) | all (3,731 `@msg` and 51 `@msgplural` rows, counted 2026-11-17: the untranslated report lists 247 messages without a Spanish row, 232 in its own section and 15 that all 24 checked languages lack) | Latin | no | full | — (review) | | Hindi | `hi` | 8,782 rows (2026-11-13): 3,014 `@msg`, 47 `@msgplural`, 41 `@plural`; the untranslated report on main `f793044f83` (2026-11-14) lists 676 missing rows for it: 608 in its own section and 68 that every checked language lacks | menus, dialogs, tooltips and scanned messages; contributor-approved loanword terminology; agent wording pass | UI and document text shape with HarfRust; installed desktop Devanagari fallback, or a `Deva` craft-fonts face; web font still needed | contributor terminology review; 2026-11-13 wording pass on messages and longer labels, and a word-sense pass on short labels, with a glossary-term test; wider proofread welcome | complete catalog, machine-assisted draft | reported missing rows, native review, layout and web font | | Gujarati | `gu` | 4,673 rows (2026-11-14): original 4,286 unchanged; all 387 additions contributor-reviewed and approved | menus and dialogs; status/error messages partial | installed Gujarati fonts on desktop; optional `Gujr` craft-fonts fallback; no Gujarati face in the pinned CI/release fonts or web startup list | original catalog reviewed by a native speaker; all 387 later additions approved by the contributor, with 11 wording corrections | contributor-reviewed catalog | remaining messages and a bundled Gujarati web font | | Arabic | `ar` | 0 | none | document text: bidi layout and Paragraph Direction; interface: no right-to-left layout, no Arabic shaping in egui | no | none | 25–40 | From fc294d56b69cc68d8de9fd07f1d758954c2c2c1f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:25:32 -0800 Subject: [PATCH 160/247] Transform panel: the Shear field takes -359 to 359 and shows the error for an angle Shear refuses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Shear field stopped at -89 and dropped any value of 90 or more without a word. It now sends every typed, stepped or picked value to `object.shear`, which shears by the tangent of an angle from -359 to 359. For ±90, ±270 and an angle outside that range the status bar shows the command's error; the art is unchanged and no undo step is recorded. --- crates/ui-egui/src/panels/transform.rs | 20 ++++-- crates/ui-egui/src/panels/transform/tests.rs | 69 ++++++++++++++++++++ docs/target-app-parity.md | 2 +- 3 files changed, 84 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/panels/transform.rs b/crates/ui-egui/src/panels/transform.rs index 1bce03c53d..98dba09b03 100644 --- a/crates/ui-egui/src/panels/transform.rs +++ b/crates/ui-egui/src/panels/transform.rs @@ -126,7 +126,12 @@ const PATTERN_MODES: [(&str, &str); 3] = [("object", "Transform Object Only"), ( /// Only (the pattern tiles alone) or Transform Both. Until one is chosen (`default`, or any other /// value) neither is passed: patterns follow General › Transform Pattern Tiles. Errors are /// dropped, as the panels' fields have always done. -pub fn run_transform(app: &mut VectorcraftApp, cmd: &str, mut params: serde_json::Value) { +pub fn run_transform(app: &mut VectorcraftApp, cmd: &str, params: serde_json::Value) { + try_transform(app, cmd, params).ok(); +} + +/// [`run_transform`] that returns the command's result, for a field that shows its error. +fn try_transform(app: &mut VectorcraftApp, cmd: &str, mut params: serde_json::Value) -> Result { let switches = match app.session.prefs.transform_panel_patterns.as_str() { "object" => Some((true, false)), "pattern" => Some((false, true)), @@ -137,7 +142,7 @@ pub fn run_transform(app: &mut VectorcraftApp, cmd: &str, mut params: serde_json params["objects"] = json!(objects); params["patterns"] = json!(patterns); } - app.run(cmd, params).ok(); + app.run(cmd, params) } /// The panel menu's checked choice of [`PATTERN_MODES`]: the one chosen, else (`default`) what @@ -323,12 +328,15 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { ui.add_space(4.0); let icon = icons::icon(ui, "dc-shear", 16.0, t.icon).on_hover_text(tl!("Shear")); crate::scrub::note_label(ui, icon.rect); - // Shear is relative: the field rests at 0° and a new value shears by it. - if let Some(a) = widgets::spin_plain_named(ui, "xfp-shear", Some(tl!("Shear")), 0.0, "°", 2, 96.0, 15.0, -89.0, &SHEAR_PRESETS) + // Shear is relative: the field rests at 0° and a new value from -359° to 359° shears + // by it. The field has no minimum, so `object.shear` checks every value: it refuses + // ±90°, ±270° and a value outside -359° to 359°, and the status bar shows its error. + if let Some(a) = + widgets::spin_plain_named(ui, "xfp-shear", Some(tl!("Shear")), 0.0, "°", 2, 96.0, 15.0, f64::NEG_INFINITY, &SHEAR_PRESETS) && a != 0.0 - && a.abs() < 90.0 + && let Err(e) = try_transform(app, "object.shear", json!({"angle": a, "axis": "horizontal", "origin": origin, "copy": copy})) { - run_transform(app, "object.shear", json!({"angle": a, "axis": "horizontal", "origin": origin, "copy": copy})); + app.status(e); } }); }); diff --git a/crates/ui-egui/src/panels/transform/tests.rs b/crates/ui-egui/src/panels/transform/tests.rs index 3dff8e6a4b..958eee4752 100644 --- a/crates/ui-egui/src/panels/transform/tests.rs +++ b/crates/ui-egui/src/panels/transform/tests.rs @@ -524,6 +524,75 @@ fn rotate_and_shear_fields_are_named() { let _ = h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Shear"); } +/// A 100 × 60 rectangle at (100, 40), selected, in a new app. +fn shear_app() -> VectorcraftApp { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + app.run("shape.rectangle", json!({"x": 100, "y": 40, "width": 100, "height": 60})).unwrap(); + app +} + +/// Types `value` into the panel's Shear field (the second field showing "0°") and presses Enter. +fn type_shear(app: &mut VectorcraftApp, value: &str) { + use crate::panels::tests_appearance::{click, frame_events}; + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let texts = frame_events(&ctx, app, vec![], show); + let at = texts.iter().filter(|(t, _)| t == "0°").nth(1).unwrap_or_else(|| panic!("no Shear field in {texts:?}")).1.center(); + click(&ctx, app, at, show); + let key = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }; + frame_events(&ctx, app, vec![key(egui::Key::A, egui::Modifiers::COMMAND)], show); + frame_events(&ctx, app, vec![egui::Event::Text(value.into())], show); + frame_events(&ctx, app, vec![key(egui::Key::Enter, egui::Modifiers::NONE)], show); + frame_events(&ctx, app, vec![], show); +} + +/// The Shear field takes -359° to 359°: a typed 120 and -359 shear about the reference point (the +/// centre) as `object.shear` does with that angle, and 120 slants as -60 does. +#[test] +fn the_shear_field_takes_angles_from_minus_359_to_359() { + for (typed, angle, like) in [("120", 120.0, Some(-60.0)), ("-359", -359.0, None), ("45", 45.0, None)] { + let mut app = shear_app(); + let before = app.selection_box().unwrap(); + type_shear(&mut app, typed); + assert_eq!(app.ui.status, "", "{typed}: no error"); + let got = app.selection_box().unwrap(); + assert_ne!(got, before, "{typed}: sheared"); + let mut want = shear_app(); + want.run("object.shear", json!({"angle": angle, "axis": "horizontal", "origin": [150, 70]})).unwrap(); + assert_eq!(got, want.selection_box().unwrap(), "{typed}"); + if let Some(like) = like { + let mut same = shear_app(); + same.run("object.shear", json!({"angle": like, "axis": "horizontal", "origin": [150, 70]})).unwrap(); + let (a, b) = (got.rect, same.selection_box().unwrap().rect); + assert!( + (a.x0 - b.x0).abs() < 1e-6 && (a.x1 - b.x1).abs() < 1e-6 && (a.y0 - b.y0).abs() < 1e-6 && (a.y1 - b.y1).abs() < 1e-6, + "{typed}: {a:?} like {b:?}" + ); + } + } +} + +/// A typed ±90 or ±270, which have no shear, and a typed 400 or -400, outside -359 to 359, leave +/// the rectangle as it is, record no undo step and show `object.shear`'s error in the status bar. +#[test] +fn the_shear_field_shows_the_error_for_an_angle_with_no_shear() { + let none = |v: &str| format!("invalid parameters for `object.shear`: `angle` cannot be {v}: ±90 and ±270 degrees have no shear"); + let range = |v: &str| format!("invalid parameters for `object.shear`: `angle` must be from -359 to 359 degrees, not {v}"); + for (typed, msg) in + [("90", none("90")), ("-90", none("-90")), ("270", none("270")), ("-270", none("-270")), ("400", range("400")), ("-400", range("-400"))] + { + let mut app = shear_app(); + let (before, revision) = (app.selection_box().unwrap(), app.session.active().unwrap().revision); + let undo = app.session.doc().unwrap().history.undo.len(); + type_shear(&mut app, typed); + assert_eq!(app.ui.status, msg, "{typed}"); + assert_eq!(app.selection_box().unwrap(), before, "{typed}: nothing moved"); + assert_eq!(app.session.active().unwrap().revision, revision, "{typed}: unchanged"); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo, "{typed}: no undo step"); + } +} + /// The Align to Pixel Grid checkbox turns the selected paths' pixel-aligned property on, shows a /// dash when they differ (a click then turns it on for both), turns it off when it is on for all, /// and is unavailable with type selected. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ea540d6390..c2c1d8f5cd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1277,7 +1277,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur The settled part of that outline is kept in paths of up to 64 pieces each. A path is shared from one frame to the next until a piece in it changes, and the canvas keeps the triangles it drew the path with while the view stays the same, so a frame does not copy, flatten or tessellate a settled path again; a pan, zoom or rotation draws each one once more. This is VectorCraft's own rule. The line that a drag of more than 64 segments shows with a round Eraser tip, the Knife, the Path Eraser or the Pencil with Live preview off is kept the same way, in pieces of 64 segments: a frame builds again only the last piece, and the Knife's dashes run on from one piece to the next. With the Eraser's Size set to a mode that follows the pen, each step of such a drag is kept as its own path and a frame builds only a new step. A smoothing drag's band is kept until it changes. The canvas still copies the kept triangles of every piece into each frame. - **Transform:** Rotate, Reflect, Scale, Shear (click or Alt-click snaps the reference point to anchors and centres; Alt-click opens the tool's dialog, and a drag with Alt down at the release, from the press or pressed mid-drag, transforms a copy), Reshape, Free Transform (free and perspective distort and shear, switched by the keys held during a handle drag). A Reshape drag stretches part of a path from the dragged point without losing the path's general form, as [Adjust path segments](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/adjust-path-segments.html) has it. On an open path the stretch reaches both ends: the end anchors stay in place, each anchor between moves less the nearer it lies to an end, and the handles of a smooth anchor stay in line (`path.reshape`; the reach and the shares are VectorCraft's own rule, in `docs/mcp.md`). A click sets a focal point and a click on a segment adds a highlighted anchor there; Shift-click adds more, and a drag from any of them moves them all. The anchors that are not direct-selected stay in place and a closed path selected whole moves whole (VectorCraft's own rule, in `docs/mcp.md`). - Align, Distribute, Distribute Spacing, Reflect and Shear return an error for any `horizontal`, `vertical`, `to`, `axis`, `bounds` or `spacing` value they don't take, listing the choices, and Align returns one when a call gives neither `horizontal` nor `vertical`; nothing moves and no undo step is recorded. Shear takes an angle from -359° to 359° and shears by its tangent, so 120° slants as -60°; an angle outside that range, and ±90° and ±270° (VectorCraft's own rule), return an error ([shear objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/shear-objects.html); `shear_angles_slant_by_their_tangent`, `shear_rejects_angles_with_no_shear_or_out_of_range`). Align and Distribute act on the anchor points selected with Direct Selection: the points of one path align to each other, not to the artboard, and Distribute spaces them (#1641, fixes #1636; aligning to a key anchor is still missing). + Align, Distribute, Distribute Spacing, Reflect and Shear return an error for any `horizontal`, `vertical`, `to`, `axis`, `bounds` or `spacing` value they don't take, listing the choices, and Align returns one when a call gives neither `horizontal` nor `vertical`; nothing moves and no undo step is recorded. Shear takes an angle from -359° to 359° and shears by its tangent, so 120° slants as -60°; an angle outside that range, and ±90° and ±270° (VectorCraft's own rule), return an error ([shear objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/shear-objects.html); `shear_angles_slant_by_their_tangent`, `shear_rejects_angles_with_no_shear_or_out_of_range`). The Transform panel's Shear field takes the same range, and the status bar shows the error for an angle Shear refuses, as VectorCraft's own rule ([shear objects with the Transform panel](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/shear-objects.html); `panels::transform::tests::the_shear_field_takes_angles_from_minus_359_to_359`, `the_shear_field_shows_the_error_for_an_angle_with_no_shear`). Align and Distribute act on the anchor points selected with Direct Selection: the points of one path align to each other, not to the artboard, and Distribute spaces them (#1641, fixes #1636; aligning to a key anchor is still missing). Transform Each opens on the scale, move, rotate, reflect, Random, reference point, Transform Objects and Preview it was last confirmed with (kept with the UI state; Copy never is), and its Copy button, left of Cancel, transforms a copy of each object as the [Scale multiple objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/scale-multiple-objects.html) help page has it; the Copy checkbox is gone (#1732; the remembered values follow a maintainer comment on the issue, not the help page). Its Scale section has the Relative and Absolute radio buttons the same page describes: percentages of each object's size, or the width and height it becomes (`object.transformEach` `relative`, which Transform Again repeats); Absolute measures each object's own box, and the scales act along its axes about that box's reference point, so a turned shape keeps its shape and objects of different sizes come out alike; the fields show the width and height the selected objects share and read "Mixed" when they differ or a side is 0 (a line's), each object measured by its own box, rotated with it, as the Transform panel and the Control bar show it (sizes they show alike count as the same), and a size typed into them sets every object to it (a side left Mixed keeps its size), our choices where the page leaves them open; a live Repeat scales its spacing by the geometric mean of the two factors, so its Absolute size is approximate. The link beside the two scales keeps them in proportion, as the shape dialogs' Width and Height link does (`__constrain`, kept with the dialog's values; where it sits is our choice, the public pages don't establish it). The panel lists Scale, Move and Rotate, then the Options in two columns (Transform Objects, Transform Patterns, Scale Strokes & Effects, Scale Corners; Reflect X, Reflect Y, Random), the Reference Point, and Preview at the left of the button row, level with Copy, Cancel and OK. Transform Again uses the Copy, Transform Patterns, Scale Strokes & Effects and Scale Corners choices of the transform it repeats; after a bounding-box handle drag on area type, it resizes the type area again and the type keeps its size (`object.transformAgain`). With anchors selected with Direct Selection, Move, Rotate, Scale, Reflect, Shear and Transform Again (the commands, their dialogs and the four tools' drags) transform only those anchors, their handles with them, about the centre of the box around them unless a point was clicked; a copy still copies the whole object (#1408; behaviour reference: [adjust path segments](https://helpx.adobe.com/illustrator/using/adjust-path-segments.html); the default reference point and the copy are our choices). The Move, Rotate, Scale, Reflect and Shear dialogs have a Preview checkbox, off when they open: while it is on the canvas follows the values, Cancel rolls it back and OK is still one undo step; Up/Down step the Rotate and Shear angles and the Scale percentages by 1, Shift by 10 (#1412). The five dialogs and Transform Each have Transform Objects beside Transform Patterns: off, the art stays and only its pattern tiles transform (`objects` on the transform commands), and Transform Again repeats the choice (#1448; behaviour reference: [scale objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/scale-objects.html); the checkboxes are always enabled and the Scale page's pair is applied to all of them, our choices). Reflect's axis is Horizontal, Vertical or an angle (#1460; [reflect objects along an axis](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/reflect-objects-along-an-axis.html)). - **Pen:** Alt pressed in the middle of dragging out an anchor splits its handles and keeps the curve already shaped into it (only the outgoing handle follows the pointer); Space held while dragging out an anchor moves it, handles and all. A press on the first anchor of the path being drawn closes it whatever the drag then does: the drag shapes the closing curve and the release closes the path wherever it ends (#501). The first anchor's incoming handle mirrors the pointer, and a click leaves it retracted and the anchor a corner. Its outgoing handle stays where it is on a corner, so the first segment keeps its shape, and on a smooth anchor it turns to stay in line at its own length; Alt makes the anchor a corner and leaves the outgoing handle where it was when Alt went down. The Smart Pen's closing drag does the same (fixes #6634; `path.close`'s `in` and `out`; behavior reference: [draw with the Pen, Curvature, or Pencil tool](https://web.archive.org/web/20220614224656/https://helpx.adobe.com/illustrator/using/drawing-pen-curvature-or-pencil.html), where a click or drag on the first anchor closes the path and Alt breaks the pairing of the closing anchor's handles; which handles the drag sets are our choices). Space held during the Pen's closing drag moves the first anchor, handles and all, as that page also describes (`path.close`'s `at`). Clicking the last anchor of the path being drawn retracts its outgoing handle (convert cursor), and dragging from it pulls out a new one on its own. Auto Add/Delete: over a selected path, a click on a segment adds an anchor and a click on an anchor deletes it (add and delete cursors); Shift held, or Preferences › General › Disable Auto Add/Delete, starts a new path instead. Alt held over a handle end or an anchor of a selected path (the one being drawn too) works as the Anchor Point tool, with its convert cursor: dragging a handle moves it alone, clicking a smooth anchor makes it a corner, dragging an anchor pulls out new symmetric handles, dragging a segment reshapes it; drawing then goes on. Cmd (Ctrl) held drags with the selection tool chosen last, Direct Selection until one is (handles, anchors and segments of the path being drawn or another), and the Pen then goes on drawing its path while that stays selected; the pointer shows that tool's while Cmd is held. The same holds for agents (`pointer_gesture` with `mods.cmd`), as the borrowing now lives in the engine (#494). A drag's preview (the Pen's, the Anchor Point tool's, Direct Selection's handles and anchors) follows every position the pointer is seen at (#834): the canvas sends the tool a drag whenever the pointer's document position differs from the last one it sent, not only when egui's frame delta is non-zero (zero when a compositor coalesces motion and in the frame the pointer comes back into the window after leaving it), and a move that arrives in the release's own frame shapes the preview before the release commits it, once the press has dragged. With the Pen, a press that moves under 3 screen pixels is a click (a corner without handles), and a Precise Cursors command toggles the existing preference and can take a shortcut (#1663). From be920daf04712a3c343e977372bfb0fdb81bc069 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:30:37 -0800 Subject: [PATCH 161/247] Rerun CI From d0de7581559f64e0c6a93c7dcdd037c3a64fb33e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:30:39 -0800 Subject: [PATCH 162/247] Rerun CI From 8842a9d6eac3a4b34bc7ea7cf2c3703d2700eb18 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:30:43 -0800 Subject: [PATCH 163/247] Rerun CI From fa817f9b28c7efbaede8a333a41182a70c89f40a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:31:00 -0800 Subject: [PATCH 164/247] Rerun CI From 03c8a4ba1bfa8e2fee4dd35ca715c64263608691 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:32:04 -0800 Subject: [PATCH 165/247] Rerun CI From bcc2a5ed37224a0c580c2752c869b31b7b1e0546 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:50:30 -0800 Subject: [PATCH 166/247] Pathfinder: warn when open subpaths cancel each other under the fill rule Make Compound Shape now also warns when a member's subpaths, all closed, enclose no area together: two open evenodd squares on top of each other, or an open evenodd square over the same closed square. Each subpath is still checked on its own, so a line beside a square still warns. A path with one subpath skips the combined check, and an area that can't be measured gives no warning. --- crates/engine/src/cmd/compoundshape.rs | 29 ++++++++++++++++------- crates/engine/src/tests/compound_shape.rs | 18 ++++++++++++-- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/compoundshape.rs b/crates/engine/src/cmd/compoundshape.rs index 74257b528f..b1c610d8bd 100644 --- a/crates/engine/src/cmd/compoundshape.rs +++ b/crates/engine/src/cmd/compoundshape.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use serde_json::{Value, json}; use vectorcraft_doc::{Document, Node, NodeId, NodeKind, ShapeMode}; -use vectorcraft_geom::{FillRule, PathData}; +use vectorcraft_geom::{FillRule, PathData, SubPath}; use vectorcraft_pathops as po; use vectorcraft_render::effects; @@ -195,9 +195,11 @@ fn make(s: &mut Session, p: &Value) -> Result { /// Member `n` holds an open path that adds no area to a compound shape: one of the paths it takes /// part as ([`effects::member_leaves`]), inside a group or a compound path too, has an open subpath -/// that encloses no area once closed (a straight line, or an evenodd contour traced twice). The area -/// is the one the path's fill rule gives, which also keeps a self-crossing path whose signed area -/// is zero (a bow tie) from the warning, as Divide measures it. +/// that encloses no area once closed (a straight line, or an evenodd contour traced twice), or it +/// has an open subpath and its subpaths, all closed, enclose no area together (open evenodd +/// subpaths that cancel one another or a closed subpath). The area is the one the path's fill rule +/// gives, which also keeps a self-crossing path whose signed area is zero (a bow tie) from the +/// warning, as Divide measures it. An area that can't be measured gives no warning. fn adds_no_area(d: &Document, n: &Node, hook: effects::OutlineHook) -> bool { effects::member_leaves(Some(d), n, Some(hook)).iter().any(|leaf| { let (paths, rule): (Vec<&PathData>, FillRule) = match &leaf.kind { @@ -205,13 +207,22 @@ fn adds_no_area(d: &Document, n: &Node, hook: effects::OutlineHook) -> bool { NodeKind::Path { path, rule, .. } => (vec![path], *rule), _ => return false, }; - paths.iter().flat_map(|p| &p.subpaths).filter(|sp| !sp.closed).any(|sp| { - let mut closed = sp.clone(); - closed.closed = true; + let subpaths: Vec<&SubPath> = paths.iter().flat_map(|p| &p.subpaths).collect(); + if subpaths.iter().all(|sp| sp.closed) { + return false; + } + let closed = |sp: &SubPath| { + let mut sp = sp.clone(); + sp.closed = true; + sp + }; + // An area that can't be measured counts as an area, so a failed measurement gives no warning. + let no_area = |p: PathData| po::try_area(&p, rule).is_ok_and(|a| a <= 0.0); + subpaths.iter().filter(|sp| !sp.closed).any(|sp| { // The signed-area test alone only holds for nonzero: evenodd can fill nothing where // the signed area is not zero (a contour traced twice). - !(rule == FillRule::NonZero && po::encloses_area(sp)) && po::area(&PathData::single(closed), rule) <= 0.0 - }) + !(rule == FillRule::NonZero && po::encloses_area(sp)) && no_area(PathData::single(closed(sp))) + }) || (subpaths.len() > 1 && no_area(PathData::new(subpaths.iter().map(|sp| closed(sp)).collect()))) }) } diff --git a/crates/engine/src/tests/compound_shape.rs b/crates/engine/src/tests/compound_shape.rs index 8127ea5bcb..0057af9253 100644 --- a/crates/engine/src/tests/compound_shape.rs +++ b/crates/engine/src/tests/compound_shape.rs @@ -702,7 +702,8 @@ fn a_locked_or_hidden_layer_keeps_the_isolated_compound_shape_from_clicks() { /// place in the stack, and its reply carries a warning that names Outline Stroke. The shape draws /// the area the other members make in that mode: the square alone in Add, or on top in Subtract, /// and nothing in Intersect or when the line is the backmost member in Subtract. A line in a group, -/// beside a closed path too, and an open evenodd square traced twice are the same. An open path that encloses an area once closed (a bow tie +/// beside a closed path too, an open evenodd square traced twice, and open evenodd subpaths that cancel one another or a closed +/// subpath of the same path are the same. An open path that encloses an area once closed (a bow tie /// whose lobes cancel in signed area included) and closed shapes alone give no warning (#7849). #[test] fn lines_that_add_no_area_are_reported() { @@ -724,6 +725,17 @@ fn lines_that_add_no_area_are_reported() { run(s, "path.setFillRule", json!({"rule": "evenOdd"})); id } + fn evenodd_of(s: &mut Session, d: &str) -> NodeId { + let id = NodeId(run(s, "path.create", json!({ "d": d }))["id"].as_u64().unwrap()); + run(s, "path.setFillRule", json!({"rule": "evenOdd"})); + id + } + fn two_open_squares_of(s: &mut Session) -> NodeId { + evenodd_of(s, "M20 20 L80 20 L80 80 L20 80 M20 20 L80 20 L80 80 L20 80") + } + fn open_over_closed_of(s: &mut Session) -> NodeId { + evenodd_of(s, "M20 20 L80 20 L80 80 L20 80 Z M20 20 L80 20 L80 80 L20 80") + } fn group_of(s: &mut Session, ids: &[NodeId]) -> NodeId { run(s, "select.set", json!({"ids": ids.iter().map(|i| i.0).collect::>()})); NodeId(run(s, "object.group", json!({}))["id"].as_u64().unwrap()) @@ -731,8 +743,10 @@ fn lines_that_add_no_area_are_reported() { type Build = fn(&mut Session) -> NodeId; // (case, mode, the other member, whether it goes behind the 100 pt square, warned, area drawn) type Case = (&'static str, &'static str, Build, bool, bool, Option); - let cases: [Case; 11] = [ + let cases: [Case; 13] = [ ("an open evenodd square traced twice", "add", twice_around_of, false, true, Some(10_000.0)), + ("two open evenodd squares on one another", "add", two_open_squares_of, false, true, Some(10_000.0)), + ("an open evenodd square on the same closed square", "add", open_over_closed_of, false, true, Some(10_000.0)), ("a line", "add", line_of, false, true, Some(10_000.0)), ("a line, subtracting", "subtract", line_of, false, true, Some(10_000.0)), ("a line, intersecting", "intersect", line_of, false, true, Some(0.0)), From dfd5fe71f4588930ae8edc621547f9733547d112 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:50:35 -0800 Subject: [PATCH 167/247] Image Trace: the panel finds the object Trace acts on once per document revision On every frame the Image Trace panel put the whole selection in paint order twice and scanned it a third time to find the object Trace acts on; its panel menu scanned it again. The panel and its menu now look it up once for each document revision and reuse the result on later frames. The lookup puts only the selected images and Image Trace objects in paint order, and reads the target in place instead of copying it. The target, its flags, its stored settings and whether any selected object is an Image Trace object are the same as before, field for field. With 100,000 selected paths in nested groups and one selected image, a frame's lookups took a median 120 ms before; the first frame after a change now takes 10 ms and later frames about 50 ns. --- crates/ui-egui/src/panels/image_trace.rs | 101 ++++-- .../ui-egui/src/panels/image_trace/tests.rs | 312 ++++++++++++++++-- docs/target-app-parity.md | 1 + 3 files changed, 356 insertions(+), 58 deletions(-) diff --git a/crates/ui-egui/src/panels/image_trace.rs b/crates/ui-egui/src/panels/image_trace.rs index bca4192b61..28c9fe9a78 100644 --- a/crates/ui-egui/src/panels/image_trace.rs +++ b/crates/ui-egui/src/panels/image_trace.rs @@ -17,7 +17,7 @@ use vectorcraft_doc::{Node, NodeId, NodeKind, TraceView}; use vectorcraft_engine::cmd::TracePresetChange; use vectorcraft_engine::cmd::swatchlib::DOCUMENT_SWATCHES; -use super::{first_selected, pstate, set_pstate, swatches}; +use super::{first_node, pstate, set_pstate, swatches}; use crate::VectorcraftApp; use crate::widgets::{self, menu_item}; @@ -150,28 +150,72 @@ pub(crate) fn is_trace(n: &Node) -> bool { && n.children().is_some_and(|c| c.first().is_some_and(|i| matches!(i.kind, NodeKind::Image(_)))) } +/// What Trace acts on in the active document, and whether any selected object is an Image Trace +/// object (wherever it is in the selection). +#[derive(Clone, Debug, Default, PartialEq)] +struct Target { + /// The active document's uid and the object Trace acts on. + object: Option<(u64, NodeId)>, + /// The object is an Image Trace object. + is_trace: bool, + /// The object is a plain image. + is_image: bool, + /// The object's stored trace settings. + stored: Option, + any_trace: bool, +} + +#[cfg(test)] +thread_local! { + /// How many times [`find_target`] looked the target up in an active document on this thread. + static TARGET_LOOKUPS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + /// The object Trace acts on: the first selected image or Image Trace object in paint order, as -/// `imageTrace.make` takes it, else the first selected object. -fn target_node(app: &VectorcraftApp) -> Option { - let st = app.session.active()?; - let traceable = |n: &&Node| is_trace(n) || matches!(n.kind, NodeKind::Image(_)); - st.selection.in_paint_order(&st.doc).into_iter().find_map(|id| st.doc.node(id).filter(traceable).cloned()).or_else(|| first_selected(app)) +/// `imageTrace.make` takes it, else the first selected object. Only the selected images and Image +/// Trace objects are put in paint order. +fn find_target(app: &VectorcraftApp) -> Target { + let Some(st) = app.session.active() else { return Target::default() }; + #[cfg(test)] + TARGET_LOOKUPS.with(|n| n.set(n.get() + 1)); + let mut any_trace = false; + let traceable: Vec = st + .selection + .objects + .iter() + .copied() + .filter(|id| { + st.doc.node(*id).is_some_and(|n| { + let trace = is_trace(n); + any_trace |= trace; + trace || matches!(n.kind, NodeKind::Image(_)) + }) + }) + .collect(); + let node = st.doc.paint_order(traceable).into_iter().find_map(|id| st.doc.node(id)).or_else(|| first_node(app)); + let Some(n) = node else { return Target { any_trace, ..Target::default() } }; + Target { + object: Some((st.uid, n.id)), + is_trace: is_trace(n), + is_image: matches!(n.kind, NodeKind::Image(_)), + stored: n.extras().trace.as_deref().cloned(), + any_trace, + } } -/// The active document and the object Trace acts on. -fn target_key(app: &VectorcraftApp) -> Option<(u64, NodeId)> { - Some((app.session.active()?.uid, target_node(app)?.id)) -} - -/// What Trace acts on: an Image Trace object (with its stored settings), a plain image, or neither. -fn target(app: &VectorcraftApp) -> (bool, bool, Option) { - let Some(n) = target_node(app) else { return (false, false, None) }; - (is_trace(&n), matches!(n.kind, NodeKind::Image(_)), n.extras().trace.as_deref().cloned()) -} - -/// Whether any selected object is an Image Trace object, wherever it is in the selection. -fn any_trace(app: &VectorcraftApp) -> bool { - app.session.active().is_some_and(|st| st.selection.objects.iter().any(|id| st.doc.node(*id).is_some_and(is_trace))) +/// [`find_target`], looked up once for each document and revision of it: the panel reads it on +/// every frame. +fn target(app: &VectorcraftApp, ctx: &egui::Context) -> Target { + let Some(st) = app.session.active() else { return Target::default() }; + let key = (st.uid, st.revision); + match pstate::>(ctx, "image-trace-target") { + Some((k, t)) if k == key => t, + _ => { + let t = find_target(app); + set_pstate(ctx, "image-trace-target", Some((key, t.clone()))); + t + } + } } /// The one selected Image Trace object's preset ("Custom" once its settings were changed) and view. @@ -385,7 +429,7 @@ fn trace(app: &mut VectorcraftApp, ctx: &egui::Context, st: &mut TraceUi) { match crate::trace_runs::start(app, "imageTrace.make", p, true) { // Traced off the UI thread: the result comes to [`traced`]. Ok(r) if r["background"] == true => {} - Ok(r) => adopt(app, st, &r), + Ok(r) => adopt(app, ctx, st, &r), Err(e) => app.ui.status = e, } } @@ -393,11 +437,12 @@ fn trace(app: &mut VectorcraftApp, ctx: &egui::Context, st: &mut TraceUi) { /// The panel takes trace `r`'s counts and the traced object's stored settings at once: Undo before /// the next panel frame must still be recognized as a change, even when it returns to the previous /// settings. -fn adopt(app: &VectorcraftApp, st: &mut TraceUi, r: &Value) { +fn adopt(app: &VectorcraftApp, ctx: &egui::Context, st: &mut TraceUi, r: &Value) { st.info = Some((r["paths"].as_u64().unwrap_or(0), r["anchors"].as_u64().unwrap_or(0), r["colors"].as_u64().unwrap_or(0))); - if let Some(stored) = target(app).2 { + let target = target(app, ctx); + if let Some(stored) = target.stored { st.synced = stored; - st.object = target_key(app); + st.object = target.object; } } @@ -405,7 +450,7 @@ fn adopt(app: &VectorcraftApp, st: &mut TraceUi, r: &Value) { pub(crate) fn traced(app: &VectorcraftApp, r: &Value) { let Some(ctx) = app.ui_ctx.clone() else { return }; let mut st: TraceUi = pstate(&ctx, "image-trace"); - adopt(app, &mut st, r); + adopt(app, &ctx, &mut st, r); set_pstate(&ctx, "image-trace", st); } @@ -570,9 +615,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { st.preset = "Default".into(); st.params = all.first().map(|p| p.1.clone()).unwrap_or_default(); } - let (is_trace, is_image, stored) = target(app); - let any_trace = any_trace(app); - let object = target_key(app); + let Target { object, is_trace, is_image, stored, any_trace } = target(app, ui.ctx()); // The saved preset changes since the last frame apply to the panel's settings before the selected object's // settings, which `sync_with_object` resolves against every change, are adopted. follow_preset_changes(app, &mut st, &all); @@ -862,7 +905,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { - let any_trace = any_trace(app); + let any_trace = target(app, ui.ctx()).any_trace; if menu_item(ui, tl!("Release"), any_trace, false) { app.run("imageTrace.release", json!({})).ok(); } diff --git a/crates/ui-egui/src/panels/image_trace/tests.rs b/crates/ui-egui/src/panels/image_trace/tests.rs index 7f686db45a..574384fe08 100644 --- a/crates/ui-egui/src/panels/image_trace/tests.rs +++ b/crates/ui-egui/src/panels/image_trace/tests.rs @@ -2,7 +2,7 @@ use super::super::tests_long_popups::{ PopupWindow, assert_last_row_scrolls_into_view, assert_rows_stay_on_one_line, assert_short_list_does_not_scroll, }; use super::*; -use crate::panels::library_panel; +use crate::panels::{first_selected, library_panel}; use egui::{Event, PointerButton, Pos2, Rect, vec2}; /// One headless frame of the panel (and its menu) with `events`: the texts drawn, with where. @@ -160,7 +160,7 @@ fn a_large_image_traces_and_the_status_bar_says_it_is_slower() { let data = vectorcraft_format::base64_encode(&png); app.run("file.place", json!({"name": "wide.png", "dataBase64": data, "link": false})).unwrap(); trace_with(&mut app, "Default"); - assert!(target(&app).2.is_some(), "the image is traced"); + assert!(find_target(&app).stored.is_some(), "the image is traced"); assert!(app.ui.status.contains("1601 × 12") && app.ui.status.contains("more slowly"), "{}", app.ui.status); } @@ -208,7 +208,7 @@ fn a_large_image_traced_as_a_flat_logo_shows_the_size_it_was_traced_at() { let data = vectorcraft_format::base64_encode(&png); app.run("file.place", json!({"name": "logo.png", "dataBase64": data, "link": false})).unwrap(); trace_with(&mut app, "Flat Logo"); - assert!(target(&app).2.is_some(), "the image is traced: {}", app.ui.status); + assert!(find_target(&app).stored.is_some(), "the image is traced: {}", app.ui.status); assert_eq!(app.ui.status, "Flat Logo traced the image at 801 × 801 pixels, averaged down from 1602 × 1602."); } @@ -327,11 +327,11 @@ fn with_preview_off_a_slider_change_waits_for_trace() { assert_eq!(app.session.active().unwrap().history.undo.len(), steps, "no trace while Preview is off"); assert_eq!(first_selected(&app).unwrap().children().unwrap().len(), 2, "source and ink path, as before"); let draft: TraceUi = pstate(&ctx, "image-trace"); - assert_ne!(draft.params["threshold"], target(&app).2.unwrap()["params"]["threshold"], "the change waits in the panel"); + assert_ne!(draft.params["threshold"], find_target(&app).stored.unwrap()["params"]["threshold"], "the change waits in the panel"); click(&mut app, &ctx, "Trace"); assert_eq!(app.session.active().unwrap().history.undo.len(), steps + 1, "Trace applies it as one undo step"); assert_eq!(first_selected(&app).unwrap().children().unwrap().len(), 1, "only the source remains below the ink's luminance"); - assert_eq!(target(&app).2.unwrap()["params"], pstate::(&ctx, "image-trace").params); + assert_eq!(find_target(&app).stored.unwrap()["params"], pstate::(&ctx, "image-trace").params); assert!(!app.ui.image_trace_preview, "Trace leaves Preview off"); } @@ -340,7 +340,7 @@ fn turning_preview_on_traces_the_changes_that_waited() { let mut app = traced_app(); let ctx = egui::Context::default(); crate::theme::install_fonts(&ctx); - let strokes = |app: &VectorcraftApp| target(app).2.map(|t| t["params"]["strokes"].clone()); + let strokes = |app: &VectorcraftApp| find_target(app).stored.map(|t| t["params"]["strokes"].clone()); let undo = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len(); let steps = undo(&app); click(&mut app, &ctx, "Preview"); @@ -357,7 +357,7 @@ fn turning_preview_on_traces_the_changes_that_waited() { // A change of view keeps the settings that wait, and Preview turned on with `ui.set` traces them. click(&mut app, &ctx, "Preview"); click(&mut app, &ctx, "Fills"); - assert_eq!(target(&app).2.unwrap()["params"]["fills"], json!(true)); + assert_eq!(find_target(&app).stored.unwrap()["params"]["fills"], json!(true)); click(&mut app, &ctx, "Tracing Result"); click(&mut app, &ctx, "Outlines"); assert_eq!(selected_trace(&app).map(|t| t.1), Some(TraceView::Outlines)); @@ -366,7 +366,7 @@ fn turning_preview_on_traces_the_changes_that_waited() { assert_eq!(pstate::(&ctx, "image-trace").params["fills"], json!(false), "the change still waits"); app.ui.image_trace_preview = true; frame(&mut app, &ctx, vec![]); - assert_eq!(target(&app).2.unwrap()["params"]["fills"], json!(false), "traced with the waiting change"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["fills"], json!(false), "traced with the waiting change"); assert_eq!(selected_trace(&app).map(|t| t.1), Some(TraceView::Outlines), "in the view chosen"); assert_eq!(undo(&app), steps + 3); } @@ -380,7 +380,7 @@ fn preview_turned_on_with_nothing_selected_traces_when_the_object_is_selected_ag let undo = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len(); click(&mut app, &ctx, "Preview"); click(&mut app, &ctx, "Strokes"); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(false), "the change waits"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(false), "the change waits"); app.run("select.none", json!({})).unwrap(); let steps = undo(&app); click(&mut app, &ctx, "Preview"); @@ -388,7 +388,7 @@ fn preview_turned_on_with_nothing_selected_traces_when_the_object_is_selected_ag assert_eq!(undo(&app), steps, "nothing to trace with nothing selected"); app.run("select.set", json!({"ids": [a.0]})).unwrap(); frame(&mut app, &ctx, vec![]); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(true), "traced with the change that waited"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(true), "traced with the change that waited"); assert_eq!(undo(&app), steps + 1); } @@ -401,7 +401,7 @@ fn settings_that_wait_stay_with_their_object() { app.run("edit.duplicate", json!({})).unwrap(); let b = first_selected(&app).unwrap().id; assert_ne!(a, b); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(false), "the copy has the same settings"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(false), "the copy has the same settings"); app.run("select.set", json!({"ids": [a.0]})).unwrap(); click(&mut app, &ctx, "Preview"); click(&mut app, &ctx, "Strokes"); @@ -410,7 +410,7 @@ fn settings_that_wait_stay_with_their_object() { frame(&mut app, &ctx, vec![]); assert_eq!(pstate::(&ctx, "image-trace").params["strokes"], json!(false), "the panel shows B's own settings"); click(&mut app, &ctx, "Trace"); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(false), "B is traced with its own settings"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(false), "B is traced with its own settings"); } #[test] @@ -434,7 +434,7 @@ fn settings_that_wait_come_back_when_their_object_is_selected_again() { assert_eq!(shown(&ctx), json!(true), "A's change still waits"); let steps = undo(&app); click(&mut app, &ctx, "Trace"); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(true), "A is traced with its change"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(true), "A is traced with its change"); assert_eq!(undo(&app), steps + 1); // Preview turned on while B is selected: A is traced with its change when it is selected again. let a = first_selected(&app).unwrap().id; @@ -446,7 +446,7 @@ fn settings_that_wait_come_back_when_their_object_is_selected_again() { let steps = undo(&app); app.run("select.set", json!({"ids": [a.0]})).unwrap(); frame(&mut app, &ctx, vec![]); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(false), "traced with the change that waited"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(false), "traced with the change that waited"); assert_eq!(undo(&app), steps + 1); frame(&mut app, &ctx, vec![]); assert_eq!(undo(&app), steps + 1, "traced once"); @@ -499,11 +499,11 @@ fn settings_that_wait_are_kept_when_a_plain_image_is_traced_in_between() { .unwrap(); let data = vectorcraft_format::base64_encode(&png); app.run("file.place", json!({"name": "plain.png", "dataBase64": data, "link": false})).unwrap(); - assert!(target(&app).1, "a plain image is selected"); + assert!(find_target(&app).is_image, "a plain image is selected"); frame(&mut app, &ctx, vec![]); click(&mut app, &ctx, "Strokes"); click(&mut app, &ctx, "Trace"); - assert_eq!(target(&app).2.unwrap()["params"]["strokes"], json!(false), "the image is traced with the panel's settings"); + assert_eq!(find_target(&app).stored.unwrap()["params"]["strokes"], json!(false), "the image is traced with the panel's settings"); app.run("select.set", json!({"ids": [a.0]})).unwrap(); frame(&mut app, &ctx, vec![]); assert_eq!(pstate::(&ctx, "image-trace").params["strokes"], json!(true), "A's change still waits"); @@ -532,7 +532,7 @@ fn settings_that_wait_are_dropped_when_their_object_changed_since() { app.run("select.set", json!({"ids": [a.0]})).unwrap(); frame(&mut app, &ctx, vec![]); let shown = pstate::(&ctx, "image-trace"); - assert_eq!(shown.params, target(&app).2.unwrap()["params"], "the panel shows A's settings as they are now"); + assert_eq!(shown.params, find_target(&app).stored.unwrap()["params"], "the panel shows A's settings as they are now"); assert!(shown.drafts.is_empty(), "the change is dropped"); } @@ -575,7 +575,7 @@ fn sketch_adjustment_sliders_retrace_on_release() { let rail = ctx.data(|d| d.get_temp::(egui::Id::unique(("trace-slider", label)))).unwrap(); let at = rail.left_center() + vec2(20.0, 0.0); let press = |pressed| Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Default::default() }; - let before = target(&app).2.unwrap()["params"][key].clone(); + let before = find_target(&app).stored.unwrap()["params"][key].clone(); let preset_before = pstate::(&ctx, "image-trace").preset; let steps = app.session.active().unwrap().history.undo.len(); frame(&mut app, &ctx, vec![Event::PointerMoved(at), press(true)]); @@ -584,7 +584,7 @@ fn sketch_adjustment_sliders_retrace_on_release() { assert_ne!(draft.params[key], before, "{label} updates while held"); assert_eq!(draft.preset, preset_before, "the preset row stays in place during {label}"); frame(&mut app, &ctx, vec![press(false)]); - let stored = target(&app).2.unwrap(); + let stored = find_target(&app).stored.unwrap(); assert_ne!( stored["params"][key], before, @@ -814,7 +814,7 @@ fn the_palette_shows_in_color_mode_and_traces_again() { let ctx = egui::Context::default(); crate::theme::install_fonts(&ctx); let has = |texts: &[(String, Rect)], s: &str| texts.iter().any(|(t, _)| t == s); - let palette = |app: &VectorcraftApp| target(app).2.map(|t| t["params"]["palette"].clone()); + let palette = |app: &VectorcraftApp| find_target(app).stored.map(|t| t["params"]["palette"].clone()); assert!(!has(&frame(&mut app, &ctx, vec![]), "Palette:"), "Black and White has no palette"); app.run("imageTrace.make", json!({"preset": "6 Colors"})).unwrap(); let texts = frame(&mut app, &ctx, vec![]); @@ -841,7 +841,7 @@ fn document_library_colors_lists_the_documents_color_groups() { let ctx = egui::Context::default(); crate::theme::install_fonts(&ctx); let has = |texts: &[(String, Rect)], s: &str| texts.iter().any(|(t, _)| t == s); - let stored = |app: &VectorcraftApp, key: &str| target(app).2.map(|t| t["params"][key].clone()); + let stored = |app: &VectorcraftApp, key: &str| find_target(app).stored.map(|t| t["params"][key].clone()); let texts = frame(&mut app, &ctx, vec![]); assert!(has(&texts, "Colors:") && has(&texts, "All"), "{texts:?}"); // The list holds All and the document's groups; a group traces again with its colors. @@ -850,7 +850,7 @@ fn document_library_colors_lists_the_documents_color_groups() { let steps = app.session.active().unwrap().history.undo.len(); click(&mut app, &ctx, " Brand"); assert_eq!(stored(&app, "colorGroup"), Some(json!("Brand"))); - assert_eq!(target(&app).2.unwrap()["preset"], "Custom"); + assert_eq!(find_target(&app).stored.unwrap()["preset"], "Custom"); assert_eq!(app.session.active().unwrap().history.undo.len(), steps + 1); assert!(has(&frame(&mut app, &ctx, vec![]), "Brand")); // All again. @@ -895,7 +895,7 @@ fn a_color_group_the_active_document_lacks_is_all() { crate::theme::install_fonts(&ctx); click(&mut app, &ctx, "All"); click(&mut app, &ctx, " Brand"); - assert_eq!(target(&app).2.map(|t| t["params"]["colorGroup"].clone()), Some(json!("Brand"))); + assert_eq!(find_target(&app).stored.map(|t| t["params"]["colorGroup"].clone()), Some(json!("Brand"))); let shows_brand = |app: &mut VectorcraftApp| frame(app, &ctx, vec![]).iter().any(|(t, _)| t == "Brand"); // Without the group the row shows All; undoing its removal shows it again. app.run("swatch.ungroup", json!({"name": "Brand"})).unwrap(); @@ -953,7 +953,7 @@ fn a_color_group_the_active_document_lacks_is_all() { assert!(!shows_brand(&mut app)); // Trace uses every document swatch. click(&mut app, &ctx, "Trace"); - let stored = target(&app).2.unwrap_or_else(|| panic!("not traced: {}", app.ui.status)); + let stored = find_target(&app).stored.unwrap_or_else(|| panic!("not traced: {}", app.ui.status)); assert!(stored["params"]["colorGroup"].as_str().is_none_or(str::is_empty), "{stored}"); assert_eq!(stored["params"]["palette"], "documentLibrary"); } @@ -963,7 +963,7 @@ fn create_strokes_traces_again_and_keeps_one_kind_on() { let mut app = traced_app(); let ctx = egui::Context::default(); crate::theme::install_fonts(&ctx); - let create = |app: &VectorcraftApp| target(app).2.map(|t| (t["params"]["fills"].clone(), t["params"]["strokes"].clone())); + let create = |app: &VectorcraftApp| find_target(app).stored.map(|t| (t["params"]["fills"].clone(), t["params"]["strokes"].clone())); let texts = frame(&mut app, &ctx, vec![]); for s in ["Create:", "Fills", "Strokes", "Stroke", "10"] { assert!(texts.iter().any(|(t, _)| t == s), "{s}: {texts:?}"); @@ -1444,7 +1444,7 @@ fn each_preset_button_traces_the_selected_object_again_with_its_preset() { assert_eq!(selected_trace(&app).unwrap().0, preset, "{label}"); assert_eq!(undo(&app), steps + 1, "{label} traces as one undo step"); let all = presets(&mut app, &ctx); - assert_eq!(target(&app).2.unwrap()["params"], find_preset(&all, preset).unwrap().1, "{label} traces with the preset's settings"); + assert_eq!(find_target(&app).stored.unwrap()["params"], find_preset(&all, preset).unwrap().1, "{label} traces with the preset's settings"); assert_eq!((shown_preset(&ctx), selected_preset_buttons(&ctx)), (preset.to_string(), vec![preset]), "{label}"); } // Undo returns to the object's previous preset, and the buttons follow it. @@ -1496,7 +1496,7 @@ fn a_preset_button_with_no_image_selected_changes_the_panel_settings_as_the_pres frame(&mut app, &ctx, vec![]); let by_button: TraceUi = pstate(&ctx, "image-trace"); assert_eq!(app.session.active().unwrap().history.undo.len(), steps, "nothing is traced"); - assert!(target(&app).2.is_none(), "no Image Trace object"); + assert!(find_target(&app).stored.is_none(), "no Image Trace object"); assert_eq!(selected_preset_buttons(&ctx), ["High Fidelity Photo"]); let mut menu_app = blank(); @@ -1542,7 +1542,7 @@ fn a_trace_off_the_ui_thread_is_adopted_when_it_lands() { crate::theme::install_fonts(&ctx); app.adopt_context(&ctx); let undo = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len(); - let strokes = |app: &VectorcraftApp| target(app).2.map(|t| t["params"]["strokes"].clone()); + let strokes = |app: &VectorcraftApp| find_target(app).stored.map(|t| t["params"]["strokes"].clone()); let steps = undo(&app); click(&mut app, &ctx, "Preview"); click(&mut app, &ctx, "Strokes"); @@ -1558,7 +1558,7 @@ fn a_trace_off_the_ui_thread_is_adopted_when_it_lands() { assert_eq!(strokes(&app), Some(json!(true))); let st: TraceUi = pstate(&ctx, "image-trace"); assert!(st.info.is_some(), "its counts show"); - assert_eq!(st.object, target_key(&app)); + assert_eq!(st.object, find_target(&app).object); assert!(st.drafts.is_empty(), "nothing waits for the object it replaced"); app.ui.image_trace_preview = true; frame(&mut app, &ctx, vec![]); @@ -1569,3 +1569,257 @@ fn a_trace_off_the_ui_thread_is_adopted_when_it_lands() { assert_eq!(strokes(&app), Some(json!(false)), "the object's own settings"); assert_eq!(undo(&app), steps); } + +/// The object Trace acts on as the panel found it before [`find_target`]: every selected object put +/// in paint order, the first image or Image Trace object among them taken, else the first selected +/// object. +fn target_node_sorting_everything(app: &VectorcraftApp) -> Option { + let st = app.session.active()?; + let traceable = |n: &&Node| is_trace(n) || matches!(n.kind, NodeKind::Image(_)); + st.selection.in_paint_order(&st.doc).into_iter().find_map(|id| st.doc.node(id).filter(traceable).cloned()).or_else(|| first_selected(app)) +} + +/// [`Target`] from [`target_node_sorting_everything`] and a scan of the whole selection for Image +/// Trace objects, as the panel read them on every frame before. +fn target_sorting_everything(app: &VectorcraftApp) -> Target { + let any_trace = app.session.active().is_some_and(|st| st.selection.objects.iter().any(|id| st.doc.node(*id).is_some_and(is_trace))); + let Some(n) = target_node_sorting_everything(app) else { return Target { any_trace, ..Target::default() } }; + Target { + object: app.session.active().map(|st| (st.uid, n.id)), + is_trace: is_trace(&n), + is_image: matches!(n.kind, NodeKind::Image(_)), + stored: n.extras().trace.as_deref().cloned(), + any_trace, + } +} + +/// One frame's lookups as the panel made them before [`target`]: the target, then the scan for +/// Image Trace objects, then the target again for its document and id. +fn frame_lookups_sorting_everything(app: &VectorcraftApp) -> Target { + let mut t = target_sorting_everything(app); + t.object = app.session.active().zip(target_node_sorting_everything(app)).map(|(st, n)| (st.uid, n.id)); + t +} + +/// Select `ids` as they are, repeats and ids the document lacks included, as a new revision. +fn select_as_is(app: &mut VectorcraftApp, ids: &[NodeId]) { + let st = app.session.active_mut().unwrap(); + st.selection.objects = ids.to_vec(); + st.revision += 1; +} + +/// A traced document with every kind of object the lookup tells apart, by name: the Image Trace +/// object (`trace`) and its image (`trace image`), plain images at the back (`back`) and front +/// (`front`) of the layer, a rectangle (`rect`), an image (`deep`) in a group (`inner`) in a group +/// (`outer`), a clipping group named Image Trace (`clip`) with an image (`clipped`), a hidden image +/// (`hidden`), a locked one (`locked`), and an image (`other`) and an Image Trace object (`other +/// trace`) on a second layer. +fn lookup_fixture() -> (VectorcraftApp, std::collections::HashMap<&'static str, NodeId>) { + let mut app = traced_app(); + let rect = app.run("shape.rectangle", json!({"x": 80, "y": 80, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + let st = app.session.active_mut().unwrap(); + let doc = Arc::make_mut(&mut st.doc); + let layer = doc.layers[0].id; + let trace: Node = doc.layers[0].children().unwrap().iter().find(|n| is_trace(n)).map(|n| (**n).clone()).unwrap(); + let image: Node = (*trace.children().unwrap()[0]).clone(); + let mut ids = std::collections::HashMap::from([("trace", trace.id), ("trace image", image.id), ("rect", NodeId(rect))]); + let back = doc.reid(&image); + ids.insert("back", doc.insert(Some(layer), 0, back).unwrap()); + let front = doc.reid(&image); + ids.insert("front", doc.insert(Some(layer), usize::MAX, front).unwrap()); + let deep = doc.reid(&image); + ids.insert("deep", deep.id); + let inner = Node::group(doc.alloc_id(), vec![Arc::new(deep)]); + ids.insert("inner", inner.id); + let outer = Node::group(doc.alloc_id(), vec![Arc::new(inner)]); + ids.insert("outer", doc.insert(Some(layer), 1, outer).unwrap()); + let clipped = doc.reid(&image); + ids.insert("clipped", clipped.id); + let mut clip = Node::new(doc.alloc_id(), NodeKind::Group { children: vec![Arc::new(clipped)], clip: true }); + clip.name = Some("Image Trace".into()); + ids.insert("clip", doc.insert(Some(layer), 2, clip).unwrap()); + let mut hidden = doc.reid(&image); + hidden.visible = false; + ids.insert("hidden", doc.insert(Some(layer), 3, hidden).unwrap()); + let mut locked = doc.reid(&image); + locked.locked = true; + ids.insert("locked", doc.insert(Some(layer), 4, locked).unwrap()); + let second = doc.add_layer(Some("Second")); + let other = doc.reid(&image); + ids.insert("other", doc.insert(Some(second), usize::MAX, other).unwrap()); + let other_trace = doc.reid(&trace); + ids.insert("other trace", doc.insert(Some(second), 0, other_trace).unwrap()); + st.revision += 1; + (app, ids) +} + +/// The panel's lookup gives what putting the whole selection in paint order gave, field for field, +/// for every kind of selection: images in either selection order, an Image Trace object with its +/// own image, a clipping group named Image Trace, nested groups, hidden and locked images, two +/// layers, repeated ids, ids the document lacks, and nothing selected. The result kept for a +/// revision follows each change of the selection, an edit, Undo and a switch of document. +#[test] +fn the_target_lookup_matches_sorting_the_whole_selection() { + let (mut app, ids) = lookup_fixture(); + let stale = NodeId(u64::MAX); + let cases: &[&[&str]] = &[ + &[], + &["rect"], + &["back", "front"], + &["front", "back"], + &["rect", "front"], + &["trace", "trace image"], + &["trace image", "trace"], + &["rect", "trace image"], + &["clip"], + &["clip", "clipped"], + &["rect", "clipped"], + &["outer"], + &["outer", "deep"], + &["inner", "rect"], + &["deep", "back"], + &["hidden", "locked"], + &["locked", "rect"], + &["other", "front"], + &["other trace", "trace"], + &["rect", "other trace", "other"], + &["front", "front"], + &["rect", "rect"], + &["stale"], + &["stale", "rect"], + &["stale", "front"], + &["rect", "stale"], + ]; + let mut every: Vec = ids.values().copied().collect(); + every.sort(); + every.push(stale); + let selections = cases.iter().map(|c| c.iter().map(|n| if *n == "stale" { stale } else { ids[n] }).collect::>()).chain([every]); + let ctx = egui::Context::default(); + let mut objects = std::collections::HashSet::new(); + for sel in selections { + select_as_is(&mut app, &sel); + let expected = target_sorting_everything(&app); + assert_eq!(frame_lookups_sorting_everything(&app), expected, "{sel:?}"); + assert_eq!(find_target(&app), expected, "{sel:?}"); + assert_eq!(target(&app, &ctx), expected, "looked up for the revision: {sel:?}"); + assert_eq!(target(&app, &ctx), expected, "kept for the revision: {sel:?}"); + objects.insert(expected.object.map(|(_, id)| id)); + } + assert!(objects.len() >= 8, "the cases reach many different objects: {objects:?}"); + + // An edit and Undo. + app.run("select.set", json!({"ids": [ids["rect"].0, ids["trace"].0]})).unwrap(); + let before = target(&app, &ctx); + assert_eq!(before.object.map(|o| o.1), Some(ids["trace"])); + app.run("imageTrace.make", json!({"preset": "Outline"})).unwrap(); + let traced = target(&app, &ctx); + assert_eq!(traced, target_sorting_everything(&app)); + assert_ne!(traced.stored, before.stored, "the edit changed the stored settings"); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(target(&app, &ctx), before, "Undo"); + + // Another document, then back once it is closed. + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + assert_eq!(target(&app, &ctx), target_sorting_everything(&app)); + assert_eq!(target(&app, &ctx).object, None, "nothing selected in the new document"); + app.run("file.close", json!({})).unwrap(); + assert_eq!(target(&app, &ctx), before, "the first document again"); + + // No document. + let none = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + assert_eq!(find_target(&none), target_sorting_everything(&none)); + assert_eq!(target(&none, &ctx), Target::default()); +} + +/// The panel and its menu look the object Trace acts on up once for each revision of the document, +/// however many frames show it, and again once the revision moves. +#[test] +fn the_panel_looks_its_target_up_once_per_document_revision() { + let mut app = traced_app(); + let trace_id = first_selected(&app).unwrap().id; + let rect = app.run("shape.rectangle", json!({"x": 80, "y": 80, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + app.run("select.set", json!({"ids": [rect, trace_id.0]})).unwrap(); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let menu_frame = |app: &mut VectorcraftApp| { + let raw = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(280.0, 700.0))), ..Default::default() }; + let mut out = ctx.run_ui(raw, |ui| menu(app, ui)); + out.textures_delta.clear(); + }; + let lookups = || TARGET_LOOKUPS.with(|n| n.get()); + let revision = |app: &VectorcraftApp| app.session.active().unwrap().revision; + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + let (start, at) = (lookups(), revision(&app)); + for _ in 0..3 { + frame(&mut app, &ctx, vec![]); + menu_frame(&mut app); + } + assert_eq!(revision(&app), at, "the frames change nothing"); + assert_eq!(lookups(), start, "the frames of one revision reuse its lookup"); + let uid = app.session.active().unwrap().uid; + assert_eq!(target(&app, &ctx).object, Some((uid, trace_id))); + + app.run("select.set", json!({"ids": [rect]})).unwrap(); + assert_eq!(target(&app, &ctx).object, Some((uid, NodeId(rect))), "a new selection is looked up"); + assert_eq!(target(&app, &ctx).object, Some((uid, NodeId(rect)))); + assert_eq!(lookups(), start + 1, "once"); +} + +/// Times one frame's lookups as the panel made them before (the whole selection put in paint order +/// twice, and scanned once more) against the kept result and against a new lookup, on 100,000 +/// selected paths in nested groups and one selected image. Run it with `cargo test --release -p +/// vectorcraft-ui-egui --lib image_trace_target_lookup_timing -- --ignored --nocapture`. +#[test] +#[ignore = "timing, run by hand"] +fn image_trace_target_lookup_timing() { + let mut app = traced_app(); + app.run("imageTrace.release", json!({})).unwrap(); + let image = first_selected(&app).unwrap().id; + let rect = app.run("shape.rectangle", json!({"x": 80, "y": 80, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + let st = app.session.active_mut().unwrap(); + let doc = Arc::make_mut(&mut st.doc); + let layer = doc.layers[0].id; + let path: Node = doc.node(NodeId(rect)).unwrap().clone(); + let mut selected = vec![]; + for _ in 0..100 { + let mut groups = vec![]; + for _ in 0..10 { + let paths: Vec> = (0..100).map(|_| Arc::new(doc.reid(&path))).collect(); + selected.extend(paths.iter().map(|p| p.id)); + groups.push(Arc::new(Node::group(doc.alloc_id(), paths))); + } + let group = Node::group(doc.alloc_id(), groups); + doc.insert(Some(layer), usize::MAX, group).unwrap(); + } + selected.push(image); + let count = selected.len(); + select_as_is(&mut app, &selected); + let expected = frame_lookups_sorting_everything(&app); + assert_eq!(expected.object.map(|o| o.1), Some(image)); + assert_eq!(find_target(&app), expected); + let ctx = egui::Context::default(); + assert_eq!(target(&app, &ctx), expected); + + let time = |f: &dyn Fn() -> Target, reps: u32| { + let t0 = std::time::Instant::now(); + for _ in 0..reps { + std::hint::black_box(f()); + } + t0.elapsed().as_secs_f64() * 1000.0 / f64::from(reps) + }; + let median = |mut v: Vec| { + v.sort_by(f64::total_cmp); + v[v.len() / 2] + }; + let (mut before, mut kept, mut lookup) = (vec![], vec![], vec![]); + for _ in 0..7 { + before.push(time(&|| frame_lookups_sorting_everything(&app), 10)); + kept.push(time(&|| target(&app, &ctx), 10_000)); + lookup.push(time(&|| find_target(&app), 10)); + } + println!("{count} selected objects, ms per frame, 7 runs"); + println!("whole selection in paint order (before): {before:.3?}, median {:.3}", median(before.clone())); + println!("kept result for the revision (after): {kept:.6?}, median {:.6}", median(kept.clone())); + println!("new lookup on a new revision (after): {lookup:.3?}, median {:.3}", median(lookup.clone())); +} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..a6c9e3c739 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1647,6 +1647,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Image Trace, Flat Logo working size:** Flat Logo traces at most 1024 px on a side; a larger decoded raster (the 64-megapixel copy for a bigger image) is averaged down in whole-number blocks first, and the trace's `warnings` name the size it was traced at and the image's own size, in place of the slower-trace and 64-megapixel notes; code-drawn 1024 and 1025 px tests in `crates/trace` and `crates/engine`. - **Image Trace, Flat Logo working size:** Flat Logo traces at most 1024 px on a side; a larger image is averaged down by a whole factor first, and the trace's `warnings` name the size it was traced at and the image's own size, in place of the slower-trace and 64-megapixel notes; code-drawn 1024 and 1025 px tests in `crates/trace` and `crates/engine`. - **Image Trace, Preview:** the Image Trace panel's Preview checkbox, before Trace, is on by default, and a setting change traces the selected Image Trace object again at once. Off, changes wait in the panel until Trace applies them as one undo step, or until Preview is turned on again. Changes stay with the object they were made for while another object is selected. When Preview is turned on with that object not selected, the object is traced with its changes when it is selected again. Preview is kept with the UI preferences, and Reset to Default leaves it. The `imageTrace.preview` command turns it on or off. +- **Image Trace, the panel's object looked up once per revision:** the Image Trace panel and its panel menu find the object Trace acts on once for each document revision and reuse it on later frames, and put only the selected images and Image Trace objects in paint order instead of every selected object. The panel acts on the same object with the same settings. With 100,000 selected paths in nested groups and one selected image, the earlier lookups took a median 120 ms per frame (wall-clock time on Linux, release build with thin LTO off, while other builds were running); the first frame after a change now takes 10 ms and later frames about 50 ns (`panels::image_trace::tests::the_target_lookup_matches_sorting_the_whole_selection`, `the_panel_looks_its_target_up_once_per_document_revision`, `image_trace_target_lookup_timing`). - **Image Trace, traces made off the UI thread stay with their document:** a trace made away from the command (`TraceRun`) applies only in the document it was made in. In another open document with the same image, object and settings, `imageTrace.make` and `imageTrace.makeAndExpand` drop it and trace that document's image, as one undo step (VectorCraft's own rule). Test: `a_trace_run_applies_only_in_its_own_document` in `crates/engine`. Scores and hours unchanged. - **Image Trace, a trace started before File › Revert does not apply after it:** the reverted document keeps its tab, but a trace prepared before the revert no longer applies, even when the restored image, object and settings are the same. A background trace that finishes after the revert changes nothing and the status bar says the document was reverted; a result handed to `imageTrace.make` or `imageTrace.makeAndExpand` is dropped and the restored image is traced again, as one undo step. Reverting another document, or a revert that fails, does not affect the trace (VectorCraft's own rule). Tests: `a_trace_run_prepared_before_a_revert_does_not_apply_after_it` in `crates/engine`, `a_trace_started_before_a_revert_does_not_apply` in `crates/ui-egui`. Scores and hours unchanged. - **Image Trace small contours:** closed fits too small to form an editable subpath retain their positioned outline, including holes. Source-generated island, hole/winding and stepped-region regressions cover Corners and Noise; defaults, parity scores and estimates are unchanged. From 51d09113f72df42fe6b2fc4ddfe912d0dd454aa2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:57:23 -0800 Subject: [PATCH 168/247] Fields: x multiplies in value fields, as * does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Value fields and length strings read `x`, `X` and `×` as a multiplication sign: `10x2` is 20, `2x3 mm` is 6 mm and `3cmx50%` is 1.5 cm. A lowercase `x` right after a `p` stays the `px` unit, so `2px x 3` is 6 px and `2px3` is not read. The change is in `Unit::parse` and `parse_number`, so every field that reads its text through them takes it. Each sign counts toward the 128-sign limit, which is checked before the text is copied. Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md. --- crates/doc/src/tests/units.rs | 42 +++++++++++++++++++++- crates/doc/src/units.rs | 51 ++++++++++++++++++++++++--- crates/ui-egui/src/tests/numfields.rs | 2 ++ crates/ui-egui/src/widgets.rs | 11 ++++++ docs/mcp.md | 5 +-- docs/target-app-parity.md | 1 + docs/ui-parity.md | 2 +- 7 files changed, 105 insertions(+), 9 deletions(-) diff --git a/crates/doc/src/tests/units.rs b/crates/doc/src/tests/units.rs index c53f60a227..9696bf54d0 100644 --- a/crates/doc/src/tests/units.rs +++ b/crates/doc/src/tests/units.rs @@ -94,11 +94,51 @@ fn a_very_long_expression_reads_as_nothing() { } } +/// `x`, `X` and `×` multiply as `*` does (#8435), units and percentages included; a lowercase `x` +/// right after a `p` stays the `px` unit. +#[test] +fn x_is_a_multiplication_sign() { + let (mm, cm) = (72.0 / 25.4, 72.0 / 2.54); + for (u, s, want) in [ + (Unit::Points, "10x2", 20.0), + (Unit::Points, "10 x 2", 20.0), + (Unit::Points, "10X2", 20.0), + (Unit::Points, "10×2", 20.0), + (Unit::Points, "10x-2", -20.0), + (Unit::Points, "10/2x5", 25.0), + (Unit::Points, "1+2x3", 7.0), + (Unit::Millimeters, "2x3 mm", 6.0 * mm), + (Unit::Points, "2x3mm", 6.0 * mm), + (Unit::Points, "3mm x 2", 6.0 * mm), + (Unit::Centimeters, "3cmx50%", 1.5 * cm), + (Unit::Points, "2p x 2", 48.0), + (Unit::Points, "10px", 10.0), + (Unit::Points, "2px x 3", 6.0), + (Unit::Points, "2pxx3", 6.0), + (Unit::Millimeters, "4x3 px", 12.0), + ] { + let got = u.parse(s).unwrap_or_else(|| panic!("{u:?} can't read `{s}`")); + assert!((got - want).abs() < 1e-9, "{u:?}: `{s}` → {got}, want {want}"); + } + for s in ["x", "x2", "5x", "5 x x 2", "xx", "2px3"] { + assert_eq!(Unit::Points.parse(s), None, "{s}"); + } + assert_eq!(crate::parse_number("45x2"), Some(90.0)); + assert_eq!(crate::parse_number(" 45 X 2 "), Some(90.0)); + assert_eq!(crate::parse_number("45×2"), Some(90.0)); + assert_eq!(crate::parse_number("90x-1"), Some(-90.0)); + assert_eq!(crate::parse_number("x"), None); + // Each sign counts toward the 128-sign limit as a `*` would. + assert_eq!(Unit::Points.parse(&format!("1{}", "x1".repeat(128))), Some(1.0)); + assert_eq!(Unit::Points.parse(&format!("1{}", "x1".repeat(129))), None); + assert_eq!(crate::parse_number(&format!("1{}", "×1".repeat(129))), None); +} + proptest! { /// Field text made of digits, operators, `%`, spaces and unit letters reads as a finite value /// or as nothing and does not panic. #[test] - fn arithmetic_text_reads_as_a_finite_value_or_nothing(s in "[0-9.+*/% ptxinmcfyd-]{0,24}") { + fn arithmetic_text_reads_as_a_finite_value_or_nothing(s in "[0-9.+*/% ptxXinmcfyd×-]{0,24}") { for u in Unit::ALL { if let Some(v) = u.parse(&s) { prop_assert!(v.is_finite(), "{u:?}: `{s}` → {v}"); diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index 5fabfece65..e3bd8520a7 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -151,18 +151,31 @@ impl Unit { /// Parse `12`, `12pt`, `1in`, `3 mm`, `2p6` (picas+points), `6q` (Q) and `6h` (Ha), simple /// `+ - * /` arithmetic. /// + /// `x`, `X` and `×` multiply as `*` does (`10x2` is 20, `2x3 mm` is 6 mm), except a lowercase + /// `x` right after a `p`, which is the `px` suffix (`2px x 3` is 6 px, and `2px3` reads as + /// nothing; write `2p x 3` for picas). + /// /// A unit after a `*` or `/` operand measures the whole expression (`1080/2 px` is 540 px), so /// math typed before a field's unit suffix works. After `*` or `/`, a percentage scales the term /// before it (`3cm*50%` is 1.5 cm, `3cm/50%` is 6 cm). After `+` or `-`, it adds or takes away /// that share of everything before it (`50pt+25%` is 62.5 pt, `100pt+20pt-50%` is 60 pt). A /// percentage on its own (`50%`) reads as nothing. /// - /// Text with more than 128 `+ - * /` signs reads as nothing. + /// Text with more than 128 `+ - * /` signs (a multiplication sign counts as `*`) reads as nothing. pub fn parse(self, s: &str) -> Option { - if s.chars().filter(|c| matches!(c, '+' | '-' | '*' | '/')).count() > MAX_MEASURE_OPERATORS { + let mut prev = None; + let operators = s + .chars() + .filter(|&c| { + let operator = matches!(c, '+' | '-' | '*' | '/') || is_times(c, prev); + prev = Some(c); + operator + }) + .count(); + if operators > MAX_MEASURE_OPERATORS { return None; } - parse_measure(s, self).filter(|v| v.is_finite()) + parse_measure(×_as_asterisks(s), self).filter(|v| v.is_finite()) } /// The value naming this unit in the Units preferences (`points`, `millimeters`, /// `feetInches`). @@ -215,6 +228,33 @@ impl Unit { /// The most `+ - * /` signs [`Unit::parse`] reads in one text. const MAX_MEASURE_OPERATORS: usize = 128; +/// Is `c`, after `prev`, a multiplication sign typed as `x`, `X` or `×`? A lowercase `x` right +/// after a `p` is the `px` suffix (`2px x 3`), also where a number follows it (`2px3`). +fn is_times(c: char, prev: Option) -> bool { + matches!(c, 'X' | '×') || (c == 'x' && prev != Some('p')) +} + +/// `s` with each multiplication sign ([`is_times`]) written as `*` (`10 x 2` is `10 * 2`); text +/// without one is not copied. +fn times_as_asterisks(s: &str) -> std::borrow::Cow<'_, str> { + let mut prev = None; + let any = s.chars().any(|c| { + let times = is_times(c, prev); + prev = Some(c); + times + }); + if !any { + return s.into(); + } + let mut out = String::with_capacity(s.len()); + let mut prev = None; + for c in s.chars() { + out.push(if is_times(c, prev) { '*' } else { c }); + prev = Some(c); + } + out.into() +} + fn parse_measure(s: &str, default: Unit) -> Option { let s = s.trim(); // Simple arithmetic on the right (Illustrator fields accept "10+5", "100/2", "3in*2"). @@ -317,9 +357,10 @@ fn percent(s: &str) -> Option { } /// A unitless field value (percent, degrees, counts) with the same `+ - * /` arithmetic as -/// [`Unit::parse`] (`45*2`, `100/3`); text other than digits, `.` and operators reads as nothing. +/// [`Unit::parse`] (`45*2`, `45x2`, `100/3`); text other than digits, `.` and operators reads as +/// nothing. pub fn parse_number(s: &str) -> Option { - if !s.chars().all(|c| c.is_ascii_digit() || " .+-*/".contains(c)) { + if !s.chars().all(|c| c.is_ascii_digit() || " .+-*/xX×".contains(c)) { return None; } // A leading `+` is a sign (`+5`), as a plain number read it. diff --git a/crates/ui-egui/src/tests/numfields.rs b/crates/ui-egui/src/tests/numfields.rs index 689a0e3a04..3b7c2d157e 100644 --- a/crates/ui-egui/src/tests/numfields.rs +++ b/crates/ui-egui/src/tests/numfields.rs @@ -778,6 +778,8 @@ fn bare_numbers_in_picas_fields_are_points_when_the_preference_says_so() { assert_eq!(typed(&mut f, pc, "2p6"), Some(30.0), "picas and points as typed"); assert_eq!(typed(&mut f, pc, "1in"), Some(72.0), "a typed unit wins"); assert_eq!(typed(&mut f, pc, "10+5"), Some(15.0), "arithmetic in points too"); + assert_eq!(typed(&mut f, pc, "10x2"), Some(20.0), "x multiplies (#8435)"); + assert_eq!(typed(&mut f, mm, "2 x 3"), Some(mm.to_pt(6.0)), "x multiplies in millimetres"); assert_eq!(typed(&mut f, mm, "12"), Some(mm.to_pt(12.0)), "a millimetre field keeps millimetres"); widgets::set_bare_numbers_are_points(&f.ctx, false); assert_eq!(typed(&mut f, pc, "12"), Some(pc.to_pt(12.0)), "off: picas"); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index fb291b8525..092d3d1be5 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -664,6 +664,17 @@ mod field_number_tests { assert_eq!(field_number("(0,125)", "", true), Some(0.125)); assert_eq!(field_number("12,5%", "%", false), Some(12.5)); } + + /// `x` multiplies in a unitless field as `*` does (#8435), next to a suffix, `%` and a decimal + /// comma too. + #[test] + fn x_multiplies_in_a_unitless_field() { + assert_eq!(field_number("45x2", "", false), Some(90.0)); + assert_eq!(field_number("45x2°", "°", false), Some(90.0)); + assert_eq!(field_number("50% x 2", "%", false), Some(100.0)); + assert_eq!(field_number("1,5x2", "", false), Some(3.0)); + assert_eq!(field_number("(10x2)", "", true), Some(20.0)); + } } #[cfg(test)] diff --git a/docs/mcp.md b/docs/mcp.md index 4c1b661f42..2a3ca1cf3b 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7310,8 +7310,9 @@ report warn about it). Commands take and return lengths in points (the distances of `object.path.offsetPath`, `object.path.simplify`, `object.path.splitIntoGrid` and `text.setStyle` `size`/`leading` also take a string with a unit, `"5 mm"`). A length string takes the same arithmetic as the desktop app's fields, where `%` is a share of the value before it: -`"200mm*50%"` is 100 mm and `"50pt+25%"` is 62.5 pt. A length string with more than 128 `+ - * /` signs is not read -as a length. The units +`"200mm*50%"` is 100 mm and `"50pt+25%"` is 62.5 pt. `x`, `X` and `×` multiply as `*` does (`"2x3 mm"` is 6 mm), +except a lowercase `x` right after a `p`, which is the `px` suffix (`"2px3"` is not read; `"2p x 3"` is 6 picas). +A length string with more than 128 `+ - * /` signs (each multiplication sign counts) is not read as a length. The units only change what the UI shows and how it reads typed numbers. Preferences ▸ Units has four: General (rulers, positions and sizes, the Info panel, dialog distances, canvas measurement labels), Stroke (weights, dashes), Type (font size, leading, baseline shift) and East Asian Type (no field uses it yet). General is the active document's units diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..dab9b3236b 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -967,6 +967,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - With automation read roots in force, `svgInteractivity.info`, `addFile` and `removeFile`, the JavaScript Files dialog in a frame a request drives and `ui_inspect`'s selected file name a linked JavaScript file outside the roots by its file name alone, as `document.json` does; `removeFile` unlinks it by that name and refuses a name that fits more than one linked file (`tests/interactivity.rs`). - Numeric fields keep the pointer's pressed character as the text-drag start when movement exceeds the click threshold (#1326); a completed focus click selects the unit too. Pixel/point, plain and optional fields are regression-tested in both directions, before/after focus, with replacement text; keyboard focus, double-click, arrows and wheel keep their prior behavior. Native egui input confirms partial replacement gives 17 px instead of 700 px, one Undo/Redo, window captures and an exact saved-document read in a separate CLI process. A focus click released more than 1 pt from its press keeps the caret, and a tap within 1 pt still selects all (#6659; short-drag and jitter-tap regressions in `tests/numfields.rs`). - Unit fields and length strings take `%` in arithmetic: `3cm*50%` reads as 1.5 cm, and `50pt+25%` reads as 62.5 pt. + - Value fields and length strings read `x` as a multiplication sign, as they read `*` (#8435; the help's "Calculate values in a panel or dialog box" lists `x` for multiplication: [help PDF, archived](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf)). `X` and `×` also multiply; that is VectorCraft's own choice. `10x2` reads as 20 and `2x3 mm` as 6 mm. A lowercase `x` right after a `p` stays the `px` unit (`2px x 3` is 6 px, and `2px3` is not read). Tests: `x_is_a_multiplication_sign` in `crates/doc/src/tests/units.rs`. - The contextual task bar's handle drags it anywhere on the canvas (kept whole on it as the window resizes); unpinned it keeps that offset as it follows the selection, and its More Options menu hides it, pins its position across selection changes (`window.taskBar.pin`), resets it under the selection (`window.taskBar.reset`) and shows the Properties panel. As in Illustrator the position isn't kept across launches. Not done: the bar's variants for other tools (only the selection tools, the Type tools, the basic shape tools, the Smooth tool and the Artboard tool show it). - A click on another object moves the contextual task bar under it without hiding it for the press; it gives way only to a drag (#4681). - With one image selected, the contextual task bar offers Image Trace, which traces the image at once with the Default preset (the Image Trace panel is left as it was), and Crop Image; with an Image Trace object it offers Expand, which keeps only the traced paths. This follows Illustrator's bar: for a selected image it includes Image Trace, Retype and Crop Image, and traced artwork can be expanded from it ([Contextual Task Bar announcement](https://community.adobe.com/announcements-651/contextual-task-bar-in-illustrator-2025-quick-actions-when-you-need-them-1546580)). Offset Path and Simplify, which don't apply to an image, aren't offered for one. Not done: Retype, which the app doesn't have. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 4182189c4a..6f6c9fcffa 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -308,7 +308,7 @@ tools, never checked side by side) isn't captured row by row. | Fields commit what was typed on a click away or a move to another field, as Enter does; Escape discards it | done | #1787 | | Number fields: Up/Down step, Shift ×10, Cmd/Ctrl ÷10, wheel over a hovered field without a click; steps, the wheel and label scrubs stop at the field's bounds (a stroke weight at 0, a miter limit at 1) | done | Shift+arrow in the Stroke weight field doesn't step by 10 (#991); bounds #3370. The field takes the wheel only when the pointer was moved onto it after the field last moved or was covered by a window or overlay, and the wheel stream began there; a stream that began elsewhere stays there until 0.5 s pass with no wheel input or the pointer is pressed on a field, so a panel scrolled under a still pointer keeps scrolling past the field. This rule and its 0.5 s are VectorCraft's choices. | | Numeric spinner arrows step once on a click and keep repeating while held with the mouse | done | #6307; headless test `a_held_spinner_arrow_repeats` holds past egui's click timeout and checks release. | -| Arithmetic in fields (`+ - * /`, and `%` of the value before it: `3cm*50%`, `50pt+25%`) and unit suffixes (`3 mm`, `1in`, `2p6`) | done | `Unit::parse`; mixed units in one expression not verified | +| Arithmetic in fields (`+ - * /`, `x`, `X` or `×` for `*`, and `%` of the value before it: `3cm*50%`, `50pt+25%`) and unit suffixes (`3 mm`, `1in`, `2p6`) | done | `Unit::parse`; mixed units in one expression not verified | | Numeric fields: focus click selects the whole value; dragging selects from the pressed character | partial | #1326; select-all waits for click release; px/pt/plain/optional fields, both directions and replacement text tested; native API input, 17 px partial replacement, Undo/Redo, saved-file round trip and screenshots verified; Tab, double-click, arrows and wheel preserved; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all (#6659) | | Units: pt, pc, in, mm, cm, px, ft-in, m, yd, ft; General/Stroke/Type units | done | units preference reverting to points on SVG output reported (#864). A file that records no units (PDF, EPS or `.ai` without ruler units, raster images, metafiles, Affinity files) opens and reverts in General units; native, SVG and DXF files and a `.ai` or EPS with ruler units keep theirs, as a [Community Expert's answer](https://community.adobe.com/questions-652/change-units-from-points-to-inches-won-t-stick-765372) describes (#5820) | | Units › East Asian Type (Q and Ha) | done | #394: `unitsAsianType` offers every unit and Q and Ha, a quarter of a millimetre each ([Scripting Guide's Measurement Units](https://ai-scripting.docsforadobe.dev/scripting/measurementUnits/): 0.709 pt per Q; [InDesign's unit notation](https://helpx.adobe.com/in/indesign/desktop/layout-and-grid-tools/rulers-and-measure-tools/change-ruler-measurement-units.html): `q`, `h`); only it lists Q and Ha. The public pages do not say which fields use it, so no field uses it yet and that waits for a source. Tests `q_and_ha_are_a_quarter_millimetre`, `east_asian_type_unit_*` | From 375b2a23e1f13374f346b7aa735376515fdec6c6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:14:05 -0800 Subject: [PATCH 169/247] Preview Bristle brush tip for rotation-capable pens --- crates/tools/src/draw2/gesture.rs | 44 +++++++++++++-- crates/tools/src/draw2/gesture/tests.rs | 71 +++++++++++++++++++++++++ crates/ui-egui/src/canvas/input.rs | 2 +- crates/ui-egui/src/canvas/tests.rs | 29 ++++++++++ docs/target-app-parity.md | 1 + 5 files changed, 142 insertions(+), 5 deletions(-) diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rs index 502fd16dbd..c753745f3a 100644 --- a/crates/tools/src/draw2/gesture.rs +++ b/crates/tools/src/draw2/gesture.rs @@ -37,7 +37,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; use serde_json::{Value, json}; -use vectorcraft_brush::{Calligraphic, Variation}; +use vectorcraft_brush::{BristleShape, BrushKind, Calligraphic, Variation}; use vectorcraft_doc::{NodeId, NodeKind}; use vectorcraft_geom::{Affine, BezPath, FillRule, ParamCurve, PathData, PathSeg, Point, Rect, Vec2, shapes}; use vectorcraft_pathops as po; @@ -200,6 +200,9 @@ pub struct GestureTool { /// Where the Blob Brush's or the Eraser's tip outline shows: the pointer over the canvas, /// unless Cmd/Ctrl lends a selection tool or Alt the Smooth tool. tip_at: Option, + /// The last rotation-capable pen over the Paintbrush's Bristle tip; a mouse or a pen without + /// barrel rotation has no tip annotator. + bristle_pen: Option<(PenPose, f64)>, /// A pen pressed less than fully at a point of the stroke whose pressure is kept. light: bool, /// Which way the pen leaned at the last point of the stroke where it leaned 1° or more from @@ -899,6 +902,7 @@ impl GestureTool { snap: DrawSnap::default(), pressed: Point::ZERO, tip_at: None, + bristle_pen: None, light: false, bearing: None, bearings: vec![], @@ -1088,12 +1092,46 @@ impl GestureTool { p } + fn pointer_tip(&mut self, cx: &ToolContext, ev: &PointerEvent) { + if self.varies_size() { + self.tip_at = (!ev.mods.cmd && !self.blob_alt_smooths(ev.mods)).then_some(ev.pos); + } else if self.id == "paintbrush" { + self.bristle_pen = + ev.pen.filter(|pen| pen.rotation.is_some()).map(|pen| (pen, if ev.kind == PointerKind::Move { 0.5 } else { f64::from(ev.pressure) })); + let borrows_smooth = !self.active && ev.mods.alt && has_selected_smooth_path(cx); + self.tip_at = self.bristle_pen.filter(|_| !ev.mods.cmd && !borrows_smooth).map(|_| ev.pos); + } + } + /// The Blob Brush's or the Eraser's tip at the pointer, before and while painting: its outline /// `size` across at its angle and roundness (the Eraser's as the pen varies them while it /// erases, [`Self::tip_now`]), at the zoom, black on a white halo so it reads on /// any art. Precise cursors show only the crosshair, and smoothing shows no tip. fn tip_outline(&self, cx: &ToolContext) -> Vec { let Some(at) = self.tip_at.filter(|_| !self.smoothing && !cx.precise_cursors) else { return vec![] }; + if self.id == "paintbrush" { + let Some((pose, pressure)) = self.bristle_pen else { return vec![] }; + let Some(name) = vectorcraft_brush::current(cx.doc) else { return vec![] }; + let Some(brush) = vectorcraft_brush::find(cx.doc, &name) else { return vec![] }; + let BrushKind::Bristle(bristle) = brush.kind else { return vec![] }; + let [pressure, tilt, bearing, rotation] = super::pen_controls(pressure, Some(pose), super::pen_bearing(pose)); + let size = bristle.size.max(0.1) * cx.paint.stroke_width.max(0.0) * (0.5 + pressure) * (1.25 - 0.5 * tilt); + if size <= 0.0 { + return vec![]; + } + let roundness = match bristle.shape { + BristleShape::RoundFan | BristleShape::FlatFan => 0.25, + BristleShape::FlatPoint | BristleShape::FlatBlunt | BristleShape::FlatCurve | BristleShape::FlatAngle => 0.45, + _ => 0.8, + }; + let angle = std::f64::consts::TAU * (bearing + rotation - 1.0); + let circle = kurbo::Shape::to_path(&kurbo::Circle::new(Point::ORIGIN, size / 2.0), size.max(0.1) * 0.05); + let path = Affine::translate(at.to_vec2()) * Affine::rotate(-angle) * Affine::scale_non_uniform(1.0, roundness) * circle; + return vec![ + Overlay::Path { path: path.clone(), color: [0xff, 0xff, 0xff], width: 3.0, dashed: false }, + Overlay::Path { path, color: [0, 0, 0], width: 1.0, dashed: false }, + ]; + } let [angle, roundness, size] = self.tip_now(); let tip = if self.id == "blobBrush" { blob_tip(angle, roundness) } else { eraser_tip(angle, roundness) }; let r = size / 2.0; @@ -1587,9 +1625,7 @@ impl Tool for GestureTool { } fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec { let p = ev.pos; - if self.varies_size() { - self.tip_at = (!ev.mods.cmd && !self.blob_alt_smooths(ev.mods)).then_some(p); - } + self.pointer_tip(cx, ev); if let Some(out) = self.marquee_pointer(cx, ev) { return out; } diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 550e7f9d32..5370b43825 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -3043,6 +3043,77 @@ fn the_blob_brush_and_the_eraser_show_their_tip_at_the_pointer() { } } +/// A rotation-capable pen shows the current Bristle brush's tip before and during a Paintbrush +/// stroke. A mouse, a pen without rotation, precise cursors and a borrowed selection tool do not. +#[test] +fn bristle_tip_annotator_follows_a_rotation_capable_pen() { + let (mut d, id) = doc_with_rect(); + d.unknown.insert(vectorcraft_brush::CURRENT_KEY.into(), json!("Bristle Flat Fan")); + let s = Selection::default(); + let p = paint(); + let view = cx(&d, &s, &p); + let bounds = |t: &GestureTool, cx: &ToolContext| { + let overlays = t.overlays(cx); + let Some(Overlay::Path { path, color: [0, 0, 0], width: 1.0, .. }) = overlays.last() else { return None }; + assert!(matches!(overlays.get(overlays.len() - 2), Some(Overlay::Path { color: [0xff, 0xff, 0xff], width: 3.0, .. }))); + Some(vectorcraft_geom::Shape::bounding_box(path)) + }; + let mut tool = GestureTool::new("paintbrush"); + let at = + |rotation| PointerEvent { pen: Some(PenPose { tilt: Some([30.0, 0.0]), rotation }), ..PointerEvent::new(PointerKind::Move, 100.0, 50.0) }; + assert!(bounds(&tool, &view).is_none()); + tool.pointer(&view, &PointerEvent::new(PointerKind::Move, 100.0, 50.0)); + assert!(bounds(&tool, &view).is_none(), "mouse"); + tool.pointer(&view, &at(None)); + assert!(bounds(&tool, &view).is_none(), "pen without rotation"); + tool.pointer(&view, &at(Some(0.0))); + let horizontal = bounds(&tool, &view).expect("rotating pen shows a tip"); + let mut selected = Selection::default(); + selected.set([id]); + let selected_view = cx(&d, &selected, &p); + tool.pointer(&selected_view, &at(Some(0.0)).with_mods(Mods { alt: true, ..Default::default() })); + assert!(bounds(&tool, &selected_view).is_none(), "Alt borrows Smooth for a selected path"); + tool.pointer(&view, &at(Some(0.0))); + let mut wider_paint = p.clone(); + wider_paint.stroke_width = 10.0; + let wider_view = cx(&d, &s, &wider_paint); + let wider = bounds(&tool, &wider_view).expect("stroke width scales the tip"); + assert!((wider.width() - horizontal.width() * 10.0).abs() < 1e-6, "{horizontal:?}, {wider:?}"); + wider_paint.stroke_width = 0.0; + assert!(bounds(&tool, &cx(&d, &s, &wider_paint)).is_none(), "a zero-width stroke has no tip"); + tool.pointer(&view, &at(Some(90.0))); + let vertical = bounds(&tool, &view).expect("tip turns with the barrel"); + assert!(horizontal.width() > horizontal.height() * 2.0, "{horizontal:?}"); + assert!(vertical.height() > vertical.width() * 2.0, "{vertical:?}"); + let mut light = at(Some(0.0)); + light.kind = PointerKind::Down; + light.pressure = 0.1; + tool.pointer(&view, &light); + let light_tip = bounds(&tool, &view).expect("light pressure shows a smaller tip"); + let mut heavy = light; + heavy.kind = PointerKind::Drag; + heavy.pressure = 0.9; + tool.pointer(&view, &heavy); + let heavy_tip = bounds(&tool, &view).expect("heavy pressure shows a larger tip"); + assert!(heavy_tip.width() > light_tip.width() * 1.5, "{light_tip:?}, {heavy_tip:?}"); + let mut release = heavy; + release.kind = PointerKind::Up; + tool.pointer(&view, &release); + let precise = ToolContext { precise_cursors: true, ..cx(&d, &s, &p) }; + assert!(bounds(&tool, &precise).is_none()); + tool.pointer(&view, &at(Some(0.0)).with_mods(Mods { cmd: true, ..Default::default() })); + assert!(bounds(&tool, &view).is_none(), "selection tool borrowed by Cmd"); + tool.pointer(&view, &at(Some(0.0))); + tool.hover_ended(&view); + assert!(bounds(&tool, &view).is_none(), "leaving the canvas"); + + let (mut d, _) = doc_with_rect(); + d.unknown.insert(vectorcraft_brush::CURRENT_KEY.into(), json!("3 pt. Round")); + let calligraphic = cx(&d, &s, &p); + tool.pointer(&calligraphic, &at(Some(0.0))); + assert!(bounds(&tool, &calligraphic).is_none(), "other brush types keep their cursor"); +} + /// Eraser Tool Options' Angle, Roundness and Size variation menus: the Eraser keeps each mode and /// Variation, the release sends them with the pen's readings along the drag, and while it erases /// its tip outline at the pointer takes the angle, roundness and size the pen gives there. The Blob diff --git a/crates/ui-egui/src/canvas/input.rs b/crates/ui-egui/src/canvas/input.rs index d811ad3bac..f711d4cb36 100644 --- a/crates/ui-egui/src/canvas/input.rs +++ b/crates/ui-egui/src/canvas/input.rs @@ -145,7 +145,7 @@ pub(super) fn handle_input(app: &mut VectorcraftApp, ui: &Ui, resp: &egui::Respo mods: mods(m, space), backquote: ui.input(|i| i.key_down(egui::Key::Backtick)), pressure: 1.0, - pen: None, + pen: pen_pose(app, &xf), }; dispatch(app, &ev, view); } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 34d0777c51..91236c86bb 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -11004,6 +11004,35 @@ fn the_tip_brings_back_the_perspective_grid_tool_without_showing_the_grid() { assert!(!visible(&app), "the grid stays hidden"); } +/// The native pen feed's barrel rotation reaches the Paintbrush during canvas hover, before any +/// stroke begins. +#[test] +fn bristle_pen_tip_reaches_the_canvas_before_a_press() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + let feed = StylusFeed::default(); + app.services.stylus = Some(feed.clone()); + app.session.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + app.session.execute("brush.setCurrent", &json!({"name": "Bristle Flat Fan"})).unwrap(); + app.select_tool("paintbrush"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let at = app.canvas_rect.unwrap().center(); + let tip = |app: &mut VectorcraftApp| { + app.session.overlays(app.view_info()).into_iter().find_map(|o| match o { + vectorcraft_tools::Overlay::Path { path, color: [0, 0, 0], width: 1.0, .. } => Some(path.bounding_box()), + _ => None, + }) + }; + feed.set_sample(Some(crate::stylus::PenSample { + pressure: 0.0, + pose: PenPose { rotation: Some(0.0), ..Default::default() }, + ..Default::default() + })); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at)]); + let horizontal = tip(&mut app).expect("hovering pen shows its brush tip"); + assert!(horizontal.width() > horizontal.height() * 2.0, "{horizontal:?}"); +} + /// #764: the pen's tilt and barrel rotation in the host's feed reach the Paintbrush's points, /// the tilt turned onto the page when the view is rotated; a mouse's points carry neither. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..4fe782d668 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1806,6 +1806,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Scatter, Art and Pattern Brush Options have the Tips button for Colorization that the [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) page (archived copy) describes, beside Method. It opens Colorization Tips, which shows each method's name and what it does beside a sample of the brush, as OK would make it, painted with that method on a blue stroke; Hue Shift's sample uses the dialog's Key Color. `ui.dialog.set {field: "tips", value: true}` opens it. Screen readers name the button, the popover and each sample. Hue Shift set by `brush.new` or `brush.options` without a key color takes the color the art's fills and strokes use most, as Brush Options already offers it, following the Brushes page, where the key color defaults to the color that stands out most in the art (). The page does not state how prominence is measured. Counting the fills and strokes that use each solid color, with the first one found winning a tie and black for art with no solid color, is VectorCraft's own rule. A `brush.options` edit that gives only the method keeps the brush's key color, and one that gives only an art brush's start guide keeps its end guide. Evidence: `tests_brushsym::hue_shift_without_a_key_takes_the_most_used_art_color`, `tests_brushsym::art_brush_options_keep_the_scale_fields_an_edit_leaves_out`. Bristle Brush Options and `brush.new` take a bristle brush name of at most 31 characters, as the Brushes page states for the Bristle Brush Options. The Name field stops taking characters at 31, and `brush.new` and `brush.options` refuse a longer new name with an error that names the limit. The page does not say how the limit counts characters or what happens to longer names already saved; counting characters and the number added to a taken name, keeping longer saved names, and leaving `brush.duplicate` unlimited are VectorCraft's own rules. A bristle brush that a document or a saved file already holds under a longer name keeps it, and the other brush types take a name of any length. Test: `bristle_brush_names_have_at_most_31_characters` in `tests/brushsym.rs`. Public reference: [Brushes](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/brushes.html) (archived copy). + With a Bristle brush selected, the Paintbrush shows a tip outline at a rotation-capable pen's pointer: its width responds to pressure and the stroke weight, its long axis follows the pen's barrel rotation and bearing, and its aspect follows the selected tip shape. Mouse input and a pen without barrel rotation keep the regular Paintbrush cursor; Precise Cursors, the borrowed selection tool, smoothing and leaving the canvas hide the outline. This is VectorCraft's own approximate tip preview; the [Brushes guide](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=189) documents when a Bristle brush tip cursor appears, but does not define its geometry or pressure mapping. Tests: `draw2::gesture::tests::bristle_tip_annotator_follows_a_rotation_capable_pen` (vectorcraft-tools) and `canvas::tests::bristle_pen_tip_reaches_the_canvas_before_a_press` (vectorcraft-ui-egui). In the Brushes panel, Shift-click selects a range of brushes and Ctrl/Cmd-click adds or removes one. Delete Brush and Duplicate Brush then act on all of them (`brush.delete {names}`, `brush.duplicate {names}`). The Brushes panel's Delete Brush button and panel menu item ask "Delete the selected brushes?" with Yes and No when none of the brushes is in use. Alt-click (Option-click on macOS) on the button deletes them without asking, as the [Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) page lists for panel deletion outside the Layers panel (archived copy). When a stroke uses one of the brushes, the button, Alt-click and the menu item all ask with Remove Strokes and Cancel; Remove Strokes deletes the brushes and the strokes that used them become plain strokes. Tests: `panels::brushes::tests`, `dialogs::brush_delete::tests`. Document Info has a Brushes category after Graphic Styles. It lists the names and types of the brushes applied to the artwork, as the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes, or with Selection Only the brushes that the selected objects' strokes use. The Document Info report and Package's report list them too (`document.info {category: "brushes"}`, `brushNames`, `brushes`). Listing each brush once, leaving out the Brushes panel's brushes no art uses (`panelBrushNames` lists the panel's brushes), hidden strokes, strokes at an opacity of 0, strokes with no paint or width, guides, paths with no segment, type that draws no characters, a group's or layer's own strokes, a compound path member's own strokes and an image's strokes without a shape, and listing a brush the panel does not hold as missing, are VectorCraft's own rules. Tests: `cmd::docinfo::tests::info_lists_the_brushes` and `info_brushes_skip_undrawn_strokes_and_name_missing_brushes` (vectorcraft-engine). From e3672e958b6fbcd94aa45fa183cac448458c9427 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:44:15 -0800 Subject: [PATCH 170/247] Wake Bristle tip preview when a stationary pen turns --- crates/ui-egui/src/canvas/drag.rs | 2 ++ crates/ui-egui/src/canvas/input.rs | 17 ++++++++++---- crates/ui-egui/src/canvas/tests.rs | 13 ++++++++++- crates/ui-egui/src/stylus.rs | 37 +++++++++++++++++++++++++++++- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/canvas/drag.rs b/crates/ui-egui/src/canvas/drag.rs index 68f06c70cc..b1d15daa00 100644 --- a/crates/ui-egui/src/canvas/drag.rs +++ b/crates/ui-egui/src/canvas/drag.rs @@ -16,6 +16,8 @@ pub(super) struct HoverContext { pub(super) center: Point, pub(super) zoom: f64, pub(super) rotation: f64, + /// A pen turning in place changes a Bristle tip even when its pointer stays still. + pub(super) pen: Option, /// The active document's id and revision (which moves with every edit, undo and selection /// change). pub(super) doc: Option<(u64, u64)>, diff --git a/crates/ui-egui/src/canvas/input.rs b/crates/ui-egui/src/canvas/input.rs index f711d4cb36..9467596cf7 100644 --- a/crates/ui-egui/src/canvas/input.rs +++ b/crates/ui-egui/src/canvas/input.rs @@ -12,6 +12,9 @@ use super::{Color32, Drag, Mods, Point, PointerEvent, PointerKind, Pos2, Shape, /// Dispatch canvas pointer, keyboard and drop events through the active document view. pub(super) fn handle_input(app: &mut VectorcraftApp, ui: &Ui, resp: &egui::Response, rect: egui::Rect) { + if let Some(feed) = app.services.stylus.as_ref() { + feed.bind_repaint(ui.ctx()); + } // A modal dialog takes the canvas's presses, finger taps, long touches and view navigation, from the frame it opens. let modal = crate::panel_docking::modal_open(app, ui.ctx()); let (pointer, m, space, hover) = wheel_view(app, ui, resp, rect, modal); @@ -53,7 +56,7 @@ pub(super) fn handle_input(app: &mut VectorcraftApp, ui: &Ui, resp: &egui::Respo }); // What a hover means besides where the pointer is on screen: the tool, the canvas, the view // (scrolled, zoomed or turned by the wheel, a gesture, keys or a command) and the document and - // selection as they are (another tab, an edit, an undo). Under a still pointer, a tool switched + // selection as they are (another tab, an edit, an undo), and the pen's orientation. Under a still pointer, a tool switched // to is hovered at once, and when the rest changes, a tool that asks for it // ([`Session::tool_wants_rehover`]) is hovered again where the pointer is. let context = HoverContext { @@ -62,13 +65,14 @@ pub(super) fn handle_input(app: &mut VectorcraftApp, ui: &Ui, resp: &egui::Respo center: v.center, zoom: v.zoom, rotation: v.rotation, + pen: pen_pose(app, &xf), doc: app.session.active().map(|st| (st.uid, st.revision)), }; - let (tool_switched, context_changed) = ui.data_mut(|d| { + let (tool_switched, context_changed, pen_changed) = ui.data_mut(|d| { let id = egui::Id::unique("canvas-hover-context"); let prev = d.get_temp::(id); d.insert_temp(id, context); - prev.map_or((false, false), |prev| (prev.tool != context.tool, prev != context)) + prev.map_or((false, false, false), |prev| (prev.tool != context.tool, prev != context, prev.pen != context.pen)) }); if app.ui.screen_mode == 3 && matches!(drag, None | Some(Drag::Present | Drag::Gesture)) { @@ -137,7 +141,12 @@ pub(super) fn handle_input(app: &mut VectorcraftApp, ui: &Ui, resp: &egui::Respo } else if let Some(p) = hover_tool // A press on an artboard's name starts no drag: the moves while it is held are not hover. && !(pointer.primary_down() && ui.data(|d| d.get_temp::<(usize, bool)>(name_press_id()).is_some())) - && (pointer.is_moving() || mods_changed || !was_over || tool_switched || (context_changed && app.session.tool_wants_rehover())) + && (pointer.is_moving() + || mods_changed + || !was_over + || tool_switched + || (context_changed && app.session.tool_wants_rehover()) + || (pen_changed && context.tool == "paintbrush")) { let ev = PointerEvent { kind: PointerKind::Move, diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 91236c86bb..6b9a4e2da0 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -11005,7 +11005,7 @@ fn the_tip_brings_back_the_perspective_grid_tool_without_showing_the_grid() { } /// The native pen feed's barrel rotation reaches the Paintbrush during canvas hover, before any -/// stroke begins. +/// stroke begins. Turning the pen or replacing it with a mouse updates a still pointer too. #[test] fn bristle_pen_tip_reaches_the_canvas_before_a_press() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); @@ -11031,6 +11031,17 @@ fn bristle_pen_tip_reaches_the_canvas_before_a_press() { frame(&mut app, &ctx, vec![egui::Event::PointerMoved(at)]); let horizontal = tip(&mut app).expect("hovering pen shows its brush tip"); assert!(horizontal.width() > horizontal.height() * 2.0, "{horizontal:?}"); + feed.set_sample(Some(crate::stylus::PenSample { + pressure: 0.0, + pose: PenPose { rotation: Some(90.0), ..Default::default() }, + ..Default::default() + })); + frame(&mut app, &ctx, vec![]); + let vertical = tip(&mut app).expect("turning a still pen turns its tip"); + assert!(vertical.height() > vertical.width() * 2.0, "{vertical:?}"); + feed.set(None); + frame(&mut app, &ctx, vec![]); + assert!(tip(&mut app).is_none(), "a mouse clears a still pen's tip"); } /// #764: the pen's tilt and barrel rotation in the host's feed reach the Paintbrush's points, diff --git a/crates/ui-egui/src/stylus.rs b/crates/ui-egui/src/stylus.rs index 81ae382877..9791839c85 100644 --- a/crates/ui-egui/src/stylus.rs +++ b/crates/ui-egui/src/stylus.rs @@ -24,7 +24,7 @@ //! the tip selects the tool used before. use std::collections::VecDeque; -use std::sync::{Arc, Condvar, Mutex, MutexGuard}; +use std::sync::{Arc, Condvar, Mutex, MutexGuard, OnceLock}; use std::time::Duration; pub use vectorcraft_tools::PenPose; @@ -82,6 +82,8 @@ impl Pen { #[derive(Default)] struct Shared { pen: Mutex, + /// Wake the canvas for a pen that turns without a new window pointer event. + repaint: OnceLock, /// Signaled on every [`StylusFeed::set_sample`] ([`StylusFeed::set`] included). set: Condvar, /// Written on the UI thread itself ([`StylusFeed::on_ui_thread`]): a press never waits. @@ -104,6 +106,10 @@ impl StylusFeed { self.0.pen.lock().unwrap_or_else(std::sync::PoisonError::into_inner) } + pub(crate) fn bind_repaint(&self, ctx: &egui::Context) { + self.0.repaint.get_or_init(|| ctx.clone()); + } + /// A pen turned to its tip moved with `pressure`, or `None`: another pointer moved /// ([`Self::set_sample`]). pub fn set(&self, pressure: Option) { @@ -119,6 +125,7 @@ impl StylusFeed { let pressure = sample.map(|s| if s.pressure.is_finite() { s.pressure.clamp(0.0, 1.0) } else { 1.0 }); let eraser = sample.is_some_and(|s| s.eraser); let mut pen = self.lock(); + let before_pose = pen.pose; if eraser != pen.eraser { *pen = Pen::default(); } @@ -138,8 +145,12 @@ impl StylusFeed { } } pen.latest = pressure; + let pose_changed = pen.pose != before_pose; drop(pen); self.0.set.notify_all(); + if pose_changed && let Some(ctx) = self.0.repaint.get() { + ctx.request_repaint(); + } } /// Like [`Self::set_sample`], for a pen sample that comes with one pointer move of the window, @@ -282,6 +293,30 @@ pub(crate) fn sync_eraser_tool(app: &mut VectorcraftApp) -> bool { #[cfg(test)] mod tests { use super::*; + use std::sync::atomic::{AtomicUsize, Ordering}; + + #[test] + fn changing_a_still_pens_pose_wakes_the_canvas() { + let feed = StylusFeed::default(); + let ctx = egui::Context::default(); + let repaints = Arc::new(AtomicUsize::new(0)); + let count = repaints.clone(); + ctx.set_repaint_observer(move |_| { + count.fetch_add(1, Ordering::Relaxed); + }); + feed.bind_repaint(&ctx); + let pose = PenPose { rotation: Some(0.0), ..Default::default() }; + let sample = PenSample { pressure: 0.0, pose, ..Default::default() }; + let writer = feed.clone(); + std::thread::spawn(move || writer.set_sample(Some(sample))).join().unwrap(); + assert_eq!(repaints.load(Ordering::Relaxed), 1); + feed.set_sample(Some(sample)); + assert_eq!(repaints.load(Ordering::Relaxed), 1, "an unchanged pose needs no new frame"); + feed.set_sample(Some(PenSample { pose: PenPose { rotation: Some(90.0), ..pose }, ..sample })); + assert_eq!(repaints.load(Ordering::Relaxed), 2); + feed.set_sample(None); + assert_eq!(repaints.load(Ordering::Relaxed), 3, "mouse input clears the tip"); + } #[test] fn the_feed_keeps_the_last_pressure_within_0_to_1() { From 5cf3ac5beb847c6c227cdd84d3e2da70e7eba25a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:45:22 -0800 Subject: [PATCH 171/247] i18n: use a narrow no-break space before the semicolon in the French compound shape warning The French row for the Make Compound Shape warning had an ordinary space before ";", which french_catalog_uses_nonbreaking_prose_punctuation rejects on main. It now uses U+202F. --- crates/ui-egui/src/i18n/fr.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 9d7d641b07..3f0f2ced04 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9349,7 +9349,7 @@ breakText Glyphs Glyphes @msg the character's size can't be measured la taille du caractère ne peut pas être mesurée @msg the code runs past its last instruction le code s’exécute au-delà de sa dernière instruction @msg the compound shape is too complex to expand la forme composée est trop complexe pour être décomposée -@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first une ligne ou un autre tracé ouvert qui n’entoure aucune surface n’ajoute aucune surface à la forme composée ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first une ligne ou un autre tracé ouvert qui n’entoure aucune surface n’ajoute aucune surface à la forme composée ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour @msg the container of the listed objects is gone le conteneur des objets listés a disparu @msg the copy `{user_id}` can't be read as a library la copie `{user_id}` ne peut pas être lue comme une bibliothèque @msg the copy would leave the canvas la copie sortirait de la zone de travail From 688baab2dba9502f7f11a3fa0d6719ec2c4b9224 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:52:43 -0800 Subject: [PATCH 172/247] Layers: a Shift-click range looks rows up in a set instead of searching them for each row layer.highlight searched the highlighted rows once for every id it was given, so a range of n rows took about n^2/2 comparisons, and the panel's preview of the rows (apply_row_click) did the same before sending the command. Both now keep a set of the highlighted rows beside the ordered list. layer.highlight builds the set only for more than 8 ids, so a one-row Ctrl/Cmd-click toggle does not pay for it. The rows, their order, the returned rows, the current layer and the revision are unchanged; tests compare the command with the per-id search on 3,000 rows and the widget with it on 5,000 rows. --- crates/engine/src/cmd/layer.rs | 14 ++- crates/engine/src/tests/layers.rs | 177 +++++++++++++++++++++++++++++ crates/ui-egui/src/widgets/drag.rs | 33 +++++- docs/target-app-parity.md | 1 + 4 files changed, 221 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 237f0f9d49..8979a5f0c1 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -622,12 +622,22 @@ fn highlight(s: &mut Session, p: &Value) -> Result { "add" | "toggle" => {} other => return Err(bad(C, format!("mode is set, add or toggle, not `{other}`"))), } + // `rows` keeps the highlight order. With more than 8 ids, `held` holds the same rows as a set and + // answers each lookup; with fewer, each lookup searches `rows`. + let mut held: Option> = (ids.len() > 8).then(|| rows.iter().copied().collect()); let mut last = None; for id in ids { - if mode == "toggle" && rows.contains(&id) { + let has = held.as_ref().map_or_else(|| rows.contains(&id), |h| h.contains(&id)); + if mode == "toggle" && has { rows.retain(|r| *r != id); - } else if !rows.contains(&id) { + if let Some(h) = &mut held { + h.remove(&id); + } + } else if !has { rows.push(id); + if let Some(h) = &mut held { + h.insert(id); + } last = Some(id); } } diff --git a/crates/engine/src/tests/layers.rs b/crates/engine/src/tests/layers.rs index f6b35716f6..4b9045b8b3 100644 --- a/crates/engine/src/tests/layers.rs +++ b/crates/engine/src/tests/layers.rs @@ -167,6 +167,183 @@ fn clicking_rows_at_any_depth_highlights_them_and_sets_the_current_layer() { assert_eq!(document_rows(&s), vec![g.0, c.0], "document.inspect lists the rows"); } +/// Run `layer.highlight` with `ids` and `mode` → (the rows it returned, the current layer), after +/// checking that the call counted one revision and left the rows it returned highlighted. +fn highlight_rows(s: &mut Session, ids: &[NodeId], mode: &str) -> (Vec, Option) { + let revision = s.doc().unwrap().revision; + let r = run(s, "layer.highlight", json!({"ids": ids.iter().map(|i| i.0).collect::>(), "mode": mode})); + let st = s.doc().unwrap(); + assert_eq!(st.revision, revision + 1, "{mode} {ids:?}"); + let rows: Vec = r["rows"].as_array().unwrap().iter().map(|v| NodeId(v.as_u64().unwrap())).collect(); + assert_eq!(rows, st.layer_rows, "{mode} {ids:?}"); + (rows, st.active_layer) +} + +/// `layer.highlight` keeps the rows in highlight order: `set` and `add` take a repeated id once, +/// `toggle` takes an id listed twice off and on again (or on and off, and its layer becomes the +/// current one), unknown ids and ids after the first 100,000 are dropped, rows highlighted twice +/// stay as they are on `add`, and `toggle` takes every copy off. +#[test] +fn highlighting_rows_keeps_their_order_with_repeated_unknown_and_excess_ids() { + let mut s = session(); + let (layer, sub, a, g, b, c) = tree(&mut s); + let unknown = NodeId(9999); + assert_eq!(highlight_rows(&mut s, &[a, g, a, unknown, c], "set"), (vec![a, g, c], Some(layer))); + assert_eq!(highlight_rows(&mut s, &[g, b, a, b], "add"), (vec![a, g, c, b], Some(sub))); + assert_eq!(highlight_rows(&mut s, &[c, c], "toggle"), (vec![a, g, b, c], Some(layer))); + // `sub` goes on and off again; it was the last row added, so its layer is the current one. + assert_eq!(highlight_rows(&mut s, &[sub, sub], "toggle"), (vec![a, g, b, c], Some(sub))); + assert_eq!(highlight_rows(&mut s, &[a, unknown], "toggle"), (vec![g, b, c], Some(layer))); + assert_eq!(highlight_rows(&mut s, &[], "add"), (vec![g, b, c], Some(layer))); + assert_eq!(highlight_rows(&mut s, &[], "toggle"), (vec![g, b, c], Some(layer))); + s.doc_mut().unwrap().active_layer = Some(sub); + assert_eq!(highlight_rows(&mut s, &[], "set"), (vec![], Some(sub)), "no rows: the current layer stays"); + let mut excess = vec![unknown; 100_000]; + excess.push(a); + assert_eq!(highlight_rows(&mut s, &excess, "set"), (vec![], Some(sub)), "only the first 100,000 ids count"); + s.doc_mut().unwrap().layer_rows = vec![a, a, g]; + assert_eq!(highlight_rows(&mut s, &[a, c], "add"), (vec![a, a, g, c], Some(layer))); + assert_eq!(highlight_rows(&mut s, &[a], "toggle"), (vec![g, c], Some(layer))); + // The same with more than 8 ids. + s.doc_mut().unwrap().layer_rows = vec![a, a, g]; + assert_eq!(highlight_rows(&mut s, &[a, c, c, c, c, c, c, c, c], "add"), (vec![a, a, g, c], Some(layer))); + s.doc_mut().unwrap().layer_rows = vec![a, a, g]; + assert_eq!(highlight_rows(&mut s, &[a, b, b, b, b, b, b, b, b], "toggle"), (vec![g], Some(sub)), "`b` goes on and off 4 times"); + assert_eq!(highlight_rows(&mut s, &[c, g, sub, g, sub, a, unknown, a, c, layer], "toggle"), (vec![g, layer], Some(layer))); + let revision = s.doc().unwrap().revision; + assert!(s.execute("layer.highlight", &json!({"ids": [b.0], "mode": "nope"})).is_err()); + let st = s.doc().unwrap(); + assert_eq!((st.revision, st.layer_rows.clone()), (revision, vec![g, layer]), "a bad mode changes nothing"); +} + +/// `layer.highlight`'s rule as a search of the highlighted rows for each id in `p`. The tests +/// compare the command with it. +fn highlight_by_search(st: &mut DocState, p: &Value) -> Value { + let mut ids: Vec = p["ids"].as_array().unwrap().iter().map(|v| NodeId(v.as_u64().unwrap())).collect(); + ids.truncate(crate::cmd::layer::MAX_ROWS); + let mode = p["mode"].as_str().unwrap_or("set"); + ids.retain(|id| st.doc.node(*id).is_some()); + let mut rows = st.highlighted_rows(); + if mode == "set" { + rows.clear(); + } + let mut last = None; + for id in ids { + if mode == "toggle" && rows.contains(&id) { + rows.retain(|r| *r != id); + } else if !rows.contains(&id) { + rows.push(id); + last = Some(id); + } + } + if let Some(layer) = last.or(rows.last().copied()).and_then(|id| st.doc.layer_containing(id)) { + st.active_layer = Some(layer); + } + st.layer_rows = rows; + st.revision += 1; + json!({ "rows": st.layer_rows.iter().map(|i| i.0).collect::>() }) +} + +/// Two sessions with `n` squares on a layer and a sublayer after them, and the squares' ids. +fn highlight_pair(n: usize) -> (Session, Session, Vec, NodeId) { + let make = || { + let mut s = super::large_edits::session(n, super::large_edits::square); + let sub = id(&run(&mut s, "layer.newSublayer", json!({"name": "Sub"}))); + (s, sub) + }; + let ((cmd, sub), (search, other)) = (make(), make()); + assert_eq!(sub, other); + let squares = super::large_edits::layer(&cmd, 0).into_iter().filter(|i| *i != sub).collect(); + (cmd, search, squares, sub) +} + +/// `p` for `layer.highlight` with `ids` and `mode`. +fn highlight_params(ids: impl IntoIterator, mode: &str) -> Value { + json!({"ids": ids.into_iter().map(|i| i.0).collect::>(), "mode": mode}) +} + +/// On 3,000 rows `layer.highlight` gives what [`highlight_by_search`] gives: the same rows in the +/// same order, the same current layer and the same returned rows, with repeated, unknown and +/// toggled ids. +#[test] +fn layer_highlight_matches_a_search_of_the_rows_for_each_id() { + let (mut cmd, mut search, sq, sub) = highlight_pair(3_000); + let unknown = NodeId(u64::MAX); + let steps = [ + highlight_params(sq[..2_000].iter().copied(), "set"), + highlight_params(sq[1_000..].iter().copied().chain([sub, sq[0]]), "add"), + highlight_params([sq[5], sq[5], sub, sq[2_999], unknown, sub, sub], "toggle"), + highlight_params(sq[500..520].iter().chain(&sq[510..515]).copied(), "toggle"), + highlight_params(sq.iter().rev().step_by(7).copied(), "add"), + highlight_params(sq.iter().step_by(3).copied().chain([sub]), "toggle"), + highlight_params(Vec::new(), "add"), + highlight_params(sq.iter().rev().step_by(2).chain(&sq[..10]).copied(), "set"), + highlight_params(Vec::new(), "set"), + ]; + for p in &steps { + let r = run(&mut cmd, "layer.highlight", p.clone()); + let expected = highlight_by_search(search.doc_mut().unwrap(), p); + let (a, b) = (cmd.doc().unwrap(), search.doc().unwrap()); + assert_eq!(r, expected, "{}", p["mode"]); + assert_eq!((&a.layer_rows, a.active_layer, a.revision), (&b.layer_rows, b.active_layer, b.revision), "{}", p["mode"]); + } +} + +/// Time `layer.highlight` against [`highlight_by_search`] on one layer of 20,000 paths: `set` of +/// all of them, `add` of 10,000 already highlighted and `toggle` of one, 7 runs each, both checked +/// to give the same rows and current layer. +/// Run with `cargo test --release -p vectorcraft-engine --lib layer_highlight_timing -- --ignored --nocapture`. +#[test] +#[ignore = "manual timing probe; wall-clock performance depends on machine load"] +fn layer_highlight_timing() { + let (mut cmd, mut search, sq, _) = highlight_pair(20_000); + let steps = [ + ("set of 20,000", highlight_params(sq.iter().copied(), "set")), + ("add of 10,000", highlight_params(sq[5_000..15_000].iter().copied(), "add")), + ("toggle of 1", highlight_params([sq[10_000]], "toggle")), + ]; + let mut ms = vec![(Vec::new(), Vec::new()); steps.len()]; + for run_no in 0..7 { + for (i, (_, p)) in steps.iter().enumerate() { + let mut time_cmd = || { + let start = std::time::Instant::now(); + let r = cmd.execute("layer.highlight", p).unwrap(); + (start.elapsed().as_secs_f64() * 1000.0, r) + }; + let mut time_search = || { + let start = std::time::Instant::now(); + let r = highlight_by_search(search.doc_mut().unwrap(), p); + (start.elapsed().as_secs_f64() * 1000.0, r) + }; + // Alternate which goes first. + let ((tc, rc), (ts, rs)) = if run_no % 2 == 0 { + let c = time_cmd(); + (c, time_search()) + } else { + let s = time_search(); + (time_cmd(), s) + }; + assert_eq!(rc, rs); + let (a, b) = (cmd.doc().unwrap(), search.doc().unwrap()); + assert_eq!((&a.layer_rows, a.active_layer), (&b.layer_rows, b.active_layer)); + ms[i].0.push(ts); + ms[i].1.push(tc); + } + } + let median = |v: &[f64]| { + let mut v = v.to_vec(); + v.sort_by(f64::total_cmp); + v[v.len() / 2] + }; + for ((name, _), (search_ms, cmd_ms)) in steps.iter().zip(&ms) { + println!( + "{name}: search {:.3} ms, command {:.3} ms (median of 7); search runs {search_ms:.3?}, command runs {cmd_ms:.3?}", + median(search_ms), + median(cmd_ms) + ); + } +} + fn document_rows(s: &Session) -> Vec { crate::inspect::document(s)["layerRows"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect() } diff --git a/crates/ui-egui/src/widgets/drag.rs b/crates/ui-egui/src/widgets/drag.rs index a3df5a4098..1ea55e238c 100644 --- a/crates/ui-egui/src/widgets/drag.rs +++ b/crates/ui-egui/src/widgets/drag.rs @@ -1,3 +1,6 @@ +use std::collections::HashSet; +use std::hash::Hash; + use super::{Paint, Rect, Response, Stroke, StrokeKind, Tokens, Ui, Vec2}; /// What panels drag onto art and onto each other. One payload type, so the canvas has one drop @@ -135,10 +138,11 @@ pub fn row_click(order: &[K], highlighted: &[K], anchor: Op /// Apply `click` to the `highlighted` rows, kept in highlight order as `layer.highlight` keeps the /// Layers panel's: a toggled row is appended (or taken off, even the last one), a range replaces the /// rows or adds those not there yet, top-down. -pub fn apply_row_click(highlighted: &mut Vec, click: &RowClick) { +pub fn apply_row_click(highlighted: &mut Vec, click: &RowClick) { let add = |rows: &mut Vec, add: &[K]| { + let mut held: HashSet = rows.iter().copied().collect(); for k in add { - if !rows.contains(k) { + if held.insert(*k) { rows.push(*k); } } @@ -268,4 +272,29 @@ mod row_click_tests { assert_eq!(applied(vec![50], RowClick::Range(vec![20, 30])), [20, 30]); assert_eq!(applied(vec![30, 50], RowClick::AddRange(vec![20, 30, 40])), [30, 50, 20, 40]); } + + /// A large range gives the rows a search of the highlighted rows for each id gives, in the same + /// order, with repeated ids and rows already highlighted kept once. + #[test] + fn a_large_range_applies_as_a_search_of_the_rows_for_each_id_does() { + let searched = |mut rows: Vec, range: &[u32]| { + for k in range { + if !rows.contains(k) { + rows.push(*k); + } + } + rows + }; + let mut range: Vec = (0..5_000).collect(); + range.extend([7, 4_999, 0]); + let before = vec![4_000, 9_000, 2, 9_000]; + let mut added = before.clone(); + apply_row_click(&mut added, &RowClick::AddRange(range.clone())); + assert_eq!(added, searched(before.clone(), &range)); + assert_eq!(added.len(), 5_002, "the 5,000 ids, the row outside the range and its repeat"); + let mut set = before; + apply_row_click(&mut set, &RowClick::Range(range.clone())); + assert_eq!(set, searched(Vec::new(), &range)); + assert_eq!(set.len(), 5_000); + } } diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..56401998a7 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1391,6 +1391,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Layer Options for several highlighted rows shows the first row's settings, and OK changes only the settings set in the dialog: each row keeps its own color, Template, Lock, Show, Print, Preview and Dim Images otherwise (`crates/ui-egui/src/dialogs/layer_options.rs` tests). As VectorCraft's own rule, a layer color (`layer.setProps`, `layer.new`, `layer.newSublayer`) or a Live Paint Gap Preview Color (`livePaint.gapOptions`) given as a hex color with an alpha part (`#rrggbbaa` or `#rgba`) is an error and changes nothing, instead of being set without its alpha. Regression tests: `a_layer_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/layers.rs` and `a_gap_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/build.rs`. Panel Options › Locate Selected Objects (beyond Illustrator, off by default): when the last selected object changes on the canvas or by a command, the panel opens the layers and groups around it and scrolls to its row, as Locate Object does, without highlighting the row; when Show Layers Only, a search or the filter leaves the object without a row, the panel opens no rows for it and scrolls as with the option off. + A Shift-click or Shift+Ctrl/Cmd-click range (`layer.highlight` with `set` or `add`, and the panel's preview of the rows before it sends the command) looks each row up in a set of the highlighted rows instead of searching the highlighted rows once for each row, as does a `toggle` of more than 8 ids; the work grows in step with the number of rows. The rows, their order, the returned rows and the current layer are the same as before. Tests: `tests::layers::layer_highlight_matches_a_search_of_the_rows_for_each_id`, `tests::layers::highlighting_rows_keeps_their_order_with_repeated_unknown_and_excess_ids` and `widgets::drag::row_click_tests::a_large_range_applies_as_a_search_of_the_rows_for_each_id_does`; timing: `cargo test --release -p vectorcraft-engine --lib layer_highlight_timing -- --ignored --nocapture`. - **Drawing aids:** Smart Guides and snapping (moving, with the Selection, Group Selection or Direct Selection tool, and resizing by the bounding-box handles with the Selection or Free Transform tool, Shift and Alt too: the dragged corner or side lands on the other objects' anchors and centres ("anchor", "center") or lines up with their edges and centres (a line and "align"); with Smart Guides › Spacing Guides, a moved selection that lines up with nothing along an axis lands as far from its neighbour as two other objects of its row or column are apart, or halfway between its two neighbours, the equal gaps marked; with View › Snap to Grid on, a moved selection lands on the grid instead, by whichever of its edges is nearest a gridline on each axis (the center does not snap), #740, #1816; the Rotate, Scale, Shear and Reflect tools drag from the anchor they grab and snap the pointer the same way, so a corner dragged onto another object's anchor scales exactly onto it, #482; anchors dragged with Direct Selection: the one pressed on lands on other anchors, its own path's that stay put among them, on path segments or in line with them, the others following, Shift keeps 45° steps, and with Smart Guides off Snap to Point pulls it onto anchors; the Artboard tool snaps artboards, and their bleed, to other artboards, bleeds and art, the grid or whole pixels while moving, copying and resizing them, and the Transform panel shows and edits the active artboard's X/Y/W/H; drawn points, #506: hovering shows where the press goes, the point lands on the other objects' anchors, centres and paths ("anchor", "center", "path") or lines up with their anchors, edges and centres ("align"), the Pen's on the path being drawn too, near a construction guide through the anchor before it on that guide (Preferences › Smart Guides › Construction Guides and Angles), and with Shift kept to its 45° step or a square's diagonal it slides along that way into line; the targets are gathered once per document state, from the art in the window, and the anchors, centres and lines near the pointer are found by bisection, so hovering never rescans the document), guides dragged out of the rulers (#451: they snap as moved guides do, Shift to the ruler's ticks; with the Artboard tool they are artboard guides, which run across their artboard only and move, copy and delete with it, `guide.add {artboard}`) that the Selection, Direct Selection and Group Selection tools then pick and drag (#414: the selected guides highlight and move together, Alt copies them, Shift snaps the dragged one to the ticks, otherwise it snaps to pixels, the grid or the edges, centres (so the sides' midpoints) and anchors of the art and the artboards, or with Smart Guides off Snap to Point pulls it onto anchors; Shift-clicked they join the selected art, and Shift-added art keeps them, so guides and art are selected together in either order, Delete then deleting both in one step; the arrow keys nudge them, Delete deletes them, dragging one back onto its ruler deletes it, Lock Guides and Hide Guides leave them alone; `guide.list`, `guide.select`, `guide.move` and `guide.remove` reach agents), a right-click on either ruler or the origin box to pick the document's units (the current one checked; `document.setUnits`, one undo step, #528), and Draw Normal / Behind / Inside modes. Smart Guides: a point drawn with the Pen or a shape tool, and an anchor dragged with Direct Selection, snaps to where paths and ruler guides cross, labelled "intersect" (#1658, part of #1602; a moved selection's own anchors don't, except the anchor the Selection tool grabbed it by). A selection the Selection tool grabs by one of its anchors snaps that anchor onto the other objects' paths ("path"), and where a path crosses another path or a ruler guide ("intersect"), in the order Direct Selection uses for a dragged anchor; when the anchor lands on a path, the selection's bounds do not also line up with other objects (#7411). The archived 2007 [user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=55) (page 49) says Smart Guides align the pointer of a moved object to existing paths. Snapping onto paths only when the selection was grabbed by an anchor is VectorCraft's own rule; a selection grabbed anywhere else still lines its bounds up. Tests: `select::tests::a_move_grabbed_by_an_anchor_lands_it_on_another_path`, `a_move_grabbed_by_an_anchor_lands_it_where_paths_cross` and `a_move_grabbed_by_an_anchor_lands_it_where_a_path_crosses_a_ruler_guide`. With Smart Guides › Measurement Labels on, the Line Segment tool labels the segment being drawn with its distance, angle and X and Y offsets (`D`, `Angle`, `dX`, `dY`), and the Pen, Curvature and Smart Pen tools label their rubber band the same way when Enable Rubber Band is on (#2983). A move that Shift keeps level, upright or diagonal stays on that line when it snaps, with the Selection, Group Selection or Direct Selection tool. It slides along the line until the selection lands on the grid or on whole pixels, lines up with the other objects or is spaced evenly with them, or until the line passes an anchor or crosses a ruler guide near the point the selection was grabbed by. A level or upright move snaps along its own axis only. Snap to Last Location: with Smart Guides on and Preferences › Smart Guides › Snap to Last Location on (off by default, VectorCraft's own choice), a selection moved by dragging with the Selection, Group Selection or Direct Selection tool, Shift too, goes back to where the move began while it is within Snapping Tolerance of it, labeled "last location"; an Alt copy is not pulled back onto its original, and with View › Snap to Grid or Snap to Pixel on the move snaps to the grid or to whole pixels instead (`prefs.set` key `snapToLastLocation`). The public [Smart Guides options](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html) page lists the option as snapping objects back to their previous position; the distance, the label, the copy rule and the grid and pixel rule are VectorCraft's own. Tests: `select::tests::snap_to_last_location_puts_a_move_back_where_it_began`, `select::tests::snap_to_pixel_wins_over_snap_to_last_location`, `direct::tests::snap_to_last_location_puts_a_path_moved_by_its_anchor_back`, `direct::tests::snap_to_pixel_wins_over_snap_to_last_location_for_a_path_moved_by_its_anchor`, `tests_prefs::snap_to_last_location_puts_a_dragged_square_back`. From 254226aff6430c218ccaaa9fc61d1775de0faa40 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:58:12 -0800 Subject: [PATCH 173/247] Brushes: the progress documents list the Arrows library The brush library evidence in docs/target-app-parity.md names Arrows and describes its five brushes, the Strokes rows and the M10 row in docs/roadmap.md count eleven libraries, and the docs/ui-parity.md checklist row lists Arrows. --- docs/roadmap.md | 2 +- docs/target-app-parity.md | 7 ++++--- docs/ui-parity.md | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index e10e3adae2..4adb59ec3e 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -166,7 +166,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box | 2–4 | | M9 | Live effects (+ 3D & Materials) | 🟡 2D effects done incl. Effect → Pathfinder, Color Adjustments and Document Raster Effects Settings; PDF export warns when the pixel cap lowers raster-effect resolution; Artistic › Colored Pencil, Cutout, Dry Brush, Film Grain, Fresco, Neon Glow, Paint Daubs, Palette Knife, Poster Edges, Rough Pastels, Smudge Stick, Sponge, Underpainting and Watercolor and Sketch › Halftone Pattern, Bas Relief, Charcoal, Conté Crayon, Photocopy, Stamp, Torn Edges and Water Paper done (57/57 Photoshop filters); Revolve with automatic smooth vector shading, default-on circular caps and continuous rims, Extrude & Bevel, Inflate and Rotate with one to ten colored directional lights and four original lighting presets; SVG Filters, remaining raster effects and 3D materials and shadows pending | 81–130 | -| M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, ten generated libraries including Tech Circuit, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | +| M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, eleven generated libraries including Tech Circuit, Arrows, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View, middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color, Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | | M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; the script document model and batch work remain | 18–27 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index aaa5d62775..fe412d6176 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -251,7 +251,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options, Touch Type, Dimension tool; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 80% | Shape Builder on the reporter's file (#937: art past 4,096 segments is cut by lines again; unconfirmed on the file itself); gap detection shares Live Paint’s finder, with a 72 pt custom cap and the existing options; Live Paint Gap Options | 4–8 | estimated; Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog (lowered from 86%: open issues); compound attributes regression-tested (#1197); single-result source names survive SVG export/import (#1293), with [SVG ID semantics](https://www.w3.org/TR/SVG2/struct.html#IDAttribute) and original-shape tests; Simplify component selection and preview regression-tested (#1272); Simplify of a Direct Selection part of a path regression-tested (`tests/simplify_part.rs`); Divide open-cutting-path geometry and appearance regression-tested (#1307); the Shape Builder's edge-source grid is bounded in memory and files a segment once per cell (`planar.rs` test `rect_index_holds_a_bounded_number_of_references`); live compound shapes (Make, Alt-click, member Shape Modes, Release, Expand, saved and exported) regression-tested (#4522); Live Paint Bucket face drags, including narrow faces and one Undo, regression-tested (#6373) | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 92% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Eyedropper copies effective character dimensions across text transforms (#6404); 30.0's gradient additions are done (dither, perceptual blending, presets); freeform gradients in SVG/PDF, mixed spot/process gradients in SVG, PDF gradients mixing a spot color with RGB or Lab stops, and dithered spot gradient fills and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, which PDF export writes as images in process colors| 4–7 | estimated; Recolor model selection is available through the engine and MCP (#2520), and the dialog's color sliders (HSB, RGB, CMYK, Lab, Tint for a spot color) edit the selected row's new color in its mode, and the Edit tab's Global Adjust sliders (Saturation, Brightness, Temperature, Luminosity, -100% to 100%) change every recolored color at once (lowered from 96%: target moved); unpainted zero-width stroke restoration fixed (#1253), score and hours unchanged; Eyedropper source reads regression-tested (#1251); screen-bounded Recolor Edit chip list (#3416), score and hours unchanged; a point on a gradient mesh's outline locates on its edge on every side (#7006: `mesh_locate_takes_a_point_on_any_side_of_the_outline`, `mesh_add_line_exactly_on_the_edge_needs_no_tolerance`), score and hours unchanged; Color panel spectrum grows with the resized panel (#8005) | -| Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (ten generated libraries including Tech Circuit, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media, User Defined, Other Library…, Save Brushes); Art brush Overlap and Pattern brush auto corners are done; remaining: pen pressure on macOS, Stylus Wheel, more built-in brush libraries, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | estimated; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed; evidence below; finite-arithmetic follow-up regressions and full CI passed (evidence below) | +| Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (eleven generated libraries including Tech Circuit, Arrows, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media, User Defined, Other Library…, Save Brushes); Art brush Overlap and Pattern brush auto corners are done; remaining: pen pressure on macOS, Stylus Wheel, more built-in brush libraries, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | estimated; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed; evidence below; finite-arithmetic follow-up regressions and full CI passed (evidence below) | | Appearance, transparency, graphic styles, masks | 5 | 97% | raster effect reach in preview bounds | 1–2 | estimated; Transform typing, sliders, preview, and undo are covered in `crates/ui-egui/src/panels/tests_appearance.rs` | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, painter visibility); materials, light presets, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | | Type core | 9 | 80% | Auto-leading style resets are implemented; Hyphenation… and Justification… options are done (#2310, #2755), and a paragraph's Auto Leading also sets the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; remaining: Optical Margin Alignment, Middle Eastern features beyond bidi layout (the Middle Eastern & South Asian and Standard composers are done per paragraph, #4935; `.ai`/EPS/PDF files carry no composer), optional group font-size preservation; transformed character controls fixed (#1034), see [type-parity.md](type-parity.md) | 14–19 | estimated; eleven-language pattern hyphenation in both composers, with grapheme and shaping-cluster protection (#4947, `hyphen::tests` and `layout::wrapping_tests`); Sanskrit patterns pending an allowlisted source; recent-font groups in font pickers (#3515); full-name font matches regression-tested (#1258); mixed paragraph alignment indication implemented; headless regressions, full integration CI and visual review pass; localized legacy family-name fallback with loaded/catalog regressions (#2208); Fractional Widths per type object regression-tested; color emoji fonts with bitmap glyphs (`sbix`, `CBDT`) draw and export; threading ports: every selected area type and type on a path shows its in and out ports (empty, arrow, red "+"), and the Selection tool threads from either, the in port into a frame before it, and a double-click on a threaded port breaks the thread there (`threads::tests::break_splits_the_thread_and_the_story_flows_into_the_first_part`, `select::tests::a_double_click_on_a_threaded_port_breaks_the_thread`, `canvas::tests::a_double_click_on_a_threaded_out_port_breaks_the_thread`) (#2572; `select::tests::a_click_on_the_in_port_threads_into_a_frame_before_it`, `text::tests::selected_type_shows_its_ports_in_each_state`, `threads::tests::add_before_threads_the_story_from_the_new_frame_into_the_clicked_one`, live screenshot); the Glyphs panel highlights and scrolls to the character selected with the Type tool (#4908, `panels::glyphs` tests); the OpenType panel lists only `ss01`–`ss20` sets present in the selected font and uses its custom names when supplied; Type-range desktop Copy publishes styled art and keeps font family, size and color on canvas Paste after editing (#5636); paint-only Arabic harakat keep joining with conditional GDEF-mark ownership and Insert Kashidas base-letter paint (`tests::harakat`) | @@ -520,7 +520,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Drawing tools | 7 | 86% | rough-square Shaper recognition and orientation steps corrected; editable Shaper Groups landed; Pencil: Alt key toggles to Smooth Tool (#2001); remaining: Shaper construction widget/gesture refinements, pencil and the remaining pen modifier nuances, Blob Brush Merge Only with Selection, Touch Type, Live Corners' Relative rounding | 7–12 | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 86% | Live Paint gap options, Shape Builder gap detection, options (Tool Options dialog, clicking a stroke in merge mode) and Shift-drag marquee | 3–6 | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 96% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); freeform gradients in SVG/PDF and mixed spot/process gradients in SVG (exported as stops; PDF export keeps the spot inks in a DeviceN shading, except next to RGB or Lab stops; dithered fills and Perceptual gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve are written as images in process colors), pattern fills in Expand | 2–4; Eyedropper source reads regression-tested (#1251) | -| Strokes, brushes, width profiles | 5 | 90% | more built-in brush libraries (ten generated in code including Tech Circuit, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media are done; Art brush Overlap and Pattern brush auto corners are done), pen pressure on macOS (the windowing layer reports none there), Stylus Wheel, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | +| Strokes, brushes, width profiles | 5 | 90% | more built-in brush libraries (eleven generated in code including Tech Circuit, Arrows, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media are done; Art brush Overlap and Pattern brush auto corners are done), pen pressure on macOS (the windowing layer reports none there), Stylus Wheel, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | | Appearance, transparency, graphic styles, masks | 5 | 98% | Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); raster effect reach in preview bounds (flattener presets apply in PDF, EPS and print) | 1–2 | | Live vector effects | 5 | 85% | Outline Object, Pathfinder Hard/Soft Mix and Trap (since done: #3061, #3063, #3785), SVG Filters, Transform Patterns and Scale Strokes & Effects on a fill's or stroke's own Transform effect | 6–10 | | 3D and Materials | 4 | ~25% | Initial Revolve, Extrude & Bevel, Inflate and Rotate, with simple lighting; materials, light presets, shadows, ray tracing, Rotate (Classic), Map Art and more complete visibility remain | 25–45 | @@ -1087,10 +1087,11 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. + - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). - **Tech Circuit library:** Circuit Trace is a chamfered art brush with 45-degree elbows and terminal pads; Bus Lines repeats three parallel conductor lanes; Terminal Nodes repeats solder pads, circular test points and connecting leads. Original vector geometry generated in code, with Tints colorization and continuous pattern tile edges. Evidence: `the_tech_circuit_library_constructs_adds_and_applies_each_brush` in `crates/engine/src/tests/brushlib.rs` covers listing, finite geometry on straight, curved, short and closed paths, add/apply, undo/redo, deduplication and saved-library round trips. G5 remaining estimate 3–13 h (estimated); area scores unchanged. - **Dry Media library** ([help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Dry Media holds four art brushes with textured strokes like dry drawing materials, each 100 pt long: Chalk Grain (about 8 pt high), Graphite Pencil (about 2.3 pt), Wax Crayon (about 5.5 pt) and Charcoal Dust (about 7 pt). The brushes, their names, sizes and art are VectorCraft's own: each is filled vector paths from a fixed seed, at most 80 paths and 500 anchors, stretched along the path with Tints colorization, and the chalk and crayon art has even-odd gaps where the paper shows (`brush.libraries`, `brush.addFromLibrary`; `the_dry_media_library_holds_grainy_art_brushes_with_bounded_art`). + - **Arrows library:** Window › Brush Libraries › Arrows holds five art brushes, each 100 pt long: Solid Arrow, Open Arrow (an outlined head), Double Arrow (a head at each end), Chevron Arrow (a second chevron on the shaft) and Dashed Arrow (five separate dashes and a head). Each brush stretches only the part between its guides, so the shaft follows the path's length and the heads keep their proportions, with Tints colorization. The brushes, their names and their art are VectorCraft's own, generated in code (`brush.libraries`, `brush.addFromLibrary`; `arrows_library_lists_renders_and_applies_original_brushes`, `dashed_arrow_keeps_separate_dashes_and_survives_library_save`). - **Brush names in library panels**: a built-in brush library's panel shows its brushes' names in the UI language, in its list rows and tooltips, and its Find field matches the name shown or the English name. This is VectorCraft's own rule. A User Defined or Other Library… library's brushes, and the document's Brushes panel, show names as they are stored. A click, a drag, Add to Brushes and `brush.addFromLibrary` still use the English name, so the brush comes into the document under that name (`built_in_library_brushes_are_listed_in_the_ui_language`, `built_in_library_brush_names_are_in_complete_catalogs`). - A canvas context menu: right-click selects the object under the pointer and lists what applies to the selection (Undo/Redo, clipboard, group, isolation, join, Remove Anchor Points when anchors are selected, masks, compound paths, guides, Transform, Arrange, Select, Export Selection, and on type Bullets and Numbering and Spelling › Auto Spell Check, checked while it is on), or the view commands on empty canvas. - A right-click over locked objects adds an Unlock submenu to the canvas context menu. The submenu lists up to 20 locked objects under the pointer, topmost first, by the name the Layers panel shows, and choosing one unlocks it (`layer.setProps`). A locked group is listed as one item. Objects on hidden, locked or template layers are not listed. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 550da7c469..7f00c88f96 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -442,7 +442,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Info panel follows the tool in use: W and H show the change in x and y, with the distance and the angle, while the selection moves or the Gradient tool draws a vector; the Scale tool's percentages; the center and angles of a Rotate, Reflect or Shear tool drag; the Zoom tool's magnification; the Paintbrush's brush. W and H follow Use Preview Bounds, several selected objects show only the paint and type they share, and Show Options names a tint or a gradient swatch | done | `info.readout`; `Tool::readout`; behavior from the Info panel overview in the [archived user guide](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=76); number formats, the rows shown between drags and the Direct Selection and Group Selection readouts are VectorCraft's own | | Make Compound Path on a group (such as outlined type) keeps its backmost path's paint; compound paths joined into one keep their holes | done | #1537 | | Symbol libraries: Window › Symbol Libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, User Defined, Other Library…, Save Symbols…) and the Symbols panel's Symbol Libraries Menu button and its menu's Open Symbol Library / Save Symbol Library…; a click on a library symbol adds it to the document's Symbols (one undo step, it becomes the current symbol), Shift/Cmd-clicks select for Add to Symbols, and a symbol dragged onto the canvas is added and placed where it is dropped | done | [public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html), [placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html); `window.symbolLibrary`, `window.symbolLibrary.other`, `ui.saveSymbolLibrary` (dialog `saveSymbolLibrary`), `window.userSymbolLibrary1`…`10`; `panels::tests_symbol_libraries`; five built-in libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons; original, generated in code) | -| Brush libraries: Window › Brush Libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, User Defined, Other Library…, Save Brushes…) and the Brushes panel's Brush Libraries Menu button and its menu's Open Brush Library / Save Brush Library…; a click on a library brush adds it to the document's Brushes (one undo step, it becomes the current brush, and selected paths take it in the same step), Shift/Cmd-clicks select for Add to Brushes, a brush dragged onto a path is added and applied to it and one dragged onto the Brushes panel is added; thumbnails render with the library's patterns and symbols | done | [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary` (dialog `saveBrushLibrary`), `window.userBrushLibrary1`…`10`; `panels::tests_brush_libraries`; ten built-in libraries (original, generated in code) | +| Brush libraries: Window › Brush Libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows, User Defined, Other Library…, Save Brushes…) and the Brushes panel's Brush Libraries Menu button and its menu's Open Brush Library / Save Brush Library…; a click on a library brush adds it to the document's Brushes (one undo step, it becomes the current brush, and selected paths take it in the same step), Shift/Cmd-clicks select for Add to Brushes, a brush dragged onto a path is added and applied to it and one dragged onto the Brushes panel is added; thumbnails render with the library's patterns and symbols | done | [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary` (dialog `saveBrushLibrary`), `window.userBrushLibrary1`…`10`; `panels::tests_brush_libraries`; eleven built-in libraries (original, generated in code) | | Symbols panel: New Symbol opens Symbol Options (Name) before making the symbol; Alt-click skips it | partial | #1560 (#1566); Registration 9-point grid in Symbol Options (`symbol.new` / `symbol.place`); Export Type (Graphic / Movie Clip) and Enable Guides for 9-Slice Scaling (scaled instances keep their corners; in symbol editing mode the guides are drawn over the art and the Selection tool drags them); Symbol Type (Dynamic Symbol / Static Symbol, new symbols dynamic; #4938); Align to Pixel Grid (`alignToPixelGrid` on `symbol.new` / `symbol.options`: the art snaps at the symbol's natural size and instances at that size stay on whole points; [Aligning symbols to pixel grid](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=28)) | | Dynamic symbols: an instance changes the fill, stroke, opacity and blend of objects in its symbol's art and stays linked; Reset in the Properties panel's Quick Actions and the Symbols panel menu (Reset Symbol Instance) | partial | #4938; `symbol.instance.setAppearance` (by child-index path) and `symbol.instance.reset`; redefining keeps the changes, Break Link bakes them; Direct Selection of a path, compound path or type object inside an instance, with the Fill/Stroke controls setting its solid fill or stroke, is on canvas; on-canvas editing beyond a solid fill and stroke, and `.ai` read and write, remain | | Pathfinder Trim, Merge and Crop remove strokes; Merge joins same-fill objects whatever their strokes | done | #1570 (#1572) | From 0637f14bfd5251844ea2872fdf2be398b5fdf846 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:01:35 -0800 Subject: [PATCH 174/247] Keep Bristle tip in sync with Alt release --- crates/tools/src/draw2/gesture.rs | 4 ++++ crates/tools/src/draw2/gesture/tests.rs | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rs index c753745f3a..64894379f7 100644 --- a/crates/tools/src/draw2/gesture.rs +++ b/crates/tools/src/draw2/gesture.rs @@ -1798,6 +1798,10 @@ impl Tool for GestureTool { self.close_to = None; self.connect_to.clear(); self.redraw = None; + if self.id == "paintbrush" { + // The release can change a drawing stroke into an Alt-borrowed Smooth hover. + self.pointer_tip(cx, ev); + } out } _ => vec![], diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 5370b43825..871fab304a 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -3099,6 +3099,17 @@ fn bristle_tip_annotator_follows_a_rotation_capable_pen() { let mut release = heavy; release.kind = PointerKind::Up; tool.pointer(&view, &release); + let mut alt_stroke = light; + alt_stroke.pressure = 0.5; + tool.pointer(&selected_view, &alt_stroke); + alt_stroke.kind = PointerKind::Drag; + alt_stroke.mods.alt = true; + tool.pointer(&selected_view, &alt_stroke); + assert!(bounds(&tool, &selected_view).is_some(), "Alt during a drawing stroke keeps the tip"); + alt_stroke.kind = PointerKind::Up; + tool.pointer(&selected_view, &alt_stroke); + assert_eq!(tool.cursor(&selected_view, alt_stroke.pos, alt_stroke.mods), Cursor::Smooth); + assert!(bounds(&tool, &selected_view).is_none(), "Alt release borrows Smooth without a stale tip"); let precise = ToolContext { precise_cursors: true, ..cx(&d, &s, &p) }; assert!(bounds(&tool, &precise).is_none()); tool.pointer(&view, &at(Some(0.0)).with_mods(Mods { cmd: true, ..Default::default() })); From 060eaf11b615163a1ae9d0f1eebacbb96d603275 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:12:30 -0800 Subject: [PATCH 175/247] i18n: Polish Artboard edge button tooltip calls the art kompozycja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Alt-click tooltip said "wraz z grafiką" for the artboard's art; the Polish catalog's term for artwork is kompozycja. --- crates/ui-egui/src/i18n/pl.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 1c0e128892..f71863dc67 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4219,7 +4219,7 @@ axis Both Obie Show Pokaż Copy Width Point Kopiuj punkt szerokości Duplicate Artboard Powiel obszar kompozycji - Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kliknij, aby dodać obszar kompozycji po tej stronie, kliknij z Alt, aby powielić ten obszar kompozycji wraz z grafiką + Click to add an artboard on this side; Alt-click to duplicate this artboard with its art Kliknij, aby dodać obszar kompozycji po tej stronie, kliknij z Alt, aby powielić ten obszar kompozycji wraz z kompozycją Click to add an artboard on this side Kliknij, aby dodać obszar kompozycji po tej stronie Area / Path Type Tekst akapitowy / na ścieżce Decrease Font Size Zmniejsz rozmiar czcionki From 18cf1d7a93d2440fde01bbe2dd39e04b674cba92 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:13:58 -0800 Subject: [PATCH 176/247] Hide Bristle tip after post-commit selection --- crates/tools/src/draw2/gesture.rs | 8 ++++++++ crates/tools/src/draw2/gesture/tests.rs | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rs index 64894379f7..d420e87475 100644 --- a/crates/tools/src/draw2/gesture.rs +++ b/crates/tools/src/draw2/gesture.rs @@ -200,6 +200,9 @@ pub struct GestureTool { /// Where the Blob Brush's or the Eraser's tip outline shows: the pointer over the canvas, /// unless Cmd/Ctrl lends a selection tool or Alt the Smooth tool. tip_at: Option, + /// Alt as it was at the last pointer event; the release can select a new path after the tool + /// returns, so the Bristle tip checks the current selection when overlays are drawn. + tip_alt: bool, /// The last rotation-capable pen over the Paintbrush's Bristle tip; a mouse or a pen without /// barrel rotation has no tip annotator. bristle_pen: Option<(PenPose, f64)>, @@ -902,6 +905,7 @@ impl GestureTool { snap: DrawSnap::default(), pressed: Point::ZERO, tip_at: None, + tip_alt: false, bristle_pen: None, light: false, bearing: None, @@ -1096,6 +1100,7 @@ impl GestureTool { if self.varies_size() { self.tip_at = (!ev.mods.cmd && !self.blob_alt_smooths(ev.mods)).then_some(ev.pos); } else if self.id == "paintbrush" { + self.tip_alt = ev.mods.alt; self.bristle_pen = ev.pen.filter(|pen| pen.rotation.is_some()).map(|pen| (pen, if ev.kind == PointerKind::Move { 0.5 } else { f64::from(ev.pressure) })); let borrows_smooth = !self.active && ev.mods.alt && has_selected_smooth_path(cx); @@ -1110,6 +1115,9 @@ impl GestureTool { fn tip_outline(&self, cx: &ToolContext) -> Vec { let Some(at) = self.tip_at.filter(|_| !self.smoothing && !cx.precise_cursors) else { return vec![] }; if self.id == "paintbrush" { + if !self.active && self.tip_alt && has_selected_smooth_path(cx) { + return vec![]; + } let Some((pose, pressure)) = self.bristle_pen else { return vec![] }; let Some(name) = vectorcraft_brush::current(cx.doc) else { return vec![] }; let Some(brush) = vectorcraft_brush::find(cx.doc, &name) else { return vec![] }; diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 871fab304a..9fe8f24d51 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -3110,6 +3110,19 @@ fn bristle_tip_annotator_follows_a_rotation_capable_pen() { tool.pointer(&selected_view, &alt_stroke); assert_eq!(tool.cursor(&selected_view, alt_stroke.pos, alt_stroke.mods), Cursor::Smooth); assert!(bounds(&tool, &selected_view).is_none(), "Alt release borrows Smooth without a stale tip"); + // A completed stroke can select its new path after `pointer` returns its actions. The overlay + // must use that current selection even without a further pointer move. + let mut newly_selected = GestureTool::new("paintbrush"); + let mut new_stroke = light; + newly_selected.pointer(&view, &new_stroke); + new_stroke.kind = PointerKind::Drag; + new_stroke.mods.alt = true; + newly_selected.pointer(&view, &new_stroke); + new_stroke.kind = PointerKind::Up; + newly_selected.pointer(&view, &new_stroke); + assert!(bounds(&newly_selected, &view).is_some(), "no selected path borrows Smooth yet"); + assert_eq!(newly_selected.cursor(&selected_view, new_stroke.pos, new_stroke.mods), Cursor::Smooth); + assert!(bounds(&newly_selected, &selected_view).is_none(), "post-commit selection also hides the tip"); let precise = ToolContext { precise_cursors: true, ..cx(&d, &s, &p) }; assert!(bounds(&tool, &precise).is_none()); tool.pointer(&view, &at(Some(0.0)).with_mods(Mods { cmd: true, ..Default::default() })); From df9483b8392a6dc0be03dc5fe671df5daeba669b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Wed, 18 Nov 2026 09:15:25 +0700 Subject: [PATCH 177/247] Fix #7242: confined package report test uses native path components The unconfined report path for an existing link is built from native path components so Windows separators match the package report. JSON assertions use the path encoded the same way Value::to_string does, and the unconfined Document Info check reads the report text field. Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com> --- crates/engine/src/tests/package.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/tests/package.rs b/crates/engine/src/tests/package.rs index 13464b24d7..7a064a1960 100644 --- a/crates/engine/src/tests/package.rs +++ b/crates/engine/src/tests/package.rs @@ -326,9 +326,11 @@ fn a_confined_package_names_files_outside_the_read_root_by_name() { let zip = unzip(&vectorcraft_format::base64_decode(r["dataBase64"].as_str().unwrap()).unwrap()); String::from_utf8(zip["poster Folder/poster Report.txt"].clone()).unwrap() }; + // Reopened existing links use native separators; missing links keep their stored path. + let red = dir.0.join("art").join("red.png").to_string_lossy().into_owned(); let person = report(&run(&mut s, "file.package", json!({}))); assert!(person.contains(&format!("From: {}\n", dir.file("poster.vectorcraft"))), "{person}"); - assert!(person.contains(&format!("{} → Links/red.png", dir.file("art/red.png"))), "{person}"); + assert!(person.contains(&format!("{red} → Links/red.png")), "{person}"); assert!(person.contains(&format!("blue.png: not found ({})", dir.file("art/blue.png"))), "{person}"); let in_root = dir.0.join("in"); @@ -339,16 +341,19 @@ fn a_confined_package_names_files_outside_the_read_root_by_name() { assert!(text.contains("\nred.png → Links/red.png\n") && text.contains("\nblue.png: not found (blue.png), not copied\n"), "{text}"); let base = dir.0.to_string_lossy().into_owned(); assert!(!text.contains(&base), "{text}"); + // Compare serialized JSON with the path encoded the same way, without its outer quotes. + let json_base = serde_json::to_string(&base).unwrap(); + let json_base = &json_base[1..json_base.len() - 1]; for key in ["missingLinks", "warnings", "files"] { - assert!(!client[key].to_string().contains(&base), "{key}: {client}"); + assert!(!client[key].to_string().contains(json_base), "{key}: {client}"); } // Document Info, whose report the package holds, gives no link either. for p in [json!({}), json!({"format": "text"})] { let info = crate::file_access::confine(roots.as_ref(), || run(&mut s, "document.info", p.clone())); - assert!(!info.to_string().contains(&base), "{p}: {info}"); + assert!(!info.to_string().contains(json_base), "{p}: {info}"); } let info = run(&mut s, "document.info", json!({"format": "text"})); - assert!(info.to_string().contains(&dir.file("art/red.png")), "the person's: {info}"); + assert!(info["text"].as_str().unwrap().contains(&red), "the person's: {info}"); } /// A confined request packages no document that links, or places a native document or a PDF with From 958b5645f385efe28c0e25bfcf9a68ad6caa0192 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:11:11 -0800 Subject: [PATCH 178/247] Save PDF: a link button keeps the four bleed values the same Marks and Bleeds in the Save PDF dialog and the PDF preset editor gets a link button beside Top, Bottom, Left and Right. While it is on, editing one value sets all four; turning it on gives every side the top value. It opens on when the four values are equal, and choosing a preset or Reset sets it again from that preset's values. With Use Document Bleed Settings on, the button is grayed out and the custom values stay as they were. The link is not an export option or a preset setting; ui.dialog.set sets it as __bleedLinked and refuses anything other than true or false. --- crates/ui-egui/src/dialogs.rs | 14 +- crates/ui-egui/src/dialogs/save_pdf.rs | 109 ++++++++++-- crates/ui-egui/src/dialogs/save_pdf/tests.rs | 171 +++++++++++++++++++ docs/control-protocol.md | 4 +- docs/target-app-parity.md | 1 + 5 files changed, 277 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 9e54eb12f6..f2c72aa852 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -537,10 +537,10 @@ fn hidden_controls(d: &Dialog) -> &'static [&'static str] { Some(DialogKind::Preferences) => &["__category", "__search", "__smartGuides", "__snapToGrid", "__taskBar"], // The section shown, the sheet the preview shows and the preset name being typed. Some(DialogKind::Print | DialogKind::PrintPreset) => &["__savePresetAs", "__section", "__sheet"], - // The section shown, All or a range of artboards, the two password checkboxes and the - // preset name being typed. + // The section shown, All or a range of artboards, the bleed link, the two password + // checkboxes and the preset name being typed. Some(DialogKind::SavePdf | DialogKind::PdfPreset) => { - &["__allArtboards", "__requireOpenPassword", "__restrictPermissions", "__savePresetAs", "__section"] + &["__allArtboards", "__bleedLinked", "__requireOpenPassword", "__restrictPermissions", "__savePresetAs", "__section"] } // The selected rows and Randomize's seed. Some(DialogKind::Recolor) => &["__seed", "__sel"], @@ -658,8 +658,9 @@ pub(crate) fn parent(d: &Dialog) -> Option { /// `ui.dialog.set` changed `field` of the open dialog from `old`: a choice that sets other fields /// sets them as choosing it in the dialog does (Export for Screens' `exportPreset`), a change /// to Export for Screens' sub-folder controls ends an applied preset's item folders, as it does in -/// the dialog, and Transform Each's Relative / Absolute keeps the Scale fields' size. A value -/// Composite Fonts' Show Sample can't take is refused. +/// the dialog, and Transform Each's Relative / Absolute keeps the Scale fields' size. Save PDF's +/// bleed link links the bleed as its button does. A value Composite Fonts' Show Sample or Save +/// PDF's bleed link can't take is refused. pub(crate) fn field_set(app: &mut VectorcraftApp, field: &str, old: Option<&Value>) -> Result<(), String> { if app.ui.dialog.as_ref().is_some_and(|d| d.kind == transform_each::KIND) { transform_each::field_set(app, field, old); @@ -668,6 +669,9 @@ pub(crate) fn field_set(app: &mut VectorcraftApp, field: &str, old: Option<&Valu if let Some(d) = app.ui.dialog.as_ref().filter(|d| d.kind == composite_fonts::KIND) { return composite_fonts::field_set(d, field); } + if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == save_pdf::KIND || d.kind == save_pdf::PRESET_KIND) { + return save_pdf::field_set(d, field, old); + } let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == export_for_screens::KIND) else { return Ok(()) }; match field { "exportPreset" => export_for_screens::preset_set(app), diff --git a/crates/ui-egui/src/dialogs/save_pdf.rs b/crates/ui-egui/src/dialogs/save_pdf.rs index af047a4cc2..bac2d72d7e 100644 --- a/crates/ui-egui/src/dialogs/save_pdf.rs +++ b/crates/ui-egui/src/dialogs/save_pdf.rs @@ -522,10 +522,12 @@ fn apply_preset(app: &mut VectorcraftApp, d: &mut Dialog, name: &str) { const OPTION_FLAGS: [&str; 2] = ["__requireOpenPassword", "__restrictPermissions"]; /// Replace every option with `settings` (from [`settings_fields`]), the password checkboxes -/// included. The preset, the artboard choice, the path and the other UI-only fields (the section, -/// the Save Preset name) stay. +/// included, and let the bleed link follow the new values. The preset, the artboard choice, the +/// path and the other UI-only fields (the section, the Save Preset name) stay. fn replace_settings(d: &mut Dialog, settings: Map) { - d.fields.retain(|k, _| matches!(k.as_str(), "preset" | "range" | "path") || (k.starts_with("__") && !OPTION_FLAGS.contains(&k.as_str()))); + d.fields.retain(|k, _| { + matches!(k.as_str(), "preset" | "range" | "path") || (k.starts_with("__") && !OPTION_FLAGS.contains(&k.as_str()) && k != BLEED_LINKED) + }); d.fields.extend(settings); } @@ -656,25 +658,102 @@ pub(super) fn marks_and_bleeds(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut flag(ui, d, "bleed.useDocument", tl!("Use document bleed settings"), true); // With the document's bleed the fields show it (Document Setup's `[top, bottom, left, right]`). let document = (get(d, "bleed.useDocument").as_bool() == Some(true)).then(|| app.session.active().map_or([0.0; 4], |s| s.doc.setup.bleed)); - egui::Grid::new("pdf-bleed").num_columns(4).spacing([10.0, 6.0]).show(ui, |ui| { - for pair in [ - [(0, "bleed.top", tl!("Top:")), (1, "bleed.bottom", tl!("Bottom:"))], - [(2, "bleed.left", tl!("Left:")), (3, "bleed.right", tl!("Right:"))], - ] { - for (i, p, label) in pair { - ui.label(label); - match document { - Some(b) => { - ui.add_enabled_ui(false, |ui| widgets::num_field(ui, p, b.get(i).copied(), unit, 80.0)); + // Save PDF and the PDF preset editor link the four sides; Print's Marks and Bleed doesn't. + let pdf = d.kind == KIND || d.kind == PRESET_KIND; + ui.horizontal(|ui| { + egui::Grid::new("pdf-bleed").num_columns(4).spacing([10.0, 6.0]).show(ui, |ui| { + for pair in [ + [(0, "bleed.top", tl!("Top:")), (1, "bleed.bottom", tl!("Bottom:"))], + [(2, "bleed.left", tl!("Left:")), (3, "bleed.right", tl!("Right:"))], + ] { + for (i, p, label) in pair { + ui.label(label); + match document { + Some(b) => { + ui.add_enabled_ui(false, |ui| widgets::num_field(ui, p, b.get(i).copied(), unit, 80.0)); + } + None if pdf => { + if let Some(x) = widgets::num_field(ui, p, get(d, p).as_f64(), unit, 80.0) { + edit_bleed(d, i, x); + } + } + None => length(ui, d, p, unit, true), } - None => length(ui, d, p, unit, true), } + ui.end_row(); + } + }); + if pdf { + let linked = bleed_linked(d); + let tip = if linked { tl!("Make the bleed values differ") } else { tl!("Make all bleed settings the same") }; + // With the document's bleed the link is grayed out and keeps its state for the custom values. + let clicked = ui + .add_enabled_ui(document.is_none(), |ui| widgets::icon_button(ui, if linked { "link" } else { "link-2-off" }, tip, linked, 24.0)) + .inner + .clicked(); + if clicked { + link_bleed(d, !linked); } - ui.end_row(); } }); } +/// The custom bleed's sides in Save PDF and the PDF preset editor, `[top, bottom, left, right]`. +const BLEED_SIDES: [&str; 4] = ["bleed.top", "bleed.bottom", "bleed.left", "bleed.right"]; +/// The field holding whether the link keeps the four custom bleed values the same. Without it, +/// the sides are linked when they are equal (a preset's, or ones `ui.dialog.set` set). +const BLEED_LINKED: &str = "__bleedLinked"; + +/// Whether the custom bleed's sides are linked. +fn bleed_linked(d: &Dialog) -> bool { + d.fields.get(BLEED_LINKED).and_then(Value::as_bool).unwrap_or_else(|| { + let top = get(d, BLEED_SIDES[0]).as_f64(); + BLEED_SIDES[1..].iter().all(|p| get(d, p).as_f64() == top) + }) +} + +/// Link (every side takes the top's value) or unlink (the sides keep their values) the bleed. +fn link_bleed(d: &mut Dialog, on: bool) { + d.fields.insert(BLEED_LINKED.into(), json!(on)); + if on { + let top = get(d, BLEED_SIDES[0]).as_f64().unwrap_or(0.0); + for p in &BLEED_SIDES[1..] { + set(d, p, json!(top)); + } + } +} + +/// Side `side` of the custom bleed was edited to `value`: linked, every side takes it. +fn edit_bleed(d: &mut Dialog, side: usize, value: f64) { + if bleed_linked(d) { + for p in BLEED_SIDES { + set(d, p, json!(value)); + } + } else if let Some(p) = BLEED_SIDES.get(side) { + set(d, p, json!(value)); + } +} + +/// `ui.dialog.set` set `field` of Save PDF or the PDF preset editor: `__bleedLinked` links or +/// unlinks the bleed as its button does, and must be true or false; a new `bleed` drops the link's +/// state, so the link follows the values set. +pub(super) fn field_set(d: &mut Dialog, field: &str, old: Option<&Value>) -> Result<(), String> { + match field { + BLEED_LINKED => match d.fields.get(BLEED_LINKED).cloned() { + Some(Value::Bool(on)) => { + link_bleed(d, on); + Ok(()) + } + v => Err(format!("{BLEED_LINKED} must be true or false, not {}", v.unwrap_or(Value::Null))), + }, + "bleed" if d.fields.get("bleed") != old => { + d.fields.remove(BLEED_LINKED); + Ok(()) + } + _ => Ok(()), + } +} + /// A dropdown of names such as colour profiles or flattener presets (`names`, the first one /// standing for "" at `path`), showing the name at `path` (one that isn't among them too). The /// first `builtins` entries are ours (translated); the others (profiles, saved presets) are names. diff --git a/crates/ui-egui/src/dialogs/save_pdf/tests.rs b/crates/ui-egui/src/dialogs/save_pdf/tests.rs index 91442f111c..05b1b101d4 100644 --- a/crates/ui-egui/src/dialogs/save_pdf/tests.rs +++ b/crates/ui-egui/src/dialogs/save_pdf/tests.rs @@ -443,6 +443,177 @@ fn marks_and_bleeds_reach_the_pdf() { assert!(ellipse, "the non-printing layer is included"); } +/// The four custom bleed values, `[top, bottom, left, right]`. +fn bleed_of(d: &Dialog) -> [f64; 4] { + BLEED_SIDES.map(|p| get(d, p).as_f64().unwrap_or(f64::NAN)) +} + +/// Headless frames of the dialog layer with an accessibility tree, as a 1280 × 900 window. +struct LinkFrames(egui::Context); + +impl LinkFrames { + fn new() -> Self { + let ctx = egui::Context::default(); + ctx.enable_accesskit(); + theme::install_fonts(&ctx); + Self(ctx) + } + + fn run(&self, app: &mut VectorcraftApp, events: Vec) -> egui::FullOutput { + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1280.0, 900.0)); + let input = egui::RawInput { events, screen_rect: Some(screen), ..Default::default() }; + let mut out = self.0.run_ui(input, |ui| super::super::show(app, ui.ctx())); + out.textures_delta.clear(); + out + } + + /// The bleed link's button once the dialog has settled: its name, whether it shows pressed, + /// whether it is grayed out, and its center. + fn link(&self, app: &mut VectorcraftApp) -> (String, bool, bool, egui::Pos2) { + self.run(app, vec![]); + let out = self.run(app, vec![]); + let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes; + let names = ["Make the bleed values differ", "Make all bleed settings the same"]; + let mut found = nodes.iter().filter(|(_, n)| n.role() == egui::accesskit::Role::Button && n.label().is_some_and(|l| names.contains(&l))); + let (_, n) = found.next().expect("a bleed link button"); + assert!(found.next().is_none(), "one bleed link button"); + let b = n.bounds().expect("bounds"); + let pressed = n.toggled() == Some(egui::accesskit::Toggled::True) || n.is_selected() == Some(true); + let center = egui::pos2((b.x0 + b.x1) as f32 * 0.5, (b.y0 + b.y1) as f32 * 0.5); + (n.label().unwrap_or_default().to_string(), pressed, n.is_disabled(), center) + } + + fn click(&self, app: &mut VectorcraftApp, at: egui::Pos2) { + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }; + self.run(app, vec![egui::Event::PointerMoved(at), press(true)]); + self.run(app, vec![press(false)]); + } +} + +/// The link button beside the custom bleed values: the built-in presets' equal sides open linked, +/// an edit to one side sets all four while linked and only that one while unlinked, and linking +/// again gives every side the top's value. The link isn't an export option, and the linked values +/// reach the PDF's page boxes. +#[test] +fn the_bleed_link_keeps_the_four_sides_the_same() { + let (mut app, written, _) = app(); + app.run("ui.savePdfDialog", json!({"path": "/tmp/bleed.pdf"})).unwrap(); + set_field(&mut app, "__section", json!("Marks and Bleeds")); + let f = LinkFrames::new(); + let (name, pressed, disabled, at) = f.link(&mut app); + assert_eq!((name.as_str(), pressed, disabled), ("Make the bleed values differ", true, false), "equal sides open linked"); + edit_bleed(app.ui.dialog.as_mut().unwrap(), 2, 6.0); + assert_eq!(bleed_of(app.ui.dialog.as_ref().unwrap()), [6.0; 4], "linked: the left value sets all four"); + + f.click(&mut app, at); + let (name, pressed, ..) = f.link(&mut app); + assert_eq!((name.as_str(), pressed), ("Make all bleed settings the same", false), "the click unlinks"); + let d = app.ui.dialog.as_mut().unwrap(); + assert_eq!(d.fields.get(BLEED_LINKED), Some(&json!(false))); + edit_bleed(d, 1, 9.0); + edit_bleed(d, 3, 2.0); + assert_eq!(bleed_of(d), [6.0, 9.0, 6.0, 2.0], "unlinked: each side is its own"); + edit_bleed(d, 0, 4.0); + assert_eq!(bleed_of(d), [4.0, 9.0, 6.0, 2.0]); + + let (.., at) = f.link(&mut app); + f.click(&mut app, at); + let (name, pressed, ..) = f.link(&mut app); + assert_eq!((name.as_str(), pressed), ("Make the bleed values differ", true), "the click links again"); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!(bleed_of(d), [4.0; 4], "linking gives every side the top's value"); + let p = params(d); + assert_eq!(p["bleed"], json!({"useDocument": false, "top": 4.0, "bottom": 4.0, "left": 4.0, "right": 4.0})); + assert!(p.get(BLEED_LINKED).is_none() && preset_params(d).get(BLEED_LINKED).is_none(), "the link is the dialog's own"); + + super::super::confirm(&mut app).unwrap(); + let bytes = &written.borrow()[0].1; + let page = &vectorcraft_pdf::info(bytes, None).unwrap().pages[0]; + let bleed = page.boxes.iter().find(|(b, _)| *b == vectorcraft_pdf::CropTo::Bleed).expect("a bleed box").1; + let trim = page.boxes.iter().find(|(b, _)| *b == vectorcraft_pdf::CropTo::Trim).expect("a trim box").1; + assert_eq!((trim.x0 - bleed.x0, trim.y0 - bleed.y0, bleed.x1 - trim.x1, bleed.y1 - trim.y1), (4.0, 4.0, 4.0, 4.0)); +} + +/// A preset whose four bleed values differ opens unlinked; choosing a preset or Reset sets the link +/// from that preset's values rather than keeping the one shown before. +#[test] +fn presets_and_reset_set_the_bleed_link_from_their_values() { + let (mut app, _, _) = app(); + app.run("pdf.preset.save", json!({"name": "Uneven", "bleed": {"top": 3, "bottom": 5, "left": 3, "right": 3}})).unwrap(); + app.run("ui.savePdfDialog", json!({"preset": "Uneven"})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert!(!bleed_linked(d), "unequal sides open unlinked"); + assert_eq!(bleed_of(d), [3.0, 5.0, 3.0, 3.0], "opening leaves the values as they are"); + + let mut d = d.clone(); + link_bleed(&mut d, true); + apply_preset(&mut app, &mut d, "Uneven"); + assert!(!bleed_linked(&d) && bleed_of(&d) == [3.0, 5.0, 3.0, 3.0], "choosing the preset takes its values and its link"); + apply_preset(&mut app, &mut d, pdf::DEFAULT_PRESET); + assert!(bleed_linked(&d), "the default preset's sides are equal"); + link_bleed(&mut d, false); + app.ui.dialog = Some(d); + app.run("ui.dialogReset", json!({})).unwrap(); + assert!(bleed_linked(app.ui.dialog.as_ref().unwrap()), "Reset sets the link from the preset's values"); + + // The preset editor has the same link. + open_preset(&mut app, &json!({"name": "Uneven"})).unwrap(); + set_field(&mut app, "__section", json!("Marks and Bleeds")); + let f = LinkFrames::new(); + let (name, pressed, disabled, at) = f.link(&mut app); + assert_eq!((name.as_str(), pressed, disabled), ("Make all bleed settings the same", false, false)); + f.click(&mut app, at); + assert_eq!(bleed_of(app.ui.dialog.as_ref().unwrap()), [3.0; 4]); +} + +/// With Use Document Bleed Settings on, the fields show the document's bleed and the link is +/// grayed out; the custom values and the link stay as they were for when it is turned off. +#[test] +fn the_document_bleed_grays_the_link_and_keeps_the_custom_values() { + let (mut app, _, _) = app(); + app.run("document.setup", json!({"bleed": 9})).unwrap(); + app.run("ui.savePdfDialog", json!({"bleed": {"top": 3, "bottom": 5, "left": 3, "right": 3}})).unwrap(); + set_field(&mut app, "__section", json!("Marks and Bleeds")); + set_field(&mut app, "bleed.useDocument", json!(true)); + let f = LinkFrames::new(); + let (name, pressed, disabled, at) = f.link(&mut app); + assert_eq!((name.as_str(), pressed, disabled), ("Make all bleed settings the same", false, true)); + f.click(&mut app, at); + let d = app.ui.dialog.as_ref().unwrap(); + assert!(!d.fields.contains_key(BLEED_LINKED), "a grayed-out link does not change"); + assert_eq!(bleed_of(d), [3.0, 5.0, 3.0, 3.0]); + set_field(&mut app, "bleed.useDocument", json!(false)); + let (name, _, disabled, _) = f.link(&mut app); + assert_eq!((name.as_str(), disabled), ("Make all bleed settings the same", false)); +} + +/// `ui.dialog.set` can set the link (`__bleedLinked`) as its button does, refuses a value other +/// than true or false, and a new `bleed` lets the link follow its values. +#[test] +fn ui_dialog_set_links_the_bleed() { + let (mut app, _, _) = app(); + app.run("ui.savePdfDialog", json!({"bleed": {"top": 3, "bottom": 5, "left": 3, "right": 3}})).unwrap(); + let set = |app: &mut VectorcraftApp, field: &str, value: Value| { + let d = app.ui.dialog.as_mut().unwrap(); + assert!(super::super::accepts_field(d, field), "{field}"); + let old = d.fields.get(field).cloned(); + super::super::set_field(d, field.into(), value); + super::super::field_set(app, field, old.as_ref()) + }; + set(&mut app, BLEED_LINKED, json!(true)).unwrap(); + assert_eq!(bleed_of(app.ui.dialog.as_ref().unwrap()), [3.0; 4], "linking gives every side the top's value"); + for bad in [json!("yes"), json!(1), Value::Null] { + let e = set(&mut app, BLEED_LINKED, bad.clone()).unwrap_err(); + assert!(e.contains("__bleedLinked must be true or false"), "{bad}: {e}"); + } + set(&mut app, BLEED_LINKED, json!(false)).unwrap(); + set(&mut app, "bleed", json!({"top": 1, "bottom": 1, "left": 1, "right": 1})).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert!(!d.fields.contains_key(BLEED_LINKED) && bleed_linked(d), "equal values set are linked"); + set(&mut app, "bleed", json!({"top": 1, "bottom": 2, "left": 1, "right": 1})).unwrap(); + assert!(!bleed_linked(app.ui.dialog.as_ref().unwrap()), "unequal values set are unlinked"); +} + #[test] fn option_labels_read_well() { assert_eq!(option_label("compression.color.abovePpi"), "Compression › Color › Above Ppi"); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index adac088a13..dbfb47a35a 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -102,7 +102,7 @@ the two can still win that race. | `ui.click` / `ui.drag` | `{x, y, button?, count?, shift?, alt?, ctrl?, cmd?}` / `{x, y, toX, toY, steps?, count?, button?, shift?, alt?, ctrl?, cmd?}` | egui pointer input; see synthetic input budgets above | | `ui.wheel` | `{x, y, dy?, dx?, unit?: "line"\|"point", shift?, alt?, cmd?}` | a mouse wheel turn over screen point (x, y): `dy` notches up (+) or down, `dx` sideways. Over the canvas the wheel scrolls, Cmd-wheel (Ctrl on Windows and Linux) scrolls sideways and Alt-wheel (Option on the Mac) zooms about the pointer (with the `ctrlWheelScrollsSideways` preference off, Cmd-wheel zooms too); with the `zoomWithMouseWheel` preference the wheel and Alt-wheel zoom about the pointer, Shift-wheel scrolls up and down and Cmd-wheel (Ctrl on Windows and Linux) sideways. Over a focused numeric field (click it first) each notch steps its value as Up/Down do (Shift: ten, Cmd/Ctrl: a tenth) and the panel stays put; over anything else in a panel the wheel scrolls it. Over the canvas, the wheel preferences in `docs/mcp.md` change what these keys do | | `ui.set` | `{brightness?, panel?, rulers?, outline?, grid?, smartGuides?, boundingBox?, controlBar?, imageTracePreview?}` | `outline`: View › Outline for the active document only (each document has its own, a document opens in Preview, and `ui.inspect` shows it as `view.outline`; an error without a document). `imageTracePreview`: the Image Trace panel's Preview (`ui.inspect` shows it as `ui.image_trace_preview`) | -| `ui.dialog.set` / `.confirm` / `.cancel` | `{field, value, action?}` or `{fields: [{field, value}…], action?}` | fill and submit the open dialog. `ui.dialog.set` takes the fields the dialog has (`ui.inspect`) other than its `__` fields, the `__` fields that are controls of the dialog (such as `__section` and `__allArtboards` in Save PDF, `__constrain` in Transform Each and the shape dialogs, and `__search` and `__category` in Preferences; Save PDF's and Print's `__savePresetAs`, the preset name, only while Save Preset… asks for it, since OK then saves a preset), `discard` on a dialog with a discard button, `preview` on one with a live preview, the fields that the dialog reads but adds only when a control changes (such as `searchFolder`, or `copy` in the Transform dialogs), and the fields it passes to the command it runs: every parameter of the `command` dialog's command (`ui.paramDialog`), and the `textureImage` that Load Texture… sets in the Glass, Texturizer and Rough Pastels effects; any other field is an error that lists the dialog's fields, and the dialog stays as it was. Any other `__` field, held or not, holds what the dialog's OK acts on (such as the `__command` and `__params` of a `confirm` or `command` dialog) or the dialog's own state: setting it is the error "the `` dialog cannot set protected field ``", and the dialog stays as it was. `fields` sets the list (at most 256 items) in order (a missing `value` is `null`) and checks every item first: when one is refused, the call is an error and no field changes. `action: "confirm"` or `"cancel"` on `ui.dialog.set` then confirms or cancels the same dialog in the same request, as `ui.dialog.confirm` and `ui.dialog.cancel` do, and the reply is `{dialog, result}`: the dialog after the fields were set and the reply to confirm (`null` for cancel); any other `action` is an error and no field changes | +| `ui.dialog.set` / `.confirm` / `.cancel` | `{field, value, action?}` or `{fields: [{field, value}…], action?}` | fill and submit the open dialog. `ui.dialog.set` takes the fields the dialog has (`ui.inspect`) other than its `__` fields, the `__` fields that are controls of the dialog (such as `__section`, `__allArtboards` and `__bleedLinked` in Save PDF, `__constrain` in Transform Each and the shape dialogs, and `__search` and `__category` in Preferences; Save PDF's and Print's `__savePresetAs`, the preset name, only while Save Preset… asks for it, since OK then saves a preset), `discard` on a dialog with a discard button, `preview` on one with a live preview, the fields that the dialog reads but adds only when a control changes (such as `searchFolder`, or `copy` in the Transform dialogs), and the fields it passes to the command it runs: every parameter of the `command` dialog's command (`ui.paramDialog`), and the `textureImage` that Load Texture… sets in the Glass, Texturizer and Rough Pastels effects; any other field is an error that lists the dialog's fields, and the dialog stays as it was. Any other `__` field, held or not, holds what the dialog's OK acts on (such as the `__command` and `__params` of a `confirm` or `command` dialog) or the dialog's own state: setting it is the error "the `` dialog cannot set protected field ``", and the dialog stays as it was. `fields` sets the list (at most 256 items) in order (a missing `value` is `null`) and checks every item first: when one is refused, the call is an error and no field changes. `action: "confirm"` or `"cancel"` on `ui.dialog.set` then confirms or cancels the same dialog in the same request, as `ui.dialog.confirm` and `ui.dialog.cancel` do, and the reply is `{dialog, result}`: the dialog after the fields were set and the reply to confirm (`null` for cancel); any other `action` is an error and no field changes | | `ui.screenshot` | `{path?, data?}` | capture the window (PNG), written to `path`; `data: true` sends it back as `pngBase64` too. The inline PNG is capped at 64 MiB: with a `path` the file is still written and `pngBase64` is omitted when the image is larger, while a path-less `data: true` request fails if either the raw RGBA image or the encoded PNG exceeds the cap. Needs a presented frame: with the screen locked or the window minimized/covered it fails after ~8 s with an explanatory error | | `ui.render` | `{path?, scale?, artboard?, data?, traceViews?}` | render an artboard headlessly (PNG with the pixels of `app.export {format: "png", background: "white"}` at the same scale; `artboard`: its 0-based index, default the first; `traceViews: true`: Image Trace objects draw in their View, as on the canvas, instead of their tracing result): written to `path`, else (or with `data: true` as well) sent back as `pngBase64` | | `ui.resize` | `{width?, height?}` | request the window's inner size; omitted or null `width` and `height` default to 1440 and 900. Returns `null` | @@ -110,7 +110,7 @@ the two can still win that race. | `app.open` / `app.save` / `app.export` / `app.quit` | `{path, importer?, params?}` / `{path?}` / `{path?, format?, artboard?, range?, scale?, …}` | `app.open` reads every format `document.open` reads (see `document.formats`) and returns its result (`{index, title, format, warnings, …}`; `warnings` say what didn't come in as it was, such as an EPS shown as its preview image and why its PostScript couldn't be read), or null when a dialog asks first or a library loads. The status bar (`ui.inspect` → `ui.status`), after a line about the document's linked files when there is one (Missing linked files below), counts the `warnings` and names the first that says reading the file left something out (the notes that make Save ask before writing over it), else the first; with several, hovering it lists them in that order, as many as fit in the window (at most 30), then how many more. After `app.save`, and `app.export` with a `path`, the status bar counts the reply's `warnings` and names the first, and with several, hovering it lists them in the reply's order (a save's notes start with what the format loses). With `importer` (an importer plug-in's format id, `plugin.`) it runs `file.openWith`: the file opens with that importer, also when a built-in format reads its extension, with the importer's parameters `params` (their defaults when omitted; no dialog asks for them). Without `importer`, `params` go to the importer that opens the file, and a built-in format does not read them. `app.export` encodes through the engine's `document.export` (same options; the document keeps its path) and writes `path` through the host; without `path` it returns `{dataBase64, format, bytes}`, as headless mode does. It refuses a key that no format takes, and an unknown key inside a PDF or EPS option object, before it writes anything (`docs/mcp.md`, Parameter keys). It accepts a key that only another format takes and does not use it: the reply's `warnings` and the status bar name the key ("`quality` was not used: PDF files don't read it"). `app.save` refuses a key that no save format takes, beside the path or in `options`, the same way. `app.quit`, `file.close` and `file.closeAll` first open a `saveChanges` dialog for each modified document (they return `{"pending": "saveChanges"}`): `ui.dialog.confirm` saves, `ui.dialog.set {field: "discard", value: true}` then confirm discards, `ui.dialog.cancel` cancels the whole close or quit | | `app.export` with `useArtboards` | `{path, useArtboards: true, range? \| artboards?, …}` | Export As: PNG, JPEG and WebP write one file per chosen artboard (default all; SVG does so for a `range`), `-.`, and return `{path, files: [path…]}`; a PDF keeps them as pages of `path`. `useArtboards: false` covers the bounds of the visible art. The menu's Export As… is `file.exportAs`: the `exportAs` dialog (`format`, `useArtboards`, `all`, `range`), then a save dialog and the format's options: `pngOptions` / `jpgOptions` / `webpOptions`, `svgOptions`, or `savePdf` for a PDF | | `ui.dialog.*` on `gradientStop` | `{field: "color" \| "opacity" \| "location", value}` | double-clicking a stop on the Gradient tool's annotator opens its popover (fields `index`, `x`, `y`, `tab`); set `color` (hex), `opacity` or `location` (percentages) and `ui.dialog.confirm` to apply them to the selected stop. `gradient.selectStop {index}` picks the stop the annotator, the panels and Delete/←/→ (`ui.key`) act on | -| `engine.execute` `ui.savePdfDialog` | `{path?, preset?, range?, …document.exportPdf options}` | opens the Save PDF dialog (`file.export.pdf` with no params opens it too). Its fields are the `document.exportPdf` options: set `compatibility` with `ui.dialog.set {field: "compatibility", value: "1.5"}`, a whole section with `{field: "compression", value: {…}}`, the artboards with `__allArtboards: false` and `range`, the visible section with `__section` (General, Compression, Marks and Bleeds, Output, Advanced, Security, Summary). `useArtboards: false` opens it for one page of the visible art's bounds, as Export As with Use Artboards off does: the dialog has no Artboards section and its `__artBounds` field is true. `ui.dialog.confirm` writes `path` (else asks for one), returns `{path, bytes, warnings}` and opens the file when `viewAfterSaving` is set. With `useArtboards: false` it writes the page as `app.export` does and returns `{path, warnings}`, or `{background: true, status}` while Background Export writes it | +| `engine.execute` `ui.savePdfDialog` | `{path?, preset?, range?, …document.exportPdf options}` | opens the Save PDF dialog (`file.export.pdf` with no params opens it too). Its fields are the `document.exportPdf` options: set `compatibility` with `ui.dialog.set {field: "compatibility", value: "1.5"}`, a whole section with `{field: "compression", value: {…}}`, the artboards with `__allArtboards: false` and `range`, the visible section with `__section` (General, Compression, Marks and Bleeds, Output, Advanced, Security, Summary), and the bleed link with `__bleedLinked` (true gives every side the top value; any value other than true or false is an error; setting `bleed` turns the link on when its four sides are equal and off when they differ). `useArtboards: false` opens it for one page of the visible art's bounds, as Export As with Use Artboards off does: the dialog has no Artboards section and its `__artBounds` field is true. `ui.dialog.confirm` writes `path` (else asks for one), returns `{path, bytes, warnings}` and opens the file when `viewAfterSaving` is set. With `useArtboards: false` it writes the page as `app.export` does and returns `{path, warnings}`, or `{background: true, status}` while Background Export writes it | | `file.save` / `file.saveAs` / `file.saveCopy` / `file.saveAsTemplate` (via `engine.execute`) | `{path?, format?, options?, svg?}` | Save writes the document's own file in its own format (a document opened from or saved as SVG/PDF saves as that again; the result's `warnings` say what the format loses). With `path` the file is written at once (Save As or a Copy to an SVG path without SVG options first opens SVG Options, below). Without one (never saved, a converted older file, Save As, a Copy, a Template) the app shows a save panel with one file type per save format (`vectorcraft`, `template`, `pdf`, `svg`, `svgz`, `ai`; for a Template, `template` and `ait`), then the format's options: SVG opens the `svgOptions` dialog (below; returns `{"pending": "svgOptions", "path"}`), PDF the `savePdf` dialog (its `__save` field names the save command); `ui.dialog.confirm` finishes the save. A name typed in the panel without the file type's extension gets it, and a name the panel returns with the extension of a format the panel does not list has it replaced (in a native save, `card.png` and `card.ait` are saved as `card.vectorcraft`, and `notes.v2`, whose extension names no format, is saved as `notes.v2.vectorcraft`); when a file of that name exists, which the panel did not ask about, the save (and every export or other write through a save panel) answers `cancelled` and opens a `replaceFile` dialog (fields `message`, `detail`, `path`): `ui.dialog.confirm` writes that file, `ui.dialog.cancel` writes nothing. A save or export that writes other files beside that path (a file per artboard, linked images, image maps) checks them before it writes anything: when any of them exists, it writes nothing and opens a `replaceFiles` dialog (fields `message`, `detail` (each file's name when there are several), `files`, `__command`, `__params`; the reply is `{"pending": "replaceFiles"}`, or comes once a Background Save or Export ends): `ui.dialog.confirm` runs the save or export again and replaces them, `ui.dialog.cancel` writes nothing; a dialog open when a background job asks stays open, and the question follows it. A save does not ask about the files the document's last Save or Save As in this session wrote. On the web a `saveOptions` dialog (fields `path`, `format`) first names the file and picks the format. `file.formatOptions {format?}` reads the options a save would use. `file.revert` opens a `confirm` dialog (`{"pending": "confirm"}`); `ui.dialog.confirm` reloads the saved file in the same tab. Location refusals return `READ_ONLY_LOCATION: ` without a fallback panel for automation; see [Save location errors](#save-location-errors). | | SVG Options (`engine.execute` of `file.export.svg`, `file.saveAs`, `file.saveCopy`) | `{}` / `{path?, svg?: {…}}` | `file.export.svg` without params, and Save As or Save a Copy to an `.svg`/`.svgz` path without SVG options, open the `svgOptions` dialog (`ui.dialog.set` its fields: `styling`, `outlineText`, `images`, `objectIds`, `decimals`, `minify`, `responsive`, `fewerTspans`, `metadata`, `preserveEditing`, `useArtboards`, `allArtboards`, `range`, `showCode`, `profile` (`svg11`/`tiny12`), `encoding` (`utf8`/`utf16`/`latin1`), `embedFonts`; `ui.dialog.confirm` exports or saves and remembers the choices). With `svg: {…}` (the `document.formats` SVG options) they run directly. `app.save {path?, svg?}` takes the same options; a document saved as SVG saves as SVG again with the same options | | `engine.execute` `file.place` | `{paths?}` / `{path \| name+dataBase64, …file.place params}` | with no file, picks files and opens the `place` dialog; with `paths`, opens it for them (fields `files`, `link`, `template`, `replace`; `__replace` says whether Replace applies, `__info` describes each file). `ui.dialog.confirm` places one file centered in the view (or in place of the selected object) and loads the place cursor with several (`file.place.queue`). In the desktop app the dialog reads its files off the UI thread: `__info` is empty until they are read, `ui.dialog.confirm` returns `{background: true, status}`, `ui.inspect` lists the files still being read in `placing`, and the file is placed (or the cursor loaded) once it is read. With a file, it runs `file.place` centered in the view, at once. Files dropped on the window with no document open open. On the web, files dropped on the canvas are placed at the drop point (linked; Shift embeds) and files dropped off it (the tab bar) open, as in Illustrator; desktop drops carry no pointer position, so documents (native, SVG, PDF, `.ai`, EPS, DXF, EMF/WMF) open as tabs of their own and pictures and text are placed in the middle of the view. Swatch libraries and color books (`.vcswatches`, `.gpl`, `.ase`, `.acb`), graphic style libraries (`.vcstyles`), Libraries panel files (`.vclibrary`), presets (`.vcflattener`, `.vcpdfpresets`, `.vcprintpresets`, `.vcperspective`, `.vcexportpresets`), plug-ins (`.wasm`) and shortcut sets (`.kys`, in Import Shortcut Set) open wherever they are dropped, as File › Open opens them. With the cursor loaded (`ui.inspect` → `tool: "place"`, `toolOptions: {count, current, name, names}`), `ui.pointer` clicks and drags place files (in the desktop app each file is read off the UI thread and placed once it is read, and `ui.inspect` lists it in `placing` until then) and `ui.key` ←/→/↑/↓ and Escape cycle and discard them | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..b8f63883df 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2009,6 +2009,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur PDF export and `.ai` saves write a page with a side longer than 14,400 pt with a `UserUnit` (PDF 1.6), its longer side divided by 14,400 and rounded up to the next thousandth, so that no side is longer than 14,400 units (ISO 32000-1, Annex C.2); a PDF 1.5 file with such a page is written as PDF 1.6 with PDF 1.5's encryption, PDF/X files and PDF 1.3 and 1.4 files write it in points (in PDF 1.3 and 1.4, a page past 32,767 pt that needs a real number past 32,767 is refused with an error naming it), a page whose short side is 3 pt or longer but would be under 3 units at that `UserUnit` gets a smaller one that keeps the short side at 3 units, and the export's warnings give each such page's size and how it is written (#6382). The Save PDF dialog's "Write pages longer than 200 in at full size in points" (`longPagesInPoints`, on by default; `.ai` saves leave it off) writes such pages in points without a `UserUnit` at every PDF version, in files without a PDF/X or PDF/A standard, so readers that ignore `UserUnit` show them at full size. Export As PDF with Use Artboards off also opens the Save PDF dialog, without its Artboards section, and writes one page of the visible art's bounds with the dialog's options (`document.exportPdf {useArtboards: false}`; `crates/ui-egui/src/dialogs/tests_export.rs`, `crates/engine/src/cmd/fileio/tests_pdf.rs`). While Alt (Option on macOS) is held, the Save PDF dialog's Cancel button reads Reset, which puts every option back to the chosen preset's settings, passwords included, and leaves the dialog open; letting the key go shows Cancel again (`ui.dialogReset`). [The help page](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=283) says that holding Alt or Option and clicking Reset returns the options to their defaults. Resetting to the chosen preset's settings, and keeping the preset, path, artboard range and section, are VectorCraft's own rules (`crates/ui-egui/src/dialogs/save_pdf/tests.rs`, `crates/ui-egui/src/dialogs/tests.rs`). + The Save PDF dialog and the PDF preset editor have a link button beside the four bleed values in Marks and Bleeds: while it is on, editing one value sets the other three to it. [The help page](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=249) describes this button for the PDF dialog. VectorCraft's own rules: the link opens on when the four values are equal and off when they differ, also after choosing a preset or Reset; turning it on gives every side the top value; turning it off leaves the values as they are; with Use Document Bleed Settings on, the button is grayed out and the custom values and link stay as they were. The link is not a PDF option or a preset setting; `ui.dialog.set` sets it as `__bleedLinked` (`crates/ui-egui/src/dialogs/save_pdf/tests.rs`). `document.exportSelection` run without params (a shortcut) takes the same route after its save panel: a picked PDF opens the Save PDF dialog without its Artboards section, and SVG, the raster formats, EPS, DXF, text and exporter plug-ins with parameters open their options, whose OK writes the selection alone, cropped to it, with the chosen options (`crates/ui-egui/src/dialogs/tests_export_selection.rs`). A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`). That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`). From 6caa857cf17f0cb4954ab5755ccdfab7e08cd585 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:24:19 -0800 Subject: [PATCH 179/247] Brushes: Chevron Arrow's second chevron keeps its length on a long path Chevron Arrow stretches only the shaft before its second chevron, so both chevrons keep their length however long the path is. The Bundled content row counts the Arrows library. --- crates/engine/src/cmd/brushlib.rs | 16 +++++++++------- crates/engine/src/tests/brushlib.rs | 17 +++++++++++++++++ docs/target-app-parity.md | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index a709d9b05e..a38b82ab6c 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -234,12 +234,13 @@ fn art(name: &str, art: Node, colorization: Colorization) -> Brush { Brush { name: name.into(), kind: BrushKind::Art(ArtBrush { art, colorization, ..Default::default() }) } } -fn arrow_art(name: &str, art: Node, start: f64) -> Brush { +/// An Arrows brush whose art stretches only between `start` and `end` (fractions of its length). +fn arrow_art(name: &str, art: Node, start: f64, end: f64) -> Brush { Brush { name: name.into(), kind: BrushKind::Art(ArtBrush { art, - scale: ArtScale::BetweenGuides { start, end: 0.76 }, + scale: ArtScale::BetweenGuides { start, end }, colorization: Colorization::Tints, ..Default::default() }), @@ -271,11 +272,12 @@ fn arrows() -> BrushLibrary { "Arrows", Document::new(100.0, 100.0), vec![ - arrow_art("Solid Arrow", solid, 0.0), - arrow_art("Open Arrow", outline, 0.0), - arrow_art("Double Arrow", double, 0.24), - arrow_art("Chevron Arrow", chevrons, 0.0), - arrow_art("Dashed Arrow", dashed, 0.0), + arrow_art("Solid Arrow", solid, 0.0, 0.76), + arrow_art("Open Arrow", outline, 0.0, 0.76), + arrow_art("Double Arrow", double, 0.24, 0.76), + // The second chevron starts at 53 pt, so only the shaft before it stretches. + arrow_art("Chevron Arrow", chevrons, 0.0, 0.53), + arrow_art("Dashed Arrow", dashed, 0.0, 0.76), ], ) } diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index 06d2ddc242..6b87a3c730 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -257,6 +257,23 @@ fn arrows_library_lists_renders_and_applies_original_brushes() { assert_eq!(brush(&s, "Double Arrow"), lib.brushes[2]); } +#[test] +fn the_chevron_arrows_second_chevron_keeps_its_length_on_a_long_path() { + let s = session(); + let (_, lib) = cmd::brushlib::library(&s, "Arrows").unwrap(); + let b = lib.brush("Chevron Arrow").unwrap(); + let widths = |length: f64| { + let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line_to(length), &black_stroke()); + let children = pieces[0].children().unwrap(); + assert_eq!(children.len(), 3, "shaft, head and second chevron"); + children[1..].iter().map(|n| n.geometric_bounds().unwrap().width()).collect::>() + }; + let short = widths(100.0); + for (long, short) in widths(400.0).into_iter().zip(short) { + assert!((long - short).abs() < 1e-6, "the heads keep their length: {long} on 400 pt, {short} on 100 pt"); + } +} + #[test] fn dashed_arrow_keeps_separate_dashes_and_survives_library_save() { let mut s = session(); diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fe412d6176..4166c4d018 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -572,7 +572,7 @@ since 2026-10-01. | **Interaction fidelity:** modifiers, cursors, small behaviours | ~30–40% | The dedicated pass hasn't started, and there has been no side-by-side session with Illustrator yet. A power user notices this first | | **Look & feel** | ~75–80% | Measured against Illustrator 2026 screenshots (2026-10-02); the panels added since haven't been re-measured | | **File interop** | ~85% | SVG/SVGZ, PDF and PDF-compatible `.ai` (and legacy version 7 `.ai` out, keeping layers, groups and type as text), EPS, DXF, EMF/WMF, raster formats, PSD export and PSD/PSB placement (merged image), Place and Links, Package, Print, clipboard flavours. Affinity documents (Affinity 1–3) open natively as editable art, checked against 51 pinned public files (33 current `.af`), with selected saved-thumbnail comparisons and every-board native/SVG/PDF/PSD checks for current files; Affinity export is missing and effects, adjustments and brushes don't import. Affinity isn't an Illustrator feature, so this doesn't raise the parity score. The editing copy inside an Illustrator EPS or `.ai` is read for its structure: layers, groups, names, hidden objects and type, colours, gradients, transparency, images and every artboard (see Out of scope for what it doesn't read yet); DWG has no open spec | -| **Bundled content:** brush, symbol, style and swatch libraries | ~46% | Ours are original and generated in code, and far fewer than Illustrator ships; symbol libraries have six (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons, Weather Icons), graphic style libraries eleven (including Game HUD, Status Effects and Neon & Glow) and brush libraries ten (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit) beside User Defined and Other Library… | +| **Bundled content:** brush, symbol, style and swatch libraries | ~46% | Ours are original and generated in code, and far fewer than Illustrator ships; symbol libraries have six (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons, Weather Icons), graphic style libraries eleven (including Game HUD, Status Effects and Neon & Glow) and brush libraries eleven (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows) beside User Defined and Other Library… | | **Performance** | unverified | Multithreaded, off-thread rendering and caches are in place. The last budget run (2026-10-01, loaded machine) measured 290 ms for a 50k-path fit against a 16 ms budget. Re-run `vectorcraft-cli perf` on an idle machine | | **Robustness** | good, new | ~2,840 tests, property tests, no panics in shipped code (lints, the `guard` safety net, import fuzzing), Data Recovery. Missing: a corpus of real-world files, Windows/Linux/browser QA | | **Platforms and 1.0 polish** | ~60% | The macOS app and the web build work, and Finder opens every readable format with the macOS app (#295, #354); on macOS the menus are in the system menu bar, laid out as a Mac app's, with the in-window menus as a fallback (`--in-window-menus`; verified on Windows and by cross-compilation, not yet by hand on a Mac); hybrid-graphics laptops render on the power-saving GPU by default on Windows and macOS (#306), and Windows starts on Direct3D 12, falling back to OpenGL, and loads no Vulkan driver unless `WGPU_BACKEND` asks for it (#545: Vulkan flickered black on an Intel GPU, DX12 and OpenGL didn't; #806: a faulty Vulkan driver crashed the app before its window appeared; verified by unit tests and the reporter's runs with `WGPU_BACKEND`), and Linux on the GPU the desktop runs on, since a Wayland compositor may refuse frames from the other one; a window that fails on its GPU while starting up starts again on the next one instead of crashing (#502; the dual-GPU Wayland case is verified by unit tests and cross-compilation, not on such hardware); web drops land in the document they were dropped on (#359); desktop drops carry no pointer position (winit 0.30), so a dropped document opens as a tab of its own and a picture or text is placed in the middle of the view, while the web places anything dropped on the canvas and opens what is dropped off it, as Illustrator does (#472); a web page that loses its WebGPU device or WebGL context restarts its graphics with the same documents (#369); on Linux/Wayland the clipboard reads the compositor's own (data-control) and copied image files paste, but files can't be dropped on the window under native Wayland until eframe moves to winit 0.31 (#398; the Wayland side is verified by compilation only), so Preferences › Performance › Linux Display Server › X11 (XWayland) opens the window through XWayland, where drops work (#1151; verified by unit tests and cross-compilation, not on a Wayland desktop); on Linux the Paste menu checks the system clipboard on a background thread, so a clipboard owner that never answers no longer freezes the window, while Windows and macOS keep their quick in-line check (#510; the X11 hang verified by the contributor, here by headless tests); on KDE Plasma 6.3+ under Wayland, pens and pen displays reach the app only under XWayland (`WAYLAND_DISPLAY=`) or with KWin's `KWIN_WAYLAND_EMULATE_TABLET=1`, since winit 0.30 has no Wayland tablet input (#491, not verified on hardware); Windows/Linux packaging and accessibility are pending | From c3e17182e1810f7d951a3f94b1b61fb58ad0802a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:37:44 -0800 Subject: [PATCH 180/247] Docs: layer.highlight uses a set past 8 valid ids in every mode The line for layer.highlight said set and add always look rows up in a set. The command builds the set in every mode only when more than 8 ids name objects after the list is cut to 100,000; with fewer it searches the rows. The Layers panel's range preview always uses a set. --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 56401998a7..9857210554 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1391,7 +1391,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Layer Options for several highlighted rows shows the first row's settings, and OK changes only the settings set in the dialog: each row keeps its own color, Template, Lock, Show, Print, Preview and Dim Images otherwise (`crates/ui-egui/src/dialogs/layer_options.rs` tests). As VectorCraft's own rule, a layer color (`layer.setProps`, `layer.new`, `layer.newSublayer`) or a Live Paint Gap Preview Color (`livePaint.gapOptions`) given as a hex color with an alpha part (`#rrggbbaa` or `#rgba`) is an error and changes nothing, instead of being set without its alpha. Regression tests: `a_layer_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/layers.rs` and `a_gap_color_with_an_alpha_part_is_refused` in `crates/engine/src/tests/build.rs`. Panel Options › Locate Selected Objects (beyond Illustrator, off by default): when the last selected object changes on the canvas or by a command, the panel opens the layers and groups around it and scrolls to its row, as Locate Object does, without highlighting the row; when Show Layers Only, a search or the filter leaves the object without a row, the panel opens no rows for it and scrolls as with the option off. - A Shift-click or Shift+Ctrl/Cmd-click range (`layer.highlight` with `set` or `add`, and the panel's preview of the rows before it sends the command) looks each row up in a set of the highlighted rows instead of searching the highlighted rows once for each row, as does a `toggle` of more than 8 ids; the work grows in step with the number of rows. The rows, their order, the returned rows and the current layer are the same as before. Tests: `tests::layers::layer_highlight_matches_a_search_of_the_rows_for_each_id`, `tests::layers::highlighting_rows_keeps_their_order_with_repeated_unknown_and_excess_ids` and `widgets::drag::row_click_tests::a_large_range_applies_as_a_search_of_the_rows_for_each_id_does`; timing: `cargo test --release -p vectorcraft-engine --lib layer_highlight_timing -- --ignored --nocapture`. + When more than 8 of its ids name objects in the document (after the list is cut to 100,000), `layer.highlight` in each mode (`set`, `add` and `toggle`) looks each row up in a set of the highlighted rows instead of searching the highlighted rows once for each row; with 8 or fewer it searches them. The Layers panel's preview of a Shift-click or Shift+Ctrl/Cmd-click range, before it sends the command, always looks the rows up in a set. The work grows in step with the number of rows. The rows, their order, the returned rows and the current layer are the same as before. Tests: `tests::layers::layer_highlight_matches_a_search_of_the_rows_for_each_id`, `tests::layers::highlighting_rows_keeps_their_order_with_repeated_unknown_and_excess_ids` and `widgets::drag::row_click_tests::a_large_range_applies_as_a_search_of_the_rows_for_each_id_does`; timing: `cargo test --release -p vectorcraft-engine --lib layer_highlight_timing -- --ignored --nocapture`. - **Drawing aids:** Smart Guides and snapping (moving, with the Selection, Group Selection or Direct Selection tool, and resizing by the bounding-box handles with the Selection or Free Transform tool, Shift and Alt too: the dragged corner or side lands on the other objects' anchors and centres ("anchor", "center") or lines up with their edges and centres (a line and "align"); with Smart Guides › Spacing Guides, a moved selection that lines up with nothing along an axis lands as far from its neighbour as two other objects of its row or column are apart, or halfway between its two neighbours, the equal gaps marked; with View › Snap to Grid on, a moved selection lands on the grid instead, by whichever of its edges is nearest a gridline on each axis (the center does not snap), #740, #1816; the Rotate, Scale, Shear and Reflect tools drag from the anchor they grab and snap the pointer the same way, so a corner dragged onto another object's anchor scales exactly onto it, #482; anchors dragged with Direct Selection: the one pressed on lands on other anchors, its own path's that stay put among them, on path segments or in line with them, the others following, Shift keeps 45° steps, and with Smart Guides off Snap to Point pulls it onto anchors; the Artboard tool snaps artboards, and their bleed, to other artboards, bleeds and art, the grid or whole pixels while moving, copying and resizing them, and the Transform panel shows and edits the active artboard's X/Y/W/H; drawn points, #506: hovering shows where the press goes, the point lands on the other objects' anchors, centres and paths ("anchor", "center", "path") or lines up with their anchors, edges and centres ("align"), the Pen's on the path being drawn too, near a construction guide through the anchor before it on that guide (Preferences › Smart Guides › Construction Guides and Angles), and with Shift kept to its 45° step or a square's diagonal it slides along that way into line; the targets are gathered once per document state, from the art in the window, and the anchors, centres and lines near the pointer are found by bisection, so hovering never rescans the document), guides dragged out of the rulers (#451: they snap as moved guides do, Shift to the ruler's ticks; with the Artboard tool they are artboard guides, which run across their artboard only and move, copy and delete with it, `guide.add {artboard}`) that the Selection, Direct Selection and Group Selection tools then pick and drag (#414: the selected guides highlight and move together, Alt copies them, Shift snaps the dragged one to the ticks, otherwise it snaps to pixels, the grid or the edges, centres (so the sides' midpoints) and anchors of the art and the artboards, or with Smart Guides off Snap to Point pulls it onto anchors; Shift-clicked they join the selected art, and Shift-added art keeps them, so guides and art are selected together in either order, Delete then deleting both in one step; the arrow keys nudge them, Delete deletes them, dragging one back onto its ruler deletes it, Lock Guides and Hide Guides leave them alone; `guide.list`, `guide.select`, `guide.move` and `guide.remove` reach agents), a right-click on either ruler or the origin box to pick the document's units (the current one checked; `document.setUnits`, one undo step, #528), and Draw Normal / Behind / Inside modes. Smart Guides: a point drawn with the Pen or a shape tool, and an anchor dragged with Direct Selection, snaps to where paths and ruler guides cross, labelled "intersect" (#1658, part of #1602; a moved selection's own anchors don't, except the anchor the Selection tool grabbed it by). A selection the Selection tool grabs by one of its anchors snaps that anchor onto the other objects' paths ("path"), and where a path crosses another path or a ruler guide ("intersect"), in the order Direct Selection uses for a dragged anchor; when the anchor lands on a path, the selection's bounds do not also line up with other objects (#7411). The archived 2007 [user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=55) (page 49) says Smart Guides align the pointer of a moved object to existing paths. Snapping onto paths only when the selection was grabbed by an anchor is VectorCraft's own rule; a selection grabbed anywhere else still lines its bounds up. Tests: `select::tests::a_move_grabbed_by_an_anchor_lands_it_on_another_path`, `a_move_grabbed_by_an_anchor_lands_it_where_paths_cross` and `a_move_grabbed_by_an_anchor_lands_it_where_a_path_crosses_a_ruler_guide`. With Smart Guides › Measurement Labels on, the Line Segment tool labels the segment being drawn with its distance, angle and X and Y offsets (`D`, `Angle`, `dX`, `dY`), and the Pen, Curvature and Smart Pen tools label their rubber band the same way when Enable Rubber Band is on (#2983). A move that Shift keeps level, upright or diagonal stays on that line when it snaps, with the Selection, Group Selection or Direct Selection tool. It slides along the line until the selection lands on the grid or on whole pixels, lines up with the other objects or is spaced evenly with them, or until the line passes an anchor or crosses a ruler guide near the point the selection was grabbed by. A level or upright move snaps along its own axis only. Snap to Last Location: with Smart Guides on and Preferences › Smart Guides › Snap to Last Location on (off by default, VectorCraft's own choice), a selection moved by dragging with the Selection, Group Selection or Direct Selection tool, Shift too, goes back to where the move began while it is within Snapping Tolerance of it, labeled "last location"; an Alt copy is not pulled back onto its original, and with View › Snap to Grid or Snap to Pixel on the move snaps to the grid or to whole pixels instead (`prefs.set` key `snapToLastLocation`). The public [Smart Guides options](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html) page lists the option as snapping objects back to their previous position; the distance, the label, the copy rule and the grid and pixel rule are VectorCraft's own. Tests: `select::tests::snap_to_last_location_puts_a_move_back_where_it_began`, `select::tests::snap_to_pixel_wins_over_snap_to_last_location`, `direct::tests::snap_to_last_location_puts_a_path_moved_by_its_anchor_back`, `direct::tests::snap_to_pixel_wins_over_snap_to_last_location_for_a_path_moved_by_its_anchor`, `tests_prefs::snap_to_last_location_puts_a_dragged_square_back`. From 4c3c4adee7f9fc39397580b0fc85595a3f257b66 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:36:44 -0800 Subject: [PATCH 181/247] Anchor Point: Alt-drag on a handle links it with the opposite handle With the Anchor Point tool chosen, dragging a direction handle with Alt held now links it with the opposite handle and makes the anchor smooth, on paths and on a selected blend's spine. A drag without Alt still moves one handle on its own, an Alt-click still retracts the handle, and the Pen with Alt keeps moving a handle on its own. - path.setHandle and object.blend.spine.moveAnchor take link: the other handle turns in line at its own length; a retracted one is pulled out to the dragged handle's length where a segment leaves the anchor on its side, and stays retracted at an open end. A request that changes nothing records no undo step; link with independent, a non-boolean link and, for the spine, link without handle are refused. - Anchor::set_handle measures long handles without overflowing, so turning a very long handle no longer writes NaN or infinite points. - The two new error messages have rows in the message catalogs. Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md. --- crates/engine/src/cmd/live/blend.rs | 39 ++++++- crates/engine/src/cmd/live/commands.rs | 2 +- crates/engine/src/cmd/path.rs | 41 ++++++- crates/engine/src/tests/anchor_edit_work.rs | 58 ++++++++++ crates/engine/src/tests/blendspine.rs | 32 +++++ crates/geom/src/path.rs | 122 +++++++++++++++++++- crates/tools/src/draw2/anchor.rs | 31 ++++- crates/tools/src/draw2/anchor/tests.rs | 85 ++++++++++++++ crates/tools/src/pen.rs | 2 +- crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + docs/mcp.md | 15 ++- docs/target-app-parity.md | 1 + docs/ui-parity.md | 2 +- 38 files changed, 469 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/live/blend.rs b/crates/engine/src/cmd/live/blend.rs index 5334311789..17eeafe960 100644 --- a/crates/engine/src/cmd/live/blend.rs +++ b/crates/engine/src/cmd/live/blend.rs @@ -214,6 +214,25 @@ fn spine_points_param(p: &Value, cmd: &str) -> Result> { list.iter().map(|i| i.as_u64().and_then(|i| usize::try_from(i).ok()).ok_or_else(wrong)).collect() } +/// Whether linking handle `out` of spine point `index` at `q` would leave the blend's spine as it +/// is (false when the blend or the point is not there, for the edit to report it). +fn spine_link_unchanged(s: &Session, p: &Value, cmd: &str, index: usize, out: bool, q: Point) -> Result { + let id = match crate::cmd::object_param(p, "id", cmd)? { + Some(id) => Some(id), + None => selected_of(s, is_blend).first().copied(), + }; + let d = &s.doc()?.doc; + let Some(NodeKind::Blend { children, spec }) = id.and_then(|id| d.node(id)).map(|n| &n.kind) else { return Ok(false) }; + let Some((path, _)) = live::pin_spine(children, spec) else { return Ok(false) }; + Ok(path.subpaths.first().is_some_and(|sp| { + sp.anchors.get(index).is_some_and(|a| { + let mut linked = *a; + linked.link_handle(out, q, sp.has_segment(index, !out)); + linked == *a + }) + })) +} + pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result { const C: &str = "object.blend.spine.moveAnchor"; let index = index_param(p, "anchor", C)?; @@ -225,15 +244,33 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result { Some(_) => return Err(bad(C, "handle must be in or out")), }; let independent = switch_or(p, "independent", false, C)?; + let link = switch_or(p, "link", false, C)?; let with = spine_points_param(p, C)?; // Any `with`, even an empty list, asks to move points, which a handle drag doesn't. if handle.is_some() && p.get("with").is_some_and(|v| !v.is_null()) { return Err(bad(C, "`with` moves points, not a handle")); } + if link && independent { + return Err(bad(C, "`link` and `independent` cannot both be true")); + } + if link && handle.is_none() { + return Err(bad(C, "`link` places a handle: give `handle`")); + } + if link && let Some(out) = handle { + // A spine point the linked handles would leave as it is records no undo step. + if spine_link_unchanged(s, p, C, index, out, q)? { + return ok(); + } + } edit_spine(s, p, C, "Reshape Spine", |sp, anchors, keys| { + let pull_out = handle.is_some_and(|out| sp.has_segment(index, !out)); let a = sp.anchors.get_mut(index).ok_or_else(|| bad(C, "no such spine point"))?; if let Some(out) = handle { - a.set_handle(out, q, independent); + if link { + a.link_handle(out, q, pull_out); + } else { + a.set_handle(out, q, independent); + } return Ok(()); } let delta = q - a.p; diff --git a/crates/engine/src/cmd/live/commands.rs b/crates/engine/src/cmd/live/commands.rs index 79b2915aa0..991ebf103c 100644 --- a/crates/engine/src/cmd/live/commands.rs +++ b/crates/engine/src/cmd/live/commands.rs @@ -99,7 +99,7 @@ pub fn specs() -> Vec { "Move Spine Point", [], None, - "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", + "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool, link?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`; `link` makes the point smooth with the other handle in line at its own length, a retracted one pulled out to the moved handle's length where a segment leaves the point on its side; `link` needs `handle` and cannot go with `independent`). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", has_doc, spine_move_anchor ), diff --git a/crates/engine/src/cmd/path.rs b/crates/engine/src/cmd/path.rs index 6c06b52c6c..4ec39cff61 100644 --- a/crates/engine/src/cmd/path.rs +++ b/crates/engine/src/cmd/path.rs @@ -50,7 +50,7 @@ pub fn specs() -> Vec { "Move Direction Handle", [], None, - "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool}", + "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, link?: bool} move a direction handle; independent moves only that side and makes the anchor a corner; link makes the anchor smooth with the other handle in line at its own length (a retracted one is pulled out to the moved handle's length where a segment leaves the anchor on its side); link and independent cannot both be true; both default false", has_doc, set_handle ), @@ -313,6 +313,9 @@ fn set_handle(s: &mut Session, p: &Value) -> Result { let ai = index_opt(p, "anchor", "path.setHandle")?.ok_or_else(|| bad("path.setHandle", "missing anchor"))?; let out = str_param(p, "which") != Some("in"); let pos = Point::new(f64_req(p, "x", "path.setHandle")?, f64_req(p, "y", "path.setHandle")?); + if switch_or(p, "link", false, "path.setHandle")? { + return link_handle(s, p, id, si, ai, out, pos); + } let independent = switch_or(p, "independent", false, "path.setHandle")?; // A handle already there, on an anchor already of the kind it would get, changes nothing and // records no undo step. The handle is compared directly: `set_handle` would recompute the @@ -332,6 +335,42 @@ fn set_handle(s: &mut Session, p: &Value) -> Result { ok() } +/// `path.setHandle` with `link` (the Anchor Point tool's Alt-drag on a handle): the handle goes to +/// (x, y) and the anchor becomes smooth, its other handle turned in line at its own length. A +/// retracted other handle is pulled out to the moved handle's length when a segment leaves the +/// anchor on its side, and stays retracted at an open end. An anchor the edit would leave as it +/// is records no undo step. +fn link_handle(s: &mut Session, p: &Value, id: NodeId, si: usize, ai: usize, out: bool, pos: Point) -> Result { + const C: &str = "path.setHandle"; + if switch_or(p, "independent", false, C)? { + return Err(bad(C, "`link` and `independent` cannot both be true")); + } + if !(pos.x.abs() < 1e9 && pos.y.abs() < 1e9) { + return Err(bad(C, "x and y must be finite")); + } + if s.script_running() { + return Err(EngineError::Busy); + } + let unchanged = s.doc()?.doc.node(id).and_then(|n| n.path_data()).and_then(|pd| pd.subpaths.get(si)).is_some_and(|sp| { + sp.anchors.get(ai).is_some_and(|a| { + let mut linked = *a; + linked.link_handle(out, pos, sp.has_segment(ai, !out)); + linked == *a + }) + }); + if unchanged { + return ok(); + } + s.edit("Reshape", |d, _| { + let sp = path_mut(d, id)?.subpaths.get_mut(si).ok_or_else(|| EngineError::Other("no such anchor".into()))?; + let pull_out = sp.has_segment(ai, !out); + let a = sp.anchors.get_mut(ai).ok_or_else(|| EngineError::Other("no such anchor".into()))?; + a.link_handle(out, pos, pull_out); + Ok(()) + })?; + ok() +} + /// `path.moveAnchor`: one anchor to (x, y), its handles keeping their offsets (the Anchor Point /// tool's Shift-drag). fn move_anchor(s: &mut Session, p: &Value) -> Result { diff --git a/crates/engine/src/tests/anchor_edit_work.rs b/crates/engine/src/tests/anchor_edit_work.rs index 5401bc0bf8..5130d30c26 100644 --- a/crates/engine/src/tests/anchor_edit_work.rs +++ b/crates/engine/src/tests/anchor_edit_work.rs @@ -176,3 +176,61 @@ fn a_handle_already_in_place_on_a_smooth_anchor_records_no_undo_step() { .unwrap(); assert_eq!(undo_steps(&s), 1); } + +/// `path.setHandle` with `link` makes a corner smooth: the other handle turns in line at its own +/// length, a retracted one is pulled out to the moved handle's length where a segment leaves the +/// anchor on its side and stays retracted at an open end. A handle already in place on a corner +/// still links; a request that changes nothing records no undo step; `link` that is not a boolean +/// or goes with `independent` is refused. +#[test] +fn a_linked_handle_makes_the_anchor_smooth() { + let (mut s, id) = long_path(100); + let p = anchor(&s, id, 5).p; + let corner = Anchor { p, h_in: p + Vec2::new(-6.0, 8.0), h_out: p + Vec2::new(3.0, 0.0), kind: AnchorKind::Corner }; + let path = Arc::make_mut(&mut s.doc_mut().unwrap().doc).node_mut(id).unwrap().path_data_mut().unwrap(); + path.subpaths[0].anchors[5] = corner; + let link = |x: f64, y: f64, ai: usize| json!({"id": id.0, "anchor": ai, "which": "out", "x": x, "y": y, "link": true}); + let near = |a: Point, b: Point| a.distance(b) < 1e-9; + + // The out handle stays where it is; the corner becomes smooth, the in handle turned opposite it. + s.execute("path.setHandle", &link(corner.h_out.x, corner.h_out.y, 5)).unwrap(); + assert_eq!(undo_steps(&s), 1); + let a = anchor(&s, id, 5); + assert_eq!((a.kind, a.h_out), (AnchorKind::Smooth, corner.h_out)); + assert!(near(a.h_in, p + Vec2::new(-10.0, 0.0)), "{a:?}"); + // Moved: the in handle keeps its length of 10. + let to = p + Vec2::new(4.0, 3.0); + s.execute("path.setHandle", &link(to.x, to.y, 5)).unwrap(); + assert_eq!(undo_steps(&s), 2); + let a = anchor(&s, id, 5); + assert!(a.kind == AnchorKind::Smooth && a.h_out == to && near(a.h_in, p + Vec2::new(-8.0, -6.0)), "{a:?}"); + // The same request again changes nothing. + s.execute("path.setHandle", &link(to.x, to.y, 5)).unwrap(); + assert_eq!(undo_steps(&s), 2); + + // A retracted in handle on an inner anchor is pulled out; at the open start it stays retracted. + let q = anchor(&s, id, 7).p; + s.execute("path.setHandle", &link(q.x, q.y + 5.0, 7)).unwrap(); + let a = anchor(&s, id, 7); + assert!(a.kind == AnchorKind::Smooth && near(a.h_in, q + Vec2::new(0.0, -5.0)), "{a:?}"); + let q = anchor(&s, id, 0).p; + s.execute("path.setHandle", &link(q.x, q.y + 5.0, 0)).unwrap(); + let a = anchor(&s, id, 0); + assert!(a.kind == AnchorKind::Smooth && a.h_in == q && a.h_out == q + Vec2::new(0.0, 5.0), "{a:?}"); + + let before = s.doc().unwrap().doc.clone(); + let undo = undo_steps(&s); + for bad in [ + json!({"id": id.0, "anchor": 5, "which": "out", "x": 0, "y": 0, "link": "yes"}), + json!({"id": id.0, "anchor": 5, "which": "out", "x": 0, "y": 0, "link": 1}), + json!({"id": id.0, "anchor": 5, "which": "out", "x": 0, "y": 0, "link": true, "independent": true}), + json!({"id": id.0, "anchor": 5, "which": "out", "x": 0, "y": 0, "link": true, "independent": "no"}), + json!({"id": id.0, "anchor": 100, "which": "out", "x": 0, "y": 0, "link": true}), + json!({"id": id.0, "anchor": 7, "which": "out", "x": 1.7e308, "y": 1.7e308, "link": true}), + json!({"id": id.0, "anchor": 7, "which": "out", "x": 0, "y": -1e9, "link": true}), + ] { + assert!(s.execute("path.setHandle", &bad).is_err(), "{bad}"); + } + assert!(s.doc().unwrap().doc == before, "a refused request changed the document"); + assert_eq!(undo_steps(&s), undo); +} diff --git a/crates/engine/src/tests/blendspine.rs b/crates/engine/src/tests/blendspine.rs index c22eb188b7..7f7c7fffa4 100644 --- a/crates/engine/src/tests/blendspine.rs +++ b/crates/engine/src/tests/blendspine.rs @@ -431,3 +431,35 @@ fn a_spine_segment_bends_with_perpendicular_handles() { use vectorcraft_geom::kurbo::ParamCurve; assert!(sp.segment(0).eval(0.5).distance(Point::new(55.0, 45.0)) < 1e-9, "{sp:?}"); } + +/// `link` with `handle` makes a spine point smooth, the other handle in line opposite the moved +/// one, without moving the keys; the same request again records no undo step, and `link` that is +/// not a boolean, goes with `independent` or comes without `handle` is refused. +#[test] +fn a_linked_spine_handle_makes_the_point_smooth() { + let mut s = session(); + let (_, _, g) = blend(&mut s); + s.execute("object.blend.spine.addAnchor", &json!({"x": 55, "y": 5})).unwrap(); + let undo = |s: &Session| s.doc().unwrap().history.undo.len(); + let link = json!({"anchor": 1, "handle": "out", "x": 75, "y": 25, "link": true}); + s.execute("object.blend.spine.moveAnchor", &link).unwrap(); + let a = spec(&s, g).spine.unwrap().subpaths[0].anchors[1]; + assert_eq!((a.kind, a.h_out), (vectorcraft_geom::AnchorKind::Smooth, Point::new(75.0, 25.0))); + let (din, dout) = (a.h_in - a.p, a.h_out - a.p); + assert!(din.hypot() > 1e-6 && (din.normalize() + dout.normalize()).hypot() < 1e-9, "{a:?}"); + let st = steps(&s, g); + assert_eq!((center(&st[0]), center(&st[2])), (Point::new(5.0, 5.0), Point::new(105.0, 5.0)), "the keys stay put"); + let done = undo(&s); + s.execute("object.blend.spine.moveAnchor", &link).unwrap(); + assert_eq!(undo(&s), done, "an unchanged spine recorded an undo step"); + let before = spec(&s, g); + for bad in [ + json!({"anchor": 1, "handle": "out", "x": 75, "y": 25, "link": "yes"}), + json!({"anchor": 1, "handle": "out", "x": 75, "y": 25, "link": true, "independent": true}), + json!({"anchor": 1, "x": 75, "y": 25, "link": true}), + ] { + assert!(s.execute("object.blend.spine.moveAnchor", &bad).is_err(), "{bad}"); + } + assert_eq!(spec(&s, g), before); + assert_eq!(undo(&s), done); +} diff --git a/crates/geom/src/path.rs b/crates/geom/src/path.rs index c5343171ef..abd72b255e 100644 --- a/crates/geom/src/path.rs +++ b/crates/geom/src/path.rs @@ -158,10 +158,56 @@ impl Anchor { let dir = p - pos; let l = dir.hypot(); if l > 1e-9 { - *other = p + dir * (len / l); + let turned = p + dir * (len / l); + if turned.is_finite() { + *other = turned; + } else { + // Long handles overflow the squares above: measure with `f64::hypot` and scale + // the unit direction, leaving the handle where it is if that is not finite. + let (v, l) = (*other - p, dir.x.hypot(dir.y)); + let turned = p + (dir / l) * v.x.hypot(v.y); + if turned.is_finite() { + *other = turned; + } + } } } } + /// Place the end of the outgoing (`out`) or incoming handle at `pos` and make the anchor smooth: + /// the other handle turns to lie in line with it on the far side of the anchor, at its own + /// length. A retracted other handle is pulled out to the moved handle's length when `pull_out` + /// and stays retracted otherwise. A handle placed on the anchor, or where the turned handle's + /// end would not be a finite point, gives no direction: it is placed, and the other handle and + /// the anchor's kind stay as they are. + pub fn link_handle(&mut self, out: bool, pos: Point, pull_out: bool) { + let p = self.p; + let (moved, other) = if out { (&mut self.h_out, &mut self.h_in) } else { (&mut self.h_in, &mut self.h_out) }; + *moved = pos; + // `f64::hypot` keeps long handles from overflowing the square of their length. + let dir = p - pos; + let l = dir.x.hypot(dir.y); + if !(l > EPS && l.is_finite()) { + return; + } + let v = *other - p; + let len = v.x.hypot(v.y); + let len = if len > EPS { + len + } else if pull_out { + l + } else { + 0.0 + }; + if len > 0.0 { + // The unit direction first, so a short handle does not overflow the scale factor. + let turned = p + (dir / l) * len; + if !turned.is_finite() { + return; + } + *other = turned; + } + self.kind = AnchorKind::Smooth; + } /// Swap handles (used when reversing path direction). pub fn reversed(&self) -> Self { Self { p: self.p, h_in: self.h_out, h_out: self.h_in, kind: self.kind } @@ -280,6 +326,11 @@ impl SubPath { pub fn polyline(points: &[Point], closed: bool) -> Self { Self { anchors: points.iter().map(|&p| Anchor::corner(p)).collect(), closed } } + /// Whether anchor `ai` has a segment on its outgoing (`out`) or incoming side. + pub fn has_segment(&self, ai: usize, out: bool) -> bool { + let n = self.anchors.len(); + ai < n && n > 1 && (self.closed || if out { ai + 1 < n } else { ai > 0 }) + } /// Number of segments (a closed path has one more, back to the start). pub fn segment_count(&self) -> usize { let n = self.anchors.len(); @@ -1103,4 +1154,73 @@ mod tests { let back: PathData = serde_json::from_str(&s).unwrap(); assert_eq!(p, back); } + + /// `link_handle` makes a corner smooth: the other handle turns onto the far side of the anchor + /// at its own length; a retracted one is pulled out to the moved handle's length only when + /// asked, and a handle placed on the anchor changes nothing else. + #[test] + fn link_handle_makes_a_corner_smooth_keeping_the_other_length() { + let p = Point::new(10.0, 10.0); + let mut a = Anchor { p, h_in: Point::new(10.0, 0.0), h_out: Point::new(13.0, 10.0), kind: AnchorKind::Corner }; + a.link_handle(true, Point::new(14.0, 13.0), false); + assert_eq!(a.kind, AnchorKind::Smooth); + assert_eq!(a.h_out, Point::new(14.0, 13.0)); + // The in handle keeps its length of 10, opposite the out handle's direction (4, 3) / 5. + assert!(a.h_in.distance(Point::new(2.0, 4.0)) < 1e-9, "{:?}", a.h_in); + + let retracted = Anchor { p, h_in: p, h_out: Point::new(13.0, 10.0), kind: AnchorKind::Corner }; + let mut pulled = retracted; + pulled.link_handle(true, Point::new(13.0, 14.0), true); + assert_eq!((pulled.kind, pulled.h_in), (AnchorKind::Smooth, Point::new(7.0, 6.0))); + let mut kept = retracted; + kept.link_handle(true, Point::new(13.0, 14.0), false); + assert_eq!((kept.kind, kept.h_in), (AnchorKind::Smooth, p)); + + let mut on_anchor = Anchor { p, h_in: Point::new(10.0, 0.0), h_out: Point::new(13.0, 10.0), kind: AnchorKind::Corner }; + on_anchor.link_handle(false, p, true); + assert_eq!(on_anchor, Anchor { p, h_in: p, h_out: Point::new(13.0, 10.0), kind: AnchorKind::Corner }); + + // A handle so far away that its distance overflows leaves the other handle finite. + let far = Point::new(1.7e308, 1.7e308); + let mut overflow = retracted; + overflow.link_handle(true, far, true); + assert_eq!(overflow, Anchor { p, h_in: p, h_out: far, kind: AnchorKind::Corner }); + // A very long other handle turned by a very short one stays finite, at its own length. + let mut long = Anchor { p: Point::ZERO, h_in: Point::new(1e308, 0.0), h_out: Point::ZERO, kind: AnchorKind::Corner }; + long.link_handle(true, Point::new(0.0, 1e-8), false); + assert_eq!((long.kind, long.h_in), (AnchorKind::Smooth, Point::new(0.0, -1e308))); + // One whose turned end would leave the finite range is left where it is. + let edge = Point::new(-1.5e308, 0.0); + let mut beyond = Anchor { p: edge, h_in: Point::new(1.5e308, 0.0), h_out: edge, kind: AnchorKind::Corner }; + beyond.link_handle(true, Point::new(-1.5e308 + 1e300, 0.0), false); + assert_eq!((beyond.kind, beyond.h_in), (AnchorKind::Corner, Point::new(1.5e308, 0.0))); + } + + /// `set_handle` on a smooth anchor turns a very long other handle without overflowing, and + /// leaves it where it is when its turned end would not be a finite point. + #[test] + fn set_handle_on_a_smooth_anchor_keeps_long_handles_finite() { + let mut long = Anchor { p: Point::ZERO, h_in: Point::new(-1e308, 0.0), h_out: Point::new(1.0, 0.0), kind: AnchorKind::Smooth }; + long.set_handle(true, Point::new(0.0, 1e-8), false); + assert_eq!(long.h_in, Point::new(0.0, -1e308)); + let edge = Point::new(-1.5e308, 0.0); + let mut beyond = Anchor { p: edge, h_in: Point::new(-1.6e308, 0.0), h_out: Point::new(1.5e308, 0.0), kind: AnchorKind::Smooth }; + beyond.set_handle(false, Point::new(-1.5e308 + 1e300, 0.0), false); + assert_eq!(beyond.h_out, Point::new(1.5e308, 0.0)); + } + + /// `has_segment` sees a segment on each side of an inner anchor, none past an open path's ends, + /// and both sides on a closed path of two anchors or more. + #[test] + fn has_segment_follows_the_open_ends() { + let pts = [Point::ZERO, Point::new(10.0, 0.0), Point::new(10.0, 10.0)]; + let open = SubPath::polyline(&pts, false); + assert!(!open.has_segment(0, false) && open.has_segment(0, true)); + assert!(open.has_segment(1, false) && open.has_segment(1, true)); + assert!(open.has_segment(2, false) && !open.has_segment(2, true)); + assert!(!open.has_segment(3, false)); + let closed = SubPath::polyline(&pts, true); + assert!(closed.has_segment(0, false) && closed.has_segment(2, true)); + assert!(!SubPath::polyline(&pts[..1], true).has_segment(0, true)); + } } diff --git a/crates/tools/src/draw2/anchor.rs b/crates/tools/src/draw2/anchor.rs index 58664704ad..b781641b14 100644 --- a/crates/tools/src/draw2/anchor.rs +++ b/crates/tools/src/draw2/anchor.rs @@ -4,7 +4,8 @@ //! Delete: click an anchor to remove it, re-fitting the neighbouring curve (Alt = add). //! Anchor Point: click a smooth anchor → corner; drag an anchor → pull out smooth handles; click a //! handle end → retract that handle only (#2267); drag a handle → move it independently (Shift: at -//! 45° steps round its anchor); drag a segment → reshape the curve, a selected blend's spine's too, +//! 45° steps round its anchor; Alt: link it with the opposite handle, the anchor made smooth, except +//! when the Pen lends the tool); drag a segment → reshape the curve, a selected blend's spine's too, //! straight or curved (#1111; Shift: its handles at right angles to the line between its anchors, //! at one length). Shift held at the press on an anchor moves it instead, handles and all (Shift //! still held: at 45° steps from where it was). Space held during a convert- or handle-drag moves @@ -103,6 +104,9 @@ pub struct AnchorTool { measure: Option<(Point, f64, f64)>, /// While Space is held during a convert/handle drag, the shape gesture to return to. space_resume: Option, + /// Lent by the Pen for its Alt gestures: Alt-dragging a handle moves it independently, as + /// without Alt, instead of linking it with the opposite handle. + lent: bool, } impl AnchorTool { @@ -113,7 +117,20 @@ impl AnchorTool { "scissors" => "scissors", _ => "addAnchor", }; - Self { id, state: State::Idle, guides: vec![], snap: HandleSnap::default(), measure: None, space_resume: None } + Self { id, state: State::Idle, guides: vec![], snap: HandleSnap::default(), measure: None, space_resume: None, lent: false } + } + + /// The Anchor Point tool as the Pen lends it with Alt held: an Alt-drag on a handle moves only + /// that handle. + pub(crate) fn lent_by_pen() -> Self { + Self { lent: true, ..Self::new("anchorPoint") } + } + + /// The handle-drag params: Alt held on the chosen Anchor Point tool links the handle with the + /// opposite one, making the anchor smooth; otherwise the handle moves independently. + fn handle_mode(&self, mut params: serde_json::Value, alt: bool) -> serde_json::Value { + params[if alt && !self.lent { "link" } else { "independent" }] = json!(true); + params } fn anchor_pos(cx: &ToolContext, id: NodeId, si: usize, ai: usize) -> Option { @@ -458,7 +475,10 @@ impl Tool for AnchorTool { }; Action::Preview( "object.blend.spine.moveAnchor".into(), - json!({"id": id.0, "anchor": ai, "handle": if out { "out" } else { "in" }, "x": q.x, "y": q.y, "independent": true}), + self.handle_mode( + json!({"id": id.0, "anchor": ai, "handle": if out { "out" } else { "in" }, "x": q.x, "y": q.y}), + ev.mods.alt, + ), ) } State::Handle { id, si, ai, out, .. } => { @@ -466,7 +486,10 @@ impl Tool for AnchorTool { self.guides = guides; Action::Preview( "path.setHandle".into(), - json!({"id": id.0, "subpath": si, "anchor": ai, "which": if out { "out" } else { "in" }, "x": q.x, "y": q.y, "independent": true}), + self.handle_mode( + json!({"id": id.0, "subpath": si, "anchor": ai, "which": if out { "out" } else { "in" }, "x": q.x, "y": q.y}), + ev.mods.alt, + ), ) } State::Reshape { id, seg, t, start, spine: true, .. } => Action::Preview( diff --git a/crates/tools/src/draw2/anchor/tests.rs b/crates/tools/src/draw2/anchor/tests.rs index 903ae5bea8..4e4af7f997 100644 --- a/crates/tools/src/draw2/anchor/tests.rs +++ b/crates/tools/src/draw2/anchor/tests.rs @@ -610,3 +610,88 @@ fn anchor_point_shift_drag_honors_measurement_labels() { assert!(t.overlays(&on).iter().any(|o| matches!(o, Overlay::Measure { text, .. } if text == &want))); assert!(!t.overlays(&off).iter().any(|o| matches!(o, Overlay::Measure { .. }))); } + +/// Alt held while dragging a handle links it with the opposite handle (`link`), making the +/// anchor smooth; without Alt the handle moves on its own. Shift with Alt keeps the 45° steps, an +/// Alt-click still retracts the handle, and Escape cancels the linking drag. The Pen, lending the +/// tool for its Alt gestures, keeps moving the handle on its own. +#[test] +fn anchor_point_alt_drag_links_a_handle_with_the_opposite_one() { + let (mut d, _) = doc_with_rect(); + let l = d.layers[0].id; + let id = d.alloc_id(); + let mut sp = vectorcraft_geom::SubPath::polyline(&[Point::new(100.0, 300.0), Point::new(200.0, 300.0), Point::new(300.0, 300.0)], false); + // A corner: handles at (240, 320) and (170, 320), not in line. + sp.anchors[1] = Anchor::with_handles(Point::new(200.0, 300.0), Point::new(170.0, 320.0), Point::new(240.0, 320.0)); + let path = vectorcraft_geom::PathData::single(sp); + d.insert(Some(l), 1, vectorcraft_doc::Node::path(id, path, vectorcraft_doc::Appearance::default_art())).unwrap(); + let mut s = Selection::default(); + s.set([id]); + let p = paint(); + let cx = cx(&d, &s, &p); + let alt = Mods { alt: true, ..Mods::default() }; + let drag = |t: &mut AnchorTool, mods: Mods, x: f64, y: f64| { + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 240.0, 320.0).with_mods(mods)); + t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, x, y).with_mods(mods)) + }; + let set = |x: f64, y: f64, key: &str| { + let mut params = json!({"id": id.0, "subpath": 0, "anchor": 1, "which": "out", "x": x, "y": y}); + params[key] = json!(true); + Action::Preview("path.setHandle".into(), params) + }; + + let mut t = AnchorTool::new("anchorPoint"); + assert_eq!(drag(&mut t, alt, 250.0, 340.0), vec![Action::Begin("Reshape".into()), set(250.0, 340.0, "link")]); + assert_eq!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 250.0, 340.0).with_mods(alt)), vec![Action::Commit]); + // Without Alt the handle moves on its own, as before. + assert_eq!(drag(&mut t, Mods::default(), 250.0, 340.0), vec![Action::Begin("Reshape".into()), set(250.0, 340.0, "independent")]); + t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 250.0, 340.0)); + + // Shift with Alt: the linked handle stays at 45° steps round its anchor. + let shift_alt = Mods { shift: true, alt: true, ..Mods::default() }; + let a = drag(&mut t, shift_alt, 250.0, 345.0); + let Some(Action::Preview(c, args)) = a.get(1) else { panic!("{a:?}") }; + assert_eq!((c.as_str(), &args["link"], args.get("independent")), ("path.setHandle", &json!(true), None)); + let (dx, dy) = (args["x"].as_f64().unwrap_or(f64::NAN) - 200.0, args["y"].as_f64().unwrap_or(f64::NAN) - 300.0); + assert!(dx > 0.0 && (dx - dy).abs() < 1e-6, "{args}"); + t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 250.0, 345.0)); + + // An Alt-click on the handle retracts it, as a click without Alt does. + t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 240.0, 320.0).with_mods(alt)); + assert_eq!( + t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 240.0, 320.0).with_mods(alt)), + vec![Action::Exec( + "path.setHandle".into(), + json!({"id": id.0, "subpath": 0, "anchor": 1, "which": "out", "x": 200.0, "y": 300.0, "independent": true}) + )] + ); + + // Escape cancels the linking drag; its release does nothing. + drag(&mut t, alt, 250.0, 340.0); + assert_eq!(t.key(&cx, ToolKey::Escape, Mods::default()), vec![Action::Cancel]); + assert!(t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 250.0, 340.0).with_mods(alt)).is_empty()); + + // Lent by the Pen, Alt-drag moves the handle on its own. + let mut lent = AnchorTool::lent_by_pen(); + assert_eq!(drag(&mut lent, alt, 250.0, 340.0), vec![Action::Begin("Reshape".into()), set(250.0, 340.0, "independent")]); +} + +/// Alt-dragging a selected blend's spine handle links it with the opposite one. +#[test] +fn anchor_point_alt_drag_links_a_blend_spine_handle() { + let (d, id, sel) = blend_spine_doc(true); + let p = paint(); + let c = cx(&d, &sel, &p); + let alt = Mods { alt: true, ..Mods::default() }; + let mut tool = AnchorTool::new("anchorPoint"); + tool.pointer(&c, &PointerEvent::new(PointerKind::Down, 190.0, 330.0).with_mods(alt)); + let actions = tool.pointer(&c, &PointerEvent::new(PointerKind::Drag, 190.0, 350.0).with_mods(alt)); + assert_eq!( + actions.get(1), + Some(&Action::Preview( + "object.blend.spine.moveAnchor".into(), + json!({"id": id.0, "anchor": 1, "handle": "out", "x": 190.0, "y": 350.0, "link": true}) + )) + ); + assert_eq!(tool.pointer(&c, &PointerEvent::new(PointerKind::Up, 190.0, 350.0).with_mods(alt)), vec![Action::Commit]); +} diff --git a/crates/tools/src/pen.rs b/crates/tools/src/pen.rs index 24a21d08ca..25990dcd87 100644 --- a/crates/tools/src/pen.rs +++ b/crates/tools/src/pen.rs @@ -605,7 +605,7 @@ impl PenTool { if !alt_converts(cx, ev.pos, ev.mods) { return None; } - let mut t = AnchorTool::new("anchorPoint"); + let mut t = AnchorTool::lent_by_pen(); let acts = t.pointer(cx, ev); if !t.busy() { return None; diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index bb039bb08e..3ea6db2533 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -4732,6 +4732,8 @@ axis Both И двете @msg no such spine point няма такава точка от оста @msg `with` must be a list of at most 10000 spine point indexes `with` трябва да е списък с най-много 10000 индекса на точки от оста @msg `with` moves points, not a handle `with` мести точки, не дръжка +@msg `link` and `independent` cannot both be true `link` и `independent` не могат и двата да са true +@msg `link` places a handle: give `handle` `link` поставя дръжка: задайте `handle` @msg no such spine segment няма такъв сегмент от оста @msg no such subpath няма такъв подпът @msg no such user library няма такава потребителска библиотека diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 99f23d313c..553e6ead83 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -5139,6 +5139,8 @@ imageTrace Outline Obris @msg no such spine point nema takve tačke kičme @msg `with` must be a list of at most 10000 spine point indexes `with` mora biti lista od najviše 10000 indeksa tačaka kičme @msg `with` moves points, not a handle `with` pomjera tačke, ne ručicu +@msg `link` and `independent` cannot both be true `link` i `independent` ne mogu oba biti true +@msg `link` places a handle: give `handle` `link` postavlja ručicu: navedite `handle` @msg no such spine segment nema takvog segmenta kičme @msg no such subpath nema takve podputanje @msg no such user library nema takve korisničke biblioteke diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c54311799d..466a1248d6 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6269,6 +6269,8 @@ liquify-list-end {0}, {1} {0} i {1} @msg no such spine point no existeix aquest punt de l’espina @msg `with` must be a list of at most 10000 spine point indexes `with` ha de ser una llista d’un màxim de 10000 índexs de punts de l’espina @msg `with` moves points, not a handle `with` mou punts, no una nansa +@msg `link` and `independent` cannot both be true `link` i `independent` no poden ser true alhora +@msg `link` places a handle: give `handle` `link` col·loca una nansa: indiqueu `handle` @msg no such spine segment no existeix aquest segment de l’espina @msg no such subpath no existeix aquest subtraçat @msg no such user library no existeix aquesta biblioteca d’usuari diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..b1ac13d504 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5412,6 +5412,8 @@ liquify-list-end {0}, {1} {0} a {1} @msg no such spine point takový bod páteře neexistuje @msg `with` must be a list of at most 10000 spine point indexes `with` musí být seznam nejvýše 10000 indexů bodů páteře @msg `with` moves points, not a handle `with` posouvá body, ne táhlo +@msg `link` and `independent` cannot both be true `link` a `independent` nemohou být zároveň true +@msg `link` places a handle: give `handle` `link` umisťuje táhlo: zadejte `handle` @msg no such spine segment takový segment páteře neexistuje @msg no such subpath taková dílčí cesta neexistuje @msg no such user library taková uživatelská knihovna neexistuje diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 08100f593f..b883c793a6 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -268,6 +268,8 @@ liquify-list-end {0}, {1} {0} og {1} @msg no such spine point intet sådant rygradpunkt @msg `with` must be a list of at most 10000 spine point indexes `with` skal være en liste med højst 10000 rygradpunktindekser @msg `with` moves points, not a handle `with` flytter punkter, ikke et håndtag +@msg `link` and `independent` cannot both be true `link` og `independent` kan ikke begge være true +@msg `link` places a handle: give `handle` `link` placerer et håndtag: angiv `handle` @msg no such spine segment intet sådant rygradsegment @msg node {_1} is on a locked artboard node {_1} ligger på en låst tegneflade @msg not a blend ikke en blanding diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 10147b2d45..3d3c7ab957 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5014,6 +5014,8 @@ liquify-list-end {0}, {1} {0} und {1} @msg no such spine point kein solcher Achsenpunkt @msg `with` must be a list of at most 10000 spine point indexes `with` muss eine Liste von höchstens 10000 Achsenpunkt-Indizes sein @msg `with` moves points, not a handle `with` verschiebt Punkte, keinen Griff +@msg `link` and `independent` cannot both be true `link` und `independent` können nicht beide true sein +@msg `link` places a handle: give `handle` `link` platziert einen Griff: geben Sie `handle` an @msg no such spine segment kein solches Achsensegment @msg no such subpath kein solcher Teilpfad @msg no such user library keine solche Benutzerbibliothek diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ebf6e5684..4fcaa30884 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5071,6 +5071,8 @@ digits Malayalam Μαλαγιάλαμ @msg no such spine point δεν υπάρχει τέτοιο σημείο κεντρικής καμπύλης @msg `with` must be a list of at most 10000 spine point indexes το `with` πρέπει να είναι λίστα με έως 10000 δείκτες σημείων κεντρικής καμπύλης @msg `with` moves points, not a handle το `with` μετακινεί σημεία, όχι λαβή +@msg `link` and `independent` cannot both be true Τα `link` και `independent` δεν μπορούν να είναι και τα δύο true +@msg `link` places a handle: give `handle` το `link` τοποθετεί μια λαβή: δώστε `handle` @msg no such spine segment δεν υπάρχει τέτοιο τμήμα κεντρικής καμπύλης @msg no such subpath δεν υπάρχει τέτοια υποδιαδρομή @msg no such user library δεν υπάρχει τέτοια βιβλιοθήκη χρήστη diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a456910a16..c8d9fee4b8 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5117,6 +5117,8 @@ liquify-list-end {0}, {1} {0}, {1} @msg no such spine point no existe ese punto del eje @msg `with` must be a list of at most 10000 spine point indexes `with` debe ser una lista de como máximo 10000 índices de puntos del eje @msg `with` moves points, not a handle `with` mueve puntos, no un manejador +@msg `link` and `independent` cannot both be true `link` y `independent` no pueden ser true a la vez +@msg `link` places a handle: give `handle` `link` coloca un manejador: indique `handle` @msg no such spine segment no existe ese segmento del eje @msg no such subpath no existe ese subtrazado @msg no such user library no existe esa biblioteca de usuario diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index bff46fc0d7..685e5a437e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5341,6 +5341,8 @@ liquify-list-end {0}, {1} {0} ja {1} @msg no such spine point selkärangan pistettä ei ole @msg `with` must be a list of at most 10000 spine point indexes `with`-arvon on oltava luettelo, jossa on enintään 10000 selkärangan pisteen indeksiä @msg `with` moves points, not a handle `with` siirtää pisteitä, ei kahvaa +@msg `link` and `independent` cannot both be true `link` ja `independent` eivät voi olla molemmat true +@msg `link` places a handle: give `handle` `link` sijoittaa kahvan: anna `handle` @msg no such spine segment selkärangan segmenttiä ei ole @msg no such subpath alipolkua ei ole @msg no such user library käyttäjäkirjastoa ei ole diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..f8053900ba 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5079,6 +5079,8 @@ liquify-list-end {0}, {1} {0} et {1} @msg no such spine point point de la dorsale inexistant @msg `with` must be a list of at most 10000 spine point indexes `with` doit être une liste d’au plus 10000 indices de points de la dorsale @msg `with` moves points, not a handle `with` déplace des points, pas une poignée +@msg `link` and `independent` cannot both be true `link` et `independent` ne peuvent pas valoir true tous les deux +@msg `link` places a handle: give `handle` `link` place une poignée : indiquez `handle` @msg no such spine segment segment de la dorsale inexistant @msg no such subpath sous-tracé inexistant @msg no such user library bibliothèque utilisateur inexistante diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index cbfb4f51d1..f71601a8ea 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -6546,6 +6546,8 @@ antiAlias Sharp शार्प @msg `version`, `description` or `author` is too long `version`, `description` या `author` बहुत लंबा है @msg `warnings` must be a list of strings `warnings` स्ट्रिंग की एक सूची होना चाहिए @msg `with` moves points, not a handle `with` पॉइंट मूव करता है, हैंडल नहीं +@msg `link` and `independent` cannot both be true `link` और `independent` दोनों true नहीं हो सकते +@msg `link` places a handle: give `handle` `link` एक हैंडल रखता है: `handle` दें @msg `with` must be a list of at most 10000 spine point indexes `with` में अधिकतम 10000 स्पाइन पॉइंट इंडेक्स की लिस्ट होनी चाहिए @msg a {_1} series can't go in a {_2} graph एक {_1} श्रृंखला एक {_2} ग्राफ में नहीं जा सकती @msg a {width}×{height} screenshot's byte count overflows {width}×{height} स्क्रीनशॉट की बाइट संख्या सीमा से बाहर है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..db9a877f3e 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5789,6 +5789,8 @@ liquify-list-end {0}, {1} {0} és {1} @msg no such spine point nincs ilyen gerincpont @msg `with` must be a list of at most 10000 spine point indexes `with`: legfeljebb 10000 gerincpont-indexből álló lista kell @msg `with` moves points, not a handle `with` pontokat mozgat, nem fogantyút +@msg `link` and `independent` cannot both be true `link` és `independent` nem lehet egyszerre true +@msg `link` places a handle: give `handle` `link` fogantyút helyez el: adja meg a `handle` értéket @msg no such spine segment nincs ilyen gerincszakasz @msg no such subpath nincs ilyen részútvonal @msg no such user library nincs ilyen felhasználói könyvtár diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8f2ed3216c..15cdaf93e9 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5147,6 +5147,8 @@ liquify-list-end {0}, {1} {0} e {1} @msg no such spine point punto della dorsale inesistente @msg `with` must be a list of at most 10000 spine point indexes `with` deve essere un elenco di al massimo 10000 indici di punti della dorsale @msg `with` moves points, not a handle `with` sposta punti, non una maniglia +@msg `link` and `independent` cannot both be true `link` e `independent` non possono essere entrambi true +@msg `link` places a handle: give `handle` `link` posiziona una maniglia: indica `handle` @msg no such spine segment segmento della dorsale inesistente @msg no such subpath sottotracciato inesistente @msg no such user library libreria utente inesistente diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..687bb0dfa9 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4732,6 +4732,8 @@ swatch Bright Violet ビビッドバイオレット @msg no such spine point 指定されたスパインポイントが見つかりません @msg `with` must be a list of at most 10000 spine point indexes `with` には最大 10000 個のスパインポイントのインデックスのリストを指定してください @msg `with` moves points, not a handle `with` はポイントを移動します。ハンドルには使えません +@msg `link` and `independent` cannot both be true `link` と `independent` を同時に true にすることはできません +@msg `link` places a handle: give `handle` `link` はハンドルを配置します:`handle` を指定してください @msg no such spine segment 指定されたスパインセグメントが見つかりません @msg no such subpath 指定されたサブパスが見つかりません @msg object {id} is not a path オブジェクト {id} はパスではありません diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..e7c637a1a9 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -8719,6 +8719,8 @@ liquify-list-end {0}, {1} {0} და {1} @msg no such spine point ხერხემლის ასეთი წერტილი არ არსებობს @msg `with` must be a list of at most 10000 spine point indexes `with` უნდა იყოს ხერხემლის წერტილების არაუმეტეს 10000 ინდექსის სია @msg `with` moves points, not a handle `with` წერტილებს გადაადგილებს და არა სახელურს +@msg `link` and `independent` cannot both be true `link` და `independent` ერთდროულად ვერ იქნება true +@msg `link` places a handle: give `handle` `link` სახელურს ათავსებს: მიუთითეთ `handle` @msg no such spine segment ხერხემლის ასეთი სეგმენტი არ არსებობს @msg not a blend ეს გადასვლა არ არის @msg only http, https and mailto URLs open in the browser, not “{url}” ბრაუზერში მხოლოდ http, https და mailto URL-ები იხსნება და არა „{url}“ diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..29fda5b1a7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4659,6 +4659,8 @@ theme Appearance 외관 @msg no such spine point 해당 스파인 포인트가 없습니다 @msg `with` must be a list of at most 10000 spine point indexes `with`는 스파인 포인트 인덱스 최대 10000개의 목록이어야 합니다 @msg `with` moves points, not a handle `with`는 포인트를 이동하며 핸들에는 쓸 수 없습니다 +@msg `link` and `independent` cannot both be true `link`와 `independent`를 동시에 true로 지정할 수 없습니다 +@msg `link` places a handle: give `handle` `link`는 핸들을 배치합니다. `handle`을 지정하십시오 @msg no such spine segment 해당 스파인 세그먼트가 없습니다 @msg no such subpath 해당 하위 패스가 없습니다 @msg object {id} is not a path 개체 {id}은(는) 패스가 아닙니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..c95df38066 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -8735,6 +8735,8 @@ swatch Bright Violet Felviolet @msg no such spine point dat aspunt bestaat niet @msg `with` must be a list of at most 10000 spine point indexes `with` moet een lijst van hoogstens 10000 aspuntindexen zijn @msg `with` moves points, not a handle `with` verplaatst punten, geen handgreep +@msg `link` and `independent` cannot both be true `link` en `independent` kunnen niet allebei true zijn +@msg `link` places a handle: give `handle` `link` plaatst een handgreep: geef `handle` op @msg no such spine segment dat assegment bestaat niet @msg not a blend geen vermenging @msg select a blend or give `id` selecteer een vermenging of geef `id` op diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0147515ffe..247f8b8fd5 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5235,6 +5235,8 @@ liquify-list-end {0}, {1} {0} i {1} @msg no such spine point brak takiego punktu grzbietu @msg `with` must be a list of at most 10000 spine point indexes `with` musi być listą co najwyżej 10000 indeksów punktów grzbietu @msg `with` moves points, not a handle `with` przesuwa punkty, nie uchwyt +@msg `link` and `independent` cannot both be true `link` i `independent` nie mogą mieć jednocześnie wartości true +@msg `link` places a handle: give `handle` `link` umieszcza uchwyt: podaj `handle` @msg no such spine segment brak takiego segmentu grzbietu @msg no such subpath brak takiej ścieżki podrzędnej @msg no such user library brak takiej biblioteki użytkownika diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8201db7ab6..87269869c7 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4421,6 +4421,8 @@ axis Both Ambos @msg no such spine point ponto da coluna inexistente @msg `with` must be a list of at most 10000 spine point indexes `with` deve ser uma lista de no máximo 10000 índices de pontos da coluna @msg `with` moves points, not a handle `with` move pontos, não uma alça +@msg `link` and `independent` cannot both be true `link` e `independent` não podem ser true ao mesmo tempo +@msg `link` places a handle: give `handle` `link` posiciona uma alça: informe `handle` @msg no such spine segment segmento da coluna inexistente @msg no such subpath subtraçado inexistente @msg no such user library biblioteca do usuário inexistente diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..927f6acb56 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5141,6 +5141,8 @@ liquify-list-end {0}, {1} {0} и {1} @msg no such spine point такой точки остова нет @msg `with` must be a list of at most 10000 spine point indexes `with` должен быть списком не более чем из 10000 индексов точек остова @msg `with` moves points, not a handle `with` перемещает точки, а не маркер +@msg `link` and `independent` cannot both be true `link` и `independent` не могут одновременно быть true +@msg `link` places a handle: give `handle` `link` размещает маркер: укажите `handle` @msg no such spine segment такого сегмента остова нет @msg no such subpath такого вложенного контура нет @msg no such user library такой пользовательской библиотеки нет diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5c0420fcd3..a400541b63 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5014,6 +5014,8 @@ liquify-list-end {0}, {1} {0} och {1} @msg no such spine point ryggradspunkten finns inte @msg `with` must be a list of at most 10000 spine point indexes `with` måste vara en lista med högst 10000 ryggradspunktsindex @msg `with` moves points, not a handle `with` flyttar punkter, inte ett handtag +@msg `link` and `independent` cannot both be true `link` och `independent` kan inte båda vara true +@msg `link` places a handle: give `handle` `link` placerar ett handtag: ange `handle` @msg no such spine segment ryggradssegmentet finns inte @msg no such subpath delbanan finns inte @msg no such user library användarbiblioteket finns inte diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..669745734d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -6486,6 +6486,8 @@ theme Appearance Görünüm @msg no such spine point böyle bir omurga noktası yok @msg `with` must be a list of at most 10000 spine point indexes `with` en fazla 10000 omurga noktası dizininden oluşan bir liste olmalıdır @msg `with` moves points, not a handle `with` noktaları taşır, tutamacı değil +@msg `link` and `independent` cannot both be true `link` ve `independent` aynı anda true olamaz +@msg `link` places a handle: give `handle` `link` bir tutamaç yerleştirir: `handle` verin @msg no such spine segment böyle bir omurga segmenti yok @msg not a blend bir karışım değil @msg select a blend or give `id` bir karışım seçin veya `id` belirtin diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index dbd6d2609e..5f9a54f97e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5131,6 +5131,8 @@ liquify-list-end {0}, {1} {0} і {1} @msg no such spine point такої точки осі немає @msg `with` must be a list of at most 10000 spine point indexes `with` має бути списком щонайбільше з 10000 індексів точок осі @msg `with` moves points, not a handle `with` переміщує точки, а не маркер +@msg `link` and `independent` cannot both be true `link` і `independent` не можуть одночасно бути true +@msg `link` places a handle: give `handle` `link` розміщує маркер: укажіть `handle` @msg no such spine segment такого сегмента осі немає @msg no such subpath такого вкладеного контуру немає @msg no such user library такої користувацької бібліотеки немає diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 519c5d8f0d..497b98065e 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5475,6 +5475,8 @@ liquify-list-end {0}, {1} {0} và {1} @msg no such spine point không có điểm trục như vậy @msg `with` must be a list of at most 10000 spine point indexes `with` phải là danh sách tối đa 10000 chỉ số điểm trục @msg `with` moves points, not a handle `with` di chuyển các điểm, không phải tay nắm +@msg `link` and `independent` cannot both be true `link` và `independent` không thể cùng là true +@msg `link` places a handle: give `handle` `link` đặt một tay nắm: hãy cho `handle` @msg no such spine segment không có đoạn trục như vậy @msg no such subpath không có nhánh con như vậy @msg no such user library không có thư viện người dùng như vậy diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c6696a9ec6..c24f864c74 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2086,6 +2086,8 @@ file-filter Templates 模板 @msg no such spine point 没有此脊线点 @msg `with` must be a list of at most 10000 spine point indexes `with` 必须是最多 10000 个脊线点索引的列表 @msg `with` moves points, not a handle `with` 移动的是点,不是手柄 +@msg `link` and `independent` cannot both be true `link` 和 `independent` 不能同时为 true +@msg `link` places a handle: give `handle` `link` 用于放置手柄:请提供 `handle` @msg no such spine segment 没有此脊线线段 @msg a key object sits on that point 该点上有关键对象 @msg a spine keeps at least two points 脊线至少保留两个点 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..cef8cbc7e3 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3351,6 +3351,8 @@ liquify-list-end {0}, {1} {0}和{1} @msg no such spine point 沒有這個脊線點 @msg `with` must be a list of at most 10000 spine point indexes `with` 必須是最多 10000 個脊線點索引的清單 @msg `with` moves points, not a handle `with` 移動的是點,不是控制把手 +@msg `link` and `independent` cannot both be true `link` 和 `independent` 不能同時為 true +@msg `link` places a handle: give `handle` `link` 用於放置控制把手:請提供 `handle` @msg no such spine segment 沒有這個脊線線段 @msg a key object sits on that point 該點上有關鍵物件 @msg a spine keeps at least two points 脊線至少要保留兩個點 diff --git a/docs/mcp.md b/docs/mcp.md index 4c1b661f42..b02d68531c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2145,7 +2145,7 @@ naming the key, and leave the document and its undo history as they were: `opaci The blend and envelope commands refuse a string, a number or another value that is not true or false with `` `smooth` must be true or false ``, naming the key, and leave the document, its undo history and the options new blends and envelopes start with as they were: `smooth` in `object.blend.make` and `object.blend.options`; -`independent` in `object.blend.spine.moveAnchor`; `perpendicular` in `object.blend.spine.reshapeSegment`; `horizontal` +`independent` and `link` in `object.blend.spine.moveAnchor`; `perpendicular` in `object.blend.spine.reshapeSegment`; `horizontal` in `object.envelope.makeWithWarp`, `resetWithWarp` and `options`, also when an `orientation` is given; `maintainShape` in `object.envelope.resetWithMesh`; `antiAlias`, `distortAppearance`, `distortLinearGradients` and `distortPatternFills` in `object.envelope.options`; and `editing` in `object.envelope.editContents`. A null is read as @@ -5943,7 +5943,8 @@ on the cut paths ([the help page](https://helpx.adobe.com/illustrator/desktop/dr VectorCraft's own rules: every stroke row is reset, hidden ones included; a path of several subpaths has one appearance, so a cut in one subpath centers the strokes of its other subpaths too, closed ones included; a cut member of a compound path centers the compound path's strokes; strokes already centered are left as they are. The Pen with Alt -held over a selected path's handle, anchor or segment works as the Anchor Point tool. `press_key` Escape between two +held over a selected path's handle, anchor or segment works as the Anchor Point tool, except that an Alt-drag on a +handle still moves that handle alone. `press_key` Escape between two `pointer_gesture` calls of an Anchor Point drag cancels it: the path goes back and no undo step is added. `path.reshapeSegment {id, subpath?, segment, t, dx, dy, perpendicular?}` (a segment dragged with Direct Selection or the Anchor Point tool) moves the segment's point at `t` by `dx`, `dy`: a smooth anchor at either end stays smooth, its other handle turning with the moved one. @@ -5962,6 +5963,14 @@ is not a whole number of 0 or more, such as 1.5, -1 or "1" ("`subpath` must be a an `anchor` or `segment` in the same way. The document does not change and no undo step is recorded. `path.moveAnchor` to the point the anchor is at, and `path.setHandle` to the point the handle is at on an anchor that keeps its kind, leave the document as it is and record no undo step. +`path.setHandle` with `link: true` (the Anchor Point tool's Alt-drag on a handle) places the handle and makes the +anchor smooth: the other handle turns to lie in line on the far side of the anchor and keeps its length. A retracted +other handle is pulled out to the placed handle's length when a segment leaves the anchor on its side, and stays +retracted at an end of an open path. A handle placed on its anchor gives no direction, so only that handle moves. A +request that leaves the anchor as it is records no undo step, and `link: true` with `independent: true` is refused +("`link` and `independent` cannot both be true"), as is an x or y of 1e9 pt or more in size with `link: true` +("x and y must be finite"). `object.blend.spine.moveAnchor` takes `link` with `handle` in the +same way for a blend's spine point; without `handle` it is refused. These rules are VectorCraft's own. `path.insertAnchor` keeps the direct-selected anchors and selected segments of the path on the same points: those after the new anchor on its subpath are numbered one higher, and a selected segment that the new anchor splits stays selected as its two halves, with the new anchor as an end of both that moves with them. Undo restores the path and @@ -6075,7 +6084,7 @@ VectorCraft's own values. These commands refuse a string, a number or another value that is not true or false with `` `closed` must be true or false ``, naming the key; the document does not change and no undo step is recorded: -`independent` in `path.close` and `path.setHandle`; `patterns` in `path.moveAnchors`; `closed`, `keepSelected` and +`independent` in `path.close` and `path.setHandle`; `link` in `path.setHandle`; `patterns` in `path.moveAnchors`; `closed`, `keepSelected` and `fill` in `path.freehand` (and in `brush.freehand`); `closed` and the `corner` of a point in `path.curvature`; `corner` in `path.curvatureEdit`; `perpendicular` in `path.reshapeSegment`; and `keepSelected`, `mergeOnlySelection` and `merge` in `path.blob`. A null is read as a key left out. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..a608f71292 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1302,6 +1302,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Live Corners:** drag a live rectangle's corner widgets (Selection or Direct Selection) to round all corners, with a radius readout; with Direct Selection, select corner anchors to show and round just those corners (#381). Each corner keeps its own radius and kind (Round, Inverted Round, Chamfer): Alt-click a widget to cycle the kind, double-click it for the Corners dialog, and the Properties and Transform radius fields set the selected corners (`object.setLiveShape {corners, radius, kind}`). A link toggle behind Corner Radius (the `singleCornerRadius` preference) switches the panels to a field for each corner of a live rectangle: Top Left, Top Right, Bottom Right and Bottom Left. Corners stay circular when the rectangle is scaled unevenly or along its own sides when rotated (the radius keeps its size, or scales by the mean scale with Scale Corners on); only a shear distorts them. On a rectangle that isn't square every corner is the same circle: a radius past half the shorter side stops there for all of them, the widgets sit on the corners as drawn and turn the edited corners red at that limit, CSS export writes the drawn radii, and rectangles saved stretched by older versions get circular corners when their corners are next set (#442). Live Corners work on any path's corners too, as on a rectangle's (#511): a star's, a live polygon's (which also shows them to the Selection tool, has a Corner Radius field in the Properties and Transform panels and keeps its radius as its sides change) and a pen path's, wherever two sides meet at an angle at an anchor that isn't smooth: curved sides too, trimmed to what the cut leaves of them (#1144). Direct Selection shows the widgets of every corner, or of the corners holding selected anchors; each corner is a circle tangent to both sides, drawn no larger than takes its cut halfway along its shorter side; a path keeps its uncut outline so its corners stay editable, and the same command, dialog, angle preference and View › Hide Corner Widget apply. With Direct Selection a click on a widget (no drag) selects its corner, as a click on the corner's anchor does, so the next drag on it rounds that corner alone; Shift-click toggles it (#1239). While a corner widget is dragged with the Selection tool the bounding box hides, so the rounding shows against the path alone (#1229). A round corner next to a curved side curves smoothly instead of sticking out of the shape (#1547, fixes #1512). View › Hide Edges hides the Live Corners widgets, the bounding box and the type widget, and the selection tools then do not answer a press on them or change the cursor over them. - **Blend spine Anchor Point tool (#2544):** on a selected blend, dragging a spine corner makes symmetric Smooth handles; the tool displays and picks existing spine handles when switched to, drags one independently or retracts it on click, and clicking a point with handles retracts both. The spine is edited live without moving its key objects. Windows native canvas checks and screenshots reviewed: symmetric and independent handles, corner/retraction, Shift constraints and perpendicular reshaping, tool switching, key preservation, Undo/Redo, save/reopen, hidden handles and overlapping Path/Blend priority (PR #2643). Behaviour reference: [public path-editing documentation](https://helpx.adobe.com/illustrator/using/adjust-path-segments.html). + - **Anchor Point tool, Alt-drag on a handle:** with the Anchor Point tool chosen, dragging a direction handle with Alt (Option) held links it with the opposite handle and makes the anchor smooth, on a path and on a selected blend's spine, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/create-smooth-paths-with-the-smooth-tool.html) describes; a drag without Alt still moves one handle on its own (`path.setHandle` and `object.blend.spine.moveAnchor` with `link`). VectorCraft's own rules: the opposite handle keeps its length; a retracted one is pulled out to the dragged handle's length where a segment leaves the anchor on its side and stays retracted at an open end; Shift with Alt keeps the 45° steps; an Alt-click still retracts the handle; the Pen with Alt keeps moving a handle on its own. Tests: `anchor_point_alt_drag_links_*` in `crates/tools/src/draw2/anchor/tests.rs`, `a_linked_handle_makes_the_anchor_smooth` in `crates/engine/src/tests/anchor_edit_work.rs`, `a_linked_spine_handle_makes_the_point_smooth` in `crates/engine/src/tests/blendspine.rs`. - **Blend spine points by marquee:** with Direct Selection, a marquee picks the spine points inside it on a selected blend, the topmost one when several are selected, and the picked points drag together as Shift-clicked ones do; Shift-marquee adds points or takes picked ones away, a plain marquee around none of them drops the picks, and Escape during the marquee keeps them. Unselected, locked and hidden blends are skipped. The spine's points are anchor points edited with Direct Selection ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/modify-spine-of-blended-objects.html)), and a boundary drag with the tool selects anchor points ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/select-anchor-points-in-paths.html)); the rules for selected, topmost and Shift are VectorCraft's own (`crates/tools/src/direct/tests.rs`, `marquee_picks_selected_blend_spine_points_which_drag_together`, `shift_marquee_toggles_selected_blend_spine_points`, `marquee_skips_unselected_locked_and_hidden_blend_spines`, `escape_cancels_a_marquee_and_keeps_the_picked_spine_points`). - **Blend steps of brushed strokes:** the steps interpolate the pen pressure, tilt, bearing and rotation recorded with the Paintbrush, so a Calligraphic, Scatter or Art brush that varies with the pen changes gradually from one key to the next. A key without a recording counts as half pressure, half tilt and 0°, as brushes read it, and angles turn the shorter way round. When the blend starts a key's path at another anchor (an open path run from its end, a closed one turned to another start), the key's recordings, width profile, arrowheads, dashes and a gradient along or across the stroke turn with the path. Different brushes still switch halfway (VectorCraft's own rule; strokes blend their options, as [Blended objects overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blended-objects-overview.html) describes; `crates/doc/src/blend.rs`, `pen_pressure_tilt_and_angles_interpolate_for_brushes`, `stroke_profiles_turn_with_a_key_path_started_elsewhere`, `stroke_gradients_and_dashes_turn_with_a_key_path_started_elsewhere`). - **Blend steps of spot gradients with process plates:** when the matching stops of two gradients, or of a gradient and a solid, are tints of one spot swatch, each step's stop stays linked to it at a tint between the two and keeps the process inks printed with it, each of C, M, Y and K between the two stops' amounts; a stop or solid without process inks counts as none of each. Gradients with different stop counts keep the inks at every resampled stop. PDF export writes such a step as one DeviceN shading of the spot and process inks. Tints of one spot color blend into tints of it, as [the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blended-objects-overview.html) describes; the process-ink interpolation is VectorCraft's own rule (`crates/doc/src/blend.rs`, `blend_gradient_spot_process_plates_interpolate`, `resampled_gradient_spot_process_plates_interpolate`, `blend_gradient_missing_plates_mean_zero`, `blend_solid_to_spot_gradient_does_not_copy_plates`; `crates/pdf/src/tests/output.rs`, `blend_steps_between_spot_gradients_with_process_plates_print_both_inks`). diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 4182189c4a..3e7091e48a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -191,7 +191,7 @@ tools, never checked side by side) isn't captured row by row. | Gradient panel: add-stop cursor under the ramp (#8241) | done | the white arrow with a plus (the Group Selection glyph) over the strip under the ramp, handed to the OS on Windows and X11 (winit shows the plain arrow for the system copy cursor there), the system copy cursor elsewhere; over the ramp itself the arrow stays; `panels::gradient` test `the_strip_under_the_ramp_shows_the_add_cursor` | | Blend spine Anchor Point conversion and handle editing (#2544) | implemented | symmetric handles, independent drag/retraction, visible-handle policy and selection/stacking covered by tool and engine regressions; Windows native canvas checks and screenshots reviewed in PR #2643 | | Several blend spine points picked and dragged together (#5285) | done | with Direct Selection, Shift-click picks more points of a selected blend's spine or takes one away, as on a path; dragging any picked point moves them all, and the key objects on them, in one undo step (`object.blend.spine.moveAnchor {with}`); a marquee picks the spine points inside it on the topmost selected blend, and with Shift adds or takes them away | -| Add/Delete/Anchor Point tools; Anchor Point tool drags segments to reshape | done | #2267: a click on a handle end retracts that handle and leaves the anchor a corner with the other one; Shift held at the press on an anchor moves it, handles and all (Shift kept down: at 45° steps) instead of pulling out handles | +| Add/Delete/Anchor Point tools; Anchor Point tool drags segments to reshape | done | #2267: a click on a handle end retracts that handle and leaves the anchor a corner with the other one; Shift held at the press on an anchor moves it, handles and all (Shift kept down: at 45° steps) instead of pulling out handles; Alt held while dragging a handle links it with the opposite handle and makes the anchor smooth, on a blend's spine too | | Pencil: Fidelity, Keep selected, Alt to Smooth, edit selected paths, close by proximity | done | Fidelity is in screen pixels, the same at any zoom, and goes down to 0.01 px in the dialog and the tool, which sends `path.freehand` the value in points at the current zoom (#5729; the Smooth tool keeps 0.05 pt); its slider runs across the Tool Options row on a logarithmic rail from 0.01 to 20 px, the field shows hundredths, and the slider's and the field's arrow keys step hundredths up to 0.1 px, tenths up to 1 px and whole pixels above (Shift ×10) (#3328); Alt key toggles to Smooth Tool (#2001); Shift held at the press draws a straight line at 45° steps from the Constrain Angle, and Alt held at the press (with Alt key toggles to Smooth Tool off) a straight line at any angle (#3799), with a straight-line cursor (a short level line) while Shift or Alt is held before the press, and a path-continuation cursor (a short rising line) over an end of a selected open path, where the stroke continues the path, freehand or straight, and while a continuing stroke ends near an open end of another selected path it connects to; Edit Selected Paths continues a selected path from an end and, from a stroke that starts and ends on a selected path, redraws the section between (the shorter way round a closed path, #2850); with Keep selected (Pencil and Paintbrush, on by default) on, a stroke selects the path it draws or continues and replaces the earlier selection, and off a new stroke leaves nothing selected, the earlier selection included, while a continued or redrawn path is deselected and the rest of the selection stays; a filled Pencil path keeps a stroke of None (#1804, part of #1679); while a freehand stroke is drawn back to within Close Paths When Ends Are Within of its start, or a stroke continuing a selected path (a straight line too) to within it of that path's other end, the Pencil and the Paintbrush show the closing cursor, and a release there closes the path; a Pencil stroke from an end of one selected open path to an end of another connects the two into one path | | Drop Shadow, Outer Glow and Inner Glow: Opacity, the offsets, Blur and Darkness have spinner arrows that step by one (a unit for distances), repeat when held and stop at the fields' ends (#5367, #5368) | done | dialogs::effect test drop_shadow_and_outer_glow_fields_have_spinner_arrows; other effect dialogs' number fields still have none | | Effect dialogs' colour fields: a swatch beside the hex follows typed values, and a double-click opens the Color Picker over the dialog, whose OK fills it and Cancel comes back unchanged (#5365) | done | dialogs::effect tests outer_glow_colour_swatch_opens_the_color_picker and drop_shadow_colour_swatch_opens_the_color_picker (Drop Shadow's Color, #5364); the picker previews nothing itself, the effect dialog previews the returned colour | From ae2e920cc1a61549b9d85c1ea71036dd0dccbeb6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:43:10 -0800 Subject: [PATCH 182/247] Toasts: messages narrow to fit a narrow window, and app messages keep the time limits In a window narrower than 352 points, messages narrow to the window's width less the stack's margins, with 32 points as the least, and the text wraps to that width. A message the app queues with Session::toast shows for 0.5 to 60 seconds, as app.toast allows; a time that is not a number shows for 4 seconds. --- crates/engine/src/cmd/toast.rs | 17 ++++++++++++-- crates/ui-egui/src/toasts.rs | 43 ++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/toast.rs b/crates/engine/src/cmd/toast.rs index bf6ed66fee..e2eb41bd21 100644 --- a/crates/engine/src/cmd/toast.rs +++ b/crates/engine/src/cmd/toast.rs @@ -76,8 +76,11 @@ impl Toast { pub struct Queue(VecDeque); impl Session { - /// Queue `toast` for the app to show. With [`MAX_QUEUED`] waiting, the oldest one goes. - pub fn toast(&mut self, toast: Toast) { + /// Queue `toast` for the app to show. With [`MAX_QUEUED`] waiting, the oldest one goes. Its + /// time is held to [`MIN_SECONDS`] to [`MAX_SECONDS`], and a time that is not a number is + /// [`DEFAULT_SECONDS`]. + pub fn toast(&mut self, mut toast: Toast) { + toast.seconds = if toast.seconds.is_nan() { DEFAULT_SECONDS } else { toast.seconds.clamp(MIN_SECONDS, MAX_SECONDS) }; while self.toasts.0.len() >= MAX_QUEUED { self.toasts.0.pop_front(); } @@ -192,6 +195,16 @@ mod tests { assert_eq!(s.take_toasts().len(), 1); } + #[test] + fn a_message_queued_by_the_app_shows_for_0_5_to_60_seconds() { + let mut s = Session::new(); + for seconds in [f64::INFINITY, 1e9, f64::NEG_INFINITY, 0.0, f64::NAN, 10.0] { + s.toast(Toast { seconds, ..Toast::new("m", Level::Info) }); + } + let got: Vec = s.take_toasts().iter().map(|t| t.seconds).collect(); + assert_eq!(got, vec![MAX_SECONDS, MAX_SECONDS, MIN_SECONDS, MIN_SECONDS, DEFAULT_SECONDS, 10.0]); + } + #[test] fn the_oldest_waiting_message_goes_past_the_limit() { let mut s = Session::new(); diff --git a/crates/ui-egui/src/toasts.rs b/crates/ui-egui/src/toasts.rs index d1f35f6326..c6868e0cfc 100644 --- a/crates/ui-egui/src/toasts.rs +++ b/crates/ui-egui/src/toasts.rs @@ -17,6 +17,10 @@ pub const MAX_SHOWN: usize = 5; /// The widest a message is, in points; longer text wraps. const WIDTH: f32 = 320.0; +/// The narrowest a message gets in a narrow window, in points: its frame's margin and edge (22 +/// points) and room for one character. +const MIN_WIDTH: f32 = 32.0; + /// The most lines a message shows; the rest shows on hover. const MAX_ROWS: usize = 6; @@ -91,10 +95,12 @@ pub(crate) fn show_at(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64) { let area = egui::Area::new(egui::Id::unique("toasts")).order(egui::Order::Foreground).anchor(egui::Align2::RIGHT_BOTTOM, corner); // A stack taller than the window scrolls, kept at its newest message. let height = (ctx.content_rect().height() - 2.0 * MARGIN).max(0.0); + // In a window narrower than a message, the messages narrow to fit it. + let width = WIDTH.min(ctx.content_rect().width() - 2.0 * MARGIN).max(MIN_WIDTH); let dismissed = area .show(ctx, |ui| { let scroll = egui::ScrollArea::vertical().max_height(height).stick_to_bottom(true); - scroll.show(ui, |ui| stack(ui, &mut app.toasts.list, &t)).inner + scroll.show(ui, |ui| stack(ui, &mut app.toasts.list, &t, width)).inner }) .inner; if let Some(id) = dismissed { @@ -103,14 +109,14 @@ pub(crate) fn show_at(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64) { } } -/// Draw `list`, oldest first; the id of the message clicked. -fn stack(ui: &mut egui::Ui, list: &mut [Entry], t: &Tokens) -> Option { - ui.set_max_width(WIDTH); +/// Draw `list`, oldest first, `width` points wide; the id of the message clicked. +fn stack(ui: &mut egui::Ui, list: &mut [Entry], t: &Tokens, width: f32) -> Option { + ui.set_max_width(width); let mut clicked = None; for e in list { // Each message's widgets keep its id when the messages before it go, so a press and a // release land on the same message. - let r = ui.push_id(e.id, |ui| message(ui, e, t)).inner; + let r = ui.push_id(e.id, |ui| message(ui, e, t, width)).inner; if r.clicked() { clicked = Some(e.id); } @@ -120,18 +126,19 @@ fn stack(ui: &mut egui::Ui, list: &mut [Entry], t: &Tokens) -> Option { clicked } -/// Draw one message → its response to clicks. -fn message(ui: &mut egui::Ui, e: &Entry, t: &Tokens) -> egui::Response { +/// Draw one message `width` points wide → its response to clicks. +fn message(ui: &mut egui::Ui, e: &Entry, t: &Tokens, width: f32) -> egui::Response { let frame = egui::Frame::new() .fill(t.panel) .stroke(egui::Stroke::new(1.0, color(t, e.toast.level))) .corner_radius(t.radius) .inner_margin(egui::Margin::symmetric(10, 8)) .show(ui, |ui| { - ui.set_width(WIDTH - 20.0); + // The frame's margin and edge take 11 points on each side. + ui.set_width(width - 22.0); let format = egui::TextFormat::simple(egui::TextStyle::Body.resolve(ui.style()), t.text); let mut job = egui::text::LayoutJob::single_section(e.toast.message.clone(), format); - job.wrap.max_width = WIDTH - 20.0; + job.wrap.max_width = width - 22.0; job.wrap.max_rows = MAX_ROWS; let galley = ui.painter().layout_job(job); let elided = galley.elided; @@ -168,7 +175,12 @@ mod tests { /// [`pass`] in a window `height` points tall. fn pass_in(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64, events: Vec, height: f32) -> Vec { - let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1000.0, height)); + pass_sized(app, ctx, now, events, egui::vec2(1000.0, height)) + } + + /// [`pass`] in a window of `size` points. + fn pass_sized(app: &mut VectorcraftApp, ctx: &egui::Context, now: f64, events: Vec, size: egui::Vec2) -> Vec { + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, size); let input = egui::RawInput { screen_rect: Some(screen), events, ..Default::default() }; let mut output = ctx.run_ui(input, |ui| show_at(app, ui.ctx(), now)); output.textures_delta.clear(); @@ -325,6 +337,17 @@ mod tests { assert_eq!(app.toasts.list.len(), MAX_SHOWN); } + #[test] + fn a_message_in_a_narrow_window_stays_inside_it() { + let (mut app, ctx) = app(); + app.run("app.toast", json!({"message": "A message long enough to wrap onto more than one line"})).unwrap(); + let size = egui::vec2(200.0, 700.0); + pass_sized(&mut app, &ctx, 0.0, vec![], size); + pass_sized(&mut app, &ctx, 0.0, vec![], size); + let rect = app.toasts.list[0].rect.unwrap(); + assert!(rect.left() >= MARGIN - 0.5 && rect.right() <= size.x - MARGIN + 0.5, "{rect:?}"); + } + #[test] fn no_message_draws_nothing() { let (mut app, ctx) = app(); From 290a58fc1865e4f407c3360bf4a94909f41087f5 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 08:38:40 +0530 Subject: [PATCH 183/247] M7/G4: retype review follow-ups (#4934) List type.retype among the commands plugins may call. Only closed shapes match glyphs. Live type, images and other art between glyphs, and unselected art between selected objects, end the line. Each selected object's own parent decides its group. Retyped type turns ligatures off, as the outlines drew each glyph on its own. --- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/engine/src/cmd/retype.rs | 57 ++++++++++++++----- crates/engine/src/cmd/retype_tests.rs | 37 ++++++++++++ 3 files changed, 82 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 6a0caf4cd6..28cce5a244 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -683,6 +683,7 @@ pub(super) const ALLOWED: &[&str] = &[ "type.pathOptions", "type.resetHorizontalScale", "type.resetTracking", + "type.retype", "type.ruby", "type.scaleTextAttributes", "type.size.decrease", diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 395ce33b23..72ab30a711 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -47,9 +47,12 @@ pub fn specs() -> Vec { /// A shape to match: a path or compound path, in document space. struct Piece { id: NodeId, - /// The group holding it (`None` for a selected shape at the top): glyphs of different - /// groups, which may composite differently, never share a line. + /// The group or layer holding it: glyphs of different groups, which may composite + /// differently, never share a line. parent: Option, + /// Other art (not retyped) lies between it and the shape before it, so the type after that + /// art must stay painted after it: the line ends here. + after_barrier: bool, path: BezPath, appearance: Appearance, /// The shape's own transparency, which the new type takes. @@ -57,28 +60,45 @@ struct Piece { blend: vectorcraft_color::BlendMode, } -fn collect(n: &Node, parent: Option, depth: usize, out: &mut Vec) { +/// The shapes in `n` (held by `parent`), in paint order. `barrier` is set when art that is not a +/// shape lies before the next one; it starts set for a root that does not follow the last root. +fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, out: &mut Vec) { if out.len() >= MAX_PIECES || depth > MAX_DEPTH { + *barrier = true; return; } - let piece = |path: BezPath| Piece { id: n.id, parent, path, appearance: (*n.appearance).clone(), opacity: n.opacity, blend: n.blend }; + let piece = |path: BezPath, after_barrier: bool| Piece { + id: n.id, + parent, + after_barrier, + path, + appearance: (*n.appearance).clone(), + opacity: n.opacity, + blend: n.blend, + }; match &n.kind { NodeKind::Group { children, clip: false } => { for c in children { - collect(c, Some(n.id), depth + 1, out); + collect(c, Some(n.id), depth + 1, barrier, out); } } - NodeKind::Path { path, clipping: false, guide: false, .. } => out.push(piece(path.to_bezpath())), + // Only closed shapes can be glyphs: an open path stroked along a glyph's outline is not one. + NodeKind::Path { path, clipping: false, guide: false, .. } if path.is_closed() => out.push(piece(path.to_bezpath(), std::mem::take(barrier))), NodeKind::Compound { children, .. } => { let mut path = BezPath::new(); for c in children { - if let NodeKind::Path { path: p, .. } = &c.kind { - path.extend(p.to_bezpath()); + match &c.kind { + NodeKind::Path { path: p, .. } if p.is_closed() => path.extend(p.to_bezpath()), + _ => { + *barrier = true; + return; + } } } - out.push(piece(path)); + out.push(piece(path, std::mem::take(barrier))); } - _ => {} + // Live type, images, clip groups and the rest stay, and the type after them stays after them. + _ => *barrier = true, } } @@ -194,10 +214,16 @@ fn retype(s: &mut Session, p: &Value) -> Result { let (lines, unmatched) = { let d = &s.doc()?.doc; let mut pieces = vec![]; + let mut last: Option<(Option, usize)> = None; for r in &roots { - if let Some(n) = d.node(*r) { - collect(n, None, 0, &mut pieces); - } + let Some(n) = d.node(*r) else { continue }; + let parent = d.parent_of(*r); + let idx = d.position(*r).map(|(_, i, _)| i); + // A root right after the last one, in the same parent, continues its lines; unselected + // art between two roots is a barrier. + let mut barrier = !matches!((last, idx), (Some((p, i)), Some(j)) if p == parent && i + 1 == j); + last = idx.map(|i| (parent, i)); + collect(n, parent, 0, &mut barrier, &mut pieces); } if pieces.is_empty() { return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); @@ -219,6 +245,9 @@ fn retype(s: &mut Session, p: &Value) -> Result { // An unmatched shape between glyphs ends the line: the type after it is painted after it. let mut open = false; for (pc, ms) in pieces.iter().zip(&found) { + if pc.after_barrier { + open = false; + } // Earlier matches win ties: they are the closer fits. let best = ms.iter().enumerate().max_by_key(|(i, m)| (rank(m.face.id()), std::cmp::Reverse(*i))).map(|(_, m)| m); let Some(m) = best else { @@ -249,6 +278,8 @@ fn retype(s: &mut Session, p: &Value) -> Result { font_style: l.face.style.clone(), // The version that matched, when two of the family and style are loaded. font_version: (!l.face.version.is_empty()).then(|| l.face.version.clone()), + // Each outlined glyph was drawn on its own; a ligature would draw another shape. + features: vec!["-liga".into()], size: l.scale * l.face.units_per_em(), fill: l.appearance.fill_paint(), stroke: l.appearance.stroke_paint(), diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index af91b8442d..57cb747414 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -166,3 +166,40 @@ fn glyphs_of_different_groups_and_transparency_stay_apart() { assert_eq!(children_of(&s, b), vec![ids[1], ids[2]]); assert_eq!(s.doc().unwrap().doc.node(NodeId(ids[2])).unwrap().opacity, 0.25, "the glyph's own opacity carries over"); } + +#[test] +fn live_type_between_glyphs_ends_the_line_too() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let live = s.execute("text.create", &json!({"x": 30, "y": 90, "text": "x", "size": 60})).unwrap()["id"].as_u64().unwrap(); + s.edit("test", |d, _| { + let n = d.node(NodeId(live)).unwrap().clone(); + d.remove(NodeId(live))?; + d.insert(Some(NodeId(g)), 1, n)?; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["A", "B"]), "{r}"); + let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect(); + assert_eq!(children_of(&s, g), vec![ids[0], live, ids[1]], "B stays over the live type"); + let t = text_of(&s, ids[0]); + assert!(t.first_style().features.iter().any(|f| f == "-liga"), "glyphs drawn one by one: no ligatures"); +} + +#[test] +fn an_open_path_along_a_glyph_is_not_a_glyph() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "I", "size": 40})); + s.edit("test", |d, _| { + let glyph = d.node(NodeId(g)).unwrap().children().unwrap()[0].id; + for sp in &mut d.node_mut(glyph).unwrap().path_data_mut().unwrap().subpaths { + sp.closed = false; + } + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + assert!(s.execute("type.retype", &json!({})).is_err(), "nothing matches"); +} From fd079ceb2956318d93905d6f4fe991069ebf3e96 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 09:04:12 +0530 Subject: [PATCH 184/247] M7/G4: retype carries a line break across selected objects (#4934) A selected object that yields no shape between two selected glyphs (live type, an open path) ends the line, as it does inside a group. Tests for that and for glyphs selected inside different groups. --- crates/engine/src/cmd/retype.rs | 7 ++++- crates/engine/src/cmd/retype_tests.rs | 37 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 72ab30a711..8634ca356e 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -215,13 +215,18 @@ fn retype(s: &mut Session, p: &Value) -> Result { let d = &s.doc()?.doc; let mut pieces = vec![]; let mut last: Option<(Option, usize)> = None; + // Carried across roots: a selected root that yields no shape (live type, an open path) still + // ends the line. + let mut barrier = true; for r in &roots { let Some(n) = d.node(*r) else { continue }; let parent = d.parent_of(*r); let idx = d.position(*r).map(|(_, i, _)| i); // A root right after the last one, in the same parent, continues its lines; unselected // art between two roots is a barrier. - let mut barrier = !matches!((last, idx), (Some((p, i)), Some(j)) if p == parent && i + 1 == j); + if !matches!((last, idx), (Some((p, i)), Some(j)) if p == parent && i + 1 == j) { + barrier = true; + } last = idx.map(|i| (parent, i)); collect(n, parent, 0, &mut barrier, &mut pieces); } diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 57cb747414..266a016ea7 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -203,3 +203,40 @@ fn an_open_path_along_a_glyph_is_not_a_glyph() { s.execute("select.set", &json!({"ids": [g]})).unwrap(); assert!(s.execute("type.retype", &json!({})).is_err(), "nothing matches"); } + +#[test] +fn live_type_selected_between_loose_glyphs_still_ends_the_line() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let live = s.execute("text.create", &json!({"x": 30, "y": 90, "text": "x", "size": 60})).unwrap()["id"].as_u64().unwrap(); + let (a, b) = (children_of(&s, g)[0], children_of(&s, g)[1]); + // A, the live type and B as siblings in the layer, as Ungroup leaves them. + s.edit("test", |d, _| { + let (par, idx, _) = d.position(NodeId(g)).unwrap(); + let live_n = d.node(NodeId(live)).unwrap().clone(); + let (an, bn) = (d.node(NodeId(a)).unwrap().clone(), d.node(NodeId(b)).unwrap().clone()); + d.remove(NodeId(live))?; + d.remove(NodeId(g))?; + d.insert(par, idx, an)?; + d.insert(par, idx + 1, live_n)?; + d.insert(par, idx + 2, bn)?; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [a, live, b]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["A", "B"]), "the selected live type between them ends the line: {r}"); +} + +#[test] +fn glyphs_selected_inside_groups_join_only_their_siblings() { + let mut s = session(); + let g1 = outlined(&mut s, json!({"x": 40, "y": 100, "text": "ab", "size": 20})); + let g2 = outlined(&mut s, json!({"x": 70, "y": 100, "text": "cd", "size": 20})); + let (a, b, c) = (children_of(&s, g1)[0], children_of(&s, g1)[1], children_of(&s, g2)[0]); + s.execute("select.set", &json!({"ids": [a, b, c]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["ab", "c"]), "a and b are siblings; c is in another group: {r}"); + let d = &s.doc().unwrap().doc; + assert!(d.node(NodeId(g2)).is_some(), "d's group stays with c's type and d in it"); +} From e6b848aaffd1a9c3d7578fe082c4e795bbbb970b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 20:16:40 -0800 Subject: [PATCH 185/247] Rerun CI From f7a6eeff136032a7b14c098271896dc6c42a3ad4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 20:17:00 -0800 Subject: [PATCH 186/247] Rerun CI From c42cfd23b7710d39e8aa651ef417ec209c941598 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 10:03:29 +0530 Subject: [PATCH 187/247] M7/G4: retype checks each line against its own layout (#4934) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each retyped line is laid out and compared glyph by glyph with the outlines; it splits where its type would draw another glyph or the same glyph elsewhere (tracking, manual spacing, font substitutions), and a glyph its type cannot draw stays an outline. Shapes with their own opacity mask stay outlines. Shapes past the limits are reported as truncated. Glyphs of plain-shape symbols (box drawing, blocks, geometric shapes, private use) are not matched, so drawn rectangles stay art. Type › Retype is in the Type menu. --- crates/engine/src/cmd/retype.rs | 150 +++++++++++++++++++++----- crates/engine/src/cmd/retype_tests.rs | 59 ++++++++++ crates/text/src/retype.rs | 23 +++- crates/ui-egui/src/menus/tree.rs | 1 + 4 files changed, 204 insertions(+), 29 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 8634ca356e..2c19ae10a5 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -38,7 +38,7 @@ pub fn specs() -> Vec { "Retype", ["Type"], None, - "{fonts?: [family…]} turn the selected outlined text (glyph paths and compound paths, inside groups too) back into live point text: each shape is matched against the glyphs of the fonts the app has loaded, the document's fonts and the families in fonts, the same up to uniform scale, rotation and translation (exact matches only); matched glyphs become point text in that font and size at the same baseline, one object per line, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are → {ids (the new type), texts, fonts: [{family, style, size}], unmatched: [id…]}; an error when no shape matches", + "{fonts?: [family…]} turn the selected outlined text (glyph paths and compound paths, inside groups too) back into live point text: each shape is matched against the glyphs of the fonts the app has loaded, the document's fonts and the families in fonts, the same up to uniform scale, rotation and translation (exact matches only); matched glyphs become point text in that font and size at the same baseline, one object per line, with the first glyph's fill, stroke, opacity and blend mode, in one undo step; a line splits where its type would not draw the outlines' glyphs in their places (tracking, manual spacing, font substitutions); shapes that match no font, glyphs type cannot draw as they are, and shapes with their own opacity mask stay as they are → {ids (the new type), texts, fonts: [{family, style, size}], unmatched: [id…], truncated (shapes past the limits of 2048 shapes or 16 nested groups were left out)}; an error when no shape matches", has_selected_path, retype )] @@ -58,13 +58,17 @@ struct Piece { /// The shape's own transparency, which the new type takes. opacity: f32, blend: vectorcraft_color::BlendMode, + /// The shape has an opacity mask of its own, which type cannot take: it stays an outline. + masked: bool, } /// The shapes in `n` (held by `parent`), in paint order. `barrier` is set when art that is not a /// shape lies before the next one; it starts set for a root that does not follow the last root. -fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, out: &mut Vec) { +/// `truncated` is set when shapes past [`MAX_PIECES`] or [`MAX_DEPTH`] were left out. +fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, truncated: &mut bool, out: &mut Vec) { if out.len() >= MAX_PIECES || depth > MAX_DEPTH { *barrier = true; + *truncated = true; return; } let piece = |path: BezPath, after_barrier: bool| Piece { @@ -75,11 +79,12 @@ fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, o appearance: (*n.appearance).clone(), opacity: n.opacity, blend: n.blend, + masked: n.extras().mask.is_some(), }; match &n.kind { NodeKind::Group { children, clip: false } => { for c in children { - collect(c, Some(n.id), depth + 1, barrier, out); + collect(c, Some(n.id), depth + 1, barrier, truncated, out); } } // Only closed shapes can be glyphs: an open path stroked along a glyph's outline is not one. @@ -129,6 +134,8 @@ fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec, + /// What each piece matched, as `pieces`. + matches: Vec, text: String, face: Arc, scale: f64, @@ -175,8 +182,110 @@ impl Line { } self.text.push(m.ch); self.pieces.push(id); + self.matches.push(m.clone()); self.end = m.origin + dir * (m.face.advance(m.gid) * m.scale); } + + /// The line of this one's glyphs `from..to`, with its group, paint and transparency. + fn part(&self, from: usize, to: usize) -> Option { + let (ids, ms) = (self.pieces.get(from..to)?, self.matches.get(from..to)?); + let (first, m) = (ids.first()?, ms.first()?); + let dir = Vec2::new(m.angle.cos(), m.angle.sin()); + let mut l = Line { + pieces: vec![*first], + matches: vec![m.clone()], + text: m.ch.to_string(), + face: m.face.clone(), + scale: m.scale, + angle: m.angle, + origin: m.origin, + end: m.origin + dir * (m.face.advance(m.gid) * m.scale), + appearance: self.appearance.clone(), + parent: self.parent, + opacity: self.opacity, + blend: self.blend, + }; + for (id, m) in ids.iter().zip(ms).skip(1) { + l.push(*id, m); + } + Some(l) + } + + /// The point type that sets this line. + fn text_object(&self, system_layout: bool) -> TextObject { + let style = CharStyle { + font_family: self.face.family.clone(), + font_style: self.face.style.clone(), + // The version that matched, when two of the family and style are loaded. + font_version: (!self.face.version.is_empty()).then(|| self.face.version.clone()), + // Each outlined glyph was drawn on its own; a ligature would draw another shape. + features: vec!["-liga".into()], + size: self.scale * self.face.units_per_em(), + fill: self.appearance.fill_paint(), + stroke: self.appearance.stroke_paint(), + stroke_width: self.appearance.stroke_width(), + ..Default::default() + }; + let mut t = TextObject::point(self.origin, &self.text, style); + if self.angle != 0.0 { + t.xf *= kurbo::Affine::rotate(self.angle); + } + t.para = super::create::new_type_para(); + t.system_layout = system_layout; + super::typecmd::refresh_bounds(&mut t); + t + } + + /// The first of this line's glyphs its type does not draw as the outlines did: another glyph + /// (a substitution the font makes) or the same glyph elsewhere (tracking, manual spacing, + /// more space than whole spaces make); `None` when the type draws every glyph in its place. + fn first_mismatch(&self, t: &TextObject) -> Option { + let lay = vectorcraft_text::layout(FontDb::global(), t); + let mut drawn = lay.glyphs.iter().filter(|g| !g.outline.elements().is_empty()); + let tol = (self.scale * self.face.units_per_em() * 0.01).max(0.01); + for (k, m) in self.matches.iter().enumerate() { + let Some(g) = drawn.next() else { return Some(k) }; + let at = t.xf * (g.xf * Point::ORIGIN); + if g.font_id != m.face.id() || g.gid != m.gid || at.distance(m.origin) > tol { + return Some(k); + } + } + // Ink the outlines did not have: the last glyph is where it went wrong. + drawn.next().map(|_| self.matches.len().saturating_sub(1)) + } +} + +/// `lines` checked against their own layout: a line splits where its type stops drawing the +/// outlines, and a glyph its type cannot draw even on its own stays an outline (`unmatched`). +/// The layouts are bounded by the number of glyphs. +fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) -> Vec { + let mut budget = lines.iter().map(|l| l.pieces.len() * 2 + 2).sum::(); + let mut todo: std::collections::VecDeque = lines.into(); + let mut out = vec![]; + while let Some(l) = todo.pop_front() { + if budget == 0 { + // Unchecked glyphs stay outlines. + unmatched.extend(l.pieces); + continue; + } + budget -= 1; + let n = l.pieces.len(); + match l.first_mismatch(&l.text_object(system_layout)) { + None => out.push(l), + Some(0) => { + unmatched.extend(l.pieces.first().copied()); + if let Some(rest) = l.part(1, n) { + todo.push_front(rest); + } + } + Some(k) => { + for part in [l.part(k, n), l.part(0, k)].into_iter().flatten() { + todo.push_front(part); + } + } + } + } + out } fn space_advance(face: &vectorcraft_text::FontFace) -> f64 { @@ -187,6 +296,7 @@ fn new_line(pc: &Piece, m: &GlyphMatch) -> Line { let dir = Vec2::new(m.angle.cos(), m.angle.sin()); Line { pieces: vec![pc.id], + matches: vec![m.clone()], text: m.ch.to_string(), face: m.face.clone(), scale: m.scale, @@ -211,9 +321,11 @@ fn retype(s: &mut Session, p: &Value) -> Result { }; let roots = selected_roots(s)?; let db = FontDb::global(); - let (lines, unmatched) = { + let system_layout = s.doc()?.doc.setup.system_layout; + let (lines, unmatched, truncated) = { let d = &s.doc()?.doc; let mut pieces = vec![]; + let mut truncated = false; let mut last: Option<(Option, usize)> = None; // Carried across roots: a selected root that yields no shape (live type, an open path) still // ends the line. @@ -228,13 +340,13 @@ fn retype(s: &mut Session, p: &Value) -> Result { barrier = true; } last = idx.map(|i| (parent, i)); - collect(n, parent, 0, &mut barrier, &mut pieces); + collect(n, parent, 0, &mut barrier, &mut truncated, &mut pieces); } if pieces.is_empty() { return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); } let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts)); - let found: Vec> = pieces.iter().map(|pc| index.matches(&pc.path)).collect(); + let found: Vec> = pieces.iter().map(|pc| if pc.masked { vec![] } else { index.matches(&pc.path) }).collect(); // The face most shapes match, so a glyph several fonts share is set in the same font as // the glyphs around it. let mut votes: Vec<(u32, usize)> = vec![]; @@ -266,38 +378,19 @@ fn retype(s: &mut Session, p: &Value) -> Result { } open = true; } - (lines, unmatched) + let lines = verified(lines, system_layout, &mut unmatched); + (lines, unmatched, truncated) }; if lines.is_empty() { return Err(EngineError::Other(format!("Retype: no selected shape matches a glyph of an available font ({} checked)", unmatched.len()))); } - let system_layout = s.doc()?.doc.setup.system_layout; let made = s.edit("Retype", |d, sel| { let mut ids = vec![]; let mut emptied = vec![]; for l in &lines { let Some(first) = l.pieces.first() else { continue }; let (par, idx, _) = d.position(*first).ok_or(EngineError::NoNode(*first))?; - let style = CharStyle { - font_family: l.face.family.clone(), - font_style: l.face.style.clone(), - // The version that matched, when two of the family and style are loaded. - font_version: (!l.face.version.is_empty()).then(|| l.face.version.clone()), - // Each outlined glyph was drawn on its own; a ligature would draw another shape. - features: vec!["-liga".into()], - size: l.scale * l.face.units_per_em(), - fill: l.appearance.fill_paint(), - stroke: l.appearance.stroke_paint(), - stroke_width: l.appearance.stroke_width(), - ..Default::default() - }; - let mut t = TextObject::point(l.origin, &l.text, style); - if l.angle != 0.0 { - t.xf *= kurbo::Affine::rotate(l.angle); - } - t.para = super::create::new_type_para(); - t.system_layout = system_layout; - super::typecmd::refresh_bounds(&mut t); + let t = l.text_object(system_layout); let id = d.alloc_id(); let mut node = Node::new(id, NodeKind::Text(Box::new(t))); // The glyphs' own transparency (the group's, kept, still applies over it). @@ -347,6 +440,7 @@ fn retype(s: &mut Session, p: &Value) -> Result { "texts": lines.iter().map(|l| l.text.clone()).collect::>(), "fonts": lines.iter().map(|l| json!({"family": l.face.family, "style": l.face.style, "size": l.scale * l.face.units_per_em()})).collect::>(), "unmatched": unmatched.iter().map(|i| i.0).collect::>(), + "truncated": truncated, })) } diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 266a016ea7..7f9cd7ac5d 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -240,3 +240,62 @@ fn glyphs_selected_inside_groups_join_only_their_siblings() { let d = &s.doc().unwrap().doc; assert!(d.node(NodeId(g2)).is_some(), "d's group stays with c's type and d in it"); } + +#[test] +fn tracked_type_splits_where_its_spacing_cannot_be_set_again() { + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "abc", "size": 30})).unwrap()["id"].as_u64().unwrap(); + // Less than half a space: no whole number of spaces makes up the gap (0.4 em would be two + // spaces in this font, and the outlines cannot tell those apart from tracking). + s.execute("text.setRangeStyle", &json!({"id": id, "start": 1, "end": 3, "tracking": 50})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); + assert_eq!(texts.concat(), "abc", "{r}"); + assert!(texts.len() > 1, "the tracked glyphs are set where the outlines are, not where untracked type puts them: {r}"); + assert_eq!(r["unmatched"], json!([])); +} + +#[test] +fn a_masked_glyph_stays_an_outline() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let a = children_of(&s, g)[0]; + s.edit("test", |d, _| { + let art = vectorcraft_doc::Node::path(d.alloc_id(), vectorcraft_geom::PathData::default(), Default::default()); + d.node_mut(NodeId(a)).unwrap().extras_mut().mask = Some(Box::new(vectorcraft_doc::OpacityMask::new(art, true))); + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["B"]), "{r}"); + assert_eq!(r["unmatched"], json!([a])); + assert!(s.doc().unwrap().doc.node(NodeId(a)).unwrap().extras().mask.is_some(), "A keeps its mask"); +} + +#[test] +fn shapes_past_the_limits_are_reported_as_left_out() { + let mut s = session(); + let top = outlined(&mut s, json!({"x": 40, "y": 100, "text": "A", "size": 40})); + let deep = outlined(&mut s, json!({"x": 40, "y": 200, "text": "B", "size": 40})); + // B, deeper than Retype looks. + s.edit("test", |d, _| { + let (par, idx, _) = d.position(NodeId(deep)).unwrap(); + let mut n = d.node(NodeId(deep)).unwrap().clone(); + d.remove(NodeId(deep))?; + for _ in 0..20 { + n = vectorcraft_doc::Node::group(d.alloc_id(), vec![std::sync::Arc::new(n)]); + } + let wrapper = n.id.0; + d.insert(par, idx, n)?; + Ok(wrapper) + }) + .map(|w| s.execute("select.set", &json!({"ids": [top, w]})).unwrap()) + .unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["A"])); + assert_eq!(r["truncated"], json!(true), "{r}"); +} diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 5a1894e2d0..c014951008 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -98,7 +98,7 @@ impl RetypeIndex { // One entry per glyph, under the lowest character that maps to it. let mut by_gid: HashMap = HashMap::new(); for &(c, gid) in face.mapped_chars().iter().take(MAX_GLYPHS_PER_FACE) { - if c.is_whitespace() || c.is_control() { + if c.is_whitespace() || c.is_control() || is_shape_symbol(c) { continue; } by_gid.entry(gid).and_modify(|e| *e = (*e).min(c)).or_insert(c); @@ -179,6 +179,16 @@ impl RetypeIndex { } } +/// Characters whose glyphs are plain shapes (box drawing, blocks, geometric shapes, legacy +/// computing symbols) or a font's own icons (private use): a drawn rectangle or circle is the same +/// shape as one of them, so matching them would turn art into text. They are not matched. +fn is_shape_symbol(c: char) -> bool { + matches!( + u32::from(c), + 0x2500..=0x25FF | 0x2B00..=0x2BFF | 0x1F780..=0x1F7FF | 0x1FB00..=0x1FBFF | 0xE000..=0xF8FF | 0xF0000..=0x10FFFF + ) +} + /// Complex multiply: `z` (a scaled turn) applied to `p`. fn mul(z: (f64, f64), p: Point) -> Point { Point::new(z.0 * p.x - z.1 * p.y, z.1 * p.x + z.0 * p.y) @@ -367,6 +377,17 @@ mod tests { assert!(fit(&a, &b).is_none_or(|(_, r)| r > TOLERANCE)); } + #[test] + fn plain_shape_symbols_are_not_matched() { + // A block element (U+1FB89) drew as a rectangle and took a drawn rectangle for it. + for c in ['\u{1FB89}', '\u{25A0}', '\u{2588}', '\u{E000}'] { + assert!(is_shape_symbol(c), "{c:?}"); + } + for c in ['A', 'l', '-', '\u{6F22}', '\u{0915}'] { + assert!(!is_shape_symbol(c), "{c:?}"); + } + } + #[test] fn degenerate_and_hostile_shapes_give_none() { assert!(signature(&BezPath::new()).is_none()); diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index 19088a259a..7f5acd6e51 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -471,6 +471,7 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec)> { ), Sep, c("Create Outlines", "type.createOutlines"), + c("Retype", "type.retype"), c("Scale Text Attributes", "type.scaleTextAttributes"), c("Optical Margin Alignment", "type.opticalMarginAlignment"), Sep, From 5ed13b1249aad6914153ef892ae21402c1be54c9 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 10:20:55 +0530 Subject: [PATCH 188/247] M7/G4: retype keeps outlines whose paint type cannot take (#4934) Shapes with more than a basic appearance (several fills or strokes, effects, item transparency, brushes, width profiles, arrowheads) stay outlines. The stroke's caps, joins, miter limit, dashes and alignment carry over. A line's glyphs share one size and turn exactly, and a first glyph its line cannot draw is tried on its own. --- crates/engine/src/cmd/retype.rs | 37 +++++++++++++++++++-------- crates/engine/src/cmd/retype_tests.rs | 20 +++++++++++++++ 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 2c19ae10a5..be7df50d95 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -58,8 +58,9 @@ struct Piece { /// The shape's own transparency, which the new type takes. opacity: f32, blend: vectorcraft_color::BlendMode, - /// The shape has an opacity mask of its own, which type cannot take: it stays an outline. - masked: bool, + /// The shape has what type cannot take (its own opacity mask, more than one fill or stroke, + /// effects, a brush, width profile or arrowheads): it stays an outline. + keeps_outline: bool, } /// The shapes in `n` (held by `parent`), in paint order. `barrier` is set when art that is not a @@ -79,7 +80,7 @@ fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, t appearance: (*n.appearance).clone(), opacity: n.opacity, blend: n.blend, - masked: n.extras().mask.is_some(), + keeps_outline: n.extras().mask.is_some() || !type_can_paint(&n.appearance), }; match &n.kind { NodeKind::Group { children, clip: false } => { @@ -107,6 +108,12 @@ fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, t } } +/// Can type's character style paint `ap` as it is: a basic appearance (at most one fill and one +/// stroke, no effects, no item opacity or blend), with a plain stroke? +fn type_can_paint(ap: &Appearance) -> bool { + ap.is_basic() && ap.stroke().is_none_or(|s| s.start_arrow.is_none() && s.end_arrow.is_none() && s.profile.is_none() && s.brush.is_none()) +} + /// The faces to match against: the families in `fonts`, the document's fonts, then every loaded face. fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec> { let mut families: Vec = fonts.iter().take(MAX_FONT_PARAMS).cloned().collect(); @@ -165,8 +172,9 @@ impl Line { && pc.opacity == self.opacity && pc.blend == self.blend && m.face.id() == self.face.id() - && (m.scale - self.scale).abs() <= self.scale * 0.005 - && (m.angle - self.angle).abs() < 1e-3 + // One size and turn for the whole line: the type sets every glyph at the first one's. + && (m.scale - self.scale).abs() <= self.scale * 1e-4 + && (m.angle - self.angle).abs() < 1e-5 && across < size * 0.05 && (m.origin - self.end).dot(dir) > -size * 0.25 } @@ -226,6 +234,14 @@ impl Line { stroke_width: self.appearance.stroke_width(), ..Default::default() }; + let mut style = style; + if let Some(st) = self.appearance.stroke() { + style.stroke_cap = st.cap; + style.stroke_join = st.join; + style.stroke_miter_limit = st.miter_limit; + style.stroke_dash = st.dash.clone(); + style.stroke_align = st.align; + } let mut t = TextObject::point(self.origin, &self.text, style); if self.angle != 0.0 { t.xf *= kurbo::Affine::rotate(self.angle); @@ -272,12 +288,13 @@ fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) let n = l.pieces.len(); match l.first_mismatch(&l.text_object(system_layout)) { None => out.push(l), - Some(0) => { - unmatched.extend(l.pieces.first().copied()); - if let Some(rest) = l.part(1, n) { - todo.push_front(rest); + // The first glyph on its own may still be drawn as it was (a contextual form changed it). + Some(0) if n > 1 => { + for part in [l.part(1, n), l.part(0, 1)].into_iter().flatten() { + todo.push_front(part); } } + Some(0) => unmatched.extend(l.pieces.first().copied()), Some(k) => { for part in [l.part(k, n), l.part(0, k)].into_iter().flatten() { todo.push_front(part); @@ -346,7 +363,7 @@ fn retype(s: &mut Session, p: &Value) -> Result { return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); } let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts)); - let found: Vec> = pieces.iter().map(|pc| if pc.masked { vec![] } else { index.matches(&pc.path) }).collect(); + let found: Vec> = pieces.iter().map(|pc| if pc.keeps_outline { vec![] } else { index.matches(&pc.path) }).collect(); // The face most shapes match, so a glyph several fonts share is set in the same font as // the glyphs around it. let mut votes: Vec<(u32, usize)> = vec![]; diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 7f9cd7ac5d..4c331720a1 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -299,3 +299,23 @@ fn shapes_past_the_limits_are_reported_as_left_out() { assert_eq!(r["texts"], json!(["A"])); assert_eq!(r["truncated"], json!(true), "{r}"); } + +#[test] +fn a_glyph_painted_beyond_what_type_takes_stays_an_outline() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let a = children_of(&s, g)[0]; + s.edit("test", |d, _| { + let n = d.node_mut(NodeId(a)).unwrap(); + let mut ap = (*n.appearance).clone(); + let fill = ap.items.iter().find(|i| i.is_fill()).unwrap().clone(); + ap.items.push(fill); + n.appearance = ap.into(); + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["B"]), "two fills: A stays an outline: {r}"); + assert_eq!(r["unmatched"], json!([a])); +} From 7973b6254c8efdba139f2ddd40000b53732dca4e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 20:53:26 -0800 Subject: [PATCH 189/247] Keep precise-cursor regression meaningful --- crates/tools/src/draw2/gesture/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 9fe8f24d51..2d4dbf9400 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -3123,6 +3123,8 @@ fn bristle_tip_annotator_follows_a_rotation_capable_pen() { assert!(bounds(&newly_selected, &view).is_some(), "no selected path borrows Smooth yet"); assert_eq!(newly_selected.cursor(&selected_view, new_stroke.pos, new_stroke.mods), Cursor::Smooth); assert!(bounds(&newly_selected, &selected_view).is_none(), "post-commit selection also hides the tip"); + tool.pointer(&view, &at(Some(0.0))); + assert!(bounds(&tool, &view).is_some(), "a normal pen hover shows the tip before Precise Cursors hides it"); let precise = ToolContext { precise_cursors: true, ..cx(&d, &s, &p) }; assert!(bounds(&tool, &precise).is_none()); tool.pointer(&view, &at(Some(0.0)).with_mods(Mods { cmd: true, ..Default::default() })); From 9ffca655cddf9082059ea015ba509a4320803584 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 21:15:25 -0800 Subject: [PATCH 190/247] Fields: count x signs in the Unit Converter's limit too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit addon.units.convert reads its value through Unit::parse, so after the merge of main it takes x, X and × as multiplication signs as well. Its 128-sign limit counted only + - * /. The new vectorcraft_doc::arithmetic_signs counts each multiplication sign as a *, and both Unit::parse and the converter use it. - The converter's params text and docs/mcp.md list the signs. - Tests cover 2pX3 and 2p×3 (6 picas), 8.5x11 in (refused before, now 93.5 in) and the converter's reading and limit. - The test message says "millimeters", and the doc comments wrap at the file's width. --- crates/doc/src/lib.rs | 2 +- crates/doc/src/tests/units.rs | 7 ++++ crates/doc/src/units.rs | 38 ++++++++++++--------- crates/engine/src/cmd/addons/units.rs | 12 +++---- crates/engine/src/cmd/addons/units/tests.rs | 6 ++++ crates/ui-egui/src/tests/numfields.rs | 2 +- docs/mcp.md | 10 +++--- docs/ui-parity.md | 2 +- 8 files changed, 49 insertions(+), 30 deletions(-) diff --git a/crates/doc/src/lib.rs b/crates/doc/src/lib.rs index 18974db32a..ddea80c5f6 100644 --- a/crates/doc/src/lib.rs +++ b/crates/doc/src/lib.rs @@ -168,7 +168,7 @@ use limits::MAX_NEXT_ID; pub use limits::{DocError, FORMAT_VERSION, MAX_COORD}; pub use records::{ImageBlob, MaskEdit, NewArtIds, SavedSelection, SavedView, SvgFilter, Symbol, SymbolEdit}; pub use stored_art::{StoredPlace, StoredRoot}; -pub use units::{ColorMode, Unit, decimal_point, finite_in_every_unit, parse_number}; +pub use units::{ColorMode, Unit, arithmetic_signs, decimal_point, finite_in_every_unit, parse_number}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Document { diff --git a/crates/doc/src/tests/units.rs b/crates/doc/src/tests/units.rs index 9696bf54d0..fd8690a8ff 100644 --- a/crates/doc/src/tests/units.rs +++ b/crates/doc/src/tests/units.rs @@ -116,6 +116,11 @@ fn x_is_a_multiplication_sign() { (Unit::Points, "2px x 3", 6.0), (Unit::Points, "2pxx3", 6.0), (Unit::Millimeters, "4x3 px", 12.0), + // Only a lowercase x after a p is the px suffix. + (Unit::Points, "2pX3", 72.0), + (Unit::Points, "2p×3", 72.0), + // Text that used to be refused now reads as a product. + (Unit::Points, "8.5x11 in", 93.5 * 72.0), ] { let got = u.parse(s).unwrap_or_else(|| panic!("{u:?} can't read `{s}`")); assert!((got - want).abs() < 1e-9, "{u:?}: `{s}` → {got}, want {want}"); @@ -132,6 +137,8 @@ fn x_is_a_multiplication_sign() { assert_eq!(Unit::Points.parse(&format!("1{}", "x1".repeat(128))), Some(1.0)); assert_eq!(Unit::Points.parse(&format!("1{}", "x1".repeat(129))), None); assert_eq!(crate::parse_number(&format!("1{}", "×1".repeat(129))), None); + assert_eq!(crate::arithmetic_signs("1+2x3X4×5*6/7-8"), 7); + assert_eq!(crate::arithmetic_signs("2px x 3"), 1); } proptest! { diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index 45af1d172b..c896ee5ee8 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -153,26 +153,17 @@ impl Unit { /// /// `x`, `X` and `×` multiply as `*` does (`10x2` is 20, `2x3 mm` is 6 mm), except a lowercase /// `x` right after a `p`, which is the `px` suffix (`2px x 3` is 6 px, and `2px3` reads as - /// nothing; write `2p x 3` for picas). + /// nothing; write `2p x 3` for picas). `X` and `×` after a `p` multiply (`2pX3` is 6 picas). /// - /// A unit after a `*` or `/` operand measures the whole expression (`1080/2 px` is 540 px), so - /// math typed before a field's unit suffix works. After `*` or `/`, a percentage scales the term - /// before it (`3cm*50%` is 1.5 cm, `3cm/50%` is 6 cm). After `+` or `-`, it adds or takes away - /// that share of everything before it (`50pt+25%` is 62.5 pt, `100pt+20pt-50%` is 60 pt). A - /// percentage on its own (`50%`) reads as nothing. + /// A unit after a `*` or `/` operand measures the whole expression (`1080/2 px` is 540 px), + /// so math typed before a field's unit suffix works. After `*` or `/`, a percentage scales the + /// term before it (`3cm*50%` is 1.5 cm, `3cm/50%` is 6 cm). After `+` or `-`, it adds or takes + /// away that share of everything before it (`50pt+25%` is 62.5 pt, `100pt+20pt-50%` is 60 + /// pt). A percentage on its own (`50%`) reads as nothing. /// - /// Text with more than 128 `+ - * /` signs (a multiplication sign counts as `*`) reads as nothing. + /// Text with more than 128 [`arithmetic_signs`] reads as nothing. pub fn parse(self, s: &str) -> Option { - let mut prev = None; - let operators = s - .chars() - .filter(|&c| { - let operator = matches!(c, '+' | '-' | '*' | '/') || is_times(c, prev); - prev = Some(c); - operator - }) - .count(); - if operators > MAX_MEASURE_OPERATORS { + if arithmetic_signs(s) > MAX_MEASURE_OPERATORS { return None; } parse_measure(×_as_asterisks(s), self).filter(|v| v.is_finite()) @@ -228,6 +219,19 @@ impl Unit { /// The most `+ - * /` signs [`Unit::parse`] reads in one text. const MAX_MEASURE_OPERATORS: usize = 128; +/// The number of `+ - * /` signs in `s`, each multiplication sign typed as `x`, `X` or `×` +/// ([`Unit::parse`]) counted as a `*`. +pub fn arithmetic_signs(s: &str) -> usize { + let mut prev = None; + s.chars() + .filter(|&c| { + let sign = matches!(c, '+' | '-' | '*' | '/') || is_times(c, prev); + prev = Some(c); + sign + }) + .count() +} + /// Is `c`, after `prev`, a multiplication sign typed as `x`, `X` or `×`? A lowercase `x` right /// after a `p` is the `px` suffix (`2px x 3`), also where a number follows it (`2px3`). fn is_times(c: char, prev: Option) -> bool { diff --git a/crates/engine/src/cmd/addons/units.rs b/crates/engine/src/cmd/addons/units.rs index b5d844709a..4da4f68b79 100644 --- a/crates/engine/src/cmd/addons/units.rs +++ b/crates/engine/src/cmd/addons/units.rs @@ -10,7 +10,7 @@ mod tests; use serde_json::{Value, json}; -use vectorcraft_doc::{OrientedBox, Unit, decimal_point, finite_in_every_unit}; +use vectorcraft_doc::{OrientedBox, Unit, arithmetic_signs, decimal_point, finite_in_every_unit}; use vectorcraft_render::effects; use super::super::{CommandSpec, always, bad, cmd, has_selection}; @@ -22,8 +22,8 @@ const SELECTION_SIZE: &str = "addon.units.selectionSize"; const SHOWN_CHARS: usize = 64; /// The longest `value` or `unit` text `addon.units.convert` reads, in bytes. const MAX_TEXT_LEN: usize = 1024; -/// The most `+ - * /` signs `addon.units.convert` reads in one `value`: [`Unit::parse`] takes one -/// level of recursion per sign. +/// The most `+ - * /` signs `addon.units.convert` reads in one `value`, a multiplication sign +/// counted as a `*`: [`Unit::parse`] takes one level of recursion per sign. const MAX_OPERATORS: usize = 128; pub fn specs() -> Vec { @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Convert Units", [], None, - "{value: a length (a number, or text as a number field reads it, with a unit suffix and + - * / arithmetic: \"10mm\", \"1in/2\", \"2p6\", \"3cm*50%\"; a decimal comma reads as a point: \"0,5 mm\"; at most 1024 bytes and 128 operators), unit?: the unit of a number without a suffix (a unit's name, suffix or key: points, picas, inches, millimeters, centimeters, pixels, feetInches, meters, yards, feet, q, ha; default: points)} the length in every unit of Preferences › Units › East Asian Type, written as the number fields write it (rounded to 3 decimals in pt, px, picas, Q and Ha and to 4 in the others; pixels are points). Nothing in the document changes → {points, units: [{unit (its key), label, number (no suffix), text (with the suffix)}]}", + "{value: a length (a number, or text as a number field reads it, with a unit suffix and + - * / arithmetic, x, X or × multiplying as * does: \"10mm\", \"1in/2\", \"2p6\", \"3cm*50%\", \"2x3 mm\"; a decimal comma reads as a point: \"0,5 mm\"; at most 1024 bytes and 128 operators, each multiplication sign counted), unit?: the unit of a number without a suffix (a unit's name, suffix or key: points, picas, inches, millimeters, centimeters, pixels, feetInches, meters, yards, feet, q, ha; default: points)} the length in every unit of Preferences › Units › East Asian Type, written as the number fields write it (rounded to 3 decimals in pt, px, picas, Q and Ha and to 4 in the others; pixels are points). Nothing in the document changes → {points, units: [{unit (its key), label, number (no suffix), text (with the suffix)}]}", always, convert ), @@ -88,9 +88,9 @@ fn convert(_: &mut Session, p: &Value) -> Result { } /// Is `s` short enough to read: at most [`MAX_TEXT_LEN`] bytes and [`MAX_OPERATORS`] `+ - * /` -/// signs? +/// signs, a multiplication sign typed as `x`, `X` or `×` counted as a `*` ([`arithmetic_signs`])? fn readable(s: &str) -> bool { - s.len() <= MAX_TEXT_LEN && s.chars().filter(|c| matches!(c, '+' | '-' | '*' | '/')).count() <= MAX_OPERATORS + s.len() <= MAX_TEXT_LEN && arithmetic_signs(s) <= MAX_OPERATORS } /// `v` as an error message shows it: text cut at [`SHOWN_CHARS`] characters with "…", as JSON, diff --git a/crates/engine/src/cmd/addons/units/tests.rs b/crates/engine/src/cmd/addons/units/tests.rs index f914c53092..802fb5dfdf 100644 --- a/crates/engine/src/cmd/addons/units/tests.rs +++ b/crates/engine/src/cmd/addons/units/tests.rs @@ -76,6 +76,12 @@ fn values_read_as_number_fields_read_them() { assert!(near(pt(&mut s, json!({"value": "1,500+2", "unit": "mm"})), 3.5 * 72.0 / 25.4)); // A sum of 128 signs still reads. assert!(near(pt(&mut s, json!({"value": format!("1{}", "+1".repeat(128))})), 129.0)); + // x, X and × multiply as * does, and each counts toward the 128 signs. + assert!(near(pt(&mut s, json!({"value": "2x3 mm"})), 6.0 * 72.0 / 25.4)); + assert!(near(pt(&mut s, json!({"value": "10X2"})), 20.0)); + assert!(near(pt(&mut s, json!({"value": "0,5×4 in"})), 144.0)); + assert!(near(pt(&mut s, json!({"value": format!("1{}", "x1".repeat(128))})), 1.0)); + assert!(s.execute("addon.units.convert", &json!({"value": format!("1{}", "x1".repeat(129))})).is_err()); } #[test] diff --git a/crates/ui-egui/src/tests/numfields.rs b/crates/ui-egui/src/tests/numfields.rs index 3b7c2d157e..585c16ba2a 100644 --- a/crates/ui-egui/src/tests/numfields.rs +++ b/crates/ui-egui/src/tests/numfields.rs @@ -779,7 +779,7 @@ fn bare_numbers_in_picas_fields_are_points_when_the_preference_says_so() { assert_eq!(typed(&mut f, pc, "1in"), Some(72.0), "a typed unit wins"); assert_eq!(typed(&mut f, pc, "10+5"), Some(15.0), "arithmetic in points too"); assert_eq!(typed(&mut f, pc, "10x2"), Some(20.0), "x multiplies (#8435)"); - assert_eq!(typed(&mut f, mm, "2 x 3"), Some(mm.to_pt(6.0)), "x multiplies in millimetres"); + assert_eq!(typed(&mut f, mm, "2 x 3"), Some(mm.to_pt(6.0)), "x multiplies in millimeters"); assert_eq!(typed(&mut f, mm, "12"), Some(mm.to_pt(12.0)), "a millimetre field keeps millimetres"); widgets::set_bare_numbers_are_points(&f.ctx, false); assert_eq!(typed(&mut f, pc, "12"), Some(pc.to_pt(12.0)), "off: picas"); diff --git a/docs/mcp.md b/docs/mcp.md index 014636167e..13b1d089fb 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7592,7 +7592,8 @@ Commands take and return lengths in points (the distances of `object.path.offset `object.path.splitIntoGrid` and `text.setStyle` `size`/`leading` also take a string with a unit, `"5 mm"`). A length string takes the same arithmetic as the desktop app's fields, where `%` is a share of the value before it: `"200mm*50%"` is 100 mm and `"50pt+25%"` is 62.5 pt. `x`, `X` and `×` multiply as `*` does (`"2x3 mm"` is 6 mm), -except a lowercase `x` right after a `p`, which is the `px` suffix (`"2px3"` is not read; `"2p x 3"` is 6 picas). +except a lowercase `x` right after a `p`, which is the `px` suffix (`"2px3"` is not read; `"2p x 3"` and `"2pX3"` +are 6 picas). A string such as `"8.5x11 in"` reads as one length, 93.5 in. A length string with more than 128 `+ - * /` signs (each multiplication sign counts) is not read as a length. The units only change what the UI shows and how it reads typed numbers. Preferences ▸ Units has four: General (rulers, positions and sizes, the Info panel, dialog distances, canvas measurement labels), Stroke @@ -14025,9 +14026,10 @@ Unit Converter is a built-in add-on that shows one length in every unit at once Converter and in its panel (`window.panel {panel: "unitConverter"}`). Neither command changes the document. `addon.units.convert {value, unit?}` reads `value` as a number field reads it: a number, or text with a unit suffix and -`+ - * /` arithmetic (`"10mm"`, `"1in/2"`, `"2p6"`, `"1080/2 px"`, `"3cm*50%"`, `"13q"`), a decimal comma read as a point -(`"0,5 mm"`) and a single number with a thousands comma (`"1,000 mm"`) refused, in at most 1024 bytes with at most 128 `+ - * /` signs. A -number without a suffix is in `unit` (a unit's name, suffix or key: `points`, `picas`, `inches`, `millimeters`, +`+ - * /` arithmetic, where `x`, `X` and `×` multiply as `*` does (`"10mm"`, `"1in/2"`, `"2p6"`, `"1080/2 px"`, +`"3cm*50%"`, `"2x3 mm"`, `"13q"`), a decimal comma read as a point (`"0,5 mm"`) and a single number with a thousands +comma (`"1,000 mm"`) refused, in at most 1024 bytes with at most 128 `+ - * /` signs (each multiplication sign counts). +A number without a suffix is in `unit` (a unit's name, suffix or key: `points`, `picas`, `inches`, `millimeters`, `centimeters`, `pixels`, `feetInches`, `meters`, `yards`, `feet`, `q`, `ha`; default `points`); a suffix in the text takes precedence over `unit`. It works without an open document. The command fails when `value` is missing, does not read, or is not finite in every unit, and when `unit` is not a unit. Result: `{points, units: [{unit, label, number, diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 47233ebac4..c7721291c0 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -309,7 +309,7 @@ tools, never checked side by side) isn't captured row by row. | Fields commit what was typed on a click away or a move to another field, as Enter does; Escape discards it | done | #1787 | | Number fields: Up/Down step, Shift ×10, Cmd/Ctrl ÷10, wheel over a hovered field without a click; steps, the wheel and label scrubs stop at the field's bounds (a stroke weight at 0, a miter limit at 1) | done | Shift+arrow in the Stroke weight field doesn't step by 10 (#991); bounds #3370. The field takes the wheel only when the pointer was moved onto it after the field last moved or was covered by a window or overlay, and the wheel stream began there; a stream that began elsewhere stays there until 0.5 s pass with no wheel input or the pointer is pressed on a field, so a panel scrolled under a still pointer keeps scrolling past the field. This rule and its 0.5 s are VectorCraft's choices. | | Numeric spinner arrows step once on a click and keep repeating while held with the mouse | done | #6307; headless test `a_held_spinner_arrow_repeats` holds past egui's click timeout and checks release. | -| Arithmetic in fields (`+ - * /`, `x`, `X` or `×` for `*`, and `%` of the value before it: `3cm*50%`, `50pt+25%`) and unit suffixes (`3 mm`, `1in`, `2p6`) | done | `Unit::parse`; mixed units in one expression not verified | +| Arithmetic in fields (`+ - * /`, `x`, `X` or `×` for `*`, and `%` of the value before it: `3cm*50%`, `50pt+25%`) and unit suffixes (`3 mm`, `1in`, `2p6`) | done | `Unit::parse` and `parse_number`; mixed units in one expression not verified | | Numeric fields: focus click selects the whole value; dragging selects from the pressed character | partial | #1326; select-all waits for click release; px/pt/plain/optional fields, both directions and replacement text tested; native API input, 17 px partial replacement, Undo/Redo, saved-file round trip and screenshots verified; Tab, double-click, arrows and wheel preserved; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all (#6659) | | Units: pt, pc, in, mm, cm, px, ft-in, m, yd, ft; General/Stroke/Type units | done | units preference reverting to points on SVG output reported (#864). A file that records no units (PDF, EPS or `.ai` without ruler units, raster images, metafiles, Affinity files) opens and reverts in General units; native, SVG and DXF files and a `.ai` or EPS with ruler units keep theirs, as a [Community Expert's answer](https://community.adobe.com/questions-652/change-units-from-points-to-inches-won-t-stick-765372) describes (#5820) | | Units › East Asian Type (Q and Ha) | done | #394: `unitsAsianType` offers every unit and Q and Ha, a quarter of a millimetre each ([Scripting Guide's Measurement Units](https://ai-scripting.docsforadobe.dev/scripting/measurementUnits/): 0.709 pt per Q; [InDesign's unit notation](https://helpx.adobe.com/in/indesign/desktop/layout-and-grid-tools/rulers-and-measure-tools/change-ruler-measurement-units.html): `q`, `h`); only it lists Q and Ha. The public pages do not say which fields use it, so no field uses it yet and that waits for a source. Tests `q_and_ha_are_a_quarter_millimetre`, `east_asian_type_unit_*` | From 1f704f2dc37a89613036763ba18f1df8fe69ad72 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 21:29:50 -0800 Subject: [PATCH 191/247] Palette: Find Next is listed, since a pick runs it as its menu item does MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A pick of Edit › Find Next goes on from the last Find and Replace search or opens the dialog, so the palette lists it among the commands a pick still runs. --- crates/ui-egui/src/palette.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index b4e3190ee7..1af89b882a 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -40,8 +40,9 @@ const WRAPPED: &[(&str, &str)] = &[ /// selection's gradient matches, Pixel Snapping Options… /// opens its dialog, the three Asset Export commands open the Asset Export panel (#4864), New /// Symbol makes a symbol of the selection, Gradient Vector gives the selection the default -/// gradient, Define Perspective Grid makes the document's grid, and Select Slice deselects the -/// slices. +/// gradient, Define Perspective Grid makes the document's grid, Select Slice deselects the +/// slices, and Find Next goes on from the last Find and Replace search or opens its dialog, as +/// its menu item does. const PICK_RUNS: &[&str] = &[ "script.stop", "script.console.clear", @@ -65,6 +66,7 @@ const PICK_RUNS: &[&str] = &[ "paint.setGradientGeom", "perspective.grid.set", "object.slice.select", + "edit.findNext", ]; /// The menu path of a panel's result: a pick runs Show Panel (`window.panel`) for the panel. From d4b1ff8f603fbdde4e33ff2bd6c456de777bfb83 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 21:53:34 -0800 Subject: [PATCH 192/247] Find and Replace: a dialog field of the wrong type is an error ui.paramDialog for edit.findReplace used to drop a field of the wrong type, such as a number for find, and open on the last search. It now returns an error and leaves the dialog closed. A null field still gives none, as the menu item's does. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/dialogs/find_replace.rs | 11 +++++++++-- .../ui-egui/src/dialogs/find_replace/tests.rs | 19 +++++++++++++++++++ crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 3 ++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 05116b02ec..25fb02285e 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -847,7 +847,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.paramDialog", "Command Dialog", "", - "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place, and Edit › Find Next goes on from it in the same document while the dialog is closed", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error), and Edit › Find Next goes on from it in the same document while the dialog is closed", ), ( "ui.recolorDialog", diff --git a/crates/ui-egui/src/dialogs/find_replace.rs b/crates/ui-egui/src/dialogs/find_replace.rs index a43e737e18..458b7a2184 100644 --- a/crates/ui-egui/src/dialogs/find_replace.rs +++ b/crates/ui-egui/src/dialogs/find_replace.rs @@ -79,8 +79,8 @@ fn active_uid(app: &VectorcraftApp) -> Option { } /// Open Find and Replace on the last search when there has been one, with the fields that -/// `params` gives in its place. A value of another type than the field's, such as the menu item's -/// null `find` ([`menu_params`]), gives none. +/// `params` gives in its place. A null value, such as the menu item's `find` ([`menu_params`]), +/// gives none. A field given a value of another type is an error, and the dialog does not open. pub fn open(app: &mut VectorcraftApp, params: &Map) -> Result { let mut fields = Map::new(); fields.insert("find".into(), json!("")); @@ -88,6 +88,13 @@ pub fn open(app: &mut VectorcraftApp, params: &Map) -> Result return Err(format!("`{k}` must be a string")), + Some(Value::Bool(_)) if !v.is_boolean() => return Err(format!("`{k}` must be true or false")), + _ => {} + } + } let last = app.ui.last_find.as_ref().and_then(Value::as_object).cloned().unwrap_or_default(); for (k, v) in last.iter().chain(params) { // Only the dialog's own fields, each of its own type. diff --git a/crates/ui-egui/src/dialogs/find_replace/tests.rs b/crates/ui-egui/src/dialogs/find_replace/tests.rs index a55e1c0085..e0e6031668 100644 --- a/crates/ui-egui/src/dialogs/find_replace/tests.rs +++ b/crates/ui-egui/src/dialogs/find_replace/tests.rs @@ -131,6 +131,25 @@ fn the_edit_menu_opens_the_find_and_replace_dialog() { } } +/// A field given a value of another type than its own is an error and the dialog does not open; a +/// null value gives no field. +#[test] +fn the_dialog_rejects_a_field_of_the_wrong_type() { + let (mut app, _) = app_with(&["cat"]); + let open = |app: &mut VectorcraftApp, params: Value| app.run("ui.paramDialog", json!({"command": super::COMMAND, "params": params})); + for (params, want) in [ + (json!({"find": 17}), "`find` must be a string"), + (json!({"replace": true}), "`replace` must be a string"), + (json!({"matchCase": "yes"}), "`matchCase` must be true or false"), + (json!({"backwards": 1}), "`backwards` must be true or false"), + ] { + assert_eq!(open(&mut app, params.clone()).unwrap_err(), want, "{params}"); + assert!(app.ui.dialog.is_none(), "{params}"); + } + open(&mut app, json!({"find": null, "replace": "dog", "wholeWord": true})).unwrap(); + assert_eq!((field(&app, "find"), field(&app, "replace"), field(&app, "wholeWord")), (json!(""), json!("dog"), json!(true))); +} + /// The dialog stays open from match to match: Find goes to the next match and selects its /// object, Replace changes that match, Replace & Find changes it and goes on, Replace All changes /// the rest, and Done closes. Each Replace is one undo step, and so is Replace All; finding and a diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 013f519f0c..b1db0a7f0e 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -848,7 +848,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.paramDialog", "Command Dialog", "", - "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place, and Edit › Find Next goes on from it in the same document while the dialog is closed", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error), and Edit › Find Next goes on from it in the same document while the dialog is closed", ), ( "ui.recolorDialog", diff --git a/docs/mcp.md b/docs/mcp.md index e367f19671..1d077aa478 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9996,7 +9996,8 @@ the options as they are now, and find one otherwise. Enter runs Find. Edit › F search while the dialog is closed, and opens the dialog when there has been none. A place the search reached in one document is not used in another, nor once the Find text or an option that decides a match changes: the search then starts again as it does without `from`. `ui.paramDialog` opens -the dialog on the last search, with the fields its `params` give in its place. +the dialog on the last search, with the fields its `params` give in its place. A null field gives none, and a field of +the wrong type is an error that leaves the dialog closed. ## Justification options From 54e4b6e1f01e12d033da71b43537bf33362464be Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 21:55:23 -0800 Subject: [PATCH 193/247] =?UTF-8?q?Align:=20Object=20=E2=80=BA=20Align=20l?= =?UTF-8?q?ists=20the=20Align=20To=20choices,=20and=20each=20can=20be=20gi?= =?UTF-8?q?ven=20a=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align to Selection, Align to Key Object and Align to Artboard follow the align items in Object › Align, with the choice the Align panel shows checked. Each is a UI command (align.toSelection, align.toKeyObject, align.toArtboard) that sets the choice as the panel's Align To button does, and Edit › Keyboard Shortcuts lists them under Align with no default key. align.toKeyObject fails with "no key object" when no object can be made the key. --- crates/mcp/src/tests.rs | 1 + crates/mcp/src/ui_catalog.rs | 18 +++++ crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/state.rs | 3 + crates/ui-egui/src/menus/tree.rs | 5 ++ crates/ui-egui/src/menus/ui_commands.rs | 18 +++++ crates/ui-egui/src/panels/align.rs | 31 ++++++++- crates/ui-egui/src/panels/align/tests.rs | 84 ++++++++++++++++++++++++ docs/mcp.md | 11 ++++ docs/target-app-parity.md | 1 + docs/ui-parity.md | 1 + 11 files changed, 172 insertions(+), 2 deletions(-) diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rs index 56b2f95944..bcee18074e 100644 --- a/crates/mcp/src/tests.rs +++ b/crates/mcp/src/tests.rs @@ -323,6 +323,7 @@ fn headless_command_list_includes_ui_commands() { "app.quit", "window.arrange.tile", "align.horizontalLeft", + "align.toKeyObject", "ui.action.play", ]; for (n, id) in want.iter().enumerate() { diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index b9b53059b4..8c3bcef98e 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -374,6 +374,24 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} the Align panel's Horizontal Distribute Space button: object.distributeSpacing {axis: \"horizontal\"} with to: \"key\" while there is a key, else the Align To choice, and spacing: the Distribute Spacing value while there is a key; with the Artboard tool chosen, the artboard command of the same name (artboard.distribute, artboard.distributeSpacing) with the same direction on the artboards the tool has selected, to: \"artboard\" (the active artboard) and spacing: the Distribute Spacing value while Align to Artboard is chosen, else \"selection\"", ), + ( + "align.toSelection", + "Align to Selection", + "", + "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}", + ), + ( + "align.toKeyObject", + "Align to Key Object", + "", + "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, when the topmost selected object can't be the key (it is inside another selected object), or with the Artboard tool chosen", + ), + ( + "align.toArtboard", + "Align to Artboard", + "", + "{} the Align panel's Align to Artboard button: Align To becomes Artboard (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: \"artboard\"}; with the Artboard tool chosen the selected objects keep their key", + ), ( "type.bold", "Bold", diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index ad85ed5bfa..aa4263112c 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -356,6 +356,7 @@ fn run_ui_part4(app: &mut VectorcraftApp, id: &str, _p: &Value) -> Option crate::panels::paragraph::convert_list_to_text(app), id if let Some(b) = crate::panels::align::button(id) => crate::panels::align::run_button(app, b), + id if let Some(v) = crate::panels::align::align_to_command(id) => crate::panels::align::run_align_to(app, v), "view.gradientAnnotator" => flag(&mut app.ui.view.gradient_annotator), "view.livePaintGaps" => flag(&mut app.ui.view.live_paint_gaps), "effect.last" => match app.last_effect.clone() { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 36dcdfc1d4..db1803c711 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -61,6 +61,8 @@ pub fn checked(app: &VectorcraftApp, id: &str, p: &Value) -> Option { // A View › Rotate View item is checked when the active view is turned to its angle; without // a document no item is checked. "view.rotate" => app.view().zip(p.get("angle").and_then(Value::as_f64)).is_some_and(|(view, a)| (view.rotation - a).abs() < 1e-9), + // Object › Align's Align To items: the choice the Align panel shows. + id if let Some(v) = crate::panels::align::align_to_command(id) => crate::panels::align::shown_align_to(app) == v, "window.control" => app.ui.control_bar, "window.helpBar" => app.ui.help_bar, "view.statusBarShow" => p.get("show").and_then(Value::as_str) == Some(app.ui.status_bar_show.param()), @@ -227,6 +229,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { id if crate::panels::paragraph::ALIGN_COMMANDS.iter().any(|c| c.0 == id) => crate::panels::character::text_style(app).is_some(), "type.applyBullets" | "type.applyNumbers" | "type.convertListToText" => crate::panels::character::text_style(app).is_some(), id if let Some(b) = crate::panels::align::button(id) => enabled(app, b.command_now(app)), + id if let Some(v) = crate::panels::align::align_to_command(id) => crate::panels::align::can_choose(app, v), "file.reveal" => app.services.reveal.is_some() && app.session.active().is_some_and(|d| d.path.is_some()), "file.cancelExport" | "file.exportInBackground" => app.background.jobs.iter().any(|j| j.progress.is_some() && !j.cancelled()), "file.cancelOpen" => !app.opening.pending.is_empty(), diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index 137c3b5758..1f08bfa4a5 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -164,6 +164,11 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec)> { cp("Vertical Align Top", "object.align", json!({"vertical": "top"})), cp("Vertical Align Center", "object.align", json!({"vertical": "center"})), cp("Vertical Align Bottom", "object.align", json!({"vertical": "bottom"})), + Sep, + // The Align panel's Align To choices, checked as the panel shows them. + c("Align to Selection", "align.toSelection"), + c("Align to Key Object", "align.toKeyObject"), + c("Align to Artboard", "align.toArtboard"), ], ), // The Align panel's Distribute Objects and Distribute Spacing buttons: each item runs diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index e2c40562f1..5c24ca9db9 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -375,6 +375,24 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} the Align panel's Horizontal Distribute Space button: object.distributeSpacing {axis: \"horizontal\"} with to: \"key\" while there is a key, else the Align To choice, and spacing: the Distribute Spacing value while there is a key; with the Artboard tool chosen, the artboard command of the same name (artboard.distribute, artboard.distributeSpacing) with the same direction on the artboards the tool has selected, to: \"artboard\" (the active artboard) and spacing: the Distribute Spacing value while Align to Artboard is chosen, else \"selection\"", ), + ( + "align.toSelection", + "Align to Selection", + "", + "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}", + ), + ( + "align.toKeyObject", + "Align to Key Object", + "", + "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, when the topmost selected object can't be the key (it is inside another selected object), or with the Artboard tool chosen", + ), + ( + "align.toArtboard", + "Align to Artboard", + "", + "{} the Align panel's Align to Artboard button: Align To becomes Artboard (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: \"artboard\"}; with the Artboard tool chosen the selected objects keep their key", + ), ( "type.bold", "Bold", diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index e5cb5d07dc..b7de2bb612 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -329,7 +329,7 @@ fn key_is_anchor(app: &VectorcraftApp) -> bool { /// The Align To choice that the Align panel and the Control bar show chosen: Artboard while one /// object is selected (the buttons then align it to the artboard), else [`align_to`]. With the /// Artboard tool chosen, it is the stored choice, Selection or Artboard. -fn shown_align_to(app: &VectorcraftApp) -> AlignTo { +pub(crate) fn shown_align_to(app: &VectorcraftApp) -> AlignTo { if on_artboards(app) { return app.ui.align_to; } @@ -340,7 +340,7 @@ fn shown_align_to(app: &VectorcraftApp) -> AlignTo { /// guide, or something to make one of: two or more selected objects, or a guide selected with /// objects. With the Artboard tool chosen it is off: Align to Artboard keeps the active artboard /// in place. -fn can_choose(app: &VectorcraftApp, v: AlignTo) -> bool { +pub(crate) fn can_choose(app: &VectorcraftApp, v: AlignTo) -> bool { if on_artboards(app) { return v != AlignTo::Key; } @@ -377,6 +377,33 @@ pub(crate) fn choose_align_to(app: &mut VectorcraftApp, v: AlignTo) { } } +/// The Align To choices as UI commands ([`crate::menus::UI_COMMANDS`]): (command id, choice). Object +/// › Align lists them after its align items, checked as the Align panel shows its choice, and Edit › +/// Keyboard Shortcuts lists each under Align with no default shortcut. +pub const ALIGN_TO_COMMANDS: [(&str, AlignTo); 3] = + [("align.toSelection", AlignTo::Selection), ("align.toKeyObject", AlignTo::Key), ("align.toArtboard", AlignTo::Artboard)]; + +/// The Align To choice of UI command `id` ([`ALIGN_TO_COMMANDS`]). `None`: `id` is not one of them. +pub(crate) fn align_to_command(id: &str) -> Option { + ALIGN_TO_COMMANDS.iter().find(|c| c.0 == id).map(|c| c.1) +} + +/// Runs the UI command of Align To choice `v`: chooses it as the Align panel's Align To buttons do +/// ([`choose_align_to`]) → `{alignTo}`, the choice the Align panel then shows. An error when it +/// can't be chosen: Align to Key Object with no key object and nothing to make one of, with the +/// Artboard tool chosen, or when the topmost selected object can't be the key (it is inside +/// another selected object). +pub(crate) fn run_align_to(app: &mut VectorcraftApp, v: AlignTo) -> Result { + if !can_choose(app, v) { + return Err("no key object".into()); + } + choose_align_to(app, v); + if v == AlignTo::Key && !has_key(app) { + return Err("no key object".into()); + } + Ok(json!({"alignTo": shown_align_to(app).param()})) +} + /// The width of the Control bar's Align To menu ([`align_to_menu`]) for buttons `size` points /// square: the icon of the choice and the arrow after it. pub(crate) fn align_to_menu_width(size: f32) -> f32 { diff --git a/crates/ui-egui/src/panels/align/tests.rs b/crates/ui-egui/src/panels/align/tests.rs index 727498c61c..f2efcf6e35 100644 --- a/crates/ui-egui/src/panels/align/tests.rs +++ b/crates/ui-egui/src/panels/align/tests.rs @@ -627,6 +627,90 @@ fn object_align_follows_align_to() { assert_eq!((bounds(&app, &a).x1, bounds(&app, &b).x1), (boards[1].x1, boards[1].x1), "the active artboard's right edge"); } +/// The Align To choices of Object → Align ([`ALIGN_TO_COMMANDS`]), in their order: (command id, +/// label). +const ALIGN_TO_ENTRIES: [(&str, &str); 3] = + [("align.toSelection", "Align to Selection"), ("align.toKeyObject", "Align to Key Object"), ("align.toArtboard", "Align to Artboard")]; + +/// Which of Object → Align's Align To items are checked, in their order. +fn align_to_checks(app: &VectorcraftApp) -> Vec> { + ALIGN_TO_ENTRIES.iter().map(|(id, _)| crate::menus::checked(app, id, &json!({}))).collect() +} + +/// Object → Align lists the Align To choices after its align items, the one the Align panel shows +/// checked, and a click on one chooses it as the panel's button does. Edit › Keyboard Shortcuts +/// lists each under Align with no default shortcut, and a shortcut chooses it too. +#[test] +fn object_align_lists_the_align_to_choices() { + let (mut app, back, front) = back_and_front(); + let items: Vec<(String, Option)> = + crate::menus::menu_entries(&app).into_iter().filter(|e| e.path == ["Object", "Align"]).map(|e| (e.label, e.command)).skip(7).collect(); + let expected: Vec<(String, Option)> = ALIGN_TO_ENTRIES.iter().map(|(id, l)| (l.to_string(), Some(id.to_string()))).collect(); + assert_eq!(items, expected, "after the seven align items"); + assert_eq!(align_to_checks(&app), [Some(true), Some(false), Some(false)]); + object_align(&mut app, "Align to Artboard"); + assert_eq!(app.ui.align_to, AlignTo::Artboard); + assert_eq!(align_to_checks(&app), [Some(false), Some(false), Some(true)]); + let list = app.run("shortcuts.list", json!({})).unwrap(); + for (id, label) in ALIGN_TO_ENTRIES { + let e = list.as_array().unwrap().iter().find(|e| e["id"] == id).unwrap_or_else(|| panic!("{id} is not listed")); + assert_eq!((e["label"].as_str(), e["group"].as_str(), &e["default"]), (Some(label), Some("Align"), &Value::Null), "{id}"); + } + // Align to Key Object by a shortcut: the topmost selected object becomes the key, and the + // stored choice stays. + app.run("shortcuts.set", json!({"id": "align.toKeyObject", "shortcut": CHORD})).unwrap(); + press_chord(&mut app); + assert_eq!(app.session.active().unwrap().selection.key.map(|k| k.0), front.as_u64(), "{}", app.ui.status); + assert_eq!(align_to_checks(&app), [Some(false), Some(true), Some(false)]); + assert_eq!(app.ui.align_to, AlignTo::Artboard); + // Align to Selection lets the key go and stores Selection. + assert_eq!(app.run("align.toSelection", json!({})).unwrap(), json!({"alignTo": "selection"})); + assert!(!has_key(&app)); + assert_eq!(app.ui.align_to, AlignTo::Selection); + // One object: Align to Key Object is off and fails, and Align To shows Artboard checked. + app.run("select.set", json!({"ids": [back]})).unwrap(); + let key_item = crate::menus::menu_entries(&app).into_iter().find(|e| e.command.as_deref() == Some("align.toKeyObject")).unwrap(); + assert!(!key_item.enabled, "one object"); + assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "no key object"); + assert!(!has_key(&app)); + assert_eq!(align_to_checks(&app), [Some(false), Some(false), Some(true)]); + // Align to Selection with one object stores Selection and returns what the panel shows. + assert_eq!(app.run("align.toSelection", json!({})).unwrap(), json!({"alignTo": "artboard"})); + assert_eq!(app.ui.align_to, AlignTo::Selection); +} + +/// With the Artboard tool chosen, Align to Key Object is off and fails, and Align to Artboard and +/// Align to Selection store the choice while the selected objects keep their key. +#[test] +fn align_to_commands_with_the_artboard_tool() { + let (mut app, _, front) = back_and_front(); + app.run("align.toKeyObject", json!({})).unwrap(); + app.select_tool("artboard"); + assert!(has_key(&app), "choosing the Artboard tool keeps the key"); + let key_item = crate::menus::menu_entries(&app).into_iter().find(|e| e.command.as_deref() == Some("align.toKeyObject")).unwrap(); + assert!(!key_item.enabled, "the Artboard tool"); + assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "no key object"); + assert_eq!(app.run("align.toArtboard", json!({})).unwrap(), json!({"alignTo": "artboard"})); + assert_eq!(app.ui.align_to, AlignTo::Artboard); + assert_eq!(align_to_checks(&app), [Some(false), Some(false), Some(true)]); + assert_eq!(app.run("align.toSelection", json!({})).unwrap(), json!({"alignTo": "selection"})); + assert_eq!(app.ui.align_to, AlignTo::Selection); + assert_eq!(align_to_checks(&app), [Some(true), Some(false), Some(false)]); + assert_eq!(app.session.active().unwrap().selection.key.map(|k| k.0), front.as_u64(), "the key stays"); +} + +/// Align to Key Object fails when the topmost selected object can't be the key: a group selected +/// with an object inside it. +#[test] +fn align_to_key_object_fails_when_the_topmost_object_cannot_be_the_key() { + let (mut app, _, front) = back_and_front(); + let group = app.run("object.group", json!({})).unwrap()["id"].clone(); + app.run("select.set", json!({"ids": [group, front]})).unwrap(); + assert_eq!(app.session.active().unwrap().selection.objects.len(), 2, "the group and its member"); + assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "no key object"); + assert!(!has_key(&app)); +} + /// With anchor points selected, Object → Align sends its params unchanged: two anchor points of /// one path align to their own bounds with Align to Selection and with Align to Artboard chosen. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 2a71579399..70e64f9771 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6988,6 +6988,17 @@ the Align To choice, and while there is a key object or a key guide they send th `shortcuts.set {id, shortcut}` gives one a shortcut. The Object › Distribute menu lists the eight Distribute commands, and each item runs its command. +The Align panel's Align To choices are UI commands too, with no params: `align.toSelection`, `align.toKeyObject` and +`align.toArtboard`. Each chooses what a click on its Align To button chooses and returns `{alignTo}`, the choice the +panel then shows (`align.toSelection` returns `"artboard"` while one object is selected, which aligns to the artboard). +`align.toSelection` and `align.toArtboard` store the choice (`ui.inspect` › `ui.align_to`) and let the key go; with the +Artboard tool chosen they store it and the selected objects keep their key. With no key, `align.toKeyObject` makes the +topmost of two or more selected objects the key object, or a ruler guide selected with one object the key guide, and +keeps the stored choice. It fails with "no key object" when there is nothing to make the key, when the topmost selected +object is inside another selected object and can't be the key, and with the Artboard tool chosen. Object › Align lists +the three after its align items, with the choice the panel shows checked, and Edit › Keyboard Shortcuts lists them +under Align with no default shortcut. + With the Artboard tool chosen, the same buttons and UI commands, and the Control bar's Align and Distribute buttons, run `artboard.align`, `artboard.distribute` and `artboard.distributeSpacing` on the artboards the tool has selected. Align To then offers Align to Selection and Align to Artboard. Align to Artboard sends `to: "artboard"`, which keeps the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c767c1e6cc..3aa58f2427 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1268,6 +1268,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur The Control bar has an Align To menu after its Align buttons. The public documentation offers Align to Selection, Align to Key Object and Align to Artboard in the Control panel (VectorCraft's Control bar) as well as in the Align panel ([Move, align, and distribute objects](https://web.archive.org/web/20250115013546/https://helpx.adobe.com/illustrator/using/moving-aligning-distributing-objects.html)). The menu shows the icon of the choice the Align panel's Align To shows, and a pick sets the same choice as the Align panel's buttons do. Align to Key Object is off while no key object can be made. When the bar runs short of room, it drops the Distribute buttons first, then the Align To menu, then the Align buttons. Object › Align aligns objects as the align buttons do: it aligns one object to the active artboard whatever Align To is set to, and otherwise it aligns to the key object while there is one, else to the Align To choice, which is saved with the preferences (`ui.inspect` → `ui.align_to`). With direct-selected anchor points, Object › Align aligns the points to their own bounds. While one object is selected, Align To shows Artboard. Edit › Keyboard Shortcuts lists each of the Align panel's Align Objects, Distribute Objects and Distribute Spacing buttons under Align, with no default shortcut, as the reference app's [release notes](https://web.archive.org/web/20261006170350/https://helpx.adobe.com/illustrator/desktop/new-features/release-notes.html) describe for its Align and Distribute commands. A shortcut set there runs what a click on the button runs, with the Align To choice, the key object and the Distribute Spacing value (`align.horizontalLeft` and the other `align.*` UI commands). + Object › Align lists Align to Selection, Align to Key Object and Align to Artboard after its align items, with the choice the Align panel shows checked, and each sets that choice as the panel's Align To buttons do; Edit › Keyboard Shortcuts lists them under Align with no default shortcut. The public page has shortcuts for the Align commands set under Object › Align ([Align and distribute objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/align-and-distribute-objects.html)); placing the Align To choices there is VectorCraft's own (`align.toSelection`, `align.toKeyObject`, `align.toArtboard`; `panels::align::tests::object_align_lists_the_align_to_choices`). The command palette lists `select.key` as Cancel Key Object, and a pick cancels the key object (#541). Agent selection commands validate every object id before changing the selection and report the resulting count and ids (#784). Commands that act on `id` or else the selection, the highlighted layer row or a new object (`css.export`, `object.isolate`, `layer.locate`, `layer.releaseToLayers`, the graphic, character and paragraph style commands, `image.info`, the `links.*` and `shaper.*` commands that take an `id`, opacity mask editing and viewing, `symbol.edit`, the blend spine commands and `path.curvature`) refuse an `id` that is not an object id (`"abc"`, `"5"`, `true`) and change nothing; `effect.apply` with the effect given as `id` still applies it to the selection. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index e44a28165c..9bbe2d0d35 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -227,6 +227,7 @@ tools, never checked side by side) isn't captured row by row. | Align panel menu › Align to Glyph Bounds › Point Text and Area Text (checked while on): Align and Distribute measure point type or area type by the ink of its glyphs instead of its em box or frame | done | #4231; `alignGlyphBoundsPoint`, `alignGlyphBoundsArea` ([Align text](https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/align-text.html)); `tests::glyphbounds`, `panels::align::tests::align_to_glyph_bounds_toggles_point_and_area_text`; the Character and Properties panels' Align to Glyph Bounds controls are not done | | Align and distribute artboards: with the Artboard tool chosen, the Align panel's Align Objects, Distribute Objects and Distribute Spacing buttons, and the Control bar's, move the selected artboards with the art inside them (Move Artwork with Artboard) | done | `artboard.align`, `artboard.distribute`, `artboard.distributeSpacing` ([Align and distribute artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/align-and-distribute-artboards.html)); VectorCraft's own rules: Align to Artboard keeps the active artboard in place and sends the Distribute Spacing value, Align to Key Object is off, a locked artboard stays where it is; `cmd::artboardalign::tests`, `panels::align::tests::the_align_buttons_align_the_selected_artboards` | | Object › Distribute, below Object › Align: Horizontal Distribute Left, Center and Right, Vertical Distribute Top, Center and Bottom, Horizontal Distribute Space and Vertical Distribute Space, each running what a click on its Align panel button runs (Align To, the key object, the Distribute Spacing value and, with the Artboard tool chosen, the selected artboards) | done | The `align.distribute*` commands; the public page names Object › Distribute beside Object › Align for the Align and Distribute commands ([Align and distribute objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/align-and-distribute-objects.html)); the items and their order are VectorCraft's own, taken from the Align panel; `menus::tests::object_distribute_runs_the_distribute_buttons` | +| Object › Align's Align to Selection, Align to Key Object and Align to Artboard, after the align items: each sets the Align panel's Align To choice as its button does, the choice the panel shows is checked, and Edit › Keyboard Shortcuts lists them under Align with no default key | done | `align.toSelection`, `align.toKeyObject`, `align.toArtboard`; the public page has shortcuts for the Align commands set under Object › Align ([Align and distribute objects](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/align-and-distribute-objects.html)); placing the Align To choices there is VectorCraft's own; `panels::align::tests::object_align_lists_the_align_to_choices` | | A marquee selects the objects whose paths it touches (anchors or segments): drawn inside a filled shape, over a background, it leaves that shape (Preview and Outline) | done | #1103 | | Click a segment independently of its endpoint anchors; only its direction handles show | done | #1278: hollow endpoint squares, selected edge emphasized; headless egui checked | | Drag a curved segment to bend it, a straight one to move its anchors | done | | From 783437f7754e7bc1084e52af6008e29c1c0fa08a Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 11:58:41 +0530 Subject: [PATCH 194/247] M7/G4: retype review: hidden art, compositing, half turns, cost (#4934) Hidden and locked shapes stay outlines and end the line. Isolated and knockout groups keep their type inside. Type turned 180 degrees stays one object (angles compared wrapped). A lone one-contour glyph beside other shapes stays an outline unless it is the only shape selected. The index samples only glyphs whose key (segments per contour) a selected shape has, reads outlines past the shared outline cache, keeps each face's keys once worked out, and loads no more faces than it takes. With Microsoft YaHei (29,905 glyphs) loaded: 877 ms the first time, 23 ms after. --- crates/engine/src/cmd/retype.rs | 44 +++++++++-- crates/engine/src/cmd/retype_tests.rs | 104 ++++++++++++++++++++++++-- crates/text/src/fontdb/lookup.rs | 12 +++ crates/text/src/retype.rs | 90 ++++++++++++++++++---- 4 files changed, 222 insertions(+), 28 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index be7df50d95..28a74ac6a9 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -14,6 +14,7 @@ //! they are and are reported. Near matches (another version of the font, simplified outlines, //! merged glyphs) and images are phase 2. +use std::f64::consts::{PI, TAU}; use std::sync::Arc; use kurbo::{BezPath, Point, Vec2}; @@ -72,6 +73,11 @@ fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, t *truncated = true; return; } + // Hidden and locked art is left as it is: a hidden glyph must not come back as visible type. + if !n.visible || n.locked { + *barrier = true; + return; + } let piece = |path: BezPath, after_barrier: bool| Piece { id: n.id, parent, @@ -126,15 +132,20 @@ fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec= cap { + break 'families; + } if let Some(face) = db.face(f, &style) { faces.push(face); } } } - faces.extend(db.loaded_faces()); + faces.extend(db.loaded_faces().into_iter().take(cap.saturating_sub(faces.len()))); faces } @@ -174,7 +185,8 @@ impl Line { && m.face.id() == self.face.id() // One size and turn for the whole line: the type sets every glyph at the first one's. && (m.scale - self.scale).abs() <= self.scale * 1e-4 - && (m.angle - self.angle).abs() < 1e-5 + // Wrapped: type turned 180° has angles near +π and −π. + && ((m.angle - self.angle + PI).rem_euclid(TAU) - PI).abs() < 1e-5 && across < size * 0.05 && (m.origin - self.end).dot(dir) > -size * 0.25 } @@ -362,7 +374,11 @@ fn retype(s: &mut Session, p: &Value) -> Result { if pieces.is_empty() { return Err(EngineError::Other("Retype: select outlined text (paths or compound paths)".into())); } - let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts)); + // Only glyphs with a selected shape's key (segments per contour) can match one: the others are + // not sampled. + let wanted: std::collections::BTreeSet> = + pieces.iter().filter(|pc| !pc.keeps_outline).filter_map(|pc| vectorcraft_text::retype::shape_key(&pc.path)).collect(); + let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts), &wanted); let found: Vec> = pieces.iter().map(|pc| if pc.keeps_outline { vec![] } else { index.matches(&pc.path) }).collect(); // The face most shapes match, so a glyph several fonts share is set in the same font as // the glyphs around it. @@ -395,7 +411,19 @@ fn retype(s: &mut Session, p: &Value) -> Result { } open = true; } - let lines = verified(lines, system_layout, &mut unmatched); + let mut lines = verified(lines, system_layout, &mut unmatched); + // A lone one-contour glyph (a period, a hyphen, a bullet) is too plain to tell from drawn + // art (a dot, a bar): beside other shapes it stays an outline. Selected on its own, it is + // what was asked for. + if pieces.len() > 1 { + lines.retain(|l| { + let lone = matches!(l.matches.as_slice(), [m] if m.contours == 1); + if lone { + unmatched.extend(l.pieces.iter().copied()); + } + !lone + }); + } (lines, unmatched, truncated) }; if lines.is_empty() { @@ -434,7 +462,11 @@ fn retype(s: &mut Session, p: &Value) -> Result { && n.blend == vectorcraft_color::BlendMode::Normal && *n.appearance == Appearance::default() && n.name.is_none() - && n.extras().mask.is_none(); + && n.extras().mask.is_none() + // Isolation and knockout change how the group composites its type. + && !n.isolate + && n.knockout == vectorcraft_doc::Knockout::default() + && !n.knockout_shape; let only_type = children.iter().all(|c| ids.contains(&c.id)); if children.is_empty() { d.remove(g)?; diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 4c331720a1..cbbf1e0302 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -148,7 +148,7 @@ fn a_shape_between_glyphs_ends_the_line_so_paint_order_holds() { fn glyphs_of_different_groups_and_transparency_stay_apart() { let mut s = session(); let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "ab", "size": 20})); - let b = outlined(&mut s, json!({"x": 120, "y": 100, "text": "cd", "size": 20})); + let b = outlined(&mut s, json!({"x": 120, "y": 100, "text": "ed", "size": 20})); let first_d = children_of(&s, b)[1]; s.edit("test", |d, _| { d.node_mut(NodeId(b)).unwrap().opacity = 0.5; @@ -158,7 +158,7 @@ fn glyphs_of_different_groups_and_transparency_stay_apart() { .unwrap(); s.execute("select.set", &json!({"ids": [a, b]})).unwrap(); let r = s.execute("type.retype", &json!({})).unwrap(); - assert_eq!(r["texts"], json!(["ab", "c", "d"]), "same baseline, other group; d has its own opacity: {r}"); + assert_eq!(r["texts"], json!(["ab", "e", "d"]), "same baseline, other group; d has its own opacity: {r}"); let ids: Vec = r["ids"].as_array().unwrap().iter().map(|v| v.as_u64().unwrap()).collect(); let d = &s.doc().unwrap().doc; assert!(d.node(NodeId(a)).is_none(), "a plain group gives way to its type"); @@ -232,11 +232,11 @@ fn live_type_selected_between_loose_glyphs_still_ends_the_line() { fn glyphs_selected_inside_groups_join_only_their_siblings() { let mut s = session(); let g1 = outlined(&mut s, json!({"x": 40, "y": 100, "text": "ab", "size": 20})); - let g2 = outlined(&mut s, json!({"x": 70, "y": 100, "text": "cd", "size": 20})); + let g2 = outlined(&mut s, json!({"x": 70, "y": 100, "text": "ed", "size": 20})); let (a, b, c) = (children_of(&s, g1)[0], children_of(&s, g1)[1], children_of(&s, g2)[0]); s.execute("select.set", &json!({"ids": [a, b, c]})).unwrap(); let r = s.execute("type.retype", &json!({})).unwrap(); - assert_eq!(r["texts"], json!(["ab", "c"]), "a and b are siblings; c is in another group: {r}"); + assert_eq!(r["texts"], json!(["ab", "e"]), "a and b are siblings; e is in another group: {r}"); let d = &s.doc().unwrap().doc; assert!(d.node(NodeId(g2)).is_some(), "d's group stays with c's type and d in it"); } @@ -244,7 +244,7 @@ fn glyphs_selected_inside_groups_join_only_their_siblings() { #[test] fn tracked_type_splits_where_its_spacing_cannot_be_set_again() { let mut s = session(); - let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "abc", "size": 30})).unwrap()["id"].as_u64().unwrap(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "abe", "size": 30})).unwrap()["id"].as_u64().unwrap(); // Less than half a space: no whole number of spaces makes up the gap (0.4 em would be two // spaces in this font, and the outlines cannot tell those apart from tracking). s.execute("text.setRangeStyle", &json!({"id": id, "start": 1, "end": 3, "tracking": 50})).unwrap(); @@ -253,7 +253,7 @@ fn tracked_type_splits_where_its_spacing_cannot_be_set_again() { s.execute("select.set", &json!({"ids": [g]})).unwrap(); let r = s.execute("type.retype", &json!({})).unwrap(); let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); - assert_eq!(texts.concat(), "abc", "{r}"); + assert_eq!(texts.concat(), "abe", "{r}"); assert!(texts.len() > 1, "the tracked glyphs are set where the outlines are, not where untracked type puts them: {r}"); assert_eq!(r["unmatched"], json!([])); } @@ -319,3 +319,95 @@ fn a_glyph_painted_beyond_what_type_takes_stays_an_outline() { assert_eq!(r["texts"], json!(["B"]), "two fills: A stays an outline: {r}"); assert_eq!(r["unmatched"], json!([a])); } + +#[test] +fn a_hidden_or_locked_glyph_stays_an_outline() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "ABD", "size": 40})); + let k = children_of(&s, g); + s.edit("test", |d, _| { + d.node_mut(NodeId(k[0])).unwrap().visible = false; + d.node_mut(NodeId(k[2])).unwrap().locked = true; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["B"]), "{r}"); + let d = &s.doc().unwrap().doc; + assert!(!d.node(NodeId(k[0])).unwrap().visible, "A stays a hidden outline"); + assert!(d.node(NodeId(k[2])).unwrap().locked, "D stays a locked outline"); +} + +#[test] +fn an_isolated_or_knockout_group_keeps_its_type_inside() { + for knock in [false, true] { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + s.edit("test", |d, _| { + let n = d.node_mut(NodeId(g)).unwrap(); + if knock { + n.knockout = vectorcraft_doc::Knockout::On; + } else { + n.isolate = true; + } + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + let id = r["ids"][0].as_u64().unwrap(); + assert_eq!(children_of(&s, g), vec![id], "knockout {knock}: the group stays, holding the type"); + } +} + +#[test] +fn type_turned_half_round_stays_one_object() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 300, "y": 200, "text": "Upside", "size": 30, "rotation": 180})); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["Upside"]), "{r}"); +} + +#[test] +fn a_drawn_dot_or_bar_beside_type_stays_art() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let dot = s.execute("shape.ellipse", &json!({"x": 300, "y": 60, "width": 8, "height": 8})).unwrap()["id"].as_u64().unwrap(); + // A bar that is exactly a hyphen of the font, somewhere else: the worst case. + let bar = outlined(&mut s, json!({"x": 200, "y": 300, "text": "-", "size": 50})); + s.execute("select.set", &json!({"ids": [g, dot, bar]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["AB"]), "{r}"); + let un = r["unmatched"].as_array().unwrap(); + assert!(un.contains(&json!(dot)) && un.len() == 2, "the dot and the bar stay art: {r}"); + // Selected on its own, the hyphen is what was asked for. + s.execute("select.set", &json!({"ids": [bar]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["-"]), "{r}"); +} + +/// How long Retype takes with a large CJK face to match against (run with `--ignored +/// --nocapture`; skips when no such face is installed). Not a pass/fail budget: it prints. +#[test] +#[ignore = "timing: needs an installed CJK font"] +fn timing_with_a_large_cjk_face() { + let db = vectorcraft_text::FontDb::global(); + let Some(family) = ["Microsoft YaHei", "Yu Gothic", "MS Gothic", "Noto Sans CJK JP", "Hiragino Sans"].into_iter().find(|f| db.has_family(f)) + else { + eprintln!("skipped: no large CJK font installed"); + return; + }; + let face = db.resolve(family, "Regular").map(|(f, _)| f).unwrap(); + let mut s = session(); + let g = outlined(&mut s, json!({"x": 20, "y": 80, "text": "漢字のテスト ABC", "size": 24, "font": family, "style": face.style})); + for run in ["cold", "warm"] { + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let t0 = std::time::Instant::now(); + let r = s.execute("type.retype", &json!({"fonts": [family]})).unwrap(); + let ms = t0.elapsed().as_secs_f64() * 1000.0; + eprintln!("{run}: Retype with {family} ({} encoded glyphs) loaded: {ms:.0} ms → {}", face.mapped_chars().len(), r["texts"]); + s.execute("edit.undo", &json!({})).unwrap(); + } +} diff --git a/crates/text/src/fontdb/lookup.rs b/crates/text/src/fontdb/lookup.rs index ef394cb079..99844220f5 100644 --- a/crates/text/src/fontdb/lookup.rs +++ b/crates/text/src/fontdb/lookup.rs @@ -675,6 +675,18 @@ impl FontDb { p } + /// [`Self::outline`] without the cache: for reading many glyphs once (Retype's index), which + /// would otherwise push out the outlines the canvas keeps there. + pub fn outline_uncached(&self, face: &FontFace, gid: u32) -> BezPath { + let mut pen = FlipPen(BezPath::new()); + if let Some(f) = face.skrifa() + && let Some(g) = f.outline_glyphs().get(GlyphId::new(gid)) + { + let _ = g.draw(DrawSettings::unhinted(Size::unscaled(), face.location()), &mut pen); + } + pen.0 + } + /// Glyph `gid`'s colour bitmap (`sbix`, `CBDT`) in `face`, cached per (face, glyph). pub fn glyph_image(&self, face: &FontFace, gid: u32) -> Option> { if !face.colour_bitmaps { diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index c014951008..30a640c3c7 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -49,6 +49,8 @@ pub struct GlyphMatch { pub origin: Point, /// The leftover distance, relative to the shape's spread. pub residual: f64, + /// How many contours the glyph has. + pub contours: usize, } /// A shape reduced for matching: points along each contour, centred. @@ -79,8 +81,11 @@ pub struct RetypeIndex { } impl RetypeIndex { - /// Index the outline glyphs of `faces` (the first [`MAX_FACES`], each face once). - pub fn build(db: &FontDb, faces: impl IntoIterator>) -> Self { + /// Index the outline glyphs of `faces` (the first [`MAX_FACES`], each face once) that have one + /// of the shape keys in `keys` (the selected shapes' [`shape_key`]s): the others could match no + /// shape, so they are not sampled. Outlines are read past the shared outline + /// cache, which keeps the canvas's glyphs. + pub fn build(db: &FontDb, faces: impl IntoIterator>, keys: &std::collections::BTreeSet>) -> Self { let mut kept: Vec> = vec![]; for f in faces { if kept.len() >= MAX_FACES { @@ -95,22 +100,16 @@ impl RetypeIndex { if entries.len() >= MAX_GLYPHS { break; } - // One entry per glyph, under the lowest character that maps to it. - let mut by_gid: HashMap = HashMap::new(); - for &(c, gid) in face.mapped_chars().iter().take(MAX_GLYPHS_PER_FACE) { - if c.is_whitespace() || c.is_control() || is_shape_symbol(c) { - continue; - } - by_gid.entry(gid).and_modify(|e| *e = (*e).min(c)).or_insert(c); - } - let mut gids: Vec<(u32, char)> = by_gid.into_iter().collect(); - gids.sort_unstable(); - for (gid, ch) in gids { - // The budget holds inside a face too: no glyph is loaded past it. + for (gid, ch, key) in face_keys(db, face).iter() { + // The budget holds inside a face too: no glyph is sampled past it. if entries.len() >= MAX_GLYPHS { break; } - let outline = db.outline(face, gid); + if !keys.contains(key) { + continue; + } + let (gid, ch) = (*gid, *ch); + let outline = db.outline_uncached(face, gid); if let Some(sig) = signature(&outline) { entries.push(Entry { face: fi, gid, ch, sig }); } @@ -165,7 +164,16 @@ impl RetypeIndex { // The glyph's origin is (0, 0) in font units: it lands at centre − z·glyph centre. let gc = mul(z, e.sig.centre); let origin = Point::new(sig.centre.x - gc.x, sig.centre.y - gc.y); - let m = GlyphMatch { face: face.clone(), gid: e.gid, ch: e.ch, scale: z.0.hypot(z.1), angle: z.1.atan2(z.0), origin, residual }; + let m = GlyphMatch { + face: face.clone(), + gid: e.gid, + ch: e.ch, + scale: z.0.hypot(z.1), + angle: z.1.atan2(z.0), + origin, + residual, + contours: e.sig.contours, + }; match best.get(&e.face) { Some(b) if b.residual < m.residual || (b.residual == m.residual && b.ch <= m.ch) => {} _ => { @@ -179,6 +187,41 @@ impl RetypeIndex { } } +/// A face's glyphs as the index looks them up: (glyph, character, [`shape_key`]), one per glyph +/// under the lowest character that maps to it. +type FaceKeys = Arc)>>; + +/// How many faces' keys [`face_keys`] keeps. +const KEPT_FACE_KEYS: usize = 32; + +/// [`FaceKeys`] of `face`, worked out once per face (each glyph drawn once, past the outline +/// cache) and kept: a later Retype samples only the glyphs whose key a selected shape has. +fn face_keys(db: &FontDb, face: &FontFace) -> FaceKeys { + type Kept = std::sync::Mutex>; + static KEPT: std::sync::OnceLock = std::sync::OnceLock::new(); + let kept = KEPT.get_or_init(Default::default); + let at = (db.id(), face.id()); + if let Some(k) = kept.lock().unwrap_or_else(|e| e.into_inner()).get(&at) { + return k.clone(); + } + let mut by_gid: HashMap = HashMap::new(); + for &(c, gid) in face.mapped_chars().iter().take(MAX_GLYPHS_PER_FACE) { + if c.is_whitespace() || c.is_control() || is_shape_symbol(c) { + continue; + } + by_gid.entry(gid).and_modify(|e| *e = (*e).min(c)).or_insert(c); + } + let mut gids: Vec<(u32, char)> = by_gid.into_iter().collect(); + gids.sort_unstable(); + let keys: FaceKeys = Arc::new(gids.into_iter().filter_map(|(gid, ch)| Some((gid, ch, shape_key(&db.outline_uncached(face, gid))?))).collect()); + let mut kept = kept.lock().unwrap_or_else(|e| e.into_inner()); + if kept.len() >= KEPT_FACE_KEYS { + kept.clear(); + } + kept.insert(at, keys.clone()); + keys +} + /// Characters whose glyphs are plain shapes (box drawing, blocks, geometric shapes, legacy /// computing symbols) or a font's own icons (private use): a drawn rectangle or circle is the same /// shape as one of them, so matching them would turn art into text. They are not matched. @@ -266,6 +309,21 @@ fn contours(path: &BezPath) -> Option>> { (out.len() <= MAX_CONTOURS).then_some(out) } +/// How many contours with length `path` has, as matching counts them; `None` past the size caps. +/// A cheap key two shapes share when one is the other scaled, turned and moved: how many segments +/// each of its contours has, in order (segments that go nowhere left out, a closing line counted +/// once whether the path draws it or closes onto it). Glyphs whose key no selected shape has are +/// not sampled. `None` past the size caps. +pub fn shape_key(path: &BezPath) -> Option> { + let moves = |s: &PathSeg| match s { + PathSeg::Line(l) => l.p0 != l.p1, + PathSeg::Quad(q) => q.p0 != q.p1 || q.p1 != q.p2, + PathSeg::Cubic(c) => c.p0 != c.p1 || c.p1 != c.p2 || c.p2 != c.p3, + }; + let key: Vec = contours(path)?.iter().map(|c| c.iter().filter(|s| moves(s)).count()).filter(|n| *n > 0).collect(); + (!key.is_empty()).then_some(key) +} + fn signature(path: &BezPath) -> Option { let bounds = path.bounding_box(); let size = bounds.width().hypot(bounds.height()); From 2275ca2fe00c5ec2a50804fa873a4fabb1ddfe7d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 22:36:13 -0800 Subject: [PATCH 195/247] Find and Replace: confirming with a field of the wrong type runs no action ui.dialog.confirm used to read a replace that is not a string as empty text, so Replace All could delete every match, and a switch that is not true or false as off. It now returns the error, which shows under the match found, and runs nothing; the match stays for Replace once the field is set right. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/dialogs/find_replace.rs | 36 ++++++++++++++----- .../ui-egui/src/dialogs/find_replace/tests.rs | 30 ++++++++++++++-- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 3 +- 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 25fb02285e..43ead3f6c2 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -847,7 +847,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.paramDialog", "Command Dialog", "", - "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error), and Edit › Find Next goes on from it in the same document while the dialog is closed", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error, and ui.dialog.confirm then runs no action), and Edit › Find Next goes on from it in the same document while the dialog is closed", ), ( "ui.recolorDialog", diff --git a/crates/ui-egui/src/dialogs/find_replace.rs b/crates/ui-egui/src/dialogs/find_replace.rs index 458b7a2184..523586d1a9 100644 --- a/crates/ui-egui/src/dialogs/find_replace.rs +++ b/crates/ui-egui/src/dialogs/find_replace.rs @@ -88,13 +88,7 @@ pub fn open(app: &mut VectorcraftApp, params: &Map) -> Result return Err(format!("`{k}` must be a string")), - Some(Value::Bool(_)) if !v.is_boolean() => return Err(format!("`{k}` must be true or false")), - _ => {} - } - } + check_types(params, true)?; let last = app.ui.last_find.as_ref().and_then(Value::as_object).cloned().unwrap_or_default(); for (k, v) in last.iter().chain(params) { // Only the dialog's own fields, each of its own type. @@ -115,6 +109,21 @@ pub fn open(app: &mut VectorcraftApp, params: &Map) -> Result, null_gives_none: bool) -> Result<(), String> { + for (k, v) in fields.iter().filter(|(_, v)| !(null_gives_none && v.is_null())) { + if matches!(k.as_str(), "find" | "replace") && !v.is_string() { + return Err(format!("`{k}` must be a string")); + } + if (k == "backwards" || SWITCHES.contains(&k.as_str())) && !v.is_boolean() { + return Err(format!("`{k}` must be true or false")); + } + } + Ok(()) +} + /// Edit › Find Next with no text to find: the next match of the last search, from the place it /// reached, with the options the dialog had. With no search yet, it opens the dialog. pub fn find_next(app: &mut VectorcraftApp) -> Result { @@ -249,10 +258,17 @@ fn replace_all(app: &mut VectorcraftApp, d: &mut Dialog) -> Result Result { let mut d = d.clone(); let action = d.fields.insert("action".into(), json!("find")).and_then(|a| a.as_str().map(str::to_string)).unwrap_or_default(); + if let Err(e) = check_types(&d.fields, false) { + d.fields.insert(NOTE.into(), json!(e)); + app.ui.dialog = Some(d); + return Err(e); + } let r = match action.as_str() { "done" => { remember(app, &d); @@ -345,7 +361,9 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> DialogAc ui.colored_label(t.text_strong, egui::RichText::new(hit).strong().underline()); widgets::dim_name(ui, &after); }); - } else if let Some(note) = d.fields.get(NOTE).and_then(Value::as_str) { + } + // Find and Replace remove the note, so it shows under a match only when an action was refused. + if let Some(note) = d.fields.get(NOTE).and_then(Value::as_str) { widgets::dim_name(ui, &crate::i18n::message(crate::i18n::current(), note)); } // Enter finds, as the Find button does. diff --git a/crates/ui-egui/src/dialogs/find_replace/tests.rs b/crates/ui-egui/src/dialogs/find_replace/tests.rs index e0e6031668..0e38820877 100644 --- a/crates/ui-egui/src/dialogs/find_replace/tests.rs +++ b/crates/ui-egui/src/dialogs/find_replace/tests.rs @@ -132,10 +132,34 @@ fn the_edit_menu_opens_the_find_and_replace_dialog() { } /// A field given a value of another type than its own is an error and the dialog does not open; a -/// null value gives no field. +/// null value gives no field. A field set to such a value once the dialog is open runs no action: +/// the error is the note, shown under the match found, and the text, the match and the last search +/// stay as they were. #[test] fn the_dialog_rejects_a_field_of_the_wrong_type() { - let (mut app, _) = app_with(&["cat"]); + let (mut app, ids) = app_with(&["cat"]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + crate::dialogs::confirm(&mut app).unwrap(); + let last = app.ui.last_find.clone(); + for (k, v, want) in [ + ("replace", json!(5), "`replace` must be a string"), + ("replace", Value::Null, "`replace` must be a string"), + ("matchCase", json!("yes"), "`matchCase` must be true or false"), + ] { + set(&mut app, k, v.clone()); + set(&mut app, "action", json!("replaceAll")); + assert_eq!(crate::dialogs::confirm(&mut app).unwrap_err(), want, "{k}: {v}"); + assert_eq!((plain(&app, ids[0]), field(&app, "__note"), app.ui.last_find.clone()), ("cat".to_string(), json!(want), last.clone())); + assert_eq!(matched(&app), Some((ids[0], 0, 3)), "Replace still changes the match found"); + let ctx = context(); + frame(&mut app, &ctx, vec![]); + let texts: Vec = frame(&mut app, &ctx, vec![]).into_iter().map(|(t, _)| t).collect(); + assert!(texts.iter().any(|t| t == want) && texts.iter().any(|t| t == "cat"), "the note shows under the match: {texts:?}"); + set(&mut app, k, if k == "replace" { json!("dog") } else { json!(false) }); + } + set(&mut app, "action", json!("done")); + crate::dialogs::confirm(&mut app).unwrap(); let open = |app: &mut VectorcraftApp, params: Value| app.run("ui.paramDialog", json!({"command": super::COMMAND, "params": params})); for (params, want) in [ (json!({"find": 17}), "`find` must be a string"), @@ -147,7 +171,7 @@ fn the_dialog_rejects_a_field_of_the_wrong_type() { assert!(app.ui.dialog.is_none(), "{params}"); } open(&mut app, json!({"find": null, "replace": "dog", "wholeWord": true})).unwrap(); - assert_eq!((field(&app, "find"), field(&app, "replace"), field(&app, "wholeWord")), (json!(""), json!("dog"), json!(true))); + assert_eq!((field(&app, "find"), field(&app, "replace"), field(&app, "wholeWord")), (json!("cat"), json!("dog"), json!(true))); } /// The dialog stays open from match to match: Find goes to the next match and selects its diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index b1db0a7f0e..4408654daa 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -848,7 +848,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.paramDialog", "Command Dialog", "", - "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error), and Edit › Find Next goes on from it in the same document while the dialog is closed", + "{command, label?, params} open a parameter dialog for any command. For edit.findReplace it opens Find and Replace (dialog `findReplace`), which stays open: fields find, replace, matchCase, wholeWord, backwards, hiddenLayers, lockedLayers, and action, which ui.dialog.confirm runs: find (the next match, edit.findNext, shown in the dialog with its place among the matches), replace (the match found, edit.replaceMatch), replaceFind (both), replaceAll (edit.findReplace) or done (close). After each one action is find again. Replace and Replace & Find change a match that find reached with the find text and options as they are now, and find one otherwise. The dialog opens on the last search, with the fields params gives in its place (a null field gives none; a field of the wrong type is an error, and ui.dialog.confirm then runs no action), and Edit › Find Next goes on from it in the same document while the dialog is closed", ), ( "ui.recolorDialog", diff --git a/docs/mcp.md b/docs/mcp.md index 1d077aa478..accd19856e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9997,7 +9997,8 @@ search while the dialog is closed, and opens the dialog when there has been none document is not used in another, nor once the Find text or an option that decides a match changes: the search then starts again as it does without `from`. `ui.paramDialog` opens the dialog on the last search, with the fields its `params` give in its place. A null field gives none, and a field of -the wrong type is an error that leaves the dialog closed. +the wrong type is an error that leaves the dialog closed. Once it is open, `ui.dialog.confirm` with a field of the +wrong type runs no action and returns the error. ## Justification options From a166087f55ca50e2aaea05ddc10ab95477fac4f1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 22:36:30 -0800 Subject: [PATCH 196/247] Fields: test a product through a length param and keep upstream's doc text - `Unit::parse` keeps main's paragraph about units after `*` and `/` as it was; the new `x` paragraph follows it, and the limit line names the signs it counts again. - `object.path.offsetPath` takes `"0.05x2 in"` (0.1 in), which it refused before; `"0x10"` reads as 0 pt. docs/mcp.md states both. --- crates/doc/src/tests/units.rs | 1 + crates/doc/src/units.rs | 15 ++++++++------- crates/engine/src/tests/pathops.rs | 4 ++++ docs/mcp.md | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/doc/src/tests/units.rs b/crates/doc/src/tests/units.rs index fd8690a8ff..96fe4aab69 100644 --- a/crates/doc/src/tests/units.rs +++ b/crates/doc/src/tests/units.rs @@ -121,6 +121,7 @@ fn x_is_a_multiplication_sign() { (Unit::Points, "2p×3", 72.0), // Text that used to be refused now reads as a product. (Unit::Points, "8.5x11 in", 93.5 * 72.0), + (Unit::Points, "0x10", 0.0), ] { let got = u.parse(s).unwrap_or_else(|| panic!("{u:?} can't read `{s}`")); assert!((got - want).abs() < 1e-9, "{u:?}: `{s}` → {got}, want {want}"); diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index c896ee5ee8..f61319326c 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -151,17 +151,18 @@ impl Unit { /// Parse `12`, `12pt`, `1in`, `3 mm`, `2p6` (picas+points), `6q` (Q) and `6h` (Ha), simple /// `+ - * /` arithmetic. /// + /// A unit after a `*` or `/` operand measures the whole expression (`1080/2 px` is 540 px), so + /// math typed before a field's unit suffix works. After `*` or `/`, a percentage scales the term + /// before it (`3cm*50%` is 1.5 cm, `3cm/50%` is 6 cm). After `+` or `-`, it adds or takes away + /// that share of everything before it (`50pt+25%` is 62.5 pt, `100pt+20pt-50%` is 60 pt). A + /// percentage on its own (`50%`) reads as nothing. + /// /// `x`, `X` and `×` multiply as `*` does (`10x2` is 20, `2x3 mm` is 6 mm), except a lowercase /// `x` right after a `p`, which is the `px` suffix (`2px x 3` is 6 px, and `2px3` reads as /// nothing; write `2p x 3` for picas). `X` and `×` after a `p` multiply (`2pX3` is 6 picas). /// - /// A unit after a `*` or `/` operand measures the whole expression (`1080/2 px` is 540 px), - /// so math typed before a field's unit suffix works. After `*` or `/`, a percentage scales the - /// term before it (`3cm*50%` is 1.5 cm, `3cm/50%` is 6 cm). After `+` or `-`, it adds or takes - /// away that share of everything before it (`50pt+25%` is 62.5 pt, `100pt+20pt-50%` is 60 - /// pt). A percentage on its own (`50%`) reads as nothing. - /// - /// Text with more than 128 [`arithmetic_signs`] reads as nothing. + /// Text with more than 128 `+ - * /` signs ([`arithmetic_signs`], a multiplication sign counted + /// as `*`) reads as nothing. pub fn parse(self, s: &str) -> Option { if arithmetic_signs(s) > MAX_MEASURE_OPERATORS { return None; diff --git a/crates/engine/src/tests/pathops.rs b/crates/engine/src/tests/pathops.rs index f20af794c4..dff77c1ce4 100644 --- a/crates/engine/src/tests/pathops.rs +++ b/crates/engine/src/tests/pathops.rs @@ -1121,6 +1121,10 @@ fn path_commands_refuse_a_param_of_the_wrong_type() { s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); let r = ids(&s.execute("object.path.offsetPath", &json!({"offset": "0.1 in", "joins": "Bevel"})).unwrap()); assert!(close(bounds(&s, r[0]), Rect::new(92.8, 92.8, 157.2, 147.2), 1e-2), "{:?}", bounds(&s, r[0])); + // A product with a unit, which the offset used to refuse: 0.05x2 in is 0.1 in. + s.execute("select.set", &json!({"ids": [a.0]})).unwrap(); + let r = ids(&s.execute("object.path.offsetPath", &json!({"offset": "0.05x2 in", "joins": "Bevel"})).unwrap()); + assert!(close(bounds(&s, r[0]), Rect::new(92.8, 92.8, 157.2, 147.2), 1e-2), "{:?}", bounds(&s, r[0])); // Null switches keep Clean Up's defaults, which remove the stray point. let r = s.execute("object.path.cleanUp", &json!({"strayPoints": null, "unpaintedObjects": null, "emptyTextPaths": null})).unwrap(); assert_eq!(r["removed"], 1); diff --git a/docs/mcp.md b/docs/mcp.md index 13b1d089fb..8a413a7217 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7593,8 +7593,8 @@ Commands take and return lengths in points (the distances of `object.path.offset string takes the same arithmetic as the desktop app's fields, where `%` is a share of the value before it: `"200mm*50%"` is 100 mm and `"50pt+25%"` is 62.5 pt. `x`, `X` and `×` multiply as `*` does (`"2x3 mm"` is 6 mm), except a lowercase `x` right after a `p`, which is the `px` suffix (`"2px3"` is not read; `"2p x 3"` and `"2pX3"` -are 6 picas). A string such as `"8.5x11 in"` reads as one length, 93.5 in. -A length string with more than 128 `+ - * /` signs (each multiplication sign counts) is not read as a length. The units +are 6 picas). A string such as `"8.5x11 in"` reads as one length, 93.5 in, and `"0x10"` reads as 0 pt. A length +string with more than 128 `+ - * /` signs (each multiplication sign counts) is not read as a length. The units only change what the UI shows and how it reads typed numbers. Preferences ▸ Units has four: General (rulers, positions and sizes, the Info panel, dialog distances, canvas measurement labels), Stroke (weights, dashes), Type (font size, leading, baseline shift) and East Asian Type (no field uses it yet). General is the active document's units From 851c7cb37231361373bd1b0fcd66c40e52093331 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 18 Nov 2026 12:23:10 +0500 Subject: [PATCH 197/247] PDF import: a TJ whose kerning starts a new line comes in filled and stroked (#8543) The reader fills every glyph of a text-showing operator, then strokes them. When a TJ's kerning started a new line part way through, the first line was finished before the stroke pass came back to it, so its strokes found no filled glyph and came in as stroke-only type over fill-only type. A line a glyph doesn't fit is now parked while a stroke may still be drawn over it, and a stroke-only glyph is matched against the open line and then the parked lines, newest first. Parked lines are finished oldest first before the open line, so drawing order is kept, and at most 64 are parked. --- crates/pdf/src/import/actual_text.rs | 16 +++- crates/pdf/src/import/builder.rs | 120 ++++++++++++++++++++++++--- crates/pdf/src/import/state.rs | 5 ++ crates/pdf/src/import_text.rs | 46 ++++++++-- crates/pdf/src/tests/textstroke.rs | 63 ++++++++++++++ docs/file-format-parity.md | 7 +- docs/roadmap.md | 5 +- docs/target-app-parity.md | 13 +-- 8 files changed, 241 insertions(+), 34 deletions(-) diff --git a/crates/pdf/src/import/actual_text.rs b/crates/pdf/src/import/actual_text.rs index aec147f99e..69a6afc1a9 100644 --- a/crates/pdf/src/import/actual_text.rs +++ b/crates/pdf/src/import/actual_text.rs @@ -63,9 +63,19 @@ impl Builder<'_> { pub(super) fn actual_glyph(&mut self, o: &craft_pdf::interpret::font::OutlineGlyph, m: Affine, at: Placement, look: Look, opacity: f32) -> bool { let key = o.font_cache_key(); self.flush_glyphs(); - // A fill and stroke callback for the same glyph consumes its text only once. + // A fill and stroke callback for the same glyph consumes its text only once, on a line + // the operator's kerning finished too. + let stroking = look.fill.is_none() && look.stroke.is_some(); + if let Some(stroke) = &look.stroke + && stroking + && self.stroke_parked(|line| line.has_actual_fill(key, at)) + && let Some((line, _)) = self.parked.first_mut() + && line.stroke_actual(key, at, stroke.clone(), look.overprint_stroke) + { + return true; + } if let (Some(stroke), Some(line)) = (&look.stroke, &mut self.text) - && look.fill.is_none() + && stroking && line.stroke_actual(key, at, stroke.clone(), look.overprint_stroke) { return true; @@ -87,7 +97,7 @@ impl Builder<'_> { None => line.push_content(&look, at, opacity, advance, content), }; if !self.text.as_mut().is_some_and(place) { - self.flush_text(); + self.park_text(!stroking); let mut line = TextLine::new(at, opacity); if !place(&mut line) { self.actual.pending = pending; diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index eb8742f2db..3ea082f513 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -12,6 +12,10 @@ use super::{ Upright, Walked, clipped, contains, fold_stop_opacity, function_paint, gradient_shape, is_rectangle, luminance, mask_spec, shading_gradient, }; +/// The most lines of type kept for a text-showing operator's stroke pass ([`Builder::park_text`]): +/// beyond them the oldest is finished, and strokes over its glyphs come in as type of their own. +const MAX_PARKED: usize = 64; + fn is_colour_face(face: &vectorcraft_text::FontFace) -> bool { use skrifa::Tag; use skrifa::raw::TableProvider; @@ -37,6 +41,7 @@ impl<'p> Builder<'p> { type3_run: None, text: None, text_glyphs: vec![], + parked: vec![], text_as, actual: Default::default(), images: HashMap::new(), @@ -119,6 +124,7 @@ impl<'p> Builder<'p> { self.type3_run = None; self.text = None; self.text_glyphs.clear(); + self.parked.clear(); self.mask = None; self.masked.clear(); self.marked.clear(); @@ -450,11 +456,73 @@ impl<'p> Builder<'p> { } } - /// Finish the open line of type. `true`: it was kept as outlines instead ([`reshaped`]), which - /// are left open as the glyph run for an outline drawn next to join. + /// Finish the open line of type, after the lines parked before it ([`Self::park_text`]). + /// `true`: the open line was kept as outlines instead ([`reshaped`]), which are left open as + /// the glyph run for an outline drawn next to join. pub(super) fn end_text(&mut self) -> bool { + self.release_parked(usize::MAX); let glyphs = std::mem::take(&mut self.text_glyphs); - let Some(mut line) = self.text.take() else { return false }; + let Some(line) = self.text.take() else { return false }; + self.end_line(line, glyphs) + } + + /// Finish the first `n` parked lines ([`Self::park_text`]), in the order they were drawn. + pub(super) fn release_parked(&mut self, n: usize) { + let n = n.min(self.parked.len()); + if n == 0 { + return; + } + let lines: Vec<_> = self.parked.drain(..n).collect(); + for (line, glyphs) in lines { + if self.end_line(line, glyphs) { + self.flush_glyphs(); + } + } + } + + /// The open line ends where glyph drawn next starts another. The reader fills every glyph of + /// a text-showing operator before it strokes them (fill and stroke rendering): a line that a + /// stroke may still be drawn over is parked instead of finished, so that the operator's + /// stroke pass still finds the glyphs it filled when its kerning started a new line part way + /// through (#8543). Any other line, or with `park` false, is finished with the lines parked + /// before it. + /// + /// Parked lines are finished, oldest first, when the stroke pass goes past them (a stroke is + /// drawn over a later line, the open one, or none of them: [`Self::stroke_parked`]), when + /// anything else ends the open line ([`Self::end_text`]), and beyond [`MAX_PARKED`] lines. + pub(super) fn park_text(&mut self, park: bool) { + match self.text.take() { + Some(line) if park && line.awaits_stroke() => { + let glyphs = std::mem::take(&mut self.text_glyphs); + self.parked.push((line, glyphs)); + self.release_parked(self.parked.len().saturating_sub(MAX_PARKED)); + } + line => { + self.text = line; + self.flush_text(); + } + } + } + + /// Whether a stroke goes over a glyph of a parked line ([`Self::park_text`]), which `takes` + /// tells of each line (a glyph it filled that the stroke is drawn over). The open line comes + /// first, then the parked lines from the last parked back: the same glyph filled at the same + /// place twice is stroked where it was filled last, by the operator that strokes it. `true`: + /// a parked line takes it, the stroke pass is on it, and the lines before it are finished, + /// so it is the first. `false`: the open line takes it or none does, so the stroke pass is + /// past them all, and they are finished. + pub(super) fn stroke_parked(&mut self, takes: impl Fn(&TextLine) -> bool) -> bool { + if self.parked.is_empty() { + return false; + } + let found = if self.text.as_ref().is_some_and(&takes) { None } else { self.parked.iter().rposition(|(line, _)| takes(line)) }; + self.release_parked(found.unwrap_or(usize::MAX)); + found.is_some() + } + + /// Finish `line` of type, whose `glyphs` are its outlines ([`Self::keep_glyph`]). `true`: + /// it was kept as them ([`Self::end_text`]). + fn end_line(&mut self, mut line: TextLine, glyphs: Vec) -> bool { let held = std::mem::take(&mut line.held); // Type the file names itself (ActualText) is in reading order as it stands. let checked = !glyphs.is_empty() && line.mapped() && !line.has_type3; @@ -880,13 +948,9 @@ impl<'p> Builder<'p> { scale: f64, overprint: bool, ) { - let Some((paint, stroke)) = drawn else { return }; - let mut path = o.outline(); - if path.elements().is_empty() { - return; + if let Some(g) = glyph_run(o, m, drawn, opacity, scale, overprint) { + self.text_glyphs.push(g); } - path.apply_affine(m); - self.text_glyphs.push(GlyphRun { path, paint, opacity, stroke, scale, overprint }); } fn type3_font_name(&mut self, key: u128) -> FontInfo { @@ -1151,9 +1215,24 @@ impl<'p> Builder<'p> { None => line.push(&look, at, opacity, advance, &text), }; self.flush_glyphs(); + let stroking = look.fill.is_none() && look.stroke.is_some(); + // A stroke over a glyph filled on a line the same operator's kerning finished. + if let Some(s) = &look.stroke + && stroking + && self.stroke_parked(|line| line.has_filled(key, at, opacity, &text)) + && let Some((line, glyphs)) = self.parked.first_mut() + { + line.stroke_filled(key, at, opacity, &text, s.clone(), overprint); + if top.is_none() + && let Some(g) = glyph_run(o, m, drawn, opacity, scale, overprint) + { + glyphs.push(g); + } + return true; + } // A stroke over the glyph just filled (fill and stroke rendering). if let (Some(s), Some(line)) = (&look.stroke, &mut self.text) - && look.fill.is_none() + && stroking && line.stroke_filled(key, at, opacity, &text, s.clone(), overprint) { // Upright glyphs aren't kept as outlines (nor, below, are those filled only): a @@ -1164,7 +1243,7 @@ impl<'p> Builder<'p> { return true; } if !self.text.as_mut().is_some_and(place) { - self.flush_text(); + self.park_text(!stroking); let mut line = TextLine::new(at, opacity); place(&mut line); self.text = Some(line); @@ -1184,6 +1263,25 @@ impl<'p> Builder<'p> { } } +/// Glyph `o` placed by `m` and drawn with `drawn` as the outline it is kept as +/// ([`Builder::keep_glyph`]). Nothing for a glyph that shows nothing. +fn glyph_run( + o: &craft_pdf::interpret::font::OutlineGlyph, + m: Affine, + drawn: Option<(Paint, Option)>, + opacity: f32, + scale: f64, + overprint: bool, +) -> Option { + let (paint, stroke) = drawn?; + let mut path = o.outline(); + if path.elements().is_empty() { + return None; + } + path.apply_affine(m); + Some(GlyphRun { path, paint, opacity, stroke, scale, overprint }) +} + /// The characters of one glyph in the order they are drawn: a PDF names a ligature's characters /// in logical order (lam then alef for لا), while a horizontal line of type is gathered glyph by /// glyph in visual order and only then put back in logical order. Right-to-left characters are diff --git a/crates/pdf/src/import/state.rs b/crates/pdf/src/import/state.rs index d8068279cf..12483256a0 100644 --- a/crates/pdf/src/import/state.rs +++ b/crates/pdf/src/import/state.rs @@ -94,6 +94,11 @@ pub(super) struct Builder<'p> { /// kept as: what the line becomes when its type wouldn't draw as the file does /// ([`super::reshaped`]). pub(super) text_glyphs: Vec, + /// Lines of type a text-showing operator's fill pass finished (a `TJ`'s kerning starts a new + /// line part way through) that its stroke pass may still go over, oldest first, each with + /// its [`text_glyphs`](Self::text_glyphs): written before the open line, in this order + /// ([`Builder::park_text`]). + pub(super) parked: Vec<(TextLine, Vec)>, pub(super) text_as: TextAs, pub(super) actual: super::actual_text::ActualText, pub(super) images: HashMap, diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index a6b128e042..18b36d9ba9 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -576,6 +576,12 @@ impl TextLine { true } + /// Whether a glyph of an ActualText span was filled in `font` at `at`, not stroked yet + /// ([`stroke_actual`](Self::stroke_actual)). + pub fn has_actual_fill(&self, font: u128, at: Placement) -> bool { + self.actual_fills.contains_key(&(font, at.origin.x.to_bits(), at.origin.y.to_bits())) + } + /// Has the baseline turned (more than about 3° from the first glyph to the last)? fn curved(&self) -> bool { self.last_dir.dot(self.at.dir) < 0.9986 @@ -625,15 +631,7 @@ impl TextLine { // A stroke at another opacity than the fill's (`CA` and `ca` differ), or over a // translucent fill, is type of its own. let opaque = opacity >= 0.999 && self.opacity >= 0.999; - let rest = if opaque { self.filled.get(self.stroked..) } else { None }; - let found = rest.and_then(|rest| { - rest.iter().position(|g| { - g.font == font - && g.at.same_as(&at) - && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) - }) - }); - let Some(index) = found.map(|i| self.stroked.saturating_add(i)) else { + let Some(index) = self.filled_index(font, at, opacity, text) else { // Stroked text of its own (stroke rendering): no later stroke goes back over the // glyphs filled before it, so no stroke looks through them again. self.stroked = self.filled.len(); @@ -661,6 +659,36 @@ impl TextLine { true } + /// The glyph a stroke over glyph `text` drawn at `at` in `font` at `opacity` is drawn over + /// ([`stroke_filled`](Self::stroke_filled)): the next one filled so and not stroked yet, as + /// an index into [`filled`](Self::filled). `None` for a translucent fill or stroke. + fn filled_index(&self, font: u128, at: Placement, opacity: f32, text: &str) -> Option { + if opacity < 0.999 || self.opacity < 0.999 { + return None; + } + let i = self.filled.get(self.stroked..)?.iter().position(|g| { + g.font == font + && g.at.same_as(&at) + && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) + })?; + Some(self.stroked.saturating_add(i)) + } + + /// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` is drawn over a + /// glyph of this line filled so ([`stroke_filled`](Self::stroke_filled) then strokes it). + /// Unlike `stroke_filled`, which then gives the stroke the line's last glyph or ends what + /// later strokes may match, it changes nothing. + pub fn has_filled(&self, font: u128, at: Placement, opacity: f32, text: &str) -> bool { + self.filled_index(font, at, opacity, text).is_some() + } + + /// Whether a stroke drawn later may still be drawn over a glyph of the line (fill and stroke + /// rendering): an opaque glyph filled and not stroked yet, or a filled glyph of an + /// ActualText span ([`stroke_actual`](Self::stroke_actual)). + pub fn awaits_stroke(&self) -> bool { + (self.opacity >= 0.999 && self.stroked < self.filled.len()) || !self.actual_fills.is_empty() + } + /// Restyle the glyphs gathered for a stroke ([`stroke_filled`](Self::stroke_filled)): their /// text becomes a run of its own with the stroke, unless the run is stroked so already, and the /// text before and after it in the run keeps its stroke. Text that comes right after a run diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index 1cc1edf5ba..c4301db5ce 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -346,3 +346,66 @@ fn glyphs_filled_and_stroked_one_by_one_stay_one_run() { assert_eq!(type_runs(content), [vec![("ABC".to_string(), true, true)]], "{content}"); } } + +/// Fill and stroke rendering of a `TJ` whose kerning starts a new line part way through: the +/// reader fills every glyph of the operator before it strokes them, and each part comes in as +/// type filled and stroked, in the order drawn, not as each part filled and then each part +/// stroked over it (#8543). So too a `TJ` that jumps back to start a line before it, one whose +/// kerning starts two new lines, and one in a span with replacement text (`ActualText`); small +/// kerning keeps one line as before. +#[test] +fn a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked() { + // Each type object as its text, and whether all of it is filled and all of it stroked. + let objects = |content: &str| -> Vec<(String, bool, bool)> { + type_runs(content) + .into_iter() + .map(|runs| (runs.iter().map(|r| r.0.as_str()).collect(), runs.iter().all(|r| r.1), runs.iter().all(|r| r.2))) + .collect() + }; + let both = |text: &str| (text.to_string(), true, true); + for mode in ["2", "6"] { + let cases = [ + ("/F1 48 Tf 20 80 Td [(AB) -3500 (CD)] TJ", vec![both("AB"), both("CD")]), + ("/F1 24 Tf 20 80 Td [(AB) -3500 (CD) -3500 (EF)] TJ", vec![both("AB"), both("CD"), both("EF")]), + ("/F1 24 Tf 200 80 Td [(AB) 6000 (CD)] TJ", vec![both("AB"), both("CD")]), + ("/F1 48 Tf 20 80 Td [(AB) -100 (CD)] TJ", vec![both("ABCD")]), + // In a span with replacement text, which places all of its text with the first glyph. + ("/F1 48 Tf 20 80 Td /Span << /ActualText (ABCD) >> BDC [(AB) -3500 (CD)] TJ EMC", vec![both("ABCD")]), + ]; + for (show, want) in cases { + let content = format!("BT {mode} Tr {show} 0 Tr ET"); + assert_eq!(objects(&content), want, "{content}: {:?}", type_runs(&content)); + } + } +} + +/// Stroke rendering (modes 1 and 5) of a `TJ` whose kerning starts a new line stays stroke only, +/// one type object per line (#8543). +#[test] +fn a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only() { + for mode in ["1", "5"] { + let content = format!("BT {mode} Tr /F1 48 Tf 20 80 Td [(AB) -3500 (CD)] TJ 0 Tr ET"); + let want = [vec![("AB".to_string(), false, true)], vec![("CD".to_string(), false, true)]]; + assert_eq!(type_runs(&content), want, "{content}"); + } +} + +/// Translucent type filled and stroked by a `TJ` whose kerning starts a new line stays a filled +/// object and a stroked one for each part, in the order the file draws them (#8015, #8543). +#[test] +fn a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart() { + use vectorcraft_testkit::pdf::{PdfPage, pdf}; + let resources = "/Font << /F1 << /Type /Font /Subtype /Type1 /BaseFont /Helvetica >> >> /ExtGState << /G << /ca 0.5 /CA 0.5 >> >>"; + let content = "/G gs 0 0 0 RG 1 1 0.8 rg 3 w BT 2 Tr /F1 48 Tf 20 80 Td [(AB) -3500 (CD)] TJ 0 Tr ET"; + let bytes = pdf(&[PdfPage { resources: resources.into(), ..PdfPage::new(300.0, 200.0, content) }], None); + let d = import(&bytes).unwrap(); + let mut types = vec![]; + d.walk(|n| { + if let NodeKind::Text(t) = &n.kind { + let st = t.first_style(); + types.push((t.plain_text(), n.opacity < 1.0, !st.fill.is_none(), !st.stroke.is_none())); + } + }); + let part = |text: &str, fill: bool| (text.to_string(), true, fill, !fill); + assert_eq!(types, [part("AB", true), part("CD", true), part("AB", false), part("CD", false)], "{content}"); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 91af8cd7b3..c56fb0e8a7 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -1,6 +1,6 @@ # File format parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (PDF import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; scores and estimates unchanged; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, not butt caps and miter joins, #7741; `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; `.ai` and EPS import: a top-object envelope whose mesh saves its sides' curves in pieces draws its contents along each whole curve, as its drawn art does, #7097; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: `.ai` and EPS import: type from the text document, type a PostScript program sets and legacy `.ai` type are set in an installed face of their font's PostScript name, exact name first, in the version a text document's record keeps; the `.ai` save writes a static font's version when its name alone gives another copy, #6983; `.ai` and EPS import: type keeps the manual kerning of its text document, #6899; `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, its strokes' miter tips and strokes a Transform effect moves included, after its glyphs grown by half its strokes' weight, #6824; `.ai` and EPS import: type filled or stroked with a pattern swatch keeps its pattern, from the art style its text document paint names, #6856; #6865: explicitly requested oversized editing artboard; PDF import: Indic type keeps its marks on their line, and a line whose type would not draw as the file does keeps the file's glyphs as outlines, #5235; previously: newly imported SVG/SVGZ titles are filtered and bounded without changing restored titles, #3626; `.ai` and EPS import, and what every export and `.ai` save draw: type's strokes in an envelope paint at their own weight along its bent outlines, Distort Appearance on or off, #6644; `.ai` and EPS import: centred and right-aligned lines of tracked type are aligned without the tracking after their last character, as the file's page aligns them, #6610; `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art, #6570; `.ai` save and open: layer colour presets Yellow, Magenta and Cyan keep their colour, as the `Lb` colour index now follows the file's numbering, #6502; `.ai` save: stroked type keeps its stroke's cap, join and miter limit in the text document, #6472; `.ai` and EPS import, PDF import: tracking and manual kerning in horizontally scaled type take the Horizontal Scale, as the file's page spaces such type; `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke, #3179; `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid, #3179; `.ai` and EPS import: stroked type keeps its stroke's cap, join and miter limit from the text document, #6472; `.ai` save: type in a variable font's named instance names its design-space setting, #6388; `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page, #3179; `.ai` and EPS import: a note for type in an envelope, #3179; `.ai` and EPS import: the live envelope and warped type check sees white art; PDF import: DeviceN images of one ink or of process plates keep their inks, #6348; `.ai` import: images in a spot ink's Separation space keep their ink, #6350; PDF import: Separation images keep their ink, #6314; PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; PDF import: image masks open colorized by the color they are painted in, #6313; EPS and `.ai` editing data: a ligature the page names by a private-use glyph matches its text object; EPS import: CIDFonts only named, over a Unicode CMap, set as live type; EPS import: CMap mappings to base-font codes and glyph names; EPS import: CID-keyed fonts in FontSets (CFF) draw their glyphs; EPS import: `kshow` procedures kern live type; EPS import: embedded Type 1 fonts' glyphs and widths; EPS import: CID-keyed fonts draw their glyphs; EPS import: Type 42 fonts' characters and widths from the font they carry, show operators' spacing kept as tracking; EPS import: an image decoder's own buffers stop counting against the memory budget once it is decoded; EPS import: sampled functions interpolate between their samples; `.ai` and EPS type from the text document keeps its tab stops; it keeps auto leading and hyphenation options, and may show more of the file's last lines in an area frame; `.ai` and EPS import: Art brushes in the older form of their objects come into the Brushes panel; EPS import: gradients drawn as abutting strips come in as one gradient, without seams; EPS import: composite fonts draw their Type 42 glyphs; SVG import: filter and mask regions clip, #5876, #5875; SVG import: Gaussian blurs keep `color-interpolation-filters`, #5877; PDF and `.ai` export: objects' URLs as links, #5785; SVG import: `color-interpolation="linearRGB"` gradients, #5878; `.ai` import: paths with a Calligraphic brush open brushed, #372) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). @@ -370,8 +370,8 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). -- [ ] PDF type filled and stroked at less than full opacity as one type object, and a `TJ` whose kerning starts a new line part way through, filled and stroked: both still come in as a filled object and a stroked one (#8015). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, or is in an `ActualText` span; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). +- [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,6 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | PDF import: fill and stroke rendering (text rendering modes 2 and 6) draws all the glyphs of a text-showing operator (`Tj`, `TJ`, `'`, `"`) filled, then the same glyphs stroked, so a word shown at once came in as two type objects: a stroke-only copy over a fill-only one. Each stroke is now matched, in order, to the glyph filled with the same placement (where, how large, how wide, slanted and turned) in the same font with the same text on the line, and only that glyph takes the stroke, so the word comes in as one type object, filled and stroked; glyphs stroked with another join part way through still split into runs of their own, and stroked type over no filled glyph (modes 1 and 5) stays stroke only (#8015; `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 3c09bde829..f3d745c10b 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (PDF import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: G2: Effect Gallery thumbnails and in-dialog preview are in; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -163,7 +163,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -215,6 +215,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c767c1e6cc..71ebe10ac1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-17 · **Change:** minor (Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (PDF import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -63,6 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | @@ -275,9 +276,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity, or by a `TJ` whose kerning starts a new line part way through, comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity, or by a `TJ` whose kerning starts a new line part way through, comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity, or by a `TJ` whose kerning starts a new line part way through, comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -540,7 +541,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not yet for type filled and stroked at less than full opacity, or a `TJ` whose kerning starts a new line part way through, which still come in as a filled object and a stroked one; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -602,7 +603,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. Not covered: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h. From e318f6cc67fbfb74f3cbbb3c802f8d2b653b942c Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 18 Nov 2026 13:02:58 +0500 Subject: [PATCH 198/247] PDF import: match a stroke pass to the glyphs filled last, in fill order (#8543) A TJ can draw the same glyph at the same place twice (its kerning goes back), so a stroke can't be matched to a filled glyph as it arrives: [(A) -3500 (B) 4834 (A)] TJ put the first A's stroke on the last A and left the earlier parts unstroked. Strokes over filled glyphs are now held until their stroke pass ends and then matched to the glyphs filled last, in the order they were filled, so each copy is stroked where it was filled, while a glyph filled and stroked where one filled before stands still strokes only the newest. At most 4096 strokes are held. Docs: ordinary text gives one filled and stroked object per part; in an ActualText span it stays one replacement object on the first glyph's line and style. --- crates/pdf/src/import/builder.rs | 169 +++++++++++++++++++++++++---- crates/pdf/src/import/state.rs | 21 ++++ crates/pdf/src/import_text.rs | 51 ++++++--- crates/pdf/src/tests/textstroke.rs | 35 +++++- docs/file-format-parity.md | 4 +- docs/roadmap.md | 4 +- docs/target-app-parity.md | 12 +- 7 files changed, 249 insertions(+), 47 deletions(-) diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index 3ea082f513..20029582b7 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -4,7 +4,9 @@ use super::entry::{ UNNAMED_CHARACTERS_NOTE, max_objects, }; use super::reshaped; -use super::state::{Builder, Frame, FrameKind, GlyphRun, Saved, bounds, grouped, mean_scale, paints, round3, same_stroke, stroke_layer, type_stroke}; +use super::state::{ + Builder, Frame, FrameKind, GlyphRun, HeldStroke, Saved, bounds, grouped, mean_scale, paints, round3, same_stroke, stroke_layer, type_stroke, +}; use super::{ Affine, Appearance, AppearanceItem, Arc, BezPath, BfString, BlendMode, CacheKey, Color, Colors, Families, FillLayer, FillRule, FunctionBudget, FunctionPaint, HashMap, HashSet, ImageBlob, ImageObject, Knockout, Look, MaskSpec, MaskType, Native, Node, NodeId, NodeKind, OpacityMask, Paint, @@ -16,6 +18,11 @@ use super::{ /// beyond them the oldest is finished, and strokes over its glyphs come in as type of their own. const MAX_PARKED: usize = 64; +/// The most strokes of a stroke pass held to be matched to the glyphs they go over +/// ([`Builder::hold_stroke`]): beyond them, those held are matched each to the first glyph it +/// may go over, and the pass goes on from there. +const MAX_HELD: usize = 4096; + fn is_colour_face(face: &vectorcraft_text::FontFace) -> bool { use skrifa::Tag; use skrifa::raw::TableProvider; @@ -42,6 +49,7 @@ impl<'p> Builder<'p> { text: None, text_glyphs: vec![], parked: vec![], + held: vec![], text_as, actual: Default::default(), images: HashMap::new(), @@ -125,6 +133,7 @@ impl<'p> Builder<'p> { self.text = None; self.text_glyphs.clear(); self.parked.clear(); + self.held.clear(); self.mask = None; self.masked.clear(); self.marked.clear(); @@ -426,7 +435,10 @@ impl<'p> Builder<'p> { } } + /// Finish the open run of glyphs kept as outlines, once the strokes held are matched + /// ([`Self::settle_strokes`]): whatever is drawn next ends their stroke pass. pub(super) fn flush_glyphs(&mut self) { + self.settle_strokes(); let Some(run) = self.glyphs.take() else { return }; if run.path.elements().is_empty() { return; @@ -460,6 +472,7 @@ impl<'p> Builder<'p> { /// `true`: the open line was kept as outlines instead ([`reshaped`]), which are left open as /// the glyph run for an outline drawn next to join. pub(super) fn end_text(&mut self) -> bool { + self.settle_strokes(); self.release_parked(usize::MAX); let glyphs = std::mem::take(&mut self.text_glyphs); let Some(line) = self.text.take() else { return false }; @@ -488,8 +501,9 @@ impl<'p> Builder<'p> { /// before it. /// /// Parked lines are finished, oldest first, when the stroke pass goes past them (a stroke is - /// drawn over a later line, the open one, or none of them: [`Self::stroke_parked`]), when - /// anything else ends the open line ([`Self::end_text`]), and beyond [`MAX_PARKED`] lines. + /// drawn over a later line or the open one: [`Self::settle_strokes`], [`Self::stroke_parked`]; + /// or over none of them), when anything else ends the open line ([`Self::end_text`]), and + /// beyond [`MAX_PARKED`] lines. pub(super) fn park_text(&mut self, park: bool) { match self.text.take() { Some(line) if park && line.awaits_stroke() => { @@ -504,13 +518,13 @@ impl<'p> Builder<'p> { } } - /// Whether a stroke goes over a glyph of a parked line ([`Self::park_text`]), which `takes` - /// tells of each line (a glyph it filled that the stroke is drawn over). The open line comes - /// first, then the parked lines from the last parked back: the same glyph filled at the same - /// place twice is stroked where it was filled last, by the operator that strokes it. `true`: - /// a parked line takes it, the stroke pass is on it, and the lines before it are finished, - /// so it is the first. `false`: the open line takes it or none does, so the stroke pass is - /// past them all, and they are finished. + /// Whether a stroke over a glyph of an ActualText span goes over a glyph of a parked line + /// ([`Self::park_text`]), which `takes` tells of each line (a glyph it filled that the + /// stroke is drawn over). The open line comes first, then the parked lines from the last + /// parked back: the same glyph filled at the same place twice is stroked where it was filled + /// last, by the operator that strokes it. `true`: a parked line takes it, the stroke pass is + /// on it, and the lines before it are finished, so it is the first. `false`: the open line + /// takes it or none does, so the stroke pass is past them all, and they are finished. pub(super) fn stroke_parked(&mut self, takes: impl Fn(&TextLine) -> bool) -> bool { if self.parked.is_empty() { return false; @@ -520,6 +534,124 @@ impl<'p> Builder<'p> { found.is_some() } + /// The parked line at `slot` ([`Self::park_text`]), or the open line at the slot after them. + fn line_at(&self, slot: usize) -> Option<&TextLine> { + match self.parked.get(slot) { + Some((line, _)) => Some(line), + None if slot == self.parked.len() => self.text.as_ref(), + None => None, + } + } + + /// The first glyph filled after `after` that stroke `h` may go over + /// ([`TextLine::next_filled`]), as its line's slot ([`Self::line_at`]) and its index among + /// the line's filled glyphs: the lines in the order they were drawn, each line's glyphs in + /// the order they were filled. From the first glyph with no `after`. + fn next_fill(&self, after: Option<(usize, usize)>, h: &HeldStroke) -> Option<(usize, usize)> { + let first = after.map_or(0, |(slot, _)| slot); + (first..=self.parked.len()).find_map(|slot| { + let from = match after { + Some((s, i)) if s == slot => i.saturating_add(1), + _ => 0, + }; + let i = self.line_at(slot)?.next_filled(from, h.font, h.at, h.opacity, &h.text)?; + Some((slot, i)) + }) + } + + /// The last glyph filled before `before` that stroke `h` may go over ([`Self::next_fill`]). + /// From the last glyph with no `before`. + fn last_fill(&self, before: Option<(usize, usize)>, h: &HeldStroke) -> Option<(usize, usize)> { + let last = before.map_or(self.parked.len(), |(slot, _)| slot); + (0..=last).rev().find_map(|slot| { + let until = match before { + Some((s, i)) if s == slot => i, + _ => usize::MAX, + }; + let i = self.line_at(slot)?.last_filled(until, h.font, h.at, h.opacity, &h.text)?; + Some((slot, i)) + }) + } + + /// Hold stroke `h`, over a glyph filled on the open line or a parked one, until its stroke + /// pass ends ([`Self::settle_strokes`]). `false`: no glyph filled after those the strokes + /// held go over is one it may go over (the strokes held are matched first, and if it may go + /// over none then, it isn't held either: it goes over the line as it stands). + /// + /// The reader fills all the glyphs of a text-showing operator, then strokes the same glyphs + /// in the same order (fill and stroke rendering, #8015). Which glyph a stroke goes over is + /// only told once the pass has ended: a `TJ` can draw the same glyph at the same place twice + /// (its kerning goes back), and an operator can fill and stroke a glyph where one filled + /// before it stands, which the device can't tell from a glyph the operator filled (#8543). + pub(super) fn hold_stroke(&mut self, mut h: HeldStroke) -> bool { + if self.held.len() >= MAX_HELD { + self.settle(false); + } + let mut first = self.next_fill(self.held.last().map(|l| l.first), &h); + if first.is_none() && !self.held.is_empty() { + self.settle_strokes(); + first = self.next_fill(None, &h); + } + let Some(first) = first else { return false }; + h.first = first; + self.held.push(h); + true + } + + /// Match the strokes held ([`Self::hold_stroke`]) to the glyphs they go over, now that their + /// stroke pass has ended, and stroke them. The pass strokes the glyphs filled last, in the + /// order they were filled: each stroke goes over the last glyph it may go over that is filled + /// before the one the stroke after it goes over. So a `TJ` that draws a glyph twice at the + /// same place strokes each where it filled it, and a glyph filled and stroked where one + /// filled before it stands strokes the one filled last (#8015, #8543). + pub(super) fn settle_strokes(&mut self) { + self.settle(true); + } + + /// [`Self::settle_strokes`], each stroke matched to the last glyph it may go over (`last`), + /// or to the first ([`Self::hold_stroke`] when too many are held). + fn settle(&mut self, last: bool) { + if self.held.is_empty() { + return; + } + let held = std::mem::take(&mut self.held); + let mut places = vec![]; + if last { + let mut before = None; + for h in held.iter().rev() { + let Some(p) = self.last_fill(before, h) else { break }; + places.push(p); + before = Some(p); + } + places.reverse(); + } + // Each held stroke goes over the first glyph it may go over after the one before it + // does ([`Self::hold_stroke`]), so the last ones are found too: this is only a guard. + if places.len() != held.len() { + places = held.iter().map(|h| h.first).collect(); + } + // The slots of the parked lines finished so far, which the later places count in. + let mut finished = 0usize; + for (h, (slot, index)) in held.into_iter().zip(places) { + let slot = slot.saturating_sub(finished); + let parked = self.parked.len(); + // The lines before the one stroked are past the stroke pass: they are finished. + self.release_parked(slot); + finished = finished.saturating_add(slot.min(parked)); + let target = match self.parked.first_mut() { + Some((line, glyphs)) if slot < parked => Some((line, glyphs)), + _ => self.text.as_mut().map(|line| (line, &mut self.text_glyphs)), + }; + if let Some((line, glyphs)) = target + && line.stroke_filled_at(index, h.stroke, h.overprint) + { + // Upright glyphs aren't kept as outlines (nor are those filled only): a vertical + // line that came in as its outlines would lose the ones filled only. + glyphs.extend(h.glyph); + } + } + } + /// Finish `line` of type, whose `glyphs` are its outlines ([`Self::keep_glyph`]). `true`: /// it was kept as them ([`Self::end_text`]). fn end_line(&mut self, mut line: TextLine, glyphs: Vec) -> bool { @@ -1214,22 +1346,19 @@ impl<'p> Builder<'p> { Some(top) => line.push_upright(&look, at, opacity, Upright { top }, &text), None => line.push(&look, at, opacity, advance, &text), }; - self.flush_glyphs(); let stroking = look.fill.is_none() && look.stroke.is_some(); - // A stroke over a glyph filled on a line the same operator's kerning finished. + // A stroke over a glyph filled before it, on the open line or one the same operator's + // kerning finished: matched once its stroke pass ends. if let Some(s) = &look.stroke && stroking - && self.stroke_parked(|line| line.has_filled(key, at, opacity, &text)) - && let Some((line, glyphs)) = self.parked.first_mut() { - line.stroke_filled(key, at, opacity, &text, s.clone(), overprint); - if top.is_none() - && let Some(g) = glyph_run(o, m, drawn, opacity, scale, overprint) - { - glyphs.push(g); + let glyph = if top.is_none() { glyph_run(o, m, drawn.clone(), opacity, scale, overprint) } else { None }; + let h = HeldStroke { font: key, at, opacity, text: text.clone(), stroke: s.clone(), overprint, glyph, first: (0, 0) }; + if self.hold_stroke(h) { + return true; } - return true; } + self.flush_glyphs(); // A stroke over the glyph just filled (fill and stroke rendering). if let (Some(s), Some(line)) = (&look.stroke, &mut self.text) && stroking diff --git a/crates/pdf/src/import/state.rs b/crates/pdf/src/import/state.rs index 12483256a0..2cf7f6e088 100644 --- a/crates/pdf/src/import/state.rs +++ b/crates/pdf/src/import/state.rs @@ -58,6 +58,23 @@ pub(super) struct GlyphRun { pub(super) overprint: bool, } +/// A stroke over a glyph filled before it (fill and stroke rendering), held with the stroke pass +/// it is part of ([`Builder::hold_stroke`]): the glyph's font, placement, opacity and text, the +/// stroke, whether it overprints, the glyph's outline as drawn (kept as for a line of type kept +/// as outlines; none for a glyph set upright), and the first glyph filled so it may go over, as +/// its line's place among the parked lines and the open one and its index in the line's filled +/// glyphs. +pub(super) struct HeldStroke { + pub(super) font: u128, + pub(super) at: super::Placement, + pub(super) opacity: f32, + pub(super) text: String, + pub(super) stroke: TypeStroke, + pub(super) overprint: bool, + pub(super) glyph: Option, + pub(super) first: (usize, usize), +} + /// How often a tiling pattern was read, and the art (as its paints) each reading drew with the /// swatch made for it. pub(super) type PatternReadings = (u32, Vec<(Vec, String)>); @@ -99,6 +116,10 @@ pub(super) struct Builder<'p> { /// its [`text_glyphs`](Self::text_glyphs): written before the open line, in this order /// ([`Builder::park_text`]). pub(super) parked: Vec<(TextLine, Vec)>, + /// The strokes of a text-showing operator's stroke pass over glyphs it filled on the + /// [`parked`](Self::parked) lines and the open one, held until the pass ends to be matched to + /// the glyphs it strokes ([`Builder::settle_strokes`]). + pub(super) held: Vec, pub(super) text_as: TextAs, pub(super) actual: super::actual_text::ActualText, pub(super) images: HashMap, diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index 18b36d9ba9..301622fe81 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -638,6 +638,17 @@ impl TextLine { // Nor does a translucent stroke join the glyph just filled. return opaque && self.stroke_last(font, at, text, stroke, overprint); }; + self.stroke_filled_at(index, stroke, overprint) + } + + /// A stroke over the glyph filled at `index` in [`filled`](Self::filled), not stroked yet + /// ([`next_filled`](Self::next_filled), [`last_filled`](Self::last_filled)): that glyph is + /// stroked as [`stroke_filled`](Self::stroke_filled) strokes the glyph it finds, and no later + /// stroke goes over the glyphs filled before it. `false`: there is no such glyph. + pub fn stroke_filled_at(&mut self, index: usize, stroke: TypeStroke, overprint: bool) -> bool { + if index < self.stroked || index >= self.filled.len() { + return false; + } let continues = self .pending .as_ref() @@ -663,23 +674,35 @@ impl TextLine { /// ([`stroke_filled`](Self::stroke_filled)): the next one filled so and not stroked yet, as /// an index into [`filled`](Self::filled). `None` for a translucent fill or stroke. fn filled_index(&self, font: u128, at: Placement, opacity: f32, text: &str) -> Option { - if opacity < 0.999 || self.opacity < 0.999 { - return None; - } - let i = self.filled.get(self.stroked..)?.iter().position(|g| { - g.font == font - && g.at.same_as(&at) - && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) - })?; + self.next_filled(0, font, at, opacity, text) + } + + /// The first glyph from index `from` of [`filled`](Self::filled) on, not stroked yet, that a + /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over: filled in + /// the same font with the same placement and text. `None` for a translucent fill or stroke. + pub fn next_filled(&self, from: usize, font: u128, at: Placement, opacity: f32, text: &str) -> Option { + let from = from.max(self.stroked); + let i = self.filled.get(from..)?.iter().position(|g| self.fills(g, font, at, opacity, text))?; + Some(from.saturating_add(i)) + } + + /// The last glyph before index `before` of [`filled`](Self::filled), not stroked yet, that a + /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over + /// ([`next_filled`](Self::next_filled)). + pub fn last_filled(&self, before: usize, font: u128, at: Placement, opacity: f32, text: &str) -> Option { + let rest = self.filled.get(self.stroked..before.min(self.filled.len()))?; + let i = rest.iter().rposition(|g| self.fills(g, font, at, opacity, text))?; Some(self.stroked.saturating_add(i)) } - /// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` is drawn over a - /// glyph of this line filled so ([`stroke_filled`](Self::stroke_filled) then strokes it). - /// Unlike `stroke_filled`, which then gives the stroke the line's last glyph or ends what - /// later strokes may match, it changes nothing. - pub fn has_filled(&self, font: u128, at: Placement, opacity: f32, text: &str) -> bool { - self.filled_index(font, at, opacity, text).is_some() + /// Whether `g` is a glyph a stroke over glyph `text` drawn at `at` in `font` at `opacity` may + /// be drawn over: opaque, in the same font, with the same placement and text. + fn fills(&self, g: &Filled, font: u128, at: Placement, opacity: f32, text: &str) -> bool { + opacity >= 0.999 + && self.opacity >= 0.999 + && g.font == font + && g.at.same_as(&at) + && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) } /// Whether a stroke drawn later may still be drawn over a glyph of the line (fill and stroke diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index c4301db5ce..75d20a9fd1 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -350,9 +350,10 @@ fn glyphs_filled_and_stroked_one_by_one_stay_one_run() { /// Fill and stroke rendering of a `TJ` whose kerning starts a new line part way through: the /// reader fills every glyph of the operator before it strokes them, and each part comes in as /// type filled and stroked, in the order drawn, not as each part filled and then each part -/// stroked over it (#8543). So too a `TJ` that jumps back to start a line before it, one whose -/// kerning starts two new lines, and one in a span with replacement text (`ActualText`); small -/// kerning keeps one line as before. +/// stroked over it (#8543). So too a `TJ` that jumps back to start a line before it and one whose +/// kerning starts two new lines. In a span with replacement text (`ActualText`) it stays one type +/// object, on the first glyph's line and in its style, filled and stroked; small kerning keeps +/// one line as before. #[test] fn a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked() { // Each type object as its text, and whether all of it is filled and all of it stroked. @@ -409,3 +410,31 @@ fn a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart( let part = |text: &str, fill: bool| (text.to_string(), true, fill, !fill); assert_eq!(types, [part("AB", true), part("CD", true), part("AB", false), part("CD", false)], "{content}"); } + +/// Fill and stroke rendering of a `TJ` whose kerning goes back to draw a glyph again where it +/// drew one before, on a line of its own: the reader strokes the glyphs in the order it filled +/// them, so each copy is filled and stroked, whether the copy drawn last ends the operator (the +/// open line) or a line after it does (a finished one), and however often it comes back +/// (#8543). A glyph filled and stroked by an operator of its own where one filled before stands +/// still strokes only the one filled last (#8015). +#[test] +fn a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy() { + let both = |text: &str| vec![(text.to_string(), true, true)]; + // Helvetica at 48 points: A and B are 667 units wide, so 4834 back after B (3500 on from A) + // draws A again where the first A stands. + for mode in ["2", "6"] { + let cases = [ + ("[(A) -3500 (B) 4834 (A)] TJ", vec![both("A"), both("B"), both("A")]), + ("[(A) -3500 (B) 4834 (A) -6000 (C)] TJ", vec![both("A"), both("B"), both("A"), both("C")]), + ("[(A) -3500 (B) 4834 (A) -3500 (B)] TJ", vec![both("A"), both("B"), both("A"), both("B")]), + ("[(A) -3500 (B) 4834 (A) -3500 (B) 4834 (A)] TJ", vec![both("A"), both("B"), both("A"), both("B"), both("A")]), + ]; + for (show, want) in cases { + let content = format!("BT {mode} Tr /F1 48 Tf 20 80 Td {show} 0 Tr ET"); + assert_eq!(type_runs(&content), want, "{content}"); + } + } + let content = "BT 0 Tr /F1 48 Tf 20 80 Td [(A) -3500 (B) 4834] TJ 2 Tr (A) Tj 0 Tr ET"; + let want = [vec![("A".to_string(), true, false)], vec![("B".to_string(), true, false)], both("A")]; + assert_eq!(type_runs(content), want, "{content}"); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index c56fb0e8a7..f8c404dd4e 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -370,7 +370,7 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, or is in an `ActualText` span; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). - [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,7 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | PDF import: fill and stroke rendering (text rendering modes 2 and 6) draws all the glyphs of a text-showing operator (`Tj`, `TJ`, `'`, `"`) filled, then the same glyphs stroked, so a word shown at once came in as two type objects: a stroke-only copy over a fill-only one. Each stroke is now matched, in order, to the glyph filled with the same placement (where, how large, how wide, slanted and turned) in the same font with the same text on the line, and only that glyph takes the stroke, so the word comes in as one type object, filled and stroked; glyphs stroked with another join part way through still split into runs of their own, and stroked type over no filled glyph (modes 1 and 5) stays stroke only (#8015; `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index f3d745c10b..3720c30570 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -163,7 +163,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -215,7 +215,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 71ebe10ac1..e20bc13100 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -63,7 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, so each stroke finds the glyph it was filled as, and each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span (whose stroke was lost). Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | @@ -276,9 +276,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -541,7 +541,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -603,7 +603,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, one whose kerning starts two new lines, and one in an `ActualText` span, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h. From 1582f52c19561953c6af5a48338a5af4de4d9f37 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:06:18 -0800 Subject: [PATCH 199/247] Command Palette: docs place typo matches above description-only matches The Command Palette entry said a result matched through a typo comes after every result the query matches without one. A result the query matches only through its description ranks below a typo match, as a_description_match_ranks_below_a_typo checks. The sentence now limits the comparison to name, menu path and id matches and states that typo matches come before description-only matches. --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 749dce93d3..36ff58bef6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1451,7 +1451,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A modal window that opens without a press in the window (a dialog opened from the macOS menu bar or by an automation command, the About window, a file dialog, the update prompt, or the progress window of a plug-in, trace or open run) closes the Command Palette, a tool group's flyout, the All Tools drawer and any open menu or popup in the pass it opens. While such a window is open, the palette stays closed, so opening it from the macOS menu bar or by an automation command does not take the keyboard from the window; it opens again once the window closes (`palette` tests `a_dialog_opened_from_the_system_menu_closes_the_palette`, `the_about_window_closes_the_palette`, `a_progress_window_closes_the_palette`, `the_palette_opened_over_a_dialog_closes`, `a_click_on_the_menu_bar_closes_the_palette_before_a_dialog_opens`, `a_dialog_opened_without_a_press_closes_a_flyout`, `a_dialog_opened_without_a_press_closes_the_tools_drawer`, `a_dialog_opened_without_a_press_closes_a_menu`, `the_palette_opened_as_a_dialog_closes_stays_open_until_the_next_dialog`). The Command Palette ranks its results by how well they match. A query that is a result's id lists that result first (`view.goto1` lists Saved View 1 above Saved View 10); then come results whose name is the query, results whose name without its menu path starts with it, and results whose initials it is ("ea" finds Export As…). Within each of those, a result where every word of the query is a whole word of its name ranks above one where a word only starts a word of the name, then one where it is a word of the menu that holds it, then of its id, then text inside a word, so a query that is a menu's title ("object") lists results named with that word above the items of that menu. A tool ranks above a menu command, panel, effect or filter plug-in that matches as well, so "rect" lists the Rectangle Tool above Effect › Convert to Shape › Rectangle…, and of two results of the same kind the shorter name comes first. Words of the menu bar item that runs a result also find it, the item's own label included ("exit" finds Quit VectorCraft, which File › Exit runs); with the native macOS menu bar, the items that bar moves into its application menu are found under it (Preferences… under Settings). Every result the earlier search found is still found, and the highlight stays on its result when a plug-in is installed, a shortcut changes or the language changes while the palette is open (`palette::search` tests `a_better_word_grade_ranks_first`, `a_better_whole_query_tier_ranks_first`, `kind_and_length_never_lift_a_worse_grade`, `a_menu_title_does_not_lift_its_items`, `common_queries_list_the_command_near_the_top`, `every_result_is_found_first_by_its_name_and_its_id`, `every_result_found_before_is_still_found_and_shown`, `results_know_their_place_in_the_menu_bar`, `native_homes_follow_the_native_application_menu`; `palette` test `the_highlight_stays_on_its_result_when_the_results_change`). A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`). - A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). + A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches in its name, menu path or id without one, and before every result the query matches only through its description; among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `a_description_match_ranks_below_a_typo`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). Each Command Palette row starts with an icon for its kind (a tool's own icon, or one for a panel, an effect, a filter plug-in or a command) and shows where the result lives after its label, in smaller dim text: the menu path of the menu bar item that runs it, with that item's label when it differs from the result's ("File › Exit" for Quit VectorCraft), and "No menu item" for a command no item runs. A panel's row shows "Window". A row with a home shows its label without the menu path in front of it. A path that keeps two results' names apart stays in the label, unless the row's home shows the same path; a tool's row drops the "Tools" in front of its name. A tool's row names the toolbar it is on: "Toolbar" for its button on the Tools panel, or the name of a toolbar made with New Toolbar, followed by ", in the group" when the tool is hidden in the group of a slot whose button shows another tool ("Toolbar, in the Direct Selection Tool group" for the Group Selection Tool), and "All Tools" when no toolbar holds it. A toolbar shown now comes first (the Tools panel, then the toolbars made with New Toolbar), then a hidden Tools panel, then hidden toolbars made with New Toolbar; toolbars count as hidden in Presentation Mode and while Tab hides the panels. The Learn command (`window.learn`), which Window › Learn runs, takes the Window menu as its home, so a search reads its menu path like any other result's, and among results that tie on everything else it ranks as a command of the menu bar, before panels and after tools. The home is cut short with "…" before the label, and a label too long for the row keeps the id it shows after its name unless the id alone is wider than the row. A cut row shows all its text while the pointer rests on it, and screen readers read the kind, the label, the home and the shortcut. The row height is unchanged (`palette` tests `rows_show_where_each_result_lives`, `no_two_rows_read_alike`, `a_tool_row_names_its_toolbar_slot`, `a_narrow_row_cuts_the_home_first_and_keeps_the_id`, `screen_readers_hear_the_kind_and_home`, `catalogs_translate_the_kind_and_home_words`). From 495e968729d4defe30adc1918195026aee3dcca3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:06:21 -0800 Subject: [PATCH 200/247] Docs: Clear Actions keeps sets only when sets were added, removed or reordered The question names the sets by id and order, so a set whose actions changed after the question opened is still deleted. --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 18af12d528..f957a949ae 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -901,7 +901,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Actions panel: the panel menu's Duplicate copies the selected action, else the current action set with all its actions ([Actions panel overview](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.duplicate`). VectorCraft's own rules, which the overview does not cover: the copy goes right after the original, is named after it with " copy" added and is selected. - Actions panel: the panel menu's Reset Actions asks first; OK replaces the sets in the panel with the default set, and Append adds the default set after them ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html); `ui.actionSet.reset`). VectorCraft's own rules, which the page does not cover: the default set is VectorCraft's own Default Actions set; after OK it is current and selected, and no action or step is selected; Append names its copy with the next free number (`Default Actions 2`) and keeps the current set; Cancel changes nothing; the item is off while an action records or plays, waiting at a stop included; Undo does not bring the old sets back. Tests `panels::actions::tests::{the_panel_menus_reset_actions_asks_first_and_is_off_while_an_action_runs, reset_replaces_every_set_with_the_built_in_set_and_clears_what_named_the_old_ones, reset_on_the_built_in_set_makes_it_current_then_changes_nothing, reset_append_adds_the_built_in_set_with_a_free_number_and_keeps_the_rest, reset_refuses_bad_params_and_a_running_action_and_changes_nothing}`, `dialogs::tests::reset_actions_ok_replaces_append_adds_and_cancel_keeps_the_sets`. - Actions panel: the panel menu's Replace Actions… opens a file and puts the set it holds in place of every set in the panel ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.replace`). VectorCraft's own rules, which the page does not cover: the file is read as Load Actions… reads it (`.vcactions` and `.aia`, with the same limits and reports); the built-in Default Actions set goes too; the file's set keeps its name and becomes current and selected, and no action or step is selected; a canceled pick, a file that can't be read or is refused (an empty one too) changes nothing; the item asks no question first and is off while an action records or plays, waiting at a stop included; Undo does not bring the old sets back. Tests `panels::actions::tests::{the_panel_menus_replace_actions_puts_the_files_set_in_place_of_every_set, replace_actions_clears_what_named_the_old_sets_and_reads_aia_files, replace_actions_refuses_bad_params_bad_files_and_a_running_action}`. - - Actions panel: the panel menu's Clear Actions deletes every set loaded in the panel with its actions ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.clear`). VectorCraft's own rules, which the page does not cover: the item asks first, and Cancel changes nothing; the built-in Default Actions set goes too, and no set, action or step is selected afterwards; OK deletes nothing when the sets changed after the question opened; the item is off with no sets and while an action records or plays, waiting at a stop included; an empty panel stays empty after a restart; Undo does not bring the sets back, and Reset Actions, Load Actions… or New Set… adds sets again. Tests `panels::actions::tests::{the_panel_menus_clear_actions_asks_first_and_ok_deletes_every_set, clear_deletes_every_set_and_clears_what_named_them, clear_refuses_bad_params_changed_sets_and_a_running_action}`. + - Actions panel: the panel menu's Clear Actions deletes every set loaded in the panel with its actions ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html); `ui.actionSet.clear`). VectorCraft's own rules, which the page does not cover: the item asks first, and Cancel changes nothing; the built-in Default Actions set goes too, and no set, action or step is selected afterward; OK deletes nothing when sets were added, removed or reordered after the question opened, and a set whose actions changed still goes; the item is off with no sets and while an action records or plays, waiting at a stop included; an empty panel stays empty after a restart; Undo does not bring the sets back, and Reset Actions, Load Actions… or New Set… adds sets again. Tests `panels::actions::tests::{the_panel_menus_clear_actions_asks_first_and_ok_deletes_every_set, clear_deletes_every_set_and_clears_what_named_them, clear_refuses_bad_params_changed_sets_and_a_running_action}`. - Batch… over data sets names each file after the document and the data set (`action.batch`). It writes `/`, `\`, `:`, `<`, `>`, `"`, `|`, `?`, `*` and control characters in the data set's name as `-`, and adds `-2`, `-3`… to a name an earlier data set used. - Batch… offers File + Number, File + Data Set Name, and Data Set Name for a Data Sets source. The dialog defaults to File + Number; `action.batch` without `datasetFileNaming` keeps File + Data Set Name. An output already in a destination folder the batch may read and write gets the next free `-2`, `-3` suffix. [Batch options](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/batch-options.html). - The Batch dialog shows its data set File Name row only when Destination is Folder, and keeps the choice while another destination is picked. With None or Save and Close it does not send `datasetFileNaming`. From d27a9e94667721c895c2605758a986c7b4c2616a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:12:58 -0800 Subject: [PATCH 201/247] Find and Replace: an action that is not a string runs no action Confirming the dialog with a number, null or list as its action used to run Find, which moved the match found, the selection and the last search. It is now an error, shown as the note, like a field of the wrong type. --- crates/ui-egui/src/dialogs/find_replace.rs | 13 ++++++++---- .../ui-egui/src/dialogs/find_replace/tests.rs | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/dialogs/find_replace.rs b/crates/ui-egui/src/dialogs/find_replace.rs index 523586d1a9..f56d07c722 100644 --- a/crates/ui-egui/src/dialogs/find_replace.rs +++ b/crates/ui-egui/src/dialogs/find_replace.rs @@ -260,16 +260,21 @@ fn replace_all(app: &mut VectorcraftApp, d: &mut Dialog) -> Result Result { let mut d = d.clone(); - let action = d.fields.insert("action".into(), json!("find")).and_then(|a| a.as_str().map(str::to_string)).unwrap_or_default(); - if let Err(e) = check_types(&d.fields, false) { + let action = d.fields.insert("action".into(), json!("find")); + let checked = match &action { + Some(a) if !a.is_string() => Err("`action` must be a string".to_string()), + _ => check_types(&d.fields, false), + }; + if let Err(e) = checked { d.fields.insert(NOTE.into(), json!(e)); app.ui.dialog = Some(d); return Err(e); } - let r = match action.as_str() { + let r = match action.as_ref().and_then(Value::as_str).unwrap_or_default() { "done" => { remember(app, &d); app.ui.dialog = None; diff --git a/crates/ui-egui/src/dialogs/find_replace/tests.rs b/crates/ui-egui/src/dialogs/find_replace/tests.rs index 0e38820877..59dbe4937b 100644 --- a/crates/ui-egui/src/dialogs/find_replace/tests.rs +++ b/crates/ui-egui/src/dialogs/find_replace/tests.rs @@ -174,6 +174,27 @@ fn the_dialog_rejects_a_field_of_the_wrong_type() { assert_eq!((field(&app, "find"), field(&app, "replace"), field(&app, "wholeWord")), (json!("cat"), json!("dog"), json!(true))); } +/// An `action` that is not a string runs no action, Find included: the error is the note, and the +/// match found, the selection and the last search stay as they were. +#[test] +fn an_action_of_the_wrong_type_runs_no_action() { + let (mut app, _) = app_with(&["cat", "cat"]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + crate::dialogs::confirm(&mut app).unwrap(); + let (at, sel, last) = (matched(&app), selected(&app), app.ui.last_find.clone()); + assert!(at.is_some()); + for v in [json!(5), Value::Null, json!(["find"])] { + set(&mut app, "action", v.clone()); + assert_eq!(crate::dialogs::confirm(&mut app).unwrap_err(), "`action` must be a string", "{v}"); + assert_eq!((matched(&app), selected(&app), app.ui.last_find.clone()), (at, sel.clone(), last.clone()), "{v}"); + assert_eq!(field(&app, "__note"), json!("`action` must be a string"), "{v}"); + } + set(&mut app, "action", json!("find")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_ne!(matched(&app), at, "a string action still runs"); +} + /// The dialog stays open from match to match: Find goes to the next match and selects its /// object, Replace changes that match, Replace & Find changes it and goes on, Replace All changes /// the rest, and Done closes. Each Replace is one undo step, and so is Replace All; finding and a From 255cdcb6cac62f46c9d251900a6619a60a947d79 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:21:57 -0800 Subject: [PATCH 202/247] Shapes: switching tools during a widget drag puts the shape back Switching away from the Selection tool or a shape tool during a drag of a corner, pie or side widget left the drag's interaction open with its preview in the document. Both tools now cancel the drag on deactivate, as Escape does, as the Selection tool already did for a blend widget. --- crates/tools/src/select.rs | 8 +++-- crates/tools/src/shape.rs | 6 ++++ crates/tools/src/shape/tests.rs | 63 +++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index cb5f1dd207..b6510f0be4 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -900,11 +900,15 @@ impl Tool for SelectionTool { out } - /// Switching tools during a blend widget's drag cancels it, as Escape does: its value goes back. + /// Switching tools during a drag of a blend widget, a corner widget, a pie widget or a + /// polygon's side widget cancels it, as Escape does: its value goes back. fn deactivate(&mut self, _cx: &ToolContext) -> Vec { match std::mem::take(&mut self.state) { State::BlendWidget(d) if d.adjusting() => vec![Action::Cancel], - State::BlendWidget(_) => vec![], + State::Corner(c) if c.adjusting() => vec![Action::Cancel], + State::Pie(d) if d.adjusting() => vec![Action::Cancel], + State::Sides(d) => d.cancel(), + State::BlendWidget(_) | State::Corner(_) | State::Pie(_) => vec![], other => { self.state = other; vec![] diff --git a/crates/tools/src/shape.rs b/crates/tools/src/shape.rs index dc04cc96d5..6685dd20f2 100644 --- a/crates/tools/src/shape.rs +++ b/crates/tools/src/shape.rs @@ -831,6 +831,12 @@ impl Tool for ShapeTool { _ => vec![], } } + /// Switching tools during a drag of a corner, pie or side widget cancels it, as Escape does: + /// the shape goes back. + fn deactivate(&mut self, cx: &ToolContext) -> Vec { + if self.widget.is_some() { self.key(cx, ToolKey::Escape, Mods::default()) } else { vec![] } + } + /// ↑/↓ change a polygon's sides, a star's points or the rounded rectangle's radius while it is /// drawn; Escape turns a widget or selection drag back. fn key(&mut self, cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec { diff --git a/crates/tools/src/shape/tests.rs b/crates/tools/src/shape/tests.rs index 2b27de29ff..d52cf374d4 100644 --- a/crates/tools/src/shape/tests.rs +++ b/crates/tools/src/shape/tests.rs @@ -1354,6 +1354,69 @@ fn a_shape_tool_drags_a_polygons_side_widget() { assert!(matches!(a.last(), Some(Action::Preview(cmd, _)) if cmd == "shape.line"), "{a:?}"); } +/// Switching away from a shape tool or the Selection tool during a drag of a corner, pie or side +/// widget cancels it, as Escape does: the shape goes back. After a press that has not moved there +/// is nothing to put back. +#[test] +fn a_tool_switch_cancels_a_widget_drag() { + use vectorcraft_doc::{Appearance, LiveShape, Node, NodeKind}; + let live = |shape: LiveShape| { + let mut d = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, id) = (d.layers[0].id, d.alloc_id()); + let mut n = Node::path(id, shape.to_path(), Appearance::default_art()); + if let NodeKind::Path { live: slot, .. } = &mut n.kind { + *slot = Some(Box::new(shape)); + } + d.insert(Some(l), 0, n).unwrap(); + let mut s = Selection::default(); + s.add(id); + (d, s) + }; + let xf = Affine::translate((100.0, 100.0)); + let rect = live(LiveShape::Rectangle { w: 100.0, h: 100.0, radii: [0.0; 4], kinds: Default::default(), radii_relative: false, xf }); + let ellipse = live(LiveShape::Ellipse { w: 200.0, h: 100.0, pie: (0.0, 360.0), xf }); + let polygon = live(LiveShape::Polygon { + radius: 80.0, + sides: 5, + xf: Affine::translate((250.0, 250.0)), + radii: vec![], + kinds: vec![], + radii_relative: false, + }); + let p = paint(); + let side = crate::sidewidget::SideWidget::for_tool(&cx(&polygon.0, &polygon.1, &p)).expect("a side widget").0.at; + // The corner widget at (110, 110), the pie widget 12 px right of (300, 150), the side widget. + let drags = [ + (&rect, Point::new(110.0, 110.0), Point::new(130.0, 130.0)), + (&ellipse, Point::new(312.0, 150.0), Point::new(200.0, 20.0)), + (&polygon, side, side + Vec2::new(0.0, 25.0)), + ]; + for ((d, s), at, to) in drags { + let c = cx(d, s, &p); + let tools: [Box; 6] = [ + Box::new(crate::select::SelectionTool::default()), + Box::new(ShapeTool::new("rectangle")), + Box::new(ShapeTool::new("roundedRectangle")), + Box::new(ShapeTool::new("ellipse")), + Box::new(ShapeTool::new("polygon")), + Box::new(ShapeTool::new("star")), + ]; + for mut t in tools { + let id = t.id(); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Down, at.x, at.y)).is_empty(), "{id} at {at:?}"); + let a = t.pointer(&c, &PointerEvent::new(PointerKind::Drag, to.x, to.y)); + assert!(matches!(a.first(), Some(Action::Begin(_))), "{id} at {at:?}: {a:?}"); + assert_eq!(t.deactivate(&c), vec![Action::Cancel], "{id} at {at:?}"); + assert!(!t.busy() && !t.transforming(), "{id} at {at:?}"); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Up, to.x, to.y)).is_empty(), "{id} at {at:?}"); + t.pointer(&c, &PointerEvent::new(PointerKind::Down, at.x, at.y)); + assert!(t.busy(), "{id} at {at:?}"); + assert!(t.deactivate(&c).is_empty(), "{id} at {at:?}"); + assert!(!t.busy(), "{id} at {at:?}"); + } + } +} + /// A double-click on a corner widget of a selected live shape, with a shape tool that shows the /// widgets, asks for the Transform panel and nothing else: neither click draws, edits or begins an /// undo step, and the tool stays idle. Line Segment, a plain path, a pie widget, a hidden or From edeb24b113614ed77c780a300420d898f666933c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:30:36 -0800 Subject: [PATCH 203/247] Recolor Artwork: OK keeps a color group's gradient and pattern swatches recolor.apply with `group` rewrote the group by place: the new colors went to its swatches in order, so a gradient, pattern or None swatch in the group took a color or was removed, at OK and in the live preview. The group's colors, from the rows or from `groupColors`, now go to its color swatches in order, and every other swatch keeps its place and its paint. `groupColors` counts the color swatches only, as the dialog already does when it lists a group's colors. swatch.editGroup is unchanged. --- crates/engine/src/cmd/recolor.rs | 31 ++++++++------- crates/engine/src/cmd/swatch.rs | 55 +++++++++++++++++++-------- crates/engine/src/tests/recolor.rs | 43 +++++++++++++++++++++ crates/ui-egui/src/dialogs/recolor.rs | 7 ++-- docs/mcp.md | 9 +++-- 5 files changed, 108 insertions(+), 37 deletions(-) diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index cb179148cc..1c3acf4e73 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -34,7 +34,7 @@ pub fn specs() -> Vec { "Recolor Artwork", ["Edit", "Edit Colors"], None, - "{map: rows [{from: [colour keys (recolor.colors) or \"#rrggbb\" (every colour shown as that hex); may be empty: an empty row recolours nothing, adds no library swatch and gives `group` no colour unless `added`], to: colour (hex, key, {c,m,y,k} or {l,a,b}) | null (in from, to and groupColors, #rrggbbaa and #rgba are refused), exclude?: false (the row's colours are kept), tint?: 100 (percent; with limitTo, art linked to the global or spot swatch the new color is takes this share of its tint), added?: false (an empty row's new color is a color added to `group`)}] | {\"key or #rrggbb\": colour, …} (one row per colour), method?: \"exact\" (default)|\"preserveTints\"|\"scaleTints\"|\"tintsShades\"|\"hueShift\" (how a row's colours take its new colour, relative to the row's darkest, average or most saturated colour), limitTo?: swatch library id or name; or \"document\" (the document's swatches): new colours snap to its nearest colour, group?: colour group to rewrite, groupColors?: [colour | null | \"keep\"] (what `group` is rewritten with, a null removing the group's swatch at its place and \"keep\" leaving that swatch its colour, without the Global Adjust (past the swatches it adds nothing; refused for a swatch that is not a colour); default: the new colors of the rows with current colors, in order, then those of the empty rows with `added`, excluded rows left out), rename?: the group's new name, includeImages?: true, includePatterns?: true, globalAdjust?: {saturation?: 0, brightness?: 0, temperature?: 0, luminosity?: 0} (Global Adjust: percent from -100 to 100, 0 changes nothing; every colour a row that isn't excluded recolours, and the group's new colours, take the same change after the row's new colour: saturation scales HSB saturation by 1 + saturation/100, brightness moves HSB brightness that share of the way to full or to black, temperature adds 0.2 × temperature/100 to red and takes it from blue, luminosity moves Lab lightness that share of the way to 100 or 0 keeping a and b; with limitTo each row's new colour takes the change before it snaps to the library)} recolour the selection (gradients, text, meshes, image pixels and pattern tiles included; each new colour keeps the model of the one it replaces (model?: \"keep\" default | \"new\" (the new colour's own model, so a CMYK colour replacing RGB art gives CMYK art) | \"document\" (the document's colour mode)), except a library swatch's with limitTo: art takes the swatch itself, linked to a global or spot colour at its tints, and the swatch joins the document's swatches; art linked to a global swatch of `group` that is rewritten with its row's new color stays linked to it, at its tint, unless the row converts the color into the art's model; other recolored art, and art in a row linked to a global swatch of `group` that is rewritten with another color, keeps its row's new color and loses its swatch link) and the group, as one undo step (none when nothing changes). On a path directly in a graph series, the graph also stores the new paint of the topmost visible fill and stroke, and on a graph label the new paint of its characters and rows for every label of its kind, and on a graph's axis line, tick mark or radar ring its rows for every line of its kind (docs/mcp.md) → {changed, swatches: [names added to the document's swatches], relinked?: with group, the other paints linked to its global swatches that took their new colors, note?: set when a colour kept a model other than its new colour's (see model), notChanged: {locked, hidden} (as edit.colors.invert), warning?: set when notChanged counts any object}", + "{map: rows [{from: [colour keys (recolor.colors) or \"#rrggbb\" (every colour shown as that hex); may be empty: an empty row recolours nothing, adds no library swatch and gives `group` no colour unless `added`], to: colour (hex, key, {c,m,y,k} or {l,a,b}) | null (in from, to and groupColors, #rrggbbaa and #rgba are refused), exclude?: false (the row's colours are kept), tint?: 100 (percent; with limitTo, art linked to the global or spot swatch the new color is takes this share of its tint), added?: false (an empty row's new color is a color added to `group`)}] | {\"key or #rrggbb\": colour, …} (one row per colour), method?: \"exact\" (default)|\"preserveTints\"|\"scaleTints\"|\"tintsShades\"|\"hueShift\" (how a row's colours take its new colour, relative to the row's darkest, average or most saturated colour), limitTo?: swatch library id or name; or \"document\" (the document's swatches): new colours snap to its nearest colour, group?: colour group to rewrite, groupColors?: [colour | null | \"keep\"] (what the color swatches of `group` are rewritten with, in order: a gradient, pattern or None swatch keeps its place and paint; a null removing the color swatch at its place and \"keep\" leaving that swatch its colour, without the Global Adjust (past the color swatches it adds nothing); default: the new colors of the rows with current colors, in order, then those of the empty rows with `added`, excluded rows left out), rename?: the group's new name, includeImages?: true, includePatterns?: true, globalAdjust?: {saturation?: 0, brightness?: 0, temperature?: 0, luminosity?: 0} (Global Adjust: percent from -100 to 100, 0 changes nothing; every colour a row that isn't excluded recolours, and the group's new colours, take the same change after the row's new colour: saturation scales HSB saturation by 1 + saturation/100, brightness moves HSB brightness that share of the way to full or to black, temperature adds 0.2 × temperature/100 to red and takes it from blue, luminosity moves Lab lightness that share of the way to 100 or 0 keeping a and b; with limitTo each row's new colour takes the change before it snaps to the library)} recolour the selection (gradients, text, meshes, image pixels and pattern tiles included; each new colour keeps the model of the one it replaces (model?: \"keep\" default | \"new\" (the new colour's own model, so a CMYK colour replacing RGB art gives CMYK art) | \"document\" (the document's colour mode)), except a library swatch's with limitTo: art takes the swatch itself, linked to a global or spot colour at its tints, and the swatch joins the document's swatches; art linked to a global swatch of `group` that is rewritten with its row's new color stays linked to it, at its tint, unless the row converts the color into the art's model; other recolored art, and art in a row linked to a global swatch of `group` that is rewritten with another color, keeps its row's new color and loses its swatch link) and the group, as one undo step (none when nothing changes). On a path directly in a graph series, the graph also stores the new paint of the topmost visible fill and stroke, and on a graph label the new paint of its characters and rows for every label of its kind, and on a graph's axis line, tick mark or radar ring its rows for every line of its kind (docs/mcp.md) → {changed, swatches: [names added to the document's swatches], relinked?: with group, the other paints linked to its global swatches that took their new colors, note?: set when a colour kept a model other than its new colour's (see model), notChanged: {locked, hidden} (as edit.colors.invert), warning?: set when notChanged counts any object}", has_doc, apply ), @@ -1680,12 +1680,18 @@ fn apply(s: &mut Session, p: &Value) -> Result { Some(Value::Array(cs)) => Some(cs), Some(_) => return Err(bad(C, "`groupColors` must be an array")), }; - // A null in groupColors removes the group's swatch at its place, and "keep" leaves the swatch - // at its place its color, without the Global Adjust. - let own: Vec> = match group { - Some(g) => { - s.doc()?.doc.swatch_groups.iter().find(|x| x.name == g).map(|g| g.swatches.iter().map(|w| w.paint.color()).collect()).unwrap_or_default() - } + // The places of groupColors are those of the group's color swatches: a gradient, pattern or + // None swatch keeps its place and paint. A null removes the color swatch at its place, and + // "keep" leaves it its color, without the Global Adjust. + let own: Vec = match group { + Some(g) => s + .doc()? + .doc + .swatch_groups + .iter() + .find(|x| x.name == g) + .map(|g| g.swatches.iter().filter_map(|w| w.paint.color()).collect()) + .unwrap_or_default(), None => vec![], }; let new: Vec> = match group_colors { @@ -1694,12 +1700,8 @@ fn apply(s: &mut Session, p: &Value) -> Result { .enumerate() .map(|(i, v)| match v { Value::Null => Ok(None), - // Past the group's swatches it adds nothing. - Value::String(k) if k == "keep" => match own.get(i) { - Some(Some(c)) => Ok(Some(*c)), - Some(None) => Err(bad(C, format!("the swatch at place {i} of groupColors is not a colour to keep"))), - None => Ok(None), - }, + // Past the group's color swatches it adds nothing. + Value::String(k) if k == "keep" => Ok(own.get(i).copied()), v => color_value(v) .map(|c| adjust.apply(c)) .map(|c| Some(in_doc_model(palette.as_ref().map_or(c, |pl| pl.nearest(c))))) @@ -1747,6 +1749,7 @@ fn apply(s: &mut Session, p: &Value) -> Result { .map(|g| { g.swatches .iter() + .filter(|w| w.paint.color().is_some()) .zip(&new) .filter(|(w, _)| w.global && !w.is_reserved()) .filter_map(|(w, c)| Some((w, (*c)?))) @@ -1766,7 +1769,7 @@ fn apply(s: &mut Session, p: &Value) -> Result { .collect(); map.converted.set(false); let changed = keeping_series_paint(d, &ids, |d| Ok(Recolor::with_links(scope, &f, &lf).run(d, &ids)))?; - let edit = group.map(|g| super::swatch::rewrite_group(d, g, &new, rename, C)).transpose()?; + let edit = group.map(|g| super::swatch::rewrite_group(d, g, &new, true, rename, C)).transpose()?; super::paint::check_colorized_kept(colorized_ok, d).map_err(|e| bad(C, e))?; // Rewriting the group's swatches can change the colors of art linked to them, left out or // not, and of the patterns it uses. Art that only loses its link keeps its colors and is diff --git a/crates/engine/src/cmd/swatch.rs b/crates/engine/src/cmd/swatch.rs index 2b746b7634..b93c378fea 100644 --- a/crates/engine/src/cmd/swatch.rs +++ b/crates/engine/src/cmd/swatch.rs @@ -1279,40 +1279,63 @@ impl GroupEdit { /// Rewrite colour group `group` with `colors`: its swatches take them in order (keeping their /// names, kinds and global or spot flags), a `None` removes the swatch at its place, extra colors -/// are added as new swatches and swatches past the end are removed. Paints linked to its global +/// are added as new swatches and swatches past the end are removed. With `colors_only`, a swatch +/// that is not a color (a gradient, pattern or None swatch) keeps its place and paint and takes no +/// entry of `colors`, which go to the group's color swatches in order. Paints linked to its global /// swatches follow (a removed swatch's are unlinked); `rename` renames the group. A built-in swatch /// (None, Registration) it would change or remove is refused. -pub(super) fn rewrite_group(d: &mut Document, group: &str, colors: &[Option], rename: Option<&str>, cmd: &str) -> Result { +pub(super) fn rewrite_group( + d: &mut Document, + group: &str, + colors: &[Option], + colors_only: bool, + rename: Option<&str>, + cmd: &str, +) -> Result { let gi = d.swatch_groups.iter().position(|g| g.name == group).ok_or_else(|| bad(cmd, format!("no colour group `{group}`")))?; let name = match rename.map(str::trim).filter(|n| !n.is_empty() && *n != group) { Some(n) => d.free_swatch_name(n), None => group.to_string(), }; let old = &d.swatch_groups[gi].swatches; + // The place in `colors` of each swatch's new color; none for a swatch kept as it is. + let mut taken = 0; + let places: Vec> = old + .iter() + .map(|w| { + (!colors_only || w.paint.color().is_some()).then(|| { + taken += 1; + taken - 1 + }) + }) + .collect(); + let new_color = |place: Option| place.and_then(|i| colors.get(i).copied().flatten()); if let Some(w) = old .iter() - .enumerate() - .find(|(i, w)| w.is_reserved() && colors.get(*i).copied().flatten().is_none_or(|c| w.paint.color() != Some(c))) - .map(|x| x.1) + .zip(&places) + .find(|(w, place)| place.is_some() && w.is_reserved() && new_color(**place).is_none_or(|c| w.paint.color() != Some(c))) + .map(|x| x.0) { return Err(bad(cmd, format!("`{}` can't be edited or removed", w.name))); } let colorized_ok = super::paint::check_colorized(d).is_ok(); let mut relinks = vec![]; let old = std::mem::take(&mut d.swatch_groups[gi].swatches); - let old_len = old.len(); - // The swatches that stay, each with its new color. - let mut kept: Vec<(Swatch, Color)> = vec![]; - for (i, w) in old.into_iter().enumerate() { - match colors.get(i).copied().flatten() { - Some(c) => kept.push((w, c)), - None if w.global => relinks.push(Relink { from: w.name.clone(), to: w.name, color: None, keep: false }), - None => {} + // The swatches that stay, each with its new color (none for one kept as it is). + let mut kept: Vec<(Swatch, Option)> = vec![]; + for (w, place) in old.into_iter().zip(places) { + match (place, new_color(place)) { + (None, _) => kept.push((w, None)), + (_, Some(c)) => kept.push((w, Some(c))), + (_, None) if w.global => relinks.push(Relink { from: w.name.clone(), to: w.name, color: None, keep: false }), + (_, None) => {} } } let mut swatches = Vec::with_capacity(kept.len()); for (mut w, c) in kept { - if w.paint.color() != Some(c) { + if let Some(c) = c + && w.paint.color() != Some(c) + { // A tint swatch becomes a colour of its own. w.paint = Paint::solid(c); if w.global { @@ -1325,7 +1348,7 @@ pub(super) fn rewrite_group(d: &mut Document, group: &str, colors: &[Option Result { { return Ok(json!({"name": group, "swatches": g.swatches.iter().map(|w| w.name.clone()).collect::>(), "relinked": 0})); } - let e = s.edit("Edit Color Group", |d, _| rewrite_group(d, group, &colors, rename, C))?; + let e = s.edit("Edit Color Group", |d, _| rewrite_group(d, group, &colors, false, rename, C))?; e.defaults(s)?; Ok(json!({"name": e.name, "swatches": e.swatches, "relinked": e.relinked})) } diff --git a/crates/engine/src/tests/recolor.rs b/crates/engine/src/tests/recolor.rs index dae6a1729f..10c2edcc17 100644 --- a/crates/engine/src/tests/recolor.rs +++ b/crates/engine/src/tests/recolor.rs @@ -836,6 +836,49 @@ fn a_null_in_group_colors_removes_that_swatch_and_the_ones_after_it_keep_their_p assert_eq!(link(&s, green), ("#00ff00".into(), Some(names[2].clone())), "art linked to a swatch that stays keeps its link"); } +/// A gradient or pattern swatch of the group keeps its place and its paint when `recolor.apply` +/// rewrites the group: the group's colors, from the rows or from `groupColors`, go to its color +/// swatches in order. +#[test] +fn apply_with_a_group_keeps_its_gradient_swatch() { + let mut s = session(); + run(&mut s, "swatch.newGroup", json!({"name": "Brand", "colors": ["#ff0000", "#0000ff"]})); + let fade = vectorcraft_color::Paint::Gradient(Box::new(vectorcraft_color::GradientPaint::new(vectorcraft_color::Gradient::default()))); + s.edit("test", |d, _| { + let w = vectorcraft_color::Swatch { name: "Fade".into(), paint: fade.clone(), global: false, spot: false }; + d.swatch_groups.iter_mut().find(|g| g.name == "Brand").unwrap().swatches.insert(1, w); + Ok(()) + }) + .unwrap(); + let group = |s: &Session| -> Vec<(String, Option)> { + let g = s.doc().unwrap().doc.swatch_groups.iter().find(|g| g.name == "Brand").unwrap().swatches.clone(); + g.iter().map(|w| (w.name.clone(), w.paint.color().map(|c| c.to_hex()))).collect() + }; + let names: Vec = group(&s).into_iter().map(|(n, _)| n).collect(); + rect(&mut s, json!("#ff0000")); + rect(&mut s, json!("#0000ff")); + select_all(&mut s); + // The rows' new colors go to the red and blue swatches; the gradient stays between them. + let map = json!([{"from": ["#ff0000"], "to": "#00ff00"}, {"from": ["#0000ff"], "to": "#ffff00"}]); + run(&mut s, "recolor.apply", json!({"map": map, "group": "Brand"})); + let want = |a: &str, b: &str| vec![(names[0].clone(), Some(a.to_string())), (names[1].clone(), None), (names[2].clone(), Some(b.to_string()))]; + assert_eq!(group(&s), want("#00ff00", "#ffff00")); + assert_eq!(gradient_at(&s, 1), fade, "the gradient swatch keeps its paint"); + // `groupColors` counts the color swatches only: "keep" is the first, and the second color is + // the blue swatch's. + run(&mut s, "recolor.apply", json!({"map": [], "group": "Brand", "groupColors": ["keep", "#123456"]})); + assert_eq!(group(&s), want("#00ff00", "#123456")); + // A null removes the color swatch at its place and leaves the gradient. + run(&mut s, "recolor.apply", json!({"map": [], "group": "Brand", "groupColors": [null, "#123456"]})); + assert_eq!(group(&s), [(names[1].clone(), None), (names[2].clone(), Some("#123456".into()))]); + assert_eq!(gradient_at(&s, 0), fade); +} + +/// The paint of the swatch at place `i` of the group "Brand". +fn gradient_at(s: &Session, i: usize) -> vectorcraft_color::Paint { + s.doc().unwrap().doc.swatch_groups.iter().find(|g| g.name == "Brand").unwrap().swatches[i].paint.clone() +} + /// A row whose new color was removed keeps its art's colors: art in it linked to another swatch of /// the group, which the rewrite gives another color, loses the link instead of following it. #[test] diff --git a/crates/ui-egui/src/dialogs/recolor.rs b/crates/ui-egui/src/dialogs/recolor.rs index cfa699b7b9..b3cb557b61 100644 --- a/crates/ui-egui/src/dialogs/recolor.rs +++ b/crates/ui-egui/src/dialogs/recolor.rs @@ -3600,7 +3600,7 @@ mod tests { vectorcraft_color::Swatch { name: "Fade".into(), paint, global: false, spot: false } } - /// With art, the preview rewrites the group being edited, its other swatch included; Save + /// With art, the preview rewrites the group being edited and keeps its other swatch; Save /// Changes is still refused, as the group is without the preview, and Cancel leaves it as it was. #[test] fn saving_a_group_with_a_swatch_that_is_not_a_color_is_refused_while_previewing() { @@ -3623,8 +3623,9 @@ mod tests { d.fields.insert("rows".into(), Value::Array(rs)); frame(&mut app, &ctx, 0.1, vec![], 0); assert!(app.session.in_interaction(), "the art previews"); - let previewed = app.session.doc().unwrap().doc.swatch_groups.iter().find(|g| g.name == "Mixed").map(|g| g.swatches.len()); - assert_eq!(previewed, Some(2), "the preview's rewrite of the group leaves out its other swatch"); + let previewed = app.session.doc().unwrap().doc.swatch_groups.iter().find(|g| g.name == "Mixed").map(|g| g.swatches.clone()); + assert_eq!(previewed.as_ref().map(Vec::len), Some(3), "the preview's rewrite of the group keeps its other swatch"); + assert_eq!(previewed.and_then(|s| s.last().cloned()), Some(fade_swatch()), "with its paint"); let refused: Result<(), String> = Err("color group `Mixed` holds swatches that are not colors, which Save Changes can't keep".into()); assert_eq!(act(&mut app, &ctx, 0.2, "save"), refused); crate::dialogs::cancel(&mut app); diff --git a/docs/mcp.md b/docs/mcp.md index 655efa1b4c..7a65e100c6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5090,10 +5090,11 @@ moves a row's `tint` with its new color and removes it from a color it changes, step (art linked to its global swatches follows); a `null` in `colors` removes the group's swatch at that place, and given the group's own colors in order and no new name, it records no undo step. A color key (`recolor.colors`) that names a swatch's color, rounded to the key's steps, counts as that color, and the swatch keeps its color unrounded. And `recolor.apply` with `group` recolours the art and rewrites the -group together. A `null` in `groupColors` removes the group's swatch at that place, and the swatches after it keep -their colors and names; art linked to a removed global swatch keeps its color and is no longer linked to it. `"keep"` in -`groupColors` leaves the swatch at that place its color, without the Global Adjust; past the group's swatches it adds -nothing, and it is refused for a swatch that is not a color. Art linked to one of the group's global swatches stays linked when the swatch is rewritten with its +group together. The group's colors, from the rows or from `groupColors`, go to its color swatches in order; a gradient, +pattern or None swatch in the group keeps its place and its paint. A `null` in `groupColors` removes the color swatch at +that place, and the swatches after it keep their colors and names; art linked to a removed global swatch keeps its color +and is no longer linked to it. `"keep"` in `groupColors` leaves the color swatch at that place its color, without the +Global Adjust; past the group's color swatches it adds nothing. Art linked to one of the group's global swatches stays linked when the swatch is rewritten with its row's new color (the default without `groupColors` when the rows follow the group's order), so a later `swatch.edit` still reaches it; the reply's `relinked` counts the other linked paints that took the group's new colors. Art in a row that is linked to a swatch rewritten with another color keeps its row's new color, even an unchanged one, and is no longer From b4afcadc5ce4ec1176e491176f6bc43295d78b60 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:32:12 -0800 Subject: [PATCH 204/247] Object Mosaic: a size out of range stays when percentages switch Resize Using Percentages now checks the new size as it is before converting it. A width or height the command refuses (outside 0.1 to 1,000,000) stays, with the mode unchanged and the reason shown, even when the converted value would be in range, for example 0.05 pt of a 10 pt wide image, which is 0.5%. --- crates/ui-egui/src/dialogs/object_mosaic.rs | 37 ++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/dialogs/object_mosaic.rs b/crates/ui-egui/src/dialogs/object_mosaic.rs index eac36e9095..0ee49a194a 100644 --- a/crates/ui-egui/src/dialogs/object_mosaic.rs +++ b/crates/ui-egui/src/dialogs/object_mosaic.rs @@ -173,8 +173,8 @@ fn derived(d: &Dialog) -> Option<(&'static str, f64)> { /// Resize Using Percentages turned on or off: the new size shown the other way, so it stays the /// same size. When a size field does not hold a number, or a size the command takes (all but the -/// side Constrain Ratio sets) falls outside what the command accepts the other way, the fields and -/// the mode stay as they are and the dialog shows why. With no image selected, nothing changes and +/// side Constrain Ratio sets) falls outside what the command accepts either as it is or the other +/// way, the fields and the mode stay as they are and the dialog shows why. With no image selected, nothing changes and /// the dialog asks for one. fn switch_percentages(d: &mut Dialog, on: bool) { if d.bool(NO_IMAGE) { @@ -190,13 +190,19 @@ fn switch_percentages(d: &mut Dialog, on: bool) { return; } }; - let (w, h) = if on { (w / iw * 100.0, h / ih * 100.0) } else { (iw * w / 100.0, ih * h / 100.0) }; let skip = follower(d); - if let Some((key, v)) = [("width", w), ("height", h)].into_iter().find(|(k, v)| skip != Some(*k) && !SIZE_RANGE.contains(v)) { - let why = format!("`{key}` must be between {} and {} (got {v})", SIZE_RANGE.start(), SIZE_RANGE.end()); + let checked = |key: &str| skip != Some(key) || d.bool(&kept(key)); + let refused = |w: f64, h: f64| { + let (key, v) = [("width", w), ("height", h)].into_iter().find(|(k, v)| checked(k) && !SIZE_RANGE.contains(v))?; + Some(format!("`{key}` must be between {} and {} (got {v})", SIZE_RANGE.start(), SIZE_RANGE.end())) + }; + // A size the command refuses as it is stays refused, even when it falls in range the other way. + let converted = if on { (w / iw * 100.0, h / ih * 100.0) } else { (iw * w / 100.0, ih * h / 100.0) }; + if let Some(why) = refused(w, h).or_else(|| refused(converted.0, converted.1)) { d.fields.insert(form::REFUSED.into(), json!(why)); return; } + let (w, h) = converted; d.fields.remove(form::REFUSED); d.fields.remove(&kept("percentages")); d.fields.insert("width".into(), json!(w)); @@ -683,6 +689,27 @@ mod tests { assert_eq!(mosaic(&app), None); } + /// A size `ui.dialog.set` gave that the command refuses stays when Resize Using Percentages + /// switches, even when it is in range the other way (0.05 pt of a 10 pt wide image is 0.5%, and + /// 0.05% of a 1,000 pt wide image is 0.5 pt), with the mode unchanged and the reason shown, and + /// OK refuses it. + #[test] + fn a_size_out_of_range_stays_when_percentages_switch() { + for (scale, given, on) in [(10, json!({}), true), (1000, json!({"percentages": true}), false)] { + let mut app = app_with_image(); + app.run("object.scale", json!({"sx": scale, "sy": scale})).unwrap(); + open(&mut app, &given).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + crate::dialogs::set_field(d, "width".into(), json!(0.05)); + crate::dialogs::set_field(d, "percentages".into(), json!(on)); + assert_eq!((d.f64("width", 0.0), d.bool("percentages")), (0.05, !on), "{given}"); + assert!(d.str(form::REFUSED).contains("`width` must be between 0.1"), "{given}: {}", d.str(form::REFUSED)); + let e = crate::dialogs::confirm(&mut app).unwrap_err(); + assert!(e.contains("width"), "{given}: {e}"); + assert_eq!(mosaic(&app), None, "{given}"); + } + } + /// The image scaled from 100 × 50 pt to 200 × 100 pt while the dialog is open: Current Size shows /// the new size, and Resize Using Percentages, by `ui.dialog.set` or by its checkbox, converts /// New Size against it, so OK makes the size shown. With no image selected, switching is refused. From 692cb813ab00f006db903a8e2e734748d3ea114e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:33:08 -0800 Subject: [PATCH 205/247] Type: the toggles read typed text, and Cmd+Shift+= picks its command when it runs Superscript, Subscript and Underline apply the typing that Real-time Drawing off leaves unapplied before they read the text, so a pending Backspace counts when they decide whether to turn the format on or off. A Cmd+Shift+= press decides between Superscript and Zoom In when its command runs, after the commands of earlier presses in the same frame, so Cmd+A followed by Cmd+Shift+= applies Superscript to the text Select All selected. --- crates/ui-egui/src/panels/character.rs | 4 +++ crates/ui-egui/src/panels/character/tests.rs | 37 ++++++++++++++++++++ crates/ui-egui/src/shortcuts.rs | 19 +++++----- crates/ui-egui/src/shortcuts/tests.rs | 6 ++++ 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 3f72044ff1..1cb759fa69 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -540,6 +540,8 @@ pub(crate) fn highlight(app: &mut VectorcraftApp, field: Field) -> Result Result { + // The typing Real-time Drawing off left unapplied is applied before the text is read. + text_editing_kept(app)?; text_style(app).ok_or("select some type first")?; let on = shared(app, |s| s.underline) != Some(true); run_format(app, json!({"underline": on}))?; @@ -550,6 +552,8 @@ pub(crate) fn toggle_underline(app: &mut VectorcraftApp) -> Result Result { + // The typing Real-time Drawing off left unapplied is applied before the text is read. + text_editing_kept(app)?; text_style(app).ok_or("select some type first")?; let change = position_toggle(shared_position(app), position); let to = change["position"].clone(); diff --git a/crates/ui-egui/src/panels/character/tests.rs b/crates/ui-egui/src/panels/character/tests.rs index 7d74e5c022..c6e43871ad 100644 --- a/crates/ui-egui/src/panels/character/tests.rs +++ b/crates/ui-egui/src/panels/character/tests.rs @@ -628,6 +628,43 @@ fn superscript_and_subscript_decide_from_the_characters_they_change() { assert!(scripts(&app, &id).iter().all(|(_, p)| *p == "normal"), "{:?}", scripts(&app, &id)); } +/// With Real-time Drawing off, Superscript, Subscript and Underline decide from the text with the +/// typing applied: after a Backspace not yet applied takes out the one plain character, the rest +/// is all superscript (or underlined), so a press turns it off. +#[test] +fn superscript_and_underline_decide_from_the_text_with_the_typing_applied() { + for (command, set, off) in + [("type.superscript", json!({"position": "superscript"}), json!("normal")), ("type.underline", json!({"underline": true}), json!(false))] + { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + app.session.execute("prefs.set", &json!({"key": "realTimeDrawing", "value": false})).unwrap(); + let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "x2", "size": 12})).unwrap()["id"].clone(); + let mut range = set.clone(); + range["id"] = id.clone(); + range["start"] = json!(1); + range["end"] = json!(2); + app.run("text.setRangeStyle", range).unwrap(); + app.run("select.set", json!({"ids": [id.clone()]})).unwrap(); + app.select_tool("type"); + app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap(); + app.session.set_tool_option("select", &json!({"start": 1, "end": 1})); + let ctx = egui::Context::default(); + let backspace = + |pressed| egui::Event::Key { key: egui::Key::Backspace, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + let raw = egui::RawInput { events: vec![backspace(true), backspace(false)], ..Default::default() }; + ctx.run_ui(raw, |ui| crate::shortcuts::handle(&mut app, ui.ctx())).textures_delta.clear(); + assert_eq!(app.session.tool_options()["typing"], json!(true), "{command}"); + let node = |app: &VectorcraftApp| match &app.session.active().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().kind { + NodeKind::Text(t) => (t.plain_text(), t.runs.iter().map(|r| (r.style.position.id(), r.style.underline)).collect::>()), + _ => panic!("text"), + }; + assert_eq!(node(&app).0, "x2", "{command}: the Backspace is not applied yet"); + assert_eq!(app.run(command, json!({})).unwrap(), off, "{command}"); + assert_eq!(node(&app), ("2".to_string(), vec![("normal", false)]), "{command}"); + } +} + /// The panel menu's Small Caps, Superscript and Subscript set the selected type's small caps /// and position and show a check mark when on; Superscript and Subscript turn each other off. #[test] diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index db4e1bbd1e..e683560b70 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -374,7 +374,8 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) { !(chord.is_plain() && types_text(chord.key) && !shifted_punctuation || row_key(chord) || gesture_escape(chord)) }); let ran = !hits.is_empty(); - for c in hits { + for hit in hits { + let c = unshifted_when_dimmed(app, hit); run_hit(app, ctx, &c); if dialog_or_palette_open(app) { break; @@ -695,7 +696,8 @@ fn type_tool_input(app: &mut VectorcraftApp, ctx: &egui::Context, composing: boo // cut or paste after a deferred pointer or navigation notice is dropped there). Only chords // with the command key run commands: the rest type or edit. let hits = dispatch(app, ctx, |hit| hit.trigger.chord.mods.cmd); - for c in hits { + for hit in hits { + let c = unshifted_when_dimmed(app, hit); run_hit(app, ctx, &c); if dialog_or_palette_open(app) { break; @@ -990,8 +992,9 @@ fn claimed_tool_keys(app: &mut VectorcraftApp, ctx: &egui::Context, view: ViewIn } /// Runs this frame's key presses against the keymap in effect; `accept` declines a hit, leaving -/// its press (and the text it typed) to what follows. -fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&Hit) -> bool) -> Vec { +/// its press (and the text it typed) to what follows. Each hit's command is worked out with +/// [`unshifted_when_dimmed`] just before it runs, after the commands of the presses before it. +fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&Hit) -> bool) -> Vec { let mirror = crate::shortcut_editor::current(); let dispatcher = &mut app.dispatcher; ctx.input_mut(|i| { @@ -1034,22 +1037,20 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, accept: impl FnMut(&H } dispatcher.dispatch_filtered(i, &mirror.keymap, &Active::NONE, accept) }) - .into_iter() - .map(|h| unshifted_when_dimmed(app, &mirror.keymap, h)) - .collect() } /// The command a hit runs. A Shift+`=` chord whose command is dimmed runs what the same chord /// without Shift runs, when that is bound: Cmd+Shift+= (Superscript) zooms in, as Cmd+= does, /// while no type is selected. -fn unshifted_when_dimmed(app: &VectorcraftApp, keymap: &craft_keymap::Keymap, hit: Hit) -> CommandRef { +fn unshifted_when_dimmed(app: &VectorcraftApp, hit: Hit) -> CommandRef { + let mirror = crate::shortcut_editor::current(); let chord = hit.trigger.chord; if chord.key == craft_keymap::Key::Equals && chord.mods.shift && !hit.trigger.double && !crate::menus::enabled(app, &hit.command.id) && let Some(unshifted) = - crate::keymap::lookup(keymap, &craft_keymap::Chord::new(craft_keymap::Mods { shift: false, ..chord.mods }, chord.key)) + crate::keymap::lookup(&mirror.keymap, &craft_keymap::Chord::new(craft_keymap::Mods { shift: false, ..chord.mods }, chord.key)) { return unshifted; } diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index 56038d3105..c41bd10c44 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -1156,6 +1156,12 @@ fn cmd_shift_equals_and_cmd_alt_shift_equals_toggle_superscript_and_subscript() assert!(zoom(&mut app) > before, "{key:?} with Cmd+Shift zooms in"); } assert!(subscript(&mut app), "{:?}", positions(&mut app)); + // Cmd+A and Cmd+Shift+= in one frame: Select All runs first, so Cmd+Shift+= applies + // Superscript to the text it selected instead of zooming in. + let before = zoom(&mut app); + frame(&mut app, [press(Key::A, Modifiers::NONE), press(Key::Equals, shift)].concat()); + assert_eq!(zoom(&mut app), before, "no zoom once Select All selected the type"); + assert!(positions(&mut app).iter().all(|(_, p)| *p == json!("superscript")), "{:?}", positions(&mut app)); } /// Tab shows and hides the panels, and in the Type tool it types a tab, without moving the From 06e8ce62b950128190951d135b68bea6141faa32 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:07:47 +0530 Subject: [PATCH 206/247] M7/G4: retype matching reads contours as drawn, checks whole outlines (#4934) Contours are read from a starting corner that does not depend on where the path starts (every tied corner tried), with straight edges split in two, degenerate curves and empty segments read as one line. A sampled fit only shortlists a glyph: its whole outline, turned onto the shape, must lie on it. Face keys are compact hashes, kept per process within a budget; kept keys stay when new ones do not fit, and go when fonts are added or rescanned. A compound path with a locked or hidden part stays whole. A group with an Attributes note, or any other extra, keeps its type inside. Faces are counted once against the cap, and no font is read when every shape stays an outline. --- crates/engine/src/cmd/retype.rs | 28 +- crates/engine/src/cmd/retype_tests.rs | 46 +++ crates/text/src/retype.rs | 434 +++++++++++++++++++++----- 3 files changed, 417 insertions(+), 91 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 28a74ac6a9..df0d88a489 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -100,7 +100,8 @@ fn collect(n: &Node, parent: Option, depth: usize, barrier: &mut bool, t let mut path = BezPath::new(); for c in children { match &c.kind { - NodeKind::Path { path: p, .. } if p.is_closed() => path.extend(p.to_bezpath()), + // A hidden or locked path keeps its whole compound as it is. + NodeKind::Path { path: p, .. } if p.is_closed() && c.visible && !c.locked => path.extend(p.to_bezpath()), _ => { *barrier = true; return; @@ -140,12 +141,21 @@ fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec= cap { break 'families; } - if let Some(face) = db.face(f, &style) { + if let Some(face) = db.face(f, &style) + && !faces.iter().any(|k: &Arc| k.id() == face.id()) + { faces.push(face); } } } - faces.extend(db.loaded_faces().into_iter().take(cap.saturating_sub(faces.len()))); + for face in db.loaded_faces() { + if faces.len() >= cap { + break; + } + if !faces.iter().any(|k| k.id() == face.id()) { + faces.push(face); + } + } faces } @@ -376,9 +386,10 @@ fn retype(s: &mut Session, p: &Value) -> Result { } // Only glyphs with a selected shape's key (segments per contour) can match one: the others are // not sampled. - let wanted: std::collections::BTreeSet> = + let wanted: std::collections::BTreeSet = pieces.iter().filter(|pc| !pc.keeps_outline).filter_map(|pc| vectorcraft_text::retype::shape_key(&pc.path)).collect(); - let index = RetypeIndex::build(db, candidate_faces(db, d, &fonts), &wanted); + // Nothing to match (every shape stays an outline): no font is read. + let index = if wanted.is_empty() { RetypeIndex::default() } else { RetypeIndex::build(db, candidate_faces(db, d, &fonts), &wanted) }; let found: Vec> = pieces.iter().map(|pc| if pc.keeps_outline { vec![] } else { index.matches(&pc.path) }).collect(); // The face most shapes match, so a glyph several fonts share is set in the same font as // the glyphs around it. @@ -462,7 +473,12 @@ fn retype(s: &mut Session, p: &Value) -> Result { && n.blend == vectorcraft_color::BlendMode::Normal && *n.appearance == Appearance::default() && n.name.is_none() - && n.extras().mask.is_none() + // Its mask, Attributes note and the rest of what few objects have stay with it. + && { + let mut ex = n.extras().clone(); + ex.type_outlines = false; + ex == vectorcraft_doc::NodeExtras::default() + } // Isolation and knockout change how the group composites its type. && !n.isolate && n.knockout == vectorcraft_doc::Knockout::default() diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index cbbf1e0302..7812fc8e65 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -411,3 +411,49 @@ fn timing_with_a_large_cjk_face() { s.execute("edit.undo", &json!({})).unwrap(); } } + +#[test] +fn a_compound_with_a_locked_or_hidden_part_stays_whole() { + let mut s = session(); + // "B" outlines as a compound path of three contours. + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + let b = children_of(&s, g)[1]; + let part = children_of(&s, b)[1]; + s.edit("test", |d, _| { + d.node_mut(NodeId(part)).unwrap().locked = true; + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["A"]), "{r}"); + let d = &s.doc().unwrap().doc; + assert!(d.node(NodeId(part)).unwrap().locked, "B's locked part, and B, stay as they are"); +} + +#[test] +fn a_group_with_an_attributes_note_keeps_its_type_inside() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); + s.execute("attributes.set", &json!({"ids": [g], "note": "logo, keep"})).unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + let id = r["ids"][0].as_u64().unwrap(); + assert_eq!(children_of(&s, g), vec![id], "the group and its note stay, holding the type"); +} + +#[test] +fn nothing_retypable_reads_no_font() { + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "A", "size": 40})); + let a = children_of(&s, g)[0]; + s.edit("test", |d, _| { + let art = vectorcraft_doc::Node::path(d.alloc_id(), vectorcraft_geom::PathData::default(), Default::default()); + d.node_mut(NodeId(a)).unwrap().extras_mut().mask = Some(Box::new(vectorcraft_doc::OpacityMask::new(art, true))); + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let e = s.execute("type.retype", &json!({})).unwrap_err().to_string(); + assert!(e.contains("(1 checked)"), "the masked shape is reported, and no font was indexed: {e}"); +} diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 30a640c3c7..80fed5f33a 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -1,18 +1,20 @@ //! Retype's glyph matching (Type › Retype, #4934): which glyph of which loaded font an outlined //! glyph's shape is, the same up to uniform scale, rotation and translation. //! -//! Phase 1 is exact matching only: a shape matches a glyph when, after the best similarity -//! transform (a Procrustes fit over points sampled at equal steps of arc length along each -//! contour), the leftover distance is a tiny fraction of the shape's size. That holds for outlines -//! made from a font the app has (Create Outlines' output, and other apps' that keep each glyph's -//! contours whole and in the font's order). Near matches (other versions of a font, hinted or -//! simplified outlines, faux styles, glyphs merged into one path) are left unmatched; fuzzy -//! identification is phase 2. +//! Phase 1 is exact matching only. Each contour is read from a starting corner that does not +//! depend on where the path happens to start (the corner farthest from the shape's corners' +//! centre; every such corner is tried when several tie), with straight edges split in two read as +//! one. Points sampled at equal steps of arc length along the contours shortlist the glyphs whose +//! best similarity transform (a Procrustes fit) leaves a tiny leftover distance, and the whole +//! outline, turned onto the shape, must then lie on it. That holds for outlines made from a font +//! the app has (Create Outlines' output, and other apps' that keep each glyph's contours whole and +//! in the font's order). Near matches (other versions of a font, hinted or simplified outlines, +//! faux styles, glyphs merged into one path) are left unmatched; fuzzy identification is phase 2. -use std::collections::HashMap; +use std::collections::{BTreeSet, HashMap}; use std::sync::Arc; -use kurbo::{BezPath, CubicBez, Line, ParamCurve, ParamCurveArclen, PathEl, PathSeg, Point, QuadBez, Shape}; +use kurbo::{Affine, BezPath, CubicBez, Line, ParamCurve, ParamCurveArclen, ParamCurveNearest, PathEl, PathSeg, Point, QuadBez, Shape}; use crate::{FontDb, FontFace}; @@ -28,9 +30,16 @@ pub const MAX_ELEMENTS: usize = 4096; const MAX_CONTOURS: usize = 48; /// Points sampled along each contour. const SAMPLES: usize = 32; +/// The most readings of a shape (one per choice of tied starting corners) that are tried. +const MAX_VARIANTS: usize = 64; /// The largest leftover distance (root mean square over the samples) for a match, as a fraction of /// the shape's spread about its centre. const TOLERANCE: f64 = 2e-3; +/// How far the whole outline, turned onto the shape, may lie from it (both ways), as a fraction of +/// the shape's spread. +const OUTLINE_TOLERANCE: f64 = 5e-3; +/// Points of a flattened outline past which the whole-outline check gives up (and so rejects). +const MAX_OUTLINE_POINTS: usize = 8192; /// How far apart two shapes' spread-to-length ratios may be and still be compared. const INVARIANT_SLACK: f64 = 0.02; @@ -70,9 +79,12 @@ struct Entry { gid: u32, ch: char, sig: Signature, + /// The glyph's outline in font units, for the whole-outline check. + outline: BezPath, } /// The glyphs of a set of faces, ready to match shapes against. +#[derive(Default)] pub struct RetypeIndex { faces: Vec>, entries: Vec, @@ -81,11 +93,11 @@ pub struct RetypeIndex { } impl RetypeIndex { - /// Index the outline glyphs of `faces` (the first [`MAX_FACES`], each face once) that have one - /// of the shape keys in `keys` (the selected shapes' [`shape_key`]s): the others could match no - /// shape, so they are not sampled. Outlines are read past the shared outline - /// cache, which keeps the canvas's glyphs. - pub fn build(db: &FontDb, faces: impl IntoIterator>, keys: &std::collections::BTreeSet>) -> Self { + /// Index the outline glyphs of `faces` (the first [`MAX_FACES`], each face once) whose + /// [`shape_key`] is in `keys` (the selected shapes' keys): the others could match no shape, so + /// they are not sampled. Outlines are read past the shared outline cache, which keeps the + /// canvas's glyphs. + pub fn build(db: &FontDb, faces: impl IntoIterator>, keys: &BTreeSet) -> Self { let mut kept: Vec> = vec![]; for f in faces { if kept.len() >= MAX_FACES { @@ -96,22 +108,18 @@ impl RetypeIndex { } } let mut entries = vec![]; - for (fi, face) in kept.iter().enumerate() { - if entries.len() >= MAX_GLYPHS { - break; - } - for (gid, ch, key) in face_keys(db, face).iter() { + 'faces: for (fi, face) in kept.iter().enumerate() { + for &(gid, ch, key) in face_keys(db, face).iter() { // The budget holds inside a face too: no glyph is sampled past it. if entries.len() >= MAX_GLYPHS { - break; + break 'faces; } - if !keys.contains(key) { + if !keys.contains(&key) { continue; } - let (gid, ch) = (*gid, *ch); let outline = db.outline_uncached(face, gid); - if let Some(sig) = signature(&outline) { - entries.push(Entry { face: fi, gid, ch, sig }); + if let Some(sig) = signatures(&outline, false).into_iter().next() { + entries.push(Entry { face: fi, gid, ch, sig, outline }); } } } @@ -145,10 +153,11 @@ impl RetypeIndex { /// The glyphs `shape` (in document space) is, the closest one per face, closest first; empty /// when it is no glyph of the indexed faces. pub fn matches(&self, shape: &BezPath) -> Vec { - let Some(sig) = signature(shape) else { return vec![] }; - let Some(list) = self.buckets.get(&sig.contours) else { return vec![] }; - let lo = sig.invariant * (1.0 - INVARIANT_SLACK); - let hi = sig.invariant * (1.0 + INVARIANT_SLACK); + let variants = signatures(shape, true); + let Some(first) = variants.first() else { return vec![] }; + let Some(list) = self.buckets.get(&first.contours) else { return vec![] }; + let lo = first.invariant * (1.0 - INVARIANT_SLACK); + let hi = first.invariant * (1.0 + INVARIANT_SLACK); let start = list.partition_point(|i| self.entries.get(*i).is_some_and(|e| e.sig.invariant < lo)); let mut best: HashMap = HashMap::new(); for i in list.iter().skip(start) { @@ -156,7 +165,11 @@ impl RetypeIndex { if e.sig.invariant > hi { break; } - let Some((z, residual)) = fit(&e.sig, &sig) else { continue }; + // The reading of the shape (its tied starting corners) that fits the glyph best. + let Some((sig, z, residual)) = variants.iter().filter_map(|s| fit(&e.sig, s).map(|(z, r)| (s, z, r))).min_by(|a, b| a.2.total_cmp(&b.2)) + else { + continue; + }; if residual > TOLERANCE { continue; } @@ -164,6 +177,12 @@ impl RetypeIndex { // The glyph's origin is (0, 0) in font units: it lands at centre − z·glyph centre. let gc = mul(z, e.sig.centre); let origin = Point::new(sig.centre.x - gc.x, sig.centre.y - gc.y); + // The samples can step over a detail (a notch between two of them): the whole outline, + // turned onto the shape, must lie on it. + let onto = Affine::new([z.0, z.1, -z.1, z.0, origin.x, origin.y]); + if !outlines_agree(&(onto * e.outline.clone()), shape, sig.spread * OUTLINE_TOLERANCE) { + continue; + } let m = GlyphMatch { face: face.clone(), gid: e.gid, @@ -189,20 +208,36 @@ impl RetypeIndex { /// A face's glyphs as the index looks them up: (glyph, character, [`shape_key`]), one per glyph /// under the lowest character that maps to it. -type FaceKeys = Arc)>>; +type FaceKeys = Arc>; -/// How many faces' keys [`face_keys`] keeps. -const KEPT_FACE_KEYS: usize = 32; +/// How many glyph keys [`face_keys`] keeps in all (16 bytes each). +const KEPT_KEYS: usize = 1 << 20; + +/// The faces' keys [`face_keys`] keeps, for the database generation they were read in. +#[derive(Default)] +struct KeptKeys { + generation: u64, + glyphs: usize, + faces: HashMap<(u64, u32), FaceKeys>, +} /// [`FaceKeys`] of `face`, worked out once per face (each glyph drawn once, past the outline -/// cache) and kept: a later Retype samples only the glyphs whose key a selected shape has. +/// cache) and kept: a later Retype samples only the glyphs whose key a selected shape has. Keys +/// already kept stay while new faces' keys would not fit, so a run over more faces than fit still +/// finds the same ones kept the next time; they are let go when fonts are added or rescanned. fn face_keys(db: &FontDb, face: &FontFace) -> FaceKeys { - type Kept = std::sync::Mutex>; - static KEPT: std::sync::OnceLock = std::sync::OnceLock::new(); + static KEPT: std::sync::OnceLock> = std::sync::OnceLock::new(); let kept = KEPT.get_or_init(Default::default); let at = (db.id(), face.id()); - if let Some(k) = kept.lock().unwrap_or_else(|e| e.into_inner()).get(&at) { - return k.clone(); + let generation = db.generation(); + { + let mut k = kept.lock().unwrap_or_else(|e| e.into_inner()); + if k.generation != generation { + *k = KeptKeys { generation, ..Default::default() }; + } + if let Some(keys) = k.faces.get(&at) { + return keys.clone(); + } } let mut by_gid: HashMap = HashMap::new(); for &(c, gid) in face.mapped_chars().iter().take(MAX_GLYPHS_PER_FACE) { @@ -214,11 +249,11 @@ fn face_keys(db: &FontDb, face: &FontFace) -> FaceKeys { let mut gids: Vec<(u32, char)> = by_gid.into_iter().collect(); gids.sort_unstable(); let keys: FaceKeys = Arc::new(gids.into_iter().filter_map(|(gid, ch)| Some((gid, ch, shape_key(&db.outline_uncached(face, gid))?))).collect()); - let mut kept = kept.lock().unwrap_or_else(|e| e.into_inner()); - if kept.len() >= KEPT_FACE_KEYS { - kept.clear(); + let mut k = kept.lock().unwrap_or_else(|e| e.into_inner()); + if k.generation == generation && k.glyphs + keys.len() <= KEPT_KEYS { + k.glyphs += keys.len(); + k.faces.insert(at, keys.clone()); } - kept.insert(at, keys.clone()); keys } @@ -264,7 +299,68 @@ fn fit(g: &Signature, s: &Signature) -> Option<((f64, f64), f64)> { rel.is_finite().then_some((z, rel)) } -/// `path`'s contours as segments, the closing line included; `None` past the size caps. +/// Do outlines `a` and `b` (in one space) lie on each other: every point of each, flattened, within +/// `tol` of the other? `false` when either is too large to check. +fn outlines_agree(a: &BezPath, b: &BezPath, tol: f64) -> bool { + if !tol.is_finite() || tol <= 0.0 { + return false; + } + let flat = |p: &BezPath| -> Option> { + let mut segs = vec![]; + let (mut start, mut last) = (Point::ZERO, Point::ZERO); + let mut too_many = false; + kurbo::flatten(p.iter(), tol / 4.0, |el| { + if segs.len() > MAX_OUTLINE_POINTS { + too_many = true; + return; + } + match el { + PathEl::MoveTo(q) => (start, last) = (q, q), + PathEl::LineTo(q) => { + segs.push((last, q)); + last = q; + } + PathEl::ClosePath => { + segs.push((last, start)); + last = start; + } + _ => {} + } + }); + (!too_many).then_some(segs) + }; + let (Some(sa), Some(sb)) = (flat(a), flat(b)) else { return false }; + let near = |p: Point, segs: &[(Point, Point)]| segs.iter().any(|(s, e)| Line::new(*s, *e).nearest(p, 1e-9).distance_sq <= tol * tol); + sa.iter().all(|(p, _)| near(*p, &sb)) && sb.iter().all(|(p, _)| near(*p, &sa)) +} + +/// `seg` as a line when it is one (a curve with its handles on its ends or on its line), else as it is. +fn as_line(seg: PathSeg) -> PathSeg { + let on_line = |a: Point, b: Point, p: Point| { + let ab = b - a; + let len = ab.hypot(); + len > 0.0 && (ab.cross(p - a)).abs() <= len * len * 1e-12 && (p - a).dot(ab) >= 0.0 && (p - b).dot(ab) <= 0.0 + }; + match seg { + PathSeg::Quad(q) if q.p1 == q.p0 || q.p1 == q.p2 || on_line(q.p0, q.p2, q.p1) => PathSeg::Line(Line::new(q.p0, q.p2)), + PathSeg::Cubic(c) if (c.p1 == c.p0 || on_line(c.p0, c.p3, c.p1)) && (c.p2 == c.p3 || on_line(c.p0, c.p3, c.p2)) => { + PathSeg::Line(Line::new(c.p0, c.p3)) + } + s => s, + } +} + +/// Lines `a` then `b` run on in one direction: one edge split in two. +fn runs_on(a: &PathSeg, b: &PathSeg) -> bool { + let (PathSeg::Line(a), PathSeg::Line(b)) = (a, b) else { return false }; + let (u, v) = (a.p1 - a.p0, b.p1 - b.p0); + let (lu, lv) = (u.hypot(), v.hypot()); + lu > 0.0 && lv > 0.0 && u.cross(v).abs() <= lu * lv * 1e-9 && u.dot(v) > 0.0 +} + +/// `path`'s contours as segments, the closing line included, read the same however the path was +/// written: segments that go nowhere are dropped, curves that are straight read as lines, and a +/// straight edge split in two (around the start too) reads as one. `None` past the size caps. fn contours(path: &BezPath) -> Option>> { if path.elements().len() > MAX_ELEMENTS { return None; @@ -272,9 +368,29 @@ fn contours(path: &BezPath) -> Option>> { let mut out: Vec> = vec![]; let mut cur: Vec = vec![]; let (mut start, mut last) = (Point::ZERO, Point::ZERO); - let mut flush = |cur: &mut Vec, start: Point, last: Point| { + let push = |cur: &mut Vec, seg: PathSeg| { + let seg = as_line(seg); + if seg.start() == seg.end() && matches!(seg, PathSeg::Line(_)) { + return; + } + match cur.last_mut() { + Some(prev) if runs_on(prev, &seg) => *prev = PathSeg::Line(Line::new(prev.start(), seg.end())), + _ => cur.push(seg), + } + }; + let flush = |cur: &mut Vec, start: Point, last: Point, out: &mut Vec>| { if last.distance(start) > 0.0 { - cur.push(PathSeg::Line(Line::new(last, start))); + push(cur, PathSeg::Line(Line::new(last, start))); + } + // An edge split at the contour's start: its two halves are the last and first segments. + if cur.len() > 1 + && let (Some(l), Some(f)) = (cur.last().copied(), cur.first().copied()) + && runs_on(&l, &f) + { + cur.pop(); + if let Some(first) = cur.first_mut() { + *first = PathSeg::Line(Line::new(l.start(), f.end())); + } } if !cur.is_empty() { out.push(std::mem::take(cur)); @@ -283,74 +399,135 @@ fn contours(path: &BezPath) -> Option>> { for el in path.elements() { match *el { PathEl::MoveTo(p) => { - flush(&mut cur, start, last); + flush(&mut cur, start, last, &mut out); start = p; last = p; } PathEl::LineTo(p) => { - cur.push(PathSeg::Line(Line::new(last, p))); + push(&mut cur, PathSeg::Line(Line::new(last, p))); last = p; } PathEl::QuadTo(a, p) => { - cur.push(PathSeg::Quad(QuadBez::new(last, a, p))); + push(&mut cur, PathSeg::Quad(QuadBez::new(last, a, p))); last = p; } PathEl::CurveTo(a, b, p) => { - cur.push(PathSeg::Cubic(CubicBez::new(last, a, b, p))); + push(&mut cur, PathSeg::Cubic(CubicBez::new(last, a, b, p))); last = p; } PathEl::ClosePath => { - flush(&mut cur, start, last); + flush(&mut cur, start, last, &mut out); last = start; } } + if out.len() > MAX_CONTOURS { + return None; + } } - flush(&mut cur, start, last); + flush(&mut cur, start, last, &mut out); (out.len() <= MAX_CONTOURS).then_some(out) } -/// How many contours with length `path` has, as matching counts them; `None` past the size caps. /// A cheap key two shapes share when one is the other scaled, turned and moved: how many segments -/// each of its contours has, in order (segments that go nowhere left out, a closing line counted -/// once whether the path draws it or closes onto it). Glyphs whose key no selected shape has are -/// not sampled. `None` past the size caps. -pub fn shape_key(path: &BezPath) -> Option> { - let moves = |s: &PathSeg| match s { - PathSeg::Line(l) => l.p0 != l.p1, - PathSeg::Quad(q) => q.p0 != q.p1 || q.p1 != q.p2, - PathSeg::Cubic(c) => c.p0 != c.p1 || c.p1 != c.p2 || c.p2 != c.p3, - }; - let key: Vec = contours(path)?.iter().map(|c| c.iter().filter(|s| moves(s)).count()).filter(|n| *n > 0).collect(); - (!key.is_empty()).then_some(key) +/// each of its contours has, in order, as [`contours`] reads them, hashed. Glyphs whose key no +/// selected shape has are not sampled. `None` past the size caps or for an empty shape. +pub fn shape_key(path: &BezPath) -> Option { + let cs = contours(path)?; + if cs.is_empty() { + return None; + } + // FNV-1a over the counts: equal keys for equal counts; a rare clash only samples a glyph more. + let mut h: u64 = 0xcbf2_9ce4_8422_2325; + for n in std::iter::once(cs.len()).chain(cs.iter().map(Vec::len)) { + for b in (n as u64).to_le_bytes() { + h ^= u64::from(b); + h = h.wrapping_mul(0x0000_0100_0000_01b3); + } + } + Some(h) } -fn signature(path: &BezPath) -> Option { +/// `path` read for matching: one reading per choice of starting corners (the corner of each contour +/// farthest from the centre of all the shape's corners; every tied corner when `all_ties`, else the +/// first), at most [`MAX_VARIANTS`]. Empty for a shape with nothing to match. +fn signatures(path: &BezPath, all_ties: bool) -> Vec { let bounds = path.bounding_box(); let size = bounds.width().hypot(bounds.height()); if !size.is_finite() || size <= 0.0 { - return None; + return vec![]; } let accuracy = size * 1e-6; - let mut pts = vec![]; - let mut total = 0.0; - let mut contours_n = 0; - for c in contours(path)? { - let lens: Vec = c.iter().map(|s| s.arclen(accuracy)).collect(); - let len: f64 = lens.iter().sum(); - // A contour with no length (a lone move) draws nothing. - if !len.is_finite() || len <= size * 1e-9 { - continue; + let Some(cs) = contours(path) else { return vec![] }; + // Each contour with length, with its segments' lengths. + let cs: Vec<(Vec, Vec)> = cs + .into_iter() + .map(|c| { + let lens: Vec = c.iter().map(|s| s.arclen(accuracy)).collect(); + (c, lens) + }) + .filter(|(_, lens)| { + let len: f64 = lens.iter().sum(); + len.is_finite() && len > size * 1e-9 + }) + .collect(); + let corners: Vec = cs.iter().flat_map(|(c, _)| c.iter().map(|s| s.start())).collect(); + if corners.is_empty() { + return vec![]; + } + let n = corners.len() as f64; + let mid = Point::new(corners.iter().map(|p| p.x).sum::() / n, corners.iter().map(|p| p.y).sum::() / n); + // Each contour's starting corners: those farthest from `mid`, ties within a hair. + let starts: Vec> = cs + .iter() + .map(|(c, _)| { + let d: Vec = c.iter().map(|s| s.start().distance(mid)).collect(); + let far = d.iter().copied().fold(0.0, f64::max); + let tied: Vec = d.iter().enumerate().filter(|(_, v)| **v >= far - size * 1e-7).map(|(i, _)| i).collect(); + if all_ties { tied } else { tied.into_iter().take(1).collect() } + }) + .collect(); + let mut out = vec![]; + let mut pick = vec![0usize; cs.len()]; + loop { + if out.len() >= MAX_VARIANTS { + break; } - total += len; - contours_n += 1; - let (mut si, mut before) = (0usize, 0.0); - for k in 0..SAMPLES { - let at = len * k as f64 / SAMPLES as f64; - while si + 1 < c.len() && before + lens.get(si).copied().unwrap_or(0.0) < at { - before += lens.get(si).copied().unwrap_or(0.0); - si += 1; + if let Some(sig) = sample(&cs, &starts, &pick, accuracy) { + out.push(sig); + } + // The next choice of tied corners (a counter in mixed radix). + let mut i = 0; + loop { + let Some((p, s)) = pick.get_mut(i).zip(starts.get(i)) else { return out }; + *p += 1; + if *p < s.len() { + break; } - let (Some(seg), Some(l)) = (c.get(si), lens.get(si)) else { return None }; + *p = 0; + i += 1; + } + } + out +} + +/// One reading of the contours `cs`, contour `i` starting at segment `starts[i][pick[i]]`. +fn sample(cs: &[(Vec, Vec)], starts: &[Vec], pick: &[usize], accuracy: f64) -> Option { + let mut pts = Vec::with_capacity(cs.len() * SAMPLES); + let mut total = 0.0; + for (((c, lens), s), p) in cs.iter().zip(starts).zip(pick) { + let from = *s.get(*p)?; + let m = c.len(); + let len: f64 = lens.iter().sum(); + total += len; + let (mut k, mut before) = (0usize, 0.0); + let at_k = |k: usize| (from + k) % m; + for j in 0..SAMPLES { + let at = len * j as f64 / SAMPLES as f64; + while k + 1 < m && before + lens.get(at_k(k)).copied().unwrap_or(0.0) < at { + before += lens.get(at_k(k)).copied().unwrap_or(0.0); + k += 1; + } + let (Some(seg), Some(l)) = (c.get(at_k(k)), lens.get(at_k(k))) else { return None }; let t = if *l > 0.0 { seg.inv_arclen((at - before).clamp(0.0, *l), accuracy) } else { 0.0 }; pts.push(seg.eval(t)); } @@ -364,16 +541,21 @@ fn signature(path: &BezPath) -> Option { *p = Point::new(p.x - centre.x, p.y - centre.y); } let spread = (pts.iter().map(|p| p.x * p.x + p.y * p.y).sum::() / n).sqrt(); - if !spread.is_finite() || spread <= 0.0 { + if !spread.is_finite() || spread <= 0.0 || !total.is_finite() || total <= 0.0 { return None; } - Some(Signature { contours: contours_n, pts, centre, spread, invariant: spread / total }) + Some(Signature { contours: cs.len(), pts, centre, spread, invariant: spread / total }) +} + +/// The first reading of `path` (for tests). +#[cfg(test)] +fn signature(path: &BezPath) -> Option { + signatures(path, false).into_iter().next() } #[cfg(test)] mod tests { use super::*; - use kurbo::Affine; fn letter() -> BezPath { // A hand-made "P"-like shape: an outer contour and a counter. @@ -464,4 +646,86 @@ mod tests { } assert!(signature(&huge).is_none()); } + + /// The best fit of `shape`'s readings onto `glyph`'s first one. + fn best_fit(glyph: &BezPath, shape: &BezPath) -> f64 { + let g = signature(glyph).unwrap(); + signatures(shape, true).iter().filter_map(|s| fit(&g, s)).map(|(_, r)| r).fold(f64::INFINITY, f64::min) + } + + #[test] + fn a_contour_started_at_another_corner_still_matches() { + // The counter of letter(), started at its second corner instead of its first. + let mut p = BezPath::new(); + p.move_to((0.0, 0.0)); + p.line_to((0.0, -700.0)); + p.curve_to((300.0, -700.0), (450.0, -600.0), (450.0, -480.0)); + p.quad_to((450.0, -300.0), (120.0, -300.0)); + p.line_to((120.0, 0.0)); + p.close_path(); + p.move_to((120.0, -400.0)); + p.quad_to((330.0, -400.0), (330.0, -500.0)); + p.quad_to((330.0, -600.0), (120.0, -600.0)); + p.line_to((120.0, -400.0)); + p.close_path(); + let shape = Affine::translate((40.0, 90.0)) * Affine::rotate(-1.1) * Affine::scale(0.03) * p; + assert_eq!(shape_key(&shape), shape_key(&letter())); + assert!(best_fit(&letter(), &shape) < 1e-6); + // A triangle started at each of its corners. + let tri = |a: (f64, f64), b: (f64, f64), c: (f64, f64)| { + let mut t = BezPath::new(); + t.move_to(a); + t.line_to(b); + t.line_to(c); + t.close_path(); + t + }; + let g = tri((0.0, 0.0), (300.0, 0.0), (0.0, -400.0)); + for s in [tri((300.0, 0.0), (0.0, -400.0), (0.0, 0.0)), tri((0.0, -400.0), (0.0, 0.0), (300.0, 0.0))] { + assert!(best_fit(&g, &s) < 1e-6); + } + } + + #[test] + fn an_edge_split_in_two_reads_as_one() { + let mut p = BezPath::new(); + p.move_to((0.0, 0.0)); + p.line_to((0.0, -350.0)); + p.line_to((0.0, -700.0)); + p.curve_to((300.0, -700.0), (450.0, -600.0), (450.0, -480.0)); + p.quad_to((450.0, -300.0), (120.0, -300.0)); + p.line_to((120.0, 0.0)); + p.line_to((60.0, 0.0)); + p.close_path(); + p.move_to((120.0, -600.0)); + p.line_to((120.0, -400.0)); + p.quad_to((330.0, -400.0), (330.0, -500.0)); + p.quad_to((330.0, -600.0), (120.0, -600.0)); + p.close_path(); + assert_eq!(shape_key(&p), shape_key(&letter()), "split edges, the closing one too, read as one"); + assert!(best_fit(&letter(), &p) < 1e-6); + } + + #[test] + fn a_detail_between_samples_fails_the_whole_outline_check() { + let bar = |notch: f64| { + let mut p = BezPath::new(); + p.move_to((0.0, 0.0)); + p.line_to((1000.0, 0.0)); + p.line_to((1000.0, -100.0)); + // A notch 2 units wide, in or out, between two samples along the top edge. + p.line_to((501.0, -100.0)); + p.line_to((501.0, -100.0 + notch)); + p.line_to((499.0, -100.0 + notch)); + p.line_to((499.0, -100.0)); + p.line_to((0.0, -100.0)); + p.close_path(); + p + }; + let (out, inn) = (bar(-10.0), bar(10.0)); + assert_eq!(shape_key(&out), shape_key(&inn), "same key"); + let tol = signature(&inn).unwrap().spread * OUTLINE_TOLERANCE; + assert!(!outlines_agree(&out, &inn, tol), "the whole outline does"); + assert!(outlines_agree(&out, &out, tol)); + } } From 60ecfd7aed35116c0fb0eec874f24ef02aff0293 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:38:48 -0800 Subject: [PATCH 207/247] Selection: a press on a group member with every anchor selected moves it select.anchors and select.key leave a path with all of its anchors in the selection's anchor map. The Selection tool's check for a selected member under the pointer read any anchor entry as a partial selection, so a press on such a member selected the outer group instead of moving the member. The check now counts a member as selected whole when its anchor entry holds every anchor of the path. --- crates/tools/src/select.rs | 8 +++++++- crates/tools/src/select/tests.rs | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 700c045d3f..5cdefd559a 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -1380,11 +1380,17 @@ fn object_behind(cx: &ToolContext, p: Point) -> Option { /// object selected whole between it and the art under the pointer, such as members of a group /// picked with Group Selection. A press there keeps the selection and a drag moves it (#8047). A /// member with only some anchors or segments selected does not count: the press selects `top`. +/// A member with every anchor selected (as `select.anchors` and `select.key` leave a path) counts. fn selected_under(cx: &ToolContext, h: &Hit, top: NodeId) -> Option { if cx.selection.contains(top) { return Some(top); } - let whole = |id: NodeId| cx.selection.contains(id) && cx.selection.partial(id).is_none() && !cx.selection.segments.contains_key(&id); + let every_anchor = |id: NodeId| { + cx.selection + .partial(id) + .is_none_or(|picked| cx.doc.node(id).and_then(|n| n.path_data()).is_some_and(|p| p.anchors().all(|(s, i, _)| picked.contains(&(s, i))))) + }; + let whole = |id: NodeId| cx.selection.contains(id) && every_anchor(id) && !cx.selection.segments.contains_key(&id); let below = h.ancestry.iter().position(|id| *id == top).map_or(&[][..], |i| h.ancestry.get(i..).unwrap_or_default()); below.iter().copied().chain(std::iter::once(h.leaf)).find(|id| whole(*id)) } diff --git a/crates/tools/src/select/tests.rs b/crates/tools/src/select/tests.rs index a8e1f8acee..d7ff7a3a90 100644 --- a/crates/tools/src/select/tests.rs +++ b/crates/tools/src/select/tests.rs @@ -2829,4 +2829,12 @@ fn a_press_on_a_selected_member_of_a_group_moves_the_selected_members() { let c = cx(&d, &s, &p); let down = SelectionTool::default().pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); assert_eq!(down, vec![Action::Exec("select.set".into(), json!({"ids": [outer.0]}))]); + // Every anchor of the member picked (as `select.anchors` and `select.key` leave it) selects + // it whole: the press moves it. + s.anchors.insert(a, [(0, 0), (0, 1), (0, 2), (0, 3)].into_iter().collect()); + let c = cx(&d, &s, &p); + let mut t = SelectionTool::default(); + assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::Move, "every anchor"); + let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); + assert!(!is_select(&down), "every anchor: {down:?}"); } From cf3e47d513795516f1f17c944cbe2e028501e8bb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:40:34 -0800 Subject: [PATCH 208/247] Align: Align to Key Object names the Artboard tool when that blocks it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - With the Artboard tool chosen, align.toKeyObject fails with "Align to Key Object isn't available with the Artboard tool" instead of "no key object": the selected objects can still have a key in that state. The message has a row in every catalog that has "no key object". - Align to Key Object is off in Object › Align and the Align panel when the topmost selected object is inside another selected object, the case where choosing it already failed. - The align.toSelection params text says the selected objects keep their key with the Artboard tool chosen; ui_catalog.rs regenerated. - A test pins Align to Key Object with a key anchor: checked, the menu name kept, and the key anchor kept. --- crates/mcp/src/ui_catalog.rs | 4 +-- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/menus/ui_commands.rs | 4 +-- crates/ui-egui/src/panels/align.rs | 45 +++++++++++++++--------- crates/ui-egui/src/panels/align/tests.rs | 26 ++++++++++++-- docs/mcp.md | 10 +++--- 32 files changed, 89 insertions(+), 27 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 8c3bcef98e..caa2104e76 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -378,13 +378,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "align.toSelection", "Align to Selection", "", - "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}", + "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}; with the Artboard tool chosen the selected objects keep their key", ), ( "align.toKeyObject", "Align to Key Object", "", - "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, when the topmost selected object can't be the key (it is inside another selected object), or with the Artboard tool chosen", + "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, which includes a topmost selected object inside another selected object; an error (\"Align to Key Object isn't available with the Artboard tool\") with the Artboard tool chosen", ), ( "align.toArtboard", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 8d833f9cdb..4d76241b8d 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -4775,6 +4775,7 @@ axis Both И двете @msg no graphic style `{n}` няма графичен стил `{n}` @msg no interaction in progress няма текущо взаимодействие @msg no key object няма основен обект +@msg Align to Key Object isn't available with the Artboard tool „Подравняване спрямо ключов обект“ не е налично с инструмента „Работна област“ @msg no library `{key}` (see {list}) няма библиотека `{key}` (вижте {list}) @msg no native format няма нативен формат @msg no pages няма страници diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 280056bb88..c8c3993c65 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -5183,6 +5183,7 @@ imageTrace Outline Obris @msg no graphic style `{n}` nema grafičkog stila `{n}` @msg no interaction in progress nema interakcije u toku @msg no key object nema ključnog objekta +@msg Align to Key Object isn't available with the Artboard tool „Poravnaj s ključnim objektom“ nije dostupno s alatom radna ploča @msg no library `{key}` (see {list}) nema biblioteke `{key}` (vidi {list}) @msg no native format nema izvornog formata @msg no pages nema stranica diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 5d0db6ef1d..96f2aee5ee 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6344,6 +6344,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg no history state {v} no hi ha cap estat de l’historial {v} @msg no interaction in progress no hi ha cap interacció en curs @msg no key object no hi ha objecte clau +@msg Align to Key Object isn't available with the Artboard tool «Alinea a l’objecte clau» no està disponible amb l’eina de tauler @msg no library `{id}` no hi ha la biblioteca `{id}` @msg the library has another item of that kind named `{name}` la biblioteca ja té un altre element d’aquest tipus anomenat `{name}` @msg no library `{key}` (see {list}) no hi ha la biblioteca `{key}` (vegeu {list}) diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 3076fe7875..7ab54c355a 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5497,6 +5497,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg no graphic style `{n}` grafický styl `{n}` neexistuje @msg no interaction in progress neprobíhá žádná interakce @msg no key object žádný klíčový objekt +@msg Align to Key Object isn't available with the Artboard tool „Zarovnat ke klíčovému objektu“ není s nástrojem Pracovní plocha k dispozici @msg no library `{key}` (see {list}) knihovna `{key}` neexistuje (viz {list}) @msg no native format chybí nativní formát @msg no pages žádné stránky diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index b610b9116d..a86d95d91e 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7671,6 +7671,7 @@ imageTrace Outline Kontur @msg no graphic style `{n}` ingen grafisk stil `{n}` @msg no interaction in progress ingen interaktion i gang @msg no key object intet nøgleobjekt +@msg Align to Key Object isn't available with the Artboard tool Juster til nøgleobjekt er ikke tilgængelig med tegnebrætværktøjet @msg no library `{key}` (see {list}) intet bibliotek `{key}` (se {list}) @msg no native format intet indbygget format @msg no pages ingen sider diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 9f0b61afac..4af672551a 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5091,6 +5091,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg no graphic style `{n}` kein Grafikstil `{n}` @msg no interaction in progress keine Interaktion im Gange @msg no key object kein Basisobjekt +@msg Align to Key Object isn't available with the Artboard tool „An Basisobjekt ausrichten“ ist mit dem Zeichenflächen-Werkzeug nicht verfügbar @msg no library `{key}` (see {list}) keine Bibliothek `{key}` (siehe {list}) @msg no native format kein natives Format @msg no pages keine Seiten diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a15c2c555f..4c376a4f18 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5154,6 +5154,7 @@ digits Malayalam Μαλαγιάλαμ @msg no graphic style `{n}` δεν υπάρχει στυλ γραφικών `{n}` @msg no interaction in progress δεν υπάρχει αλληλεπίδραση σε εξέλιξη @msg no key object δεν υπάρχει βασικό αντικείμενο +@msg Align to Key Object isn't available with the Artboard tool η «Στοίχιση ως προς το βασικό αντικείμενο» δεν είναι διαθέσιμη με το εργαλείο πίνακα σχεδίασης @msg no library `{key}` (see {list}) δεν υπάρχει βιβλιοθήκη `{key}` (δείτε {list}) @msg no native format δεν υπάρχει εγγενής μορφή @msg no pages δεν υπάρχουν σελίδες diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 5af6a75d82..a3730586df 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5204,6 +5204,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg no graphic style `{n}` no existe el estilo gráfico `{n}` @msg no interaction in progress no hay ninguna interacción en curso @msg no key object no hay objeto clave +@msg Align to Key Object isn't available with the Artboard tool «Alinear con el objeto clave» no está disponible con la herramienta Mesa de trabajo @msg no library `{key}` (see {list}) no existe la biblioteca `{key}` (consulta {list}) @msg no native format no hay formato nativo @msg no pages no hay páginas diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 1a3f52e96d..f1e36c4d9f 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5420,6 +5420,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg no graphic style `{n}` ei grafiikkatyyliä `{n}` @msg no interaction in progress mikään vuorovaikutus ei ole käynnissä @msg no key object ei avainobjektia +@msg Align to Key Object isn't available with the Artboard tool ”Tasaa avainobjektiin” ei ole käytettävissä piirtoalustatyökalulla @msg no library `{key}` (see {list}) ei kirjastoa `{key}` (ks. {list}) @msg no native format ei omaa tiedostomuotoa @msg no pages ei sivuja diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index e2adbffc29..8b2c99741f 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5163,6 +5163,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg no graphic style `{n}` aucun style graphique `{n}` @msg no interaction in progress aucune interaction en cours @msg no key object aucun objet clé +@msg Align to Key Object isn't available with the Artboard tool L’alignement sur l’objet clé n’est pas disponible avec l’outil Plan de travail @msg no library `{key}` (see {list}) aucune bibliothèque `{key}` (voir {list}) @msg no native format aucun format natif @msg no pages aucune page diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index e63af675f2..c009cb8cc7 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7883,6 +7883,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg no item at index {from} इंडेक्स {from} पर कोई आइटम नहीं @msg no item at one of the indices {idx} indices {idx} में से एक पर कोई आइटम नहीं @msg no key object कोई कुंजी ऑब्जेक्ट नहीं +@msg Align to Key Object isn't available with the Artboard tool आर्टबोर्ड टूल के साथ "मुख्य ऑब्जेक्ट पर संरेखित करें" उपलब्ध नहीं है @msg no layer कोई लेयर नहीं @msg no layer {id} (see layer.list) कोई लेयर {id} (layer.list देखें) @msg no layers to export निर्यात करने के लिए कोई लेयरें नहीं diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 68a8c82cf2..24f8ded896 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5869,6 +5869,7 @@ liquify-list-end {0}, {1} {0} és {1} @msg no graphic style `{n}` nincs ilyen grafikai stílus: `{n}` @msg no interaction in progress nincs folyamatban lévő művelet @msg no key object nincs kulcsobjektum +@msg Align to Key Object isn't available with the Artboard tool az „Igazítás a kulcsobjektumhoz” nem érhető el a Rajztábla eszközzel @msg no library `{id}` nincs ilyen könyvtár: `{id}` @msg the library has another item of that kind named `{name}` a könyvtárban már van egy másik ilyen fajta elem `{name}` néven @msg no library `{key}` (see {list}) nincs ilyen könyvtár: `{key}` (lásd: {list}) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index b5ca49a56b..e6c3aaf72e 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4882,6 +4882,7 @@ imageTrace Outline Kontur @msg no graphic style `{n}` tidak ada gaya grafis `{n}` @msg no interaction in progress tidak ada interaksi yang berlangsung @msg no key object tidak ada objek kunci +@msg Align to Key Object isn't available with the Artboard tool Ratakan ke objek kunci tidak tersedia dengan alat artboard @msg no library `{key}` (see {list}) tidak ada pustaka `{key}` (lihat {list}) @msg no native format tidak ada format asli @msg no pages tidak ada halaman diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index c09271ca2b..d8980a6a4f 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5228,6 +5228,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg no graphic style `{n}` nessuno stile grafico `{n}` @msg no interaction in progress nessuna interazione in corso @msg no key object nessun oggetto chiave +@msg Align to Key Object isn't available with the Artboard tool «Allinea all'oggetto chiave» non è disponibile con lo strumento Tavola da disegno @msg no library `{key}` (see {list}) nessuna libreria `{key}` (vedi {list}) @msg no native format nessun formato nativo @msg no pages nessuna pagina diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index d3b9bef584..4b2a28a762 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4959,6 +4959,7 @@ variable-list-end {0}, {1} {0}、{1} @msg no bounds 境界がありません @msg no current layer 現在のレイヤーがありません @msg no key object キーオブジェクトが設定されていません +@msg Align to Key Object isn't available with the Artboard tool アートボードツールでは「キーオブジェクトに整列」を使用できません @msg no previous transform 前回の変形がありません @msg nothing to align 整列するものがありません @msg select a clip group クリップグループを選択してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index cc03030df2..edeb02faeb 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6960,6 +6960,7 @@ font-technology Variable ცვლადი @msg no graphic style `{n}` გრაფიკული სტილი `{n}` არ არის @msg no interaction in progress მიმდინარე ურთიერთქმედება არ არის @msg no key object საკვანძო ობიექტი არ არის +@msg Align to Key Object isn't available with the Artboard tool „საკვანძო ობიექტზე სწორება“ სამუშაო დაფის ხელსაწყოსთან მიუწვდომელია @msg no library `{key}` (see {list}) ბიბლიოთეკა `{key}` არ არის (იხ. {list}) @msg no native format საკუთარი ფორმატი არ არის @msg no pages გვერდები არ არის diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 4fa5ba90d8..7c805dd002 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4886,6 +4886,7 @@ variable-list-end {0}, {1} {0} 및 {1} @msg no bounds 경계가 없습니다 @msg no current layer 현재 레이어가 없습니다 @msg no key object 키 개체가 없습니다 +@msg Align to Key Object isn't available with the Artboard tool 아트보드 도구에서는 키 개체에 정렬을 사용할 수 없습니다 @msg no previous transform 이전 변형이 없습니다 @msg nothing to align 정렬할 항목이 없습니다 @msg select a clip group 클립 그룹을 선택하세요 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index e726eae41b..237f4b978f 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5550,6 +5550,7 @@ imageTrace Outline Contour @msg no graphic style `{n}` geen grafische stijl `{n}` @msg no interaction in progress geen interactie gaande @msg no key object geen sleutelobject +@msg Align to Key Object isn't available with the Artboard tool Uitlijnen op sleutelobject is niet beschikbaar met het tekengebied-gereedschap @msg no library `{key}` (see {list}) geen bibliotheek `{key}` (zie {list}) @msg no native format geen eigen indeling @msg no pages geen pagina's diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 8cd18cdcb2..e996ff50d2 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5314,6 +5314,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg no graphic style `{n}` brak stylu graficznego `{n}` @msg no interaction in progress brak trwającej interakcji @msg no key object brak obiektu kluczowego +@msg Align to Key Object isn't available with the Artboard tool „Wyrównaj do obiektu kluczowego” jest niedostępne z narzędziem Obszar kompozycji @msg no library `{key}` (see {list}) brak biblioteki `{key}` (patrz {list}) @msg no native format brak formatu natywnego @msg no pages brak stron diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index bba7ed642c..b302d733c9 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4460,6 +4460,7 @@ axis Both Ambos @msg no graphic style `{n}` nenhum estilo gráfico `{n}` @msg no interaction in progress nenhuma interação em andamento @msg no key object nenhum objeto-chave +@msg Align to Key Object isn't available with the Artboard tool Alinhar ao Objeto-Chave não está disponível com a Ferramenta Mesa de Trabalho @msg no library `{key}` (see {list}) nenhuma biblioteca `{key}` (veja {list}) @msg no native format sem formato nativo @msg no pages sem páginas diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e2ab3a9097..691c5ec468 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5225,6 +5225,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg no graphic style `{n}` нет графического стиля `{n}` @msg no interaction in progress нет взаимодействия в процессе @msg no key object нет ключевого объекта +@msg Align to Key Object isn't available with the Artboard tool «Выровнять по ключевому объекту» недоступно с инструментом «Монтажная область» @msg no library `{key}` (see {list}) нет библиотеки `{key}` (см. {list}) @msg no native format нет собственного формата @msg no pages нет страниц diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 4893ecc8ce..db6fe3dd59 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5094,6 +5094,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg no graphic style `{n}` ingen grafisk stil `{n}` @msg no interaction in progress ingen interaktion pågår @msg no key object inget nyckelobjekt +@msg Align to Key Object isn't available with the Artboard tool Justera mot nyckelobjekt är inte tillgängligt med ritytsverktyget @msg no library `{key}` (see {list}) inget bibliotek `{key}` (se {list}) @msg no native format inget eget format @msg no pages inga sidor diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 3f6be1e0f9..12429053aa 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4916,6 +4916,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msg no graphic style `{n}` grafik stili yok `{n}` @msg no interaction in progress herhangi bir etkileşim devam etmiyor @msg no key object anahtar nesne yok +@msg Align to Key Object isn't available with the Artboard tool Anahtar Nesneye Hizala, Çalışma Yüzeyi Aracı ile kullanılamaz @msg no library `{key}` (see {list}) `{key}` kitaplığı yok (bkz. {list}) @msg no native format yerel format yok @msg no pages sayfa yok diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 845010a40f..5cb7d71a6a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5212,6 +5212,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg no graphic style `{n}` немає графічного стилю `{n}` @msg no interaction in progress немає взаємодії у процесі @msg no key object немає ключового об’єкта +@msg Align to Key Object isn't available with the Artboard tool «Вирівняти за ключовим об’єктом» недоступно з інструментом «Монтажна область» @msg no library `{key}` (see {list}) немає бібліотеки `{key}` (див. {list}) @msg no native format немає власного формату @msg no pages немає сторінок diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index d501f87e17..7744045bef 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5560,6 +5560,7 @@ liquify-list-end {0}, {1} {0} và {1} @msg no graphic style `{n}` không có kiểu đồ họa `{n}` @msg no interaction in progress không có tương tác nào đang tiến hành @msg no key object không có đối tượng khóa +@msg Align to Key Object isn't available with the Artboard tool không thể dùng Căn theo đối tượng chính với Công cụ Bảng vẽ @msg no library `{id}` không có thư viện `{id}` @msg the library has another item of that kind named `{name}` thư viện đã có một mục khác cùng loại tên là `{name}` @msg no library `{key}` (see {list}) không có thư viện `{key}` (xem {list}) diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index a0ffedd15c..2b0693c357 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4654,6 +4654,7 @@ imageTrace Outline 轮廓 @msg no bounds 没有边界 @msg no current layer 没有当前图层 @msg no key object 没有关键对象 +@msg Align to Key Object isn't available with the Artboard tool 使用画板工具时无法对齐关键对象 @msg no previous transform 没有上一次变换 @msg nothing to align 没有可对齐的内容 @msg select a clip group 请选择一个剪切组 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 86a856ddde..5a43976c8c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2123,6 +2123,7 @@ file-filter Templates 範本 @msg no bounds 沒有邊界 @msg no current layer 沒有目前圖層 @msg no key object 沒有關鍵物件 +@msg Align to Key Object isn't available with the Artboard tool 使用工作區域工具時無法對齊關鍵物件 @msg no previous transform 沒有上一次的變形 @msg nothing to align 沒有可對齊的內容 @msg select a clip group 請選取剪裁群組 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 5c24ca9db9..316f740872 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -379,13 +379,13 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "align.toSelection", "Align to Selection", "", - "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}", + "{} the Align panel's Align to Selection button: Align To becomes Selection (saved with the preferences, ui.inspect › ui.align_to) and the key object, key guide or key anchor is let go → {alignTo: the choice the Align panel then shows: \"selection\", or \"artboard\" while one object is selected, since one object aligns to the artboard}; with the Artboard tool chosen the selected objects keep their key", ), ( "align.toKeyObject", "Align to Key Object", "", - "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, when the topmost selected object can't be the key (it is inside another selected object), or with the Artboard tool chosen", + "{} the Align panel's Align to Key Object button: with no key, the topmost of two or more selected objects becomes the key object, or a ruler guide selected with one object the key guide; the stored Selection or Artboard choice stays → {alignTo: \"key\"}; an error (\"no key object\") when there is no key and nothing to make one of, which includes a topmost selected object inside another selected object; an error (\"Align to Key Object isn't available with the Artboard tool\") with the Artboard tool chosen", ), ( "align.toArtboard", diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index b7de2bb612..ca838c03b9 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -336,20 +336,32 @@ pub(crate) fn shown_align_to(app: &VectorcraftApp) -> AlignTo { aligns_to(align_to(app), objects_aligned(app)) } -/// Whether Align To choice `v` can be chosen. Align to Key Object needs a key object or a key -/// guide, or something to make one of: two or more selected objects, or a guide selected with -/// objects. With the Artboard tool chosen it is off: Align to Artboard keeps the active artboard -/// in place. +/// What Align to Key Object makes the key while there is none, as `select.key` params: the topmost +/// of two or more selected objects when no other selected object holds it, or with one object, a +/// ruler guide selected with it. `None`: nothing can be made the key. +fn key_pick(app: &VectorcraftApp) -> Option { + if selection_len(app) < 2 { + return guide_for_key(app).map(|g| json!({"guide": g})); + } + let id = topmost(app)?; + let st = app.session.active()?; + let inside = st.doc.ancestry(id).unwrap_or_default().into_iter().any(|a| a != id && st.selection.contains(a)); + if inside { None } else { Some(json!({"id": id.0})) } +} + +/// Whether Align To choice `v` can be chosen. Align to Key Object needs a key object, a key guide +/// or a key anchor, or something to make the key ([`key_pick`]). With the Artboard tool chosen it +/// is off: Align to Artboard keeps the active artboard in place. pub(crate) fn can_choose(app: &VectorcraftApp, v: AlignTo) -> bool { if on_artboards(app) { return v != AlignTo::Key; } - v != AlignTo::Key || selection_len(app) >= 2 || has_key(app) || guide_for_key(app).is_some() + v != AlignTo::Key || has_key(app) || key_pick(app).is_some() } /// Chooses Align To `v`, as the Align panel's Align To buttons and the Control bar's Align To menu -/// do. Align to Key Object makes the topmost selected object the key object, unless there is one -/// already; with one object, a guide selected with it becomes the key. The stored choice stays as +/// do. Align to Key Object makes the key what [`key_pick`] gives, unless there is a key already: +/// the topmost selected object, or with one object, a guide selected with it. The stored choice stays as /// it was, and Align To shows it again once the key is cleared. Align to Selection and Align to /// Artboard store the choice and let go of the key object. With the Artboard tool chosen, the /// choice is stored and the selected objects keep their key. @@ -362,12 +374,10 @@ pub(crate) fn choose_align_to(app: &mut VectorcraftApp, v: AlignTo) { return; } if v == AlignTo::Key { - if !has_key(app) { - match (topmost(app).filter(|_| selection_len(app) >= 2), guide_for_key(app)) { - (Some(id), _) => app.run("select.key", json!({"id": id.0})).ok(), - (None, Some(g)) => app.run("select.key", json!({"guide": g})).ok(), - (None, None) => None, - }; + if !has_key(app) + && let Some(p) = key_pick(app) + { + app.run("select.key", p).ok(); } } else { app.ui.align_to = v; @@ -390,10 +400,13 @@ pub(crate) fn align_to_command(id: &str) -> Option { /// Runs the UI command of Align To choice `v`: chooses it as the Align panel's Align To buttons do /// ([`choose_align_to`]) → `{alignTo}`, the choice the Align panel then shows. An error when it -/// can't be chosen: Align to Key Object with no key object and nothing to make one of, with the -/// Artboard tool chosen, or when the topmost selected object can't be the key (it is inside -/// another selected object). +/// can't be chosen: Align to Key Object with the Artboard tool chosen, or with no key and nothing +/// to make the key ([`key_pick`]), which includes a topmost selected object inside another +/// selected object. pub(crate) fn run_align_to(app: &mut VectorcraftApp, v: AlignTo) -> Result { + if v == AlignTo::Key && on_artboards(app) { + return Err("Align to Key Object isn't available with the Artboard tool".into()); + } if !can_choose(app, v) { return Err("no key object".into()); } diff --git a/crates/ui-egui/src/panels/align/tests.rs b/crates/ui-egui/src/panels/align/tests.rs index f2efcf6e35..ffdc0b10a3 100644 --- a/crates/ui-egui/src/panels/align/tests.rs +++ b/crates/ui-egui/src/panels/align/tests.rs @@ -689,7 +689,7 @@ fn align_to_commands_with_the_artboard_tool() { assert!(has_key(&app), "choosing the Artboard tool keeps the key"); let key_item = crate::menus::menu_entries(&app).into_iter().find(|e| e.command.as_deref() == Some("align.toKeyObject")).unwrap(); assert!(!key_item.enabled, "the Artboard tool"); - assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "no key object"); + assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "Align to Key Object isn't available with the Artboard tool"); assert_eq!(app.run("align.toArtboard", json!({})).unwrap(), json!({"alignTo": "artboard"})); assert_eq!(app.ui.align_to, AlignTo::Artboard); assert_eq!(align_to_checks(&app), [Some(false), Some(false), Some(true)]); @@ -699,18 +699,38 @@ fn align_to_commands_with_the_artboard_tool() { assert_eq!(app.session.active().unwrap().selection.key.map(|k| k.0), front.as_u64(), "the key stays"); } -/// Align to Key Object fails when the topmost selected object can't be the key: a group selected -/// with an object inside it. +/// Align to Key Object is off and fails when the topmost selected object can't be the key: a group +/// selected with an object inside it. #[test] fn align_to_key_object_fails_when_the_topmost_object_cannot_be_the_key() { let (mut app, _, front) = back_and_front(); let group = app.run("object.group", json!({})).unwrap()["id"].clone(); app.run("select.set", json!({"ids": [group, front]})).unwrap(); assert_eq!(app.session.active().unwrap().selection.objects.len(), 2, "the group and its member"); + let key_item = crate::menus::menu_entries(&app).into_iter().find(|e| e.command.as_deref() == Some("align.toKeyObject")).unwrap(); + assert!(!key_item.enabled, "the topmost object is inside the group"); + assert!(!can_choose(&app, AlignTo::Key), "the panel's button is off too"); assert_eq!(app.run("align.toKeyObject", json!({})).unwrap_err(), "no key object"); assert!(!has_key(&app)); } +/// With a key anchor, Object → Align shows Align to Key Object checked under its menu name, and +/// the command keeps the key anchor → `{alignTo: "key"}`. +#[test] +fn align_to_key_object_with_a_key_anchor() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + let id = app.run("path.create", json!({"d": "M100 40 L200 60 L150 160 Z"})).unwrap()["id"].as_u64().unwrap(); + app.run("select.anchors", json!({"id": id, "anchors": [[0, 0], [0, 2]], "mode": "set"})).unwrap(); + app.run("select.key", json!({"id": id, "anchor": [0, 2]})).unwrap(); + assert_eq!(align_to_checks(&app), [Some(false), Some(true), Some(false)]); + let key_item = crate::menus::menu_entries(&app).into_iter().find(|e| e.command.as_deref() == Some("align.toKeyObject")).unwrap(); + assert_eq!((key_item.label.as_str(), key_item.enabled), ("Align to Key Object", true)); + assert_eq!(app.run("align.toKeyObject", json!({})).unwrap(), json!({"alignTo": "key"})); + let key_anchor = app.session.active().unwrap().selection.key_anchor.map(|(k, a)| (k.0, a)); + assert_eq!(key_anchor, Some((id, (0, 2))), "the key anchor stays"); +} + /// With anchor points selected, Object → Align sends its params unchanged: two anchor points of /// one path align to their own bounds with Align to Selection and with Align to Artboard chosen. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 70e64f9771..4d8e141427 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6994,10 +6994,12 @@ panel then shows (`align.toSelection` returns `"artboard"` while one object is s `align.toSelection` and `align.toArtboard` store the choice (`ui.inspect` › `ui.align_to`) and let the key go; with the Artboard tool chosen they store it and the selected objects keep their key. With no key, `align.toKeyObject` makes the topmost of two or more selected objects the key object, or a ruler guide selected with one object the key guide, and -keeps the stored choice. It fails with "no key object" when there is nothing to make the key, when the topmost selected -object is inside another selected object and can't be the key, and with the Artboard tool chosen. Object › Align lists -the three after its align items, with the choice the panel shows checked, and Edit › Keyboard Shortcuts lists them -under Align with no default shortcut. +keeps the stored choice. It fails with "no key object" when there is nothing to make the key, which includes a topmost +selected object inside another selected object, and with "Align to Key Object isn't available with the Artboard tool" +while the Artboard tool is chosen; its menu item and the panel's button are off in both cases. Object › Align lists the +three after its align items, with the choice the panel shows checked, and Edit › Keyboard Shortcuts lists them under +Align with no default shortcut. While the key is a key anchor, the panel names its choice Align to Key Anchor and the +menu item keeps the name Align to Key Object. With the Artboard tool chosen, the same buttons and UI commands, and the Control bar's Align and Distribute buttons, run `artboard.align`, `artboard.distribute` and `artboard.distributeSpacing` on the artboards the tool has selected. From 8796b773ec1c36aaae304f322a43fd15f67db019 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 18 Nov 2026 14:46:42 +0500 Subject: [PATCH 209/247] PDF import: a stroke pass matches only glyphs filled since its last boundary (#8543) Answers the second CodeRabbit review on #8549. - A stroke that goes over no filled glyph (stroked type of its own) and the start and end of an ActualText span now end the stroke pass (Builder::end_fills): the held strokes are matched, the parked lines finished and the open line's fills closed, so a later stroke can't go over an earlier fill and a later span keeps its own replacement text. - ActualText fills are ordinary entries in the line's fill list, and span strokes are held and matched in replay order like any other, so an A/B/A TJ in a span strokes the replacement. The actual_fills map, stroke_parked and has_actual_fill are gone. - Past MAX_HELD, the held strokes are matched to the first run of glyphs filled one right after another that they go over (Builder::replayed), with bounded work, instead of each to its first match, which could reach an earlier operator's fill. - Docs state that past 64 lines in one operator each part stays a filled object and a stroked one. --- crates/pdf/src/import/actual_text.rs | 42 +++++---- crates/pdf/src/import/builder.rs | 95 +++++++++++++++----- crates/pdf/src/import/device.rs | 10 ++- crates/pdf/src/import/state.rs | 7 +- crates/pdf/src/import_text.rs | 130 +++++++++++++++------------ crates/pdf/src/tests/textstroke.rs | 63 +++++++++++++ docs/file-format-parity.md | 4 +- docs/roadmap.md | 4 +- docs/target-app-parity.md | 12 +-- 9 files changed, 260 insertions(+), 107 deletions(-) diff --git a/crates/pdf/src/import/actual_text.rs b/crates/pdf/src/import/actual_text.rs index 69a6afc1a9..aa7f9a5e76 100644 --- a/crates/pdf/src/import/actual_text.rs +++ b/crates/pdf/src/import/actual_text.rs @@ -1,6 +1,6 @@ //! Bounded ownership of authored replacement text (ISO 32000-1, 14.9.4). -use super::state::Builder; +use super::state::{Builder, HeldStroke}; use super::{Affine, Look, Placement, Shape, TextLine, Upright}; use crate::import_text::TextContent; @@ -21,13 +21,16 @@ impl ActualText { self.depth = self.depth.saturating_add(1); } - pub(super) fn end(&mut self) { - if self.owner == Some(self.depth) { + /// `true`: the owner's span ended. + pub(super) fn end(&mut self) -> bool { + let ended = self.owner == Some(self.depth); + if ended { self.owner = None; self.pending = None; self.empty = false; } self.depth = self.depth.saturating_sub(1); + ended } pub(super) fn active(&self) -> bool { @@ -62,23 +65,32 @@ impl Builder<'_> { /// against the glyph's original Unicode, not against this replacement's characters. pub(super) fn actual_glyph(&mut self, o: &craft_pdf::interpret::font::OutlineGlyph, m: Affine, at: Placement, look: Look, opacity: f32) -> bool { let key = o.font_cache_key(); - self.flush_glyphs(); - // A fill and stroke callback for the same glyph consumes its text only once, on a line - // the operator's kerning finished too. + // A fill and stroke callback for the same glyph consumes its text only once: the stroke + // goes over the glyph of the span filled, matched as the stroke pass ends as any other + // (`Builder::hold_stroke`), on a line the operator's kerning finished too. let stroking = look.fill.is_none() && look.stroke.is_some(); if let Some(stroke) = &look.stroke && stroking - && self.stroke_parked(|line| line.has_actual_fill(key, at)) - && let Some((line, _)) = self.parked.first_mut() - && line.stroke_actual(key, at, stroke.clone(), look.overprint_stroke) { - return true; + let h = HeldStroke { + font: key, + at, + opacity, + text: String::new(), + stroke: stroke.clone(), + overprint: look.overprint_stroke, + glyph: None, + actual: true, + first: (0, 0), + }; + if self.hold_stroke(h) { + return true; + } } - if let (Some(stroke), Some(line)) = (&look.stroke, &mut self.text) - && stroking - && line.stroke_actual(key, at, stroke.clone(), look.overprint_stroke) - { - return true; + self.flush_glyphs(); + // Stroked type of its own ends the stroke pass of the glyphs filled before it. + if stroking { + self.end_fills(); } let width = o.advance_width().filter(|w| w.is_finite()); let advance = width.map_or(at.size * 0.5, |w| w as f64 / 1000.0 * at.size * at.h_scale / 100.0); diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index 20029582b7..a566614097 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -19,10 +19,14 @@ use super::{ const MAX_PARKED: usize = 64; /// The most strokes of a stroke pass held to be matched to the glyphs they go over -/// ([`Builder::hold_stroke`]): beyond them, those held are matched each to the first glyph it -/// may go over, and the pass goes on from there. +/// ([`Builder::hold_stroke`]): beyond them, those held are matched to the first glyphs filled one +/// after another that they go over ([`Builder::replayed`]), and the pass goes on from there. const MAX_HELD: usize = 4096; +/// The most glyphs [`Builder::replayed`] compares to the strokes held, for bounded work on +/// hostile input: beyond them, each stroke goes over the first glyph it may go over. +const MAX_REPLAY_WORK: usize = 1 << 20; + fn is_colour_face(face: &vectorcraft_text::FontFace) -> bool { use skrifa::Tag; use skrifa::raw::TableProvider; @@ -501,8 +505,8 @@ impl<'p> Builder<'p> { /// before it. /// /// Parked lines are finished, oldest first, when the stroke pass goes past them (a stroke is - /// drawn over a later line or the open one: [`Self::settle_strokes`], [`Self::stroke_parked`]; - /// or over none of them), when anything else ends the open line ([`Self::end_text`]), and + /// drawn over a later line or the open one: [`Self::settle_strokes`]; or over none of them: + /// [`Self::end_fills`]), when anything else ends the open line ([`Self::end_text`]), and /// beyond [`MAX_PARKED`] lines. pub(super) fn park_text(&mut self, park: bool) { match self.text.take() { @@ -518,20 +522,19 @@ impl<'p> Builder<'p> { } } - /// Whether a stroke over a glyph of an ActualText span goes over a glyph of a parked line - /// ([`Self::park_text`]), which `takes` tells of each line (a glyph it filled that the - /// stroke is drawn over). The open line comes first, then the parked lines from the last - /// parked back: the same glyph filled at the same place twice is stroked where it was filled - /// last, by the operator that strokes it. `true`: a parked line takes it, the stroke pass is - /// on it, and the lines before it are finished, so it is the first. `false`: the open line - /// takes it or none does, so the stroke pass is past them all, and they are finished. - pub(super) fn stroke_parked(&mut self, takes: impl Fn(&TextLine) -> bool) -> bool { - if self.parked.is_empty() { - return false; + /// A boundary of stroke passes: no stroke drawn from now on goes over a glyph filled before + /// it. The strokes held are matched ([`Self::settle_strokes`]), the parked lines finished, and + /// the open line's glyphs filled so far closed to strokes ([`TextLine::end_fills`]). A stroke + /// that goes over no glyph filled (stroked type of its own) is one: a stroke pass replays the + /// glyphs its operator filled last, so a stroke after it isn't part of a pass over glyphs + /// filled before it, and stroking those would draw it under the type of its own. The start + /// and end of an ActualText span are too: a span's glyphs are stroked within it (#8543). + pub(super) fn end_fills(&mut self) { + self.settle_strokes(); + self.release_parked(usize::MAX); + if let Some(line) = &mut self.text { + line.end_fills(); } - let found = if self.text.as_ref().is_some_and(&takes) { None } else { self.parked.iter().rposition(|(line, _)| takes(line)) }; - self.release_parked(found.unwrap_or(usize::MAX)); - found.is_some() } /// The parked line at `slot` ([`Self::park_text`]), or the open line at the slot after them. @@ -543,6 +546,16 @@ impl<'p> Builder<'p> { } } + /// The glyph filled right after the one at `at` (a line's slot and its index among the line's + /// filled glyphs, as [`Self::next_fill`]): the next on its line, else the first of the line + /// after it. + fn after_fill(&self, (slot, i): (usize, usize)) -> (usize, usize) { + match self.line_at(slot) { + Some(line) if i.saturating_add(1) < line.filled_len() => (slot, i.saturating_add(1)), + _ => (slot.saturating_add(1), 0), + } + } + /// The first glyph filled after `after` that stroke `h` may go over /// ([`TextLine::next_filled`]), as its line's slot ([`Self::line_at`]) and its index among /// the line's filled glyphs: the lines in the order they were drawn, each line's glyphs in @@ -554,7 +567,7 @@ impl<'p> Builder<'p> { Some((s, i)) if s == slot => i.saturating_add(1), _ => 0, }; - let i = self.line_at(slot)?.next_filled(from, h.font, h.at, h.opacity, &h.text)?; + let i = self.line_at(slot)?.next_filled(from, h.font, h.at, h.opacity, &h.text, h.actual)?; Some((slot, i)) }) } @@ -568,7 +581,7 @@ impl<'p> Builder<'p> { Some((s, i)) if s == slot => i, _ => usize::MAX, }; - let i = self.line_at(slot)?.last_filled(until, h.font, h.at, h.opacity, &h.text)?; + let i = self.line_at(slot)?.last_filled(until, h.font, h.at, h.opacity, &h.text, h.actual)?; Some((slot, i)) }) } @@ -608,8 +621,42 @@ impl<'p> Builder<'p> { self.settle(true); } + /// The glyphs the strokes `held` go over when they are the start of a stroke pass that goes + /// on after them ([`MAX_HELD`]): the first glyphs filled one right after another that they + /// may go over, in order. The pass replays its operator's fill pass, whose glyphs were + /// filled one right after another, so the strokes don't go over a glyph filled before those + /// (another operator's), nor skip one. `None` when there are none, or beyond + /// [`MAX_REPLAY_WORK`]. + fn replayed(&self, held: &[HeldStroke]) -> Option> { + let (head, rest) = held.split_first()?; + let mut work = 0usize; + let mut start = Some(head.first); + while let Some(first) = start { + let mut places = Vec::with_capacity(held.len()); + places.push(first); + let mut at = first; + for h in rest { + work = work.saturating_add(1); + if work > MAX_REPLAY_WORK { + return None; + } + at = self.after_fill(at); + if !self.line_at(at.0).is_some_and(|line| line.fills_at(at.1, h.font, h.at, h.opacity, &h.text, h.actual)) { + break; + } + places.push(at); + } + if places.len() == held.len() { + return Some(places); + } + start = self.next_fill(Some(first), head); + } + None + } + /// [`Self::settle_strokes`], each stroke matched to the last glyph it may go over (`last`), - /// or to the first ([`Self::hold_stroke`] when too many are held). + /// or, when too many are held ([`Self::hold_stroke`]), as the start of a pass that goes on + /// ([`Self::replayed`]). fn settle(&mut self, last: bool) { if self.held.is_empty() { return; @@ -624,6 +671,8 @@ impl<'p> Builder<'p> { before = Some(p); } places.reverse(); + } else if let Some(p) = self.replayed(&held) { + places = p; } // Each held stroke goes over the first glyph it may go over after the one before it // does ([`Self::hold_stroke`]), so the last ones are found too: this is only a guard. @@ -1353,7 +1402,7 @@ impl<'p> Builder<'p> { && stroking { let glyph = if top.is_none() { glyph_run(o, m, drawn.clone(), opacity, scale, overprint) } else { None }; - let h = HeldStroke { font: key, at, opacity, text: text.clone(), stroke: s.clone(), overprint, glyph, first: (0, 0) }; + let h = HeldStroke { font: key, at, opacity, text: text.clone(), stroke: s.clone(), overprint, glyph, actual: false, first: (0, 0) }; if self.hold_stroke(h) { return true; } @@ -1371,6 +1420,10 @@ impl<'p> Builder<'p> { } return true; } + // Stroked type of its own ends the stroke pass of the glyphs filled before it. + if stroking { + self.end_fills(); + } if !self.text.as_mut().is_some_and(place) { self.park_text(!stroking); let mut line = TextLine::new(at, opacity); diff --git a/crates/pdf/src/import/device.rs b/crates/pdf/src/import/device.rs index 452090c6b6..47924a717d 100644 --- a/crates/pdf/src/import/device.rs +++ b/crates/pdf/src/import/device.rs @@ -453,12 +453,20 @@ impl<'a> Device<'a> for Builder<'_> { self.flush(); } self.marked.pop(); - self.actual.end(); + // A span's glyphs are stroked within it: a stroke after it goes over none of them. + if self.actual.end() { + self.end_fills(); + } } fn actual_text(&mut self, text: &[u8]) { + let active = self.actual.active(); if self.nested == 0 && self.text_as == crate::TextAs::Text && !self.actual.set(text) { self.warn("ActualText beyond the import size or nesting limit was left to glyph mappings"); } + // Nor does a stroke in a span go over a glyph filled before it. + if !active && self.actual.active() { + self.end_fills(); + } } } diff --git a/crates/pdf/src/import/state.rs b/crates/pdf/src/import/state.rs index 2cf7f6e088..e7a4379982 100644 --- a/crates/pdf/src/import/state.rs +++ b/crates/pdf/src/import/state.rs @@ -61,9 +61,9 @@ pub(super) struct GlyphRun { /// A stroke over a glyph filled before it (fill and stroke rendering), held with the stroke pass /// it is part of ([`Builder::hold_stroke`]): the glyph's font, placement, opacity and text, the /// stroke, whether it overprints, the glyph's outline as drawn (kept as for a line of type kept -/// as outlines; none for a glyph set upright), and the first glyph filled so it may go over, as -/// its line's place among the parked lines and the open one and its index in the line's filled -/// glyphs. +/// as outlines; none for a glyph set upright or one of an ActualText span), whether it is one of +/// an ActualText span, and the first glyph filled so it may go over, as its line's place among +/// the parked lines and the open one and its index in the line's filled glyphs. pub(super) struct HeldStroke { pub(super) font: u128, pub(super) at: super::Placement, @@ -72,6 +72,7 @@ pub(super) struct HeldStroke { pub(super) stroke: TypeStroke, pub(super) overprint: bool, pub(super) glyph: Option, + pub(super) actual: bool, pub(super) first: (usize, usize), } diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index 301622fe81..dd9804db67 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -233,10 +233,8 @@ pub(crate) struct TextLine { slots: Vec>, /// Per character: authored logical order must survive visual-to-logical reconstruction. authored: Vec, - /// Fill callbacks in an authored span, for the reader's later stroke pass. - actual_fills: HashMap<(u128, u64, u64), Option>, /// The glyphs filled without a stroke, in drawing order, for a stroke drawn over them later - /// ([`stroke_filled`](Self::stroke_filled)). + /// ([`stroke_filled`](Self::stroke_filled)), those of an ActualText span among them. filled: Vec, /// The first of [`filled`](Self::filled) a stroke may still be drawn over: a stroke matches /// glyphs in the order they were filled, and each at most once. @@ -279,7 +277,9 @@ struct Slot { } /// A glyph filled without a stroke: its font and placement, and where its text is in the line's -/// runs (the run's index, the text's byte offset in it and its length). +/// runs (the run's index, the text's byte offset in it and its length). A glyph of an ActualText +/// span has `actual`: `Some(true)` for the glyph whose run holds the replacement text, +/// `Some(false)` for the glyphs after it, which add no text (`len` 0 for both). #[derive(Clone, Copy, Debug)] struct Filled { font: u128, @@ -287,6 +287,7 @@ struct Filled { run: usize, start: usize, len: usize, + actual: Option, } /// Glyphs next to each other in one run that a stroke is drawn over, not yet restyled @@ -331,7 +332,6 @@ impl TextLine { text_bytes: 0, slots: vec![], authored: vec![], - actual_fills: HashMap::new(), filled: vec![], stroked: 0, pending: None, @@ -382,7 +382,6 @@ impl TextLine { let Some((last, _, run)) = self.runs.last_mut() else { self.runs.push((look.clone(), 0.0, text.to_string())); self.last_start = 0; - self.record_actual_fill(look, at, content); self.record_filled(look, at, content); self.authored.extend(text.chars().map(|_| content.authored())); (self.upright, self.next, self.last, self.last_at) = (Some(upright), at.origin + down * at.size, at.origin, at); @@ -420,7 +419,6 @@ impl TextLine { self.runs.push((look.clone(), 0.0, text.to_string())); self.last_start = 0; } - self.record_actual_fill(look, at, content); self.record_filled(look, at, content); self.authored.extend(text.chars().map(|_| content.authored())); self.next = at.origin + down * at.size; @@ -522,7 +520,6 @@ impl TextLine { self.runs.push((look.clone(), 0.0, text.to_string())); self.last_start = 0; } - self.record_actual_fill(look, at, content); self.record_filled(look, at, content); self.text_bytes = self.text_bytes.saturating_add(text.len()); if !pen { @@ -545,41 +542,31 @@ impl TextLine { true } - fn record_actual_fill(&mut self, look: &Look, at: Placement, content: TextContent<'_>) { - if content.authored() && look.fill.is_some() { - let run = matches!(content, TextContent::Actual(_)).then(|| self.runs.len().saturating_sub(1)); - self.actual_fills.insert((look.font, at.origin.x.to_bits(), at.origin.y.to_bits()), run); - } - } - /// Note glyph `content` just added to the last run, filled without a stroke, for a stroke - /// drawn over it later. + /// drawn over it later: a glyph of an ActualText span too, whose text is the replacement's + /// (the first glyph's) or none. fn record_filled(&mut self, look: &Look, at: Placement, content: TextContent<'_>) { - let len = content.text().len(); - if content.authored() || len == 0 || look.fill.is_none() || look.stroke.is_some() { + if look.fill.is_none() || look.stroke.is_some() { return; } - let run = self.runs.len().saturating_sub(1); - self.filled.push(Filled { font: look.font, at, run, start: self.last_start, len }); + let (run, start) = (self.runs.len().saturating_sub(1), self.last_start); + let (start, len, actual) = match content { + TextContent::Mapped(text) if !text.is_empty() => (start, text.len(), None), + TextContent::Mapped(_) => return, + TextContent::Actual(_) => (0, 0, Some(true)), + TextContent::Pen => (0, 0, Some(false)), + }; + self.filled.push(Filled { font: look.font, at, run, start, len, actual }); } /// The reader fills a whole Tj/TJ before replaying its glyphs as strokes. A replay /// must neither consume the replacement nor rewind the pen. Only the first glyph's - /// style belongs to the replacement; suppressed glyphs have no text to restyle. + /// style belongs to the replacement; suppressed glyphs have no text to restyle. The stroke + /// goes over the next glyph of the span filled in `font` at `at`, not stroked yet + /// ([`stroke_filled_at`](Self::stroke_filled_at)). pub fn stroke_actual(&mut self, font: u128, at: Placement, stroke: TypeStroke, overprint: bool) -> bool { - self.flush_stroke(); - let key = (font, at.origin.x.to_bits(), at.origin.y.to_bits()); - let Some(run) = self.actual_fills.remove(&key) else { return false }; - if let Some((look, ..)) = run.and_then(|i| self.runs.get_mut(i)) { - (look.stroke, look.overprint_stroke) = (Some(stroke), overprint); - } - true - } - - /// Whether a glyph of an ActualText span was filled in `font` at `at`, not stroked yet - /// ([`stroke_actual`](Self::stroke_actual)). - pub fn has_actual_fill(&self, font: u128, at: Placement) -> bool { - self.actual_fills.contains_key(&(font, at.origin.x.to_bits(), at.origin.y.to_bits())) + let Some(index) = self.next_filled(0, font, at, 1.0, "", true) else { return false }; + self.stroke_filled_at(index, stroke, overprint) } /// Has the baseline turned (more than about 3° from the first glyph to the last)? @@ -631,7 +618,7 @@ impl TextLine { // A stroke at another opacity than the fill's (`CA` and `ca` differ), or over a // translucent fill, is type of its own. let opaque = opacity >= 0.999 && self.opacity >= 0.999; - let Some(index) = self.filled_index(font, at, opacity, text) else { + let Some(index) = self.next_filled(0, font, at, opacity, text, false) else { // Stroked text of its own (stroke rendering): no later stroke goes back over the // glyphs filled before it, so no stroke looks through them again. self.stroked = self.filled.len(); @@ -645,10 +632,21 @@ impl TextLine { /// ([`next_filled`](Self::next_filled), [`last_filled`](Self::last_filled)): that glyph is /// stroked as [`stroke_filled`](Self::stroke_filled) strokes the glyph it finds, and no later /// stroke goes over the glyphs filled before it. `false`: there is no such glyph. + /// A glyph of an ActualText span restyles its replacement's run at once, if it holds it. pub fn stroke_filled_at(&mut self, index: usize, stroke: TypeStroke, overprint: bool) -> bool { if index < self.stroked || index >= self.filled.len() { return false; } + if let Some(g) = self.filled.get(index).copied() + && let Some(owner) = g.actual + { + self.flush_stroke(); + if let Some((look, ..)) = self.runs.get_mut(g.run).filter(|_| owner) { + (look.stroke, look.overprint_stroke) = (Some(stroke), overprint); + } + self.stroked = index.saturating_add(1); + return true; + } let continues = self .pending .as_ref() @@ -670,35 +668,49 @@ impl TextLine { true } - /// The glyph a stroke over glyph `text` drawn at `at` in `font` at `opacity` is drawn over - /// ([`stroke_filled`](Self::stroke_filled)): the next one filled so and not stroked yet, as - /// an index into [`filled`](Self::filled). `None` for a translucent fill or stroke. - fn filled_index(&self, font: u128, at: Placement, opacity: f32, text: &str) -> Option { - self.next_filled(0, font, at, opacity, text) - } - /// The first glyph from index `from` of [`filled`](Self::filled) on, not stroked yet, that a - /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over: filled in - /// the same font with the same placement and text. `None` for a translucent fill or stroke. - pub fn next_filled(&self, from: usize, font: u128, at: Placement, opacity: f32, text: &str) -> Option { + /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over + /// ([`fills_at`](Self::fills_at)). `None` for a translucent fill or stroke. + pub fn next_filled(&self, from: usize, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> Option { let from = from.max(self.stroked); - let i = self.filled.get(from..)?.iter().position(|g| self.fills(g, font, at, opacity, text))?; + let i = self.filled.get(from..)?.iter().position(|g| self.fills(g, font, at, opacity, text, actual))?; Some(from.saturating_add(i)) } /// The last glyph before index `before` of [`filled`](Self::filled), not stroked yet, that a /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over - /// ([`next_filled`](Self::next_filled)). - pub fn last_filled(&self, before: usize, font: u128, at: Placement, opacity: f32, text: &str) -> Option { + /// ([`fills_at`](Self::fills_at)). + pub fn last_filled(&self, before: usize, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> Option { let rest = self.filled.get(self.stroked..before.min(self.filled.len()))?; - let i = rest.iter().rposition(|g| self.fills(g, font, at, opacity, text))?; + let i = rest.iter().rposition(|g| self.fills(g, font, at, opacity, text, actual))?; Some(self.stroked.saturating_add(i)) } - /// Whether `g` is a glyph a stroke over glyph `text` drawn at `at` in `font` at `opacity` may - /// be drawn over: opaque, in the same font, with the same placement and text. - fn fills(&self, g: &Filled, font: u128, at: Placement, opacity: f32, text: &str) -> bool { - opacity >= 0.999 + /// Whether the glyph filled at `index` in [`filled`](Self::filled), not stroked yet, is one a + /// stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over: opaque, + /// in the same font, with the same placement and text. With `actual`, a stroke over a glyph + /// of an ActualText span instead: a glyph of the span filled in the same font at the same + /// origin, at any opacity ([`stroke_actual`](Self::stroke_actual)): the span's replacement + /// text goes with the glyph filled first, so a translucent stroke kept apart from its fill + /// would be type with no text, and come in as nothing. + pub fn fills_at(&self, index: usize, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + index >= self.stroked && self.filled.get(index).is_some_and(|g| self.fills(g, font, at, opacity, text, actual)) + } + + /// How many glyphs the line filled for a stroke drawn over them later, stroked or not + /// ([`filled`](Self::filled)). + pub fn filled_len(&self) -> usize { + self.filled.len() + } + + /// [`fills_at`](Self::fills_at) for glyph `g`. + fn fills(&self, g: &Filled, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + if actual { + let same = |a: f64, b: f64| a.to_bits() == b.to_bits(); + return g.actual.is_some() && g.font == font && same(g.at.origin.x, at.origin.x) && same(g.at.origin.y, at.origin.y); + } + g.actual.is_none() + && opacity >= 0.999 && self.opacity >= 0.999 && g.font == font && g.at.same_as(&at) @@ -709,7 +721,14 @@ impl TextLine { /// rendering): an opaque glyph filled and not stroked yet, or a filled glyph of an /// ActualText span ([`stroke_actual`](Self::stroke_actual)). pub fn awaits_stroke(&self) -> bool { - (self.opacity >= 0.999 && self.stroked < self.filled.len()) || !self.actual_fills.is_empty() + self.filled.get(self.stroked..).is_some_and(|rest| rest.iter().any(|g| g.actual.is_some() || self.opacity >= 0.999)) + } + + /// No stroke drawn from now on goes over a glyph the line filled so far: a stroke pass does + /// not go back past a stroke of its own (one over no glyph filled) or the start or end of an + /// ActualText span ([`stroke_filled`](Self::stroke_filled)). + pub fn end_fills(&mut self) { + self.stroked = self.filled.len(); } /// Restyle the glyphs gathered for a stroke ([`stroke_filled`](Self::stroke_filled)): their @@ -780,9 +799,6 @@ impl TextLine { for g in self.filled.iter_mut().skip(from) { (g.run, g.start) = moved(g.run, g.start); } - for i in self.actual_fills.values_mut().flatten() { - *i = moved(*i, 0).0; - } if last { self.last_start = moved(run, self.last_start).1; } diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index 75d20a9fd1..2af3e4b8cf 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -438,3 +438,66 @@ fn a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy() { let want = [vec![("A".to_string(), true, false)], vec![("B".to_string(), true, false)], both("A")]; assert_eq!(type_runs(content), want, "{content}"); } + +/// A stroke pass longer than the importer holds at once ([`MAX_HELD`] strokes) is matched to its +/// own operator's glyphs, in the order filled: an `A` filled by an operator of its own, then `A` +/// and 4,096 `B`s filled and stroked from the same place, strokes the second `A`, not the first +/// (#8543). +#[test] +fn a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before() { + let bs = "B".repeat(4096); + let content = format!("BT /F1 2 Tf 1 0 0 1 20 80 Tm 0 Tr (A) Tj 1 0 0 1 20 80 Tm 2 Tr (A{bs}) Tj 0 Tr ET"); + let looks: Vec> = type_runs(&content); + let want = [vec![("A".to_string(), true, false)], vec![(format!("A{bs}"), true, true)]]; + assert!(looks == want, "{:?}", looks.iter().map(|t| t.iter().map(|r| (r.0.len(), r.1, r.2)).collect::>()).collect::>()); +} + +/// Stroked type of its own (a stroke over no glyph filled) ends the stroke pass of the glyphs +/// filled before it: an `A` filled, a `B` filled on a line of its own, a `C` stroked after the +/// `B`, then a stroke over the `A` is type of its own, drawn last, not a stroke joined to the +/// `A` drawn under the `B` and `C` (#8543). +#[test] +fn a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before() { + let content = "BT /F1 48 Tf 1 0 0 1 20 80 Tm 0 Tr (A) Tj 1 0 0 1 20 140 Tm (B) Tj 1 Tr (C) Tj 1 0 0 1 20 80 Tm (A) Tj 0 Tr ET"; + let run = |text: &str, fill: bool, stroke: bool| (text.to_string(), fill, stroke); + let want = [vec![run("A", true, false)], vec![run("B", true, false), run("C", false, true)], vec![run("A", false, true)]]; + assert_eq!(type_runs(content), want, "{content}"); +} + +/// A stroke in an ActualText span goes over a glyph that span filled, not one an earlier span +/// filled at the same place: each span's replacement text comes in (#8543). +#[test] +fn a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph() { + let content = "BT /F1 48 Tf 0 Tr /Span << /ActualText (First) >> BDC 1 0 0 1 20 80 Tm (A) Tj EMC 1 0 0 1 20 140 Tm (B) Tj \ + /Span << /ActualText (Second) >> BDC 1 Tr 1 0 0 1 20 80 Tm (A) Tj EMC 0 Tr ET"; + let run = |text: &str, fill: bool, stroke: bool| vec![(text.to_string(), fill, stroke)]; + assert_eq!(type_runs(content), [run("First", true, false), run("B", true, false), run("Second", false, true)], "{content}"); +} + +/// Fill and stroke rendering of a `TJ` that draws a glyph again where it drew one, in an +/// ActualText span: the strokes go over the glyphs in the order filled, so the replacement text, +/// on the first glyph's line and in its style, is filled and stroked, not left to the copy drawn +/// last, which shows no text (#8543). +#[test] +fn a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement() { + for mode in ["2", "6"] { + for show in ["[(A) 667 (A)] TJ", "[(A) -500 (B) 1834 (A)] TJ", "[(A) -3500 (B) 4834 (A)] TJ"] { + let content = format!("BT {mode} Tr /F1 48 Tf 20 80 Td /Span << /ActualText (ABA) >> BDC {show} EMC 0 Tr ET"); + assert_eq!(type_runs(&content), [vec![("ABA".to_string(), true, true)]], "{content}"); + } + } +} + +/// The lines of type one operator's fill pass finishes are kept for its stroke pass up to 64 at +/// a time: a `TJ` whose kerning starts 65 lines comes in as 65 type objects filled and stroked, +/// and one that starts 66 as a filled object and a stroked one for each part, the fills first, +/// as the file draws them (#8543). +#[test] +fn a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart() { + let content = |n: usize| format!("BT 2 Tr /F1 4 Tf 20 80 Td [{}] TJ 0 Tr ET", vec!["(A)"; n].join(" -3500 ")); + let both = vec![("A".to_string(), true, true)]; + assert_eq!(type_runs(&content(65)), vec![both; 65]); + let (fill, stroke) = (vec![("A".to_string(), true, false)], vec![("A".to_string(), false, true)]); + let want: Vec<_> = std::iter::repeat_n(fill, 66).chain(std::iter::repeat_n(stroke, 66)).collect(); + assert_eq!(type_runs(&content(66)), want); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 989b04e21f..3c1e1b270d 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -370,7 +370,7 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 64 lines in one operator: past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`). A stroke after stroked type of its own, or in another `ActualText` span, goes over no glyph filled before it: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`). - [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,7 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-18 | minor | PDF export (#3644): the document language chosen in Document Setup is written as the catalog's `/Lang` (BCP 47, `en-US` by default) and as XMP `dc:language`; a language without a tag writes none. Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 2a5a009344..66c9700808 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -164,7 +164,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -216,7 +216,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 4258136427..828e3f1eea 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -63,7 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64) until the stroke pass goes past them, and the pass's strokes are held (up to 4096) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-18 | minor | Hardening: PDF export writes the document language (Document Setup) as the catalog's `/Lang` and XMP `dc:language` (#3644). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | @@ -277,9 +277,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -542,7 +542,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one; in an `ActualText` span it stays one replacement type object on the first glyph's line and in its style (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -604,7 +604,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h. From efc36481b174be967bbbf3d94be5a6c7e5e12c5a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:46:57 -0800 Subject: [PATCH 210/247] Find and Replace: Find with other Find text starts at the first match With no place to go on from, the dialog left out edit.findNext's from, so the search went on after the selected type object and passed over its matches: after Find selected a type object, changing the Find text skipped the matches in it. edit.findNext now starts at the first match for a null from, and the dialog sends one. --- crates/engine/src/cmd/typemenu.rs | 12 +++++++----- crates/engine/src/tests/menucmds.rs | 4 ++++ crates/ui-egui/src/dialogs/find_replace.rs | 5 ++--- .../ui-egui/src/dialogs/find_replace/tests.rs | 17 +++++++++++++++++ docs/mcp.md | 6 ++++-- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/typemenu.rs b/crates/engine/src/cmd/typemenu.rs index 85bc20926a..f9c6471812 100644 --- a/crates/engine/src/cmd/typemenu.rs +++ b/crates/engine/src/cmd/typemenu.rs @@ -129,7 +129,7 @@ pub fn specs() -> Vec { "Find Next", ["Edit"], None, - "{find, matchCase?: false, wholeWord?: false, backwards?: false, hiddenLayers?: false, lockedLayers?: false, from?: {id, start, end} (a match this command returned, or the range edit.replaceMatch returned)} find the next match of `find` in the type edit.findReplace reaches and select its type object → {id, start, end (the match's bytes in the object's plain text), index (its place among all the matches, from 1), count, selected} or {id: null, count: 0}. The search visits type objects from the top of the stacking order down and each object's matches in reading order; backwards visits the objects from the bottom up and each object's matches from the last. It goes on after `from` and, past the last match, starts again at the first. Without `from` it goes on after the first selected type object, and with no type selected it starts at the first match. A match on a hidden or locked layer is returned with selected false and the selection stays as it is. Nothing is recorded for undo.", + "{find, matchCase?: false, wholeWord?: false, backwards?: false, hiddenLayers?: false, lockedLayers?: false, from?: {id, start, end} (a match this command returned, or the range edit.replaceMatch returned)} find the next match of `find` in the type edit.findReplace reaches and select its type object → {id, start, end (the match's bytes in the object's plain text), index (its place among all the matches, from 1), count, selected} or {id: null, count: 0}. The search visits type objects from the top of the stacking order down and each object's matches in reading order; backwards visits the objects from the bottom up and each object's matches from the last. It goes on after `from` and, past the last match, starts again at the first. Without `from` it goes on after the first selected type object, and with no type selected, or with a null `from`, it starts at the first match. A match on a hidden or locked layer is returned with selected false and the selection stays as it is. Nothing is recorded for undo.", has_doc, find_next ), @@ -1856,10 +1856,12 @@ fn find_next(s: &mut Session, p: &Value) -> Result { let q = Query::of(p, C)?; let backwards = switch_or(p, "backwards", false, C)?; let (hidden, locked) = (switch_or(p, "hiddenLayers", false, C)?, switch_or(p, "lockedLayers", false, C)?); - // A `from` that is no object gives no `id`, and is refused as one without it. + // A `from` that is no object gives no `id`, and is refused as one without it. A null `from` + // starts at the first match, whatever is selected. let from = match p.get("from") { - None | Some(Value::Null) => None, - Some(v) => Some(Match::of(v, C)?), + None => None, + Some(Value::Null) => Some(None), + Some(v) => Some(Some(Match::of(v, C)?)), }; let st = s.doc()?; // The objects in the order the search visits them: from the top of the stacking order down, @@ -1885,7 +1887,7 @@ fn find_next(s: &mut Session, p: &Value) -> Result { // The search goes on from `from`, or from the whole of the first selected type object it // visits, so that the same call again reaches the next object. From anywhere else it starts // at the first match. - let from = from.or_else(|| { + let from = from.unwrap_or_else(|| { st.selection.objects.iter().filter(|id| order.contains(id)).find_map(|id| match &st.doc.node(*id)?.kind { NodeKind::Text(t) => Some(Match { id: *id, start: 0, end: t.runs.iter().map(|r| r.text.len()).sum() }), _ => None, diff --git a/crates/engine/src/tests/menucmds.rs b/crates/engine/src/tests/menucmds.rs index dbbf9e803d..9c03205ee7 100644 --- a/crates/engine/src/tests/menucmds.rs +++ b/crates/engine/src/tests/menucmds.rs @@ -2476,6 +2476,10 @@ fn find_next_steps_through_the_matches_in_both_directions() { // A `from` in an object the search does not visit starts at the first match. let r = s.execute("edit.findNext", &json!({"find": "cat", "from": {"id": 999_999, "start": 0, "end": 0}})).unwrap(); assert_eq!(found(&r), (top.0, 2, 5, 1, 3)); + // So does a null `from`, with a type object selected. + sel(&mut s, &[top]); + let r = s.execute("edit.findNext", &json!({"find": "cat", "from": null})).unwrap(); + assert_eq!(found(&r), (top.0, 2, 5, 1, 3)); // Nothing found: no match, and the selection stays. let r = s.execute("edit.findNext", &json!({"find": "zebra"})).unwrap(); assert_eq!((r, selected(&s)), (json!({"id": null, "count": 0}), vec![top])); diff --git a/crates/ui-egui/src/dialogs/find_replace.rs b/crates/ui-egui/src/dialogs/find_replace.rs index f56d07c722..8e229980e6 100644 --- a/crates/ui-egui/src/dialogs/find_replace.rs +++ b/crates/ui-egui/src/dialogs/find_replace.rs @@ -204,9 +204,8 @@ fn remember(app: &mut VectorcraftApp, d: &Dialog) { fn find(app: &mut VectorcraftApp, d: &mut Dialog) -> Result { let mut p = query(d); p["backwards"] = json!(d.bool("backwards")); - if let Some(at) = place(app, d) { - p["from"] = at.clone(); - } + // With no place, the search starts at the first match, not after the selected type object. + p["from"] = place(app, d).cloned().unwrap_or(Value::Null); d.fields.remove(FOUND); d.fields.remove(NOTE); let r = app.run(NEXT, p)?; diff --git a/crates/ui-egui/src/dialogs/find_replace/tests.rs b/crates/ui-egui/src/dialogs/find_replace/tests.rs index 59dbe4937b..1f2bb756ab 100644 --- a/crates/ui-egui/src/dialogs/find_replace/tests.rs +++ b/crates/ui-egui/src/dialogs/find_replace/tests.rs @@ -195,6 +195,23 @@ fn an_action_of_the_wrong_type_runs_no_action() { assert_ne!(matched(&app), at, "a string action still runs"); } +/// Find with other Find text starts again at the first match, the matches in the type object the +/// last Find selected included. +#[test] +fn find_with_other_text_starts_at_the_first_match() { + let (mut app, ids) = app_with(&["dog", "cat dog"]); + let (bottom, top) = (ids[0], ids[1]); + choose(&mut app); + set(&mut app, "find", json!("cat")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((matched(&app), selected(&app)), (Some((top, 0, 3)), vec![top])); + set(&mut app, "find", json!("dog")); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!((matched(&app), selected(&app)), (Some((top, 4, 7)), vec![top])); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(matched(&app), Some((bottom, 0, 3))); +} + /// The dialog stays open from match to match: Find goes to the next match and selects its /// object, Replace changes that match, Replace & Find changes it and goes on, Replace All changes /// the rest, and Done closes. Each Replace is one undo step, and so is Replace All; finding and a diff --git a/docs/mcp.md b/docs/mcp.md index accd19856e..1b0bcf1ef0 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9969,8 +9969,10 @@ recorded for undo. - These rules are VectorCraft's own. Inside a type object the matches come in reading order, or from the last with `backwards`. `from: {id, start, end}`, a match the command returned or the range `edit.replaceMatch` returned, is where the search goes on from; past the last match it starts again at the first. Without `from` it goes on after the - first selected type object, and with no type selected it starts at the first match. A match on a hidden or locked - layer comes back with `selected: false` and the selection stays as it is. A match stays inside one style run. + first selected type object, and with no type selected, or with `from: null`, it starts at the first match. The Find + and Replace dialog sends `from: null` when it has no place to go on from, as when its Find text or a switch changed + since its last match. A match on a hidden or locked layer comes back with `selected: false` and the selection stays + as it is. A match stays inside one style run. `edit.replaceMatch {find, replace?, matchCase?, wholeWord?, id, start, end}` replaces that one match with `replace` as one undo step and returns `{id, start, end, replaced}`, with `start` and `end` the replacement's bytes. Bytes that From 1d974067ce015863ce3e56903b8bc82528f73559 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 22:57:51 -0800 Subject: [PATCH 211/247] Fix #8537: Dimension tool points land on preview bounds corners With Use Preview Bounds on, W and H measure a stroked path from the outside of its stroke, while the Dimension tool's Linear points only snapped to the path's anchors, on the stroke's centerline. A dimension between the corners of a 12 x 6 mm rectangle with a 0.4 mm stroke then read 11.6 x 5.6 mm. - With Use Preview Bounds on, a Linear click within 8 pixels of a corner of the preview bounds of a path or compound path (strokes and effects included) lands on that corner instead of on that object's anchors, whatever the snapping options. An anchor of other art nearer the pointer than the corner takes the point, and a corner that is also an anchor takes the anchor. - The point is held against the anchors of the path whose bounds reach that corner, also when the corner lies far from the path or on another path's segment. It moves with the path; a later change to the stroke weight does not move it. - A press on such a corner picks it when the pointer moves a few pixels before the release, as on an anchor. - Hovering by such a corner shows the anchor ring. The ring now also shows when the pointer is exactly on the point a pick lands on, which it did not for the end of a dimension's line. Docs: docs/dimensions.md, docs/target-app-parity.md. --- crates/tools/src/dimension.rs | 384 ++++++++++++++++++++++++++++++++-- docs/dimensions.md | 15 +- docs/target-app-parity.md | 1 + 3 files changed, 379 insertions(+), 21 deletions(-) diff --git a/crates/tools/src/dimension.rs b/crates/tools/src/dimension.rs index 3e50415434..edb12b1db1 100644 --- a/crates/tools/src/dimension.rs +++ b/crates/tools/src/dimension.rs @@ -4,11 +4,12 @@ //! a click on a circle or arc gives its radius. Escape cancels without leaving any artwork. use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, ToolContext, ToolKey}; use serde_json::{Value, json}; +use std::collections::HashMap; use vectorcraft_doc::{ - Node, NodeId, + Node, NodeId, NodeKind, dimension::{self, Dimension, DimensionMode, DimensionOptions, DimensionSource, FreePoint, Orientation, PointRef, SegmentRef}, }; -use vectorcraft_geom::{BezPath, Point, Vec2}; +use vectorcraft_geom::{BezPath, Point, Rect, Vec2}; /// The three kinds of dimension the tool draws. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] @@ -68,7 +69,7 @@ pub struct DimensionTool { /// Where the next Linear pick lands, as last worked out for the pointer (for the overlays). snapped: Option<(Point, Option)>, /// Whether the last Linear pick worked out landed on the end of a line of a dimension already - /// drawn (shown as an anchor). + /// drawn, or on a corner of a path's preview bounds (shown as an anchor). on_end: bool, /// Whether the press under way began on an anchor a Linear click picks. press_on_anchor: bool, @@ -76,6 +77,8 @@ pub struct DimensionTool { /// for that click (a snap or Shift can move the point away from it): placed with the pointer /// still at either, it is aligned. second: Option<(Point, Point)>, + /// The preview bounds the Linear picks measured, for the document's revision. + preview_boxes: PreviewBoxes, } /// What a linear dimension between `a` and `b` measures with the pointer at `p` while it is @@ -170,9 +173,14 @@ fn anchor_near(cx: &ToolContext, edge: &SegmentRef, p: Point) -> Option<(usize, /// The anchor nearest `p` within reach, on any editable path (the topmost on a tie), as a link to /// its path. Bounded work, and dimension artwork is skipped, as in [`pick`]. fn anchor_under(cx: &ToolContext, p: Point) -> Option<(Point, PointRef)> { + anchor_under_where(cx, p, |_| true) +} + +/// [`anchor_under`] outside the objects `keep` turns down, and outside everything in them. +fn anchor_under_where(cx: &ToolContext, p: Point, keep: impl Fn(NodeId) -> bool) -> Option<(Point, PointRef)> { type Best = Option<(f64, Point, PointRef)>; - fn visit(n: &Node, p: Point, reach: f64, budget: &mut usize, best: &mut Best) { - if *budget == 0 || !n.visible || n.locked || n.extras().dimension.is_some() { + fn visit(n: &Node, p: Point, reach: f64, keep: &dyn Fn(NodeId) -> bool, budget: &mut usize, best: &mut Best) { + if *budget == 0 || !n.visible || n.locked || n.extras().dimension.is_some() || !keep(n.id) { return; } if let Some(path) = n.path_data() { @@ -191,17 +199,140 @@ fn anchor_under(cx: &ToolContext, p: Point) -> Option<(Point, PointRef)> { } if let Some(ch) = n.children() { for c in ch.iter().rev() { - visit(c, p, reach, budget, best); + visit(c, p, reach, keep, budget, best); } } } let (reach, mut budget, mut best) = (cx.tol(ANCHOR_REACH), 20_000usize, None); for n in cx.doc.layers.iter().rev() { - visit(n, p, reach, &mut budget, &mut best); + visit(n, p, reach, &keep, &mut budget, &mut best); } best.map(|(_, at, r)| (at, r)) } +/// The geometric bounds of the paths [`preview_corner`] looked at, and the preview bounds of +/// those it measured, kept while the document is unchanged, so that the pointer moving over the +/// art measures each path once. +#[derive(Default)] +struct PreviewBoxes { + revision: Option<(u64, u64)>, + geometric: HashMap>, + preview: HashMap>, +} + +/// A corner of an object's preview bounds that a Linear pick can land on. +#[derive(Clone, Copy, Debug)] +struct PreviewCorner { + at: Point, + /// The path the point is held against. + holder: NodeId, + /// The path or compound path whose preview bounds have the corner. + object: NodeId, +} + +/// With Use Preview Bounds on, the corner of a path's or compound path's preview bounds (its +/// strokes and effects included) nearest `p` within reach, on any editable one whose preview +/// bounds differ from its geometric bounds. In a compound path, the member whose own box reaches +/// nearest to the corner holds it. The work is bounded, and dimension artwork is skipped, as in +/// [`pick`]. `cache` keeps the bounds measured for the document's revision. +fn preview_corner(cx: &ToolContext, p: Point, cache: &mut PreviewBoxes) -> Option { + struct Walk<'a, 'c> { + symbols: Option>, + doc: &'a vectorcraft_doc::Document, + cache: &'c mut PreviewBoxes, + p: Point, + reach: f64, + budget: usize, + best: Option<(f64, PreviewCorner)>, + } + fn visit(n: &Node, w: &mut Walk) { + if w.budget == 0 || !n.visible || n.locked || n.extras().dimension.is_some() { + return; + } + w.budget -= 1; + // Only effects, on the object or on one of its fills or strokes, paint further out than + // its strokes reach. + let effects = !n.appearance.effects.is_empty() || n.appearance.items.iter().any(|i| !i.effects().is_empty()); + let reach = n.appearance.outset() + w.reach; + let corners = |r: Rect| [Point::new(r.x0, r.y0), Point::new(r.x1, r.y0), Point::new(r.x1, r.y1), Point::new(r.x0, r.y1)]; + // A path is its own member; a compound path's members are its paths. + let compound = match &n.kind { + NodeKind::Compound { children, .. } => Some(children.as_slice()), + _ => None, + }; + let members = + || compound.into_iter().flatten().map(|c| c.as_ref()).chain(compound.is_none().then_some(n)).filter(|m| m.path_data().is_some()); + if members().next().is_some() + && let Some(geometric) = *w.cache.geometric.entry(n.id).or_insert_with(|| n.geometric_bounds()) + && (effects || geometric.inflate(reach, reach).contains(w.p)) + { + let doc = w.doc; + let measured = match w.cache.preview.get(&n.id) { + Some(r) => *r, + None => { + let symbols = w.symbols.get_or_insert_with(|| doc.symbol_boxes()); + let r = vectorcraft_effects::preview::visual_bounds(symbols, n); + w.cache.preview.insert(n.id, r); + r + } + }; + if let Some(r) = measured + && r != geometric + { + for (k, q) in corners(r).into_iter().enumerate() { + let d = q.distance(w.p); + if d > w.reach || w.best.is_some_and(|(nearest, ..)| d >= nearest) { + continue; + } + // The path whose own box reaches furthest towards the corner holds it: in a + // compound path, the member that puts that corner where it is. + let mut holder = None; + for m in members() { + let Some(b) = *w.cache.geometric.entry(m.id).or_insert_with(|| m.geometric_bounds()) else { continue }; + let gap = corners(b).get(k).map_or(f64::INFINITY, |c| c.distance(q)); + if holder.is_none_or(|(near, _)| gap < near) { + holder = Some((gap, m.id)); + } + } + if let Some((_, holder)) = holder { + w.best = Some((d, PreviewCorner { at: q, holder, object: n.id })); + } + } + } + } + if let Some(ch) = n.children() { + for c in ch.iter().rev() { + visit(c, w); + } + } + } + // Anchors take a pick whatever the snapping options, and so do the corners standing in for them. + if !cx.preview_bounds { + return None; + } + if cache.revision != Some(cx.revision) { + *cache = PreviewBoxes { revision: Some(cx.revision), ..Default::default() }; + } + let mut w = Walk { symbols: None, doc: cx.doc, cache, p, reach: cx.tol(ANCHOR_REACH), budget: 20_000, best: None }; + for n in cx.doc.layers.iter().rev() { + visit(n, &mut w); + } + w.best.map(|(_, corner)| corner) +} + +/// The anchor a pick at `p` lands on instead of `corner`, given `anchor`, the nearest anchor +/// within reach; `None` when the corner takes it. The corner takes the pick from the anchors of +/// the object whose preview bounds have it, which sit on the stroke's centerline. An anchor right +/// on the corner takes it, and so does the nearest anchor of other art when that anchor is nearer +/// the pointer than the corner. +fn anchor_over_corner(cx: &ToolContext, p: Point, corner: &PreviewCorner, anchor: Option<(Point, PointRef)>) -> Option<(Point, PointRef)> { + let (at, _) = anchor.as_ref()?; + if at.distance(corner.at) <= 1e-9 { + return anchor; + } + anchor_under_where(cx, p, |id| id != corner.object).filter(|(other, _)| other.distance(p) < corner.at.distance(p)) +} + /// Where a pick at `p` lands on the artwork of the visible, unlocked dimensions already drawn, /// with no link to it: the nearest end of one of their lines (dimension and extension lines) /// within the anchor reach, as an anchor (`true`); else the nearest point of one of those lines @@ -303,10 +434,24 @@ fn nearest_on(cx: &ToolContext, edge: &SegmentRef, p: Point) -> Option { /// A point on a segment keeps its place along the segment. Any other point is held /// against the anchors of the path under it, or, with no path under it, the path of the other /// point, so that it moves with that path. None when neither point has a path to link to. -fn points_source(cx: &ToolContext, (a, ra): (Point, &Option), (b, rb): (Point, &Option)) -> Option { - let (edge_a, edge_b) = (pick(cx, a), pick(cx, b)); - let node = |r: &Option, e: &Option| r.as_ref().map(|r| r.node).or_else(|| e.as_ref().map(|e| e.node)); - let (path_a, path_b) = (node(ra, &edge_a), node(rb, &edge_b)); +fn points_source( + cx: &ToolContext, + boxes: &mut PreviewBoxes, + (a, ra): (Point, &Option), + (b, rb): (Point, &Option), +) -> Option { + // A point on a corner of a path's preview bounds is held against that path, however far its + // strokes or effects put the corner from the path and whatever other segment lies there. + let mut corner_of = |p: Point, r: &Option| { + r.is_none().then(|| preview_corner(cx, p, boxes)).flatten().filter(|c| c.at.distance(p) <= 1e-9).map(|c| c.holder) + }; + let (corner_a, corner_b) = (corner_of(a, ra), corner_of(b, rb)); + let edge = |p: Point, corner: Option| if corner.is_some() { None } else { pick(cx, p) }; + let (edge_a, edge_b) = (edge(a, corner_a), edge(b, corner_b)); + let node = |r: &Option, corner: Option, e: &Option| { + r.as_ref().map(|r| r.node).or(corner).or_else(|| e.as_ref().map(|e| e.node)) + }; + let (path_a, path_b) = (node(ra, corner_a, &edge_a), node(rb, corner_b, &edge_b)); let free = |p: Point, r: &Option, edge: &Option, own: Option, other: Option| { if r.is_some() { return None; @@ -324,7 +469,10 @@ fn points_source(cx: &ToolContext, (a, ra): (Point, &Option), (b, rb): } impl DimensionTool { - /// Where a Linear pick at `p` lands: on the nearest anchor of any path, within reach (kept as + /// Where a Linear pick at `p` lands: with Use Preview Bounds on, on the nearest corner of a + /// path's preview bounds within reach, where they differ from its anchors, unless an anchor of + /// other art is nearer (held against the path, labeled "anchor"; [`anchor_over_corner`]); else on the + /// nearest anchor of any path, within reach (kept as /// a link to its path), labeled "anchor"; else on the nearest end of a line of a dimension /// already drawn, within the same reach (no link), also labeled "anchor"; else where Smart Guides put it (another object's anchor or centre, in /// line with one, or for the second point square to a segment or grazing a curve from the @@ -341,7 +489,16 @@ impl DimensionTool { }); let guided = self.snap.hover(cx, p, &[], leave.as_ref()); self.on_end = false; - if let Some((point, reference)) = anchor_under(cx, p) { + let mut anchor = anchor_under(cx, p); + if let Some(corner) = preview_corner(cx, p, &mut self.preview_boxes) { + anchor = anchor_over_corner(cx, p, &corner, anchor); + if anchor.is_none() { + self.on_end = true; + self.snap.label(corner.at, "anchor"); + return (corner.at, None); + } + } + if let Some((point, reference)) = anchor { self.snap.label(point, "anchor"); return (point, Some(reference)); } @@ -509,7 +666,7 @@ impl DimensionTool { } self.points.push((at, reference)); if let [(a, ra), (b, rb)] = self.points.as_slice() { - let source = points_source(cx, (*a, ra), (*b, rb)); + let source = points_source(cx, &mut self.preview_boxes, (*a, ra), (*b, rb)); let mut d = self.recipe(DimensionMode::Linear, *a, *b, Point::ZERO, source); if d.resolve(cx.doc).is_ok() { self.second = Some((*b, p)); @@ -609,11 +766,14 @@ impl Tool for DimensionTool { self.press = Some((ev.pos, None)); return self.preview(cx, ev.pos); } - // A Linear press on an anchor, or on the end of a dimension's line, picks it unless - // it drags past the anchor's reach: moving a few pixels before the release does not - // drag out the dimension of a segment under the pointer. - self.press_on_anchor = - self.kind == Kind::Linear && (anchor_under(cx, ev.pos).is_some() || on_dimensions(cx, ev.pos).is_some_and(|(_, end)| end)); + // A Linear press on an anchor, on a corner of preview bounds or on the end of a + // dimension's line, picks it unless it drags past the anchor's reach: moving a few + // pixels before the release does not drag out the dimension of a segment under the + // pointer. + self.press_on_anchor = self.kind == Kind::Linear + && (anchor_under(cx, ev.pos).is_some() + || preview_corner(cx, ev.pos, &mut self.preview_boxes).is_some() + || on_dimensions(cx, ev.pos).is_some_and(|(_, end)| end)); self.press = Some((ev.pos, self.target(cx, ev.pos))); vec![] } @@ -727,7 +887,7 @@ impl Tool for DimensionTool { let linear_pick = self.kind == Kind::Linear && self.pending.is_none() && self.lines.is_empty(); let snapped = self.snapped.clone().filter(|_| linear_pick); if let Some((q, reference)) = &snapped - && (reference.is_some() || q.distance(self.at) > 1e-9) + && (reference.is_some() || self.on_end || q.distance(self.at) > 1e-9) { let on_anchor = reference.is_some() || self.on_end; out.push(Overlay::Anchor { p: *q, color, filled: !on_anchor, size: if on_anchor { 10.0 } else { 6.0 } }); @@ -937,6 +1097,190 @@ mod tests { assert!(at.distance(pending.b) < 1e-9, "{at:?} {:?}", pending.b); } + /// With Use Preview Bounds on, clicks by the corners of a stroked path land on the corners of + /// its preview bounds, held against the path, so the dimension measures the outside of the + /// stroke as W and H do. Without a stroke, or with the preference off, the anchors are picked. + #[test] + fn with_preview_bounds_points_land_on_the_corners_of_the_stroke() { + use vectorcraft_doc::dimension::FreePoint; + let (d, id) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let pick = |c: &ToolContext| { + let mut t = DimensionTool::default(); + for (x, y) in [(101.0, 101.0), (199.0, 199.0)] { + t.pointer(c, &PointerEvent::new(PointerKind::Move, x, y)); + t.pointer(c, &PointerEvent::new(PointerKind::Down, x, y)); + t.pointer(c, &PointerEvent::new(PointerKind::Up, x, y)); + } + t.pending.expect("both points were picked") + }; + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let pending = pick(&c); + let near = |a: Point, b: Point| a.distance(b) < 1e-9; + assert!(near(pending.a, Point::new(99.5, 99.5)) && near(pending.b, Point::new(200.5, 200.5)), "{:?} {:?}", pending.a, pending.b); + let Some(DimensionSource::Points { a: None, b: None, free_a: Some(free_a), free_b: Some(free_b), .. }) = &pending.source else { + panic!("{:?}", pending.source) + }; + for (free, at) in [(free_a, pending.a), (free_b, pending.b)] { + assert!(matches!(free, FreePoint::Anchors { node, .. } if *node == id), "{free:?}"); + assert!(free.position(&d).expect("the anchors that hold it exist").distance(at) < 1e-9); + } + // A line of another path through the corner leaves the point held against the rectangle. + let mut crossed = d.clone(); + let (l, line) = (crossed.layers[0].id, crossed.alloc_id()); + let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(0.0, 99.5), Point::new(300.0, 99.5)], false)); + crossed.insert(Some(l), 1, Node::path(line, path, vectorcraft_doc::Appearance::default_art())).expect("the line"); + let pending = pick(&ToolContext { preview_bounds: true, ..cx(&crossed, &s, &p) }); + assert!(near(pending.a, Point::new(99.5, 99.5)), "{:?}", pending.a); + let Some(DimensionSource::Points { free_a: Some(free_a), .. }) = &pending.source else { panic!("{:?}", pending.source) }; + assert!(matches!(free_a, FreePoint::Anchors { node, .. } if *node == id), "{free_a:?}"); + let anchors = |pending: &Dimension| (pending.a, pending.b, pending.source.clone()); + let anchor = |anchor| Some(PointRef { node: id, subpath: 0, anchor }); + let linked = DimensionSource::Points { a: anchor(0), b: anchor(2), vertex: None, free_a: None, free_b: None }; + let off = pick(&cx(&d, &s, &p)); + assert_eq!(anchors(&off), (Point::new(100.0, 100.0), Point::new(200.0, 200.0), Some(linked.clone())), "preference off"); + let mut bare = d.clone(); + bare.node_mut(id).expect("the rectangle").appearance = vectorcraft_doc::Appearance::default().into(); + let c = ToolContext { preview_bounds: true, ..cx(&bare, &s, &p) }; + assert_eq!(anchors(&pick(&c)), (Point::new(100.0, 100.0), Point::new(200.0, 200.0), Some(linked)), "no stroke"); + // A compound path's stroke: the points are held against the member that reaches the + // corner, not the small hole drawn first. + let mut compound = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, hole, part, whole) = (compound.layers[0].id, compound.alloc_id(), compound.alloc_id(), compound.alloc_id()); + let square = |id, a: f64, b: f64| { + std::sync::Arc::new(Node::path(id, vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(a, a, b, b)), Default::default())) + }; + let children = vec![square(hole, 140.0, 160.0), square(part, 100.0, 200.0)]; + let mut n = Node::new(whole, NodeKind::Compound { children, rule: Default::default() }); + n.appearance = vectorcraft_doc::Appearance::default_art().into(); + compound.insert(Some(l), 0, n).expect("the compound path"); + let pending = pick(&ToolContext { preview_bounds: true, ..cx(&compound, &s, &p) }); + assert!(near(pending.a, Point::new(99.5, 99.5)) && near(pending.b, Point::new(200.5, 200.5)), "{:?} {:?}", pending.a, pending.b); + let Some(DimensionSource::Points { free_a: Some(free_a), free_b: Some(free_b), .. }) = &pending.source else { + panic!("{:?}", pending.source) + }; + for free in [free_a, free_b] { + assert!(matches!(free, FreePoint::Anchors { node, .. } if *node == part), "{free:?}"); + } + // A 40 point stroke, and an Offset Path effect on the fill, put the corners further from + // the path than a click on the path reaches: the points still land there and stay linked. + let mut wide = vectorcraft_doc::Appearance::default_art(); + wide.stroke_mut().expect("a stroke").width = 40.0; + let mut offset = vectorcraft_doc::Appearance::default_art(); + let effect = + vectorcraft_doc::Effect { id: "path.offsetPath".into(), params: serde_json::json!({"offset": 30, "joins": "miter"}), visible: true }; + offset.effects_mut(Some(0)).expect("the fill").push(effect); + for (appearance, out) in [(wide, 20.0), (offset, 30.0)] { + let mut d = d.clone(); + d.node_mut(id).expect("the rectangle").appearance = appearance.into(); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + for (x, y) in [(101.0 - out, 101.0 - out), (199.0 + out, 199.0 + out)] { + t.pointer(&c, &PointerEvent::new(PointerKind::Move, x, y)); + t.pointer(&c, &PointerEvent::new(PointerKind::Down, x, y)); + t.pointer(&c, &PointerEvent::new(PointerKind::Up, x, y)); + } + let pending = t.pending.expect("both points were picked"); + let (a, b) = (Point::new(100.0 - out, 100.0 - out), Point::new(200.0 + out, 200.0 + out)); + assert!(near(pending.a, a) && near(pending.b, b), "{out}: {:?} {:?}", pending.a, pending.b); + let Some(DimensionSource::Points { free_a: Some(free_a), free_b: Some(free_b), .. }) = &pending.source else { + panic!("{out}: {:?}", pending.source) + }; + for free in [free_a, free_b] { + assert!(matches!(free, FreePoint::Anchors { node, .. } if *node == id), "{out}: {free:?}"); + } + } + // A press on a corner over another path's segment picks the corner when the pointer moves + // a few pixels before the release, as on an anchor. + let mut d = d.clone(); + let mut wide = vectorcraft_doc::Appearance::default_art(); + wide.stroke_mut().expect("a stroke").width = 40.0; + d.node_mut(id).expect("the rectangle").appearance = wide.into(); + let (l, line) = (d.layers[0].id, d.alloc_id()); + let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(0.0, 82.0), Point::new(95.0, 82.0)], false)); + d.insert(Some(l), 1, Node::path(line, path, Default::default())).expect("the line"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Down, 81.0, 81.0)).is_empty()); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Drag, 85.0, 81.0)).is_empty(), "no segment dimension is dragged out"); + assert!(t.pointer(&c, &PointerEvent::new(PointerKind::Up, 85.0, 81.0)).is_empty()); + assert!(t.points.first().is_some_and(|(q, _)| near(*q, Point::new(80.0, 80.0))), "{:?}", t.points); + } + + /// With Use Preview Bounds on, hovering by a corner of a stroked path's preview bounds, or + /// right on it, shows the anchor ring there. + #[test] + fn hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + for (x, y) in [(101.0, 101.0), (99.5, 99.5)] { + let mut t = DimensionTool::default(); + t.pointer(&c, &PointerEvent::new(PointerKind::Move, x, y)); + let ring = t + .overlays(&c) + .into_iter() + .any(|o| matches!(o, Overlay::Anchor { p, filled: false, size, .. } if p.distance(Point::new(99.5, 99.5)) < 1e-9 && size == 10.0)); + assert!(ring, "({x}, {y})"); + } + } + + /// With Use Preview Bounds on, a corner of the preview bounds takes a pick with Smart Guides and + /// Snap to Point off, as an anchor does, and an anchor of other art nearer the pointer than the + /// corner takes it from the corner. The point moves with the path, and a later change to the + /// stroke weight leaves it where it was. + #[test] + fn preview_bounds_corners_take_picks_as_anchors_do() { + let (d, id) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let near = |a: Point, b: Point| a.distance(b) < 1e-9; + let pick = |c: &ToolContext, at: [(f64, f64); 2]| { + let mut t = DimensionTool::default(); + for (x, y) in at { + t.pointer(c, &PointerEvent::new(PointerKind::Move, x, y)); + t.pointer(c, &PointerEvent::new(PointerKind::Down, x, y)); + t.pointer(c, &PointerEvent::new(PointerKind::Up, x, y)); + } + t.pending.expect("both points were picked") + }; + let unsnapped = ToolContext { preview_bounds: true, smart_guides: false, snap_to_point: false, ..cx(&d, &s, &p) }; + let pending = pick(&unsnapped, [(101.0, 101.0), (199.0, 199.0)]); + assert!(near(pending.a, Point::new(99.5, 99.5)) && near(pending.b, Point::new(200.5, 200.5)), "{:?} {:?}", pending.a, pending.b); + // An unstroked line whose end lies 2.5 points outside the corner. + let mut other = d.clone(); + let (l, line) = (other.layers[0].id, other.alloc_id()); + let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(97.0, 97.0), Point::new(50.0, 50.0)], false)); + other.insert(Some(l), 1, Node::path(line, path, Default::default())).expect("the line"); + let c = ToolContext { preview_bounds: true, ..cx(&other, &s, &p) }; + let pending = pick(&c, [(97.5, 97.5), (199.0, 199.0)]); + assert!(near(pending.a, Point::new(97.0, 97.0)), "the line's end is nearer: {:?}", pending.a); + let Some(DimensionSource::Points { a: Some(a), .. }) = &pending.source else { panic!("{:?}", pending.source) }; + assert_eq!(a.node, line); + let pending = pick(&c, [(99.0, 99.0), (199.0, 199.0)]); + assert!(near(pending.a, Point::new(99.5, 99.5)), "the corner is nearer: {:?}", pending.a); + // Right on the rectangle's anchor, with another path's anchor nearer than the corner: that + // anchor takes the point, not the rectangle's own anchor on the stroke's centerline. + let mut beside = d.clone(); + let (l, line) = (beside.layers[0].id, beside.alloc_id()); + let path = + vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(100.5, 100.0), Point::new(150.0, 50.0)], false)); + beside.insert(Some(l), 1, Node::path(line, path, Default::default())).expect("the line"); + let pending = pick(&ToolContext { preview_bounds: true, ..cx(&beside, &s, &p) }, [(100.0, 100.0), (199.0, 199.0)]); + let Some(DimensionSource::Points { a: Some(a), .. }) = &pending.source else { panic!("{:?}", pending.source) }; + assert!(near(pending.a, Point::new(100.5, 100.0)) && a.node == line, "{:?} {a:?}", pending.a); + // The point held against the rectangle moves with it and stays put when the stroke changes. + let pending = pick(&ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }, [(101.0, 101.0), (199.0, 199.0)]); + let Some(DimensionSource::Points { free_a: Some(free), .. }) = &pending.source else { panic!("{:?}", pending.source) }; + let mut moved = d.clone(); + moved.node_mut(id).expect("the rectangle").transform(vectorcraft_geom::Affine::translate((10.0, 0.0)), false); + assert!(free.position(&moved).is_some_and(|q| near(q, Point::new(109.5, 99.5))), "{:?}", free.position(&moved)); + let mut wider = d.clone(); + let mut wide = vectorcraft_doc::Appearance::default_art(); + wide.stroke_mut().expect("a stroke").width = 40.0; + wider.node_mut(id).expect("the rectangle").appearance = wide.into(); + assert!(free.position(&wider).is_some_and(|q| near(q, Point::new(99.5, 99.5))), "{:?}", free.position(&wider)); + } + /// The anchors of a live rectangle are picked the same way. #[test] fn a_press_on_a_live_shapes_anchor_picks_it() { diff --git a/docs/dimensions.md b/docs/dimensions.md index 35e164d4f9..b15d8f8727 100644 --- a/docs/dimensions.md +++ b/docs/dimensions.md @@ -20,7 +20,8 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers first point was picked on an anchor, the second also snaps onto the construction guides through it; any other first point has no construction guides through it. The guides show while hovering, before each click. VectorCraft's own rules decide where a point lands: an - anchor within 8 pixels takes it first; with Smart Guides or Snap to Point on, the end of a line + anchor within 8 pixels takes it first (with Use Preview Bounds on, after a corner of a path's + preview bounds, as below); with Smart Guides or Snap to Point on, the end of a line of a visible, unlocked dimension already drawn (its dimension line, or the far end of an extension line) within 8 pixels takes it next, without a link to that dimension; a point on a guide stays on the guide where the pointer @@ -31,6 +32,18 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers line of a dimension already drawn, within 8 pixels. With Smart Guides and Anchor/Path Labels on, a point on an anchor or a line end shows the "anchor" label, and a point on a segment or line shows the "path" label. These rules apply to the Linear points. + With Use Preview Bounds on (Preferences › General), a click within 8 pixels of a corner of the + preview bounds of a path or compound path, its strokes and effects included, lands on that + corner instead of on that object's anchors, as the + [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) + describes for measuring a stroked segment. An anchor of other art that is nearer the pointer + than the corner takes the point instead. The point is linked to the path (in a compound path, + to the member whose own bounds reach nearest to the corner), held against its anchors, and + shows the "anchor" label. It moves with the path, and a later change to the stroke weight does + not move it. For an object that is not rotated, a horizontal or vertical dimension between two + such corners measures the outside of the stroke, the width or height that W and H show in the + Transform and Properties panels. A corner that is also an anchor, as on a path without a + stroke, takes the anchor. A linear dimension is aligned, horizontal or vertical, as the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes: after the second click, clicking again places an aligned dimension, and moving the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b6f0207e69..cb2da583b9 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -635,6 +635,7 @@ since 2026-10-01. **Drawing tools, Dimension tool points on a Smart Guide stay on the guide:** By VectorCraft's own rule, a clicked point that lies on a Smart Guide already, such as one in line with an object's center, stays where the pointer is when no anchor is within 8 pixels and no segment is within the Smart Guides snapping tolerance, instead of moving onto a segment farther than that tolerance and within 8 pixels; with Snap to Grid or Snap to Pixel on, a point stays on the grid or the whole pixel those options give. `a_point_on_a_guide_stays_on_the_guide` covers it. **Drawing tools, Dimension tool second point without construction guides through a first point off the anchors:** By VectorCraft's own rule, with Smart Guides on, the second Linear point does not snap to the construction guides through a first point that is not on an anchor, so a click beside a segment straight below such a first point lands on the segment; after a first point picked on an anchor, the construction guides through it still apply. The second point still snaps to anchors, centers and alignment lines, and with Snap to Perpendicular or Snap to Tangent on, it lands where the line from the first point meets a segment square or grazes a curve. `a_point_on_a_guide_stays_on_the_guide`, `the_second_point_after_an_anchor_lands_on_construction_guides`, `the_second_point_lands_square_to_a_segment_or_grazing_a_curve` and `linear_picks_show_and_snap_to_smart_guides` cover it. **Drawing tools, Dimension tool points land on dimensions already drawn (#8063):** By VectorCraft's own rule, with Smart Guides or Snap to Point on, a Linear point that no anchor of the art within 8 pixels takes lands on the end of a visible, unlocked dimension's dimension line, or on the far end of its extension line, within 8 pixels, and a point that nothing else places lands on the closest point of such a line within 8 pixels, so at any zoom a dimension can start where another one ends. The end of an extension line next to the point it measures does not pull points away from that anchor. With Smart Guides and Anchor/Path Labels on, a point on an anchor or line end shows the "anchor" label and a point on a segment or line shows the "path" label. `linear_picks_land_on_anchors_paths_and_drawn_dimensions` and `an_anchor_beside_a_drawn_dimension_takes_the_point` cover it. +**Drawing tools, Dimension tool points on preview bounds (#8537):** With Use Preview Bounds on, a Linear point clicked within 8 pixels of a corner of the preview bounds of a path or compound path with a stroke or effects lands on that corner instead of on that object's anchors, as the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes, unless an anchor of other art is nearer the pointer; for an object that is not rotated, a horizontal or vertical dimension between two such corners measures the size that W and H show. `with_preview_bounds_points_land_on_the_corners_of_the_stroke`, `preview_bounds_corners_take_picks_as_anchors_do` and `hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring` cover it. **Drawing tools, Dimension tool dimensions selected with their art keep their lines and label:** Object › Expand, Object › Expand Appearance and Object › Path › Outline Stroke leave a dimension selected with art it measures, directly or in selected groups without fills, strokes or effects of their own, as it is and change only the other art; when the new art no longer fits its link, the dimension stays where it was, no longer linked, and undo links it again. `expand_leaves_a_dimension_selected_with_its_art_as_it_is`, `expand_appearance_leaves_a_dimension_selected_with_its_art_as_it_is`, `outline_stroke_leaves_a_dimension_selected_with_its_art_as_it_is`, `a_dimension_selected_with_art_that_has_nothing_to_expand_changes_nothing`, `a_group_effect_expanded_reaches_the_dimension_it_holds`, `expand_keeps_a_dimension_in_its_asset_and_its_variable_binding`, `a_dimension_keeps_no_link_to_the_art_expand_replaced`, `a_dimension_outlasts_the_art_outline_stroke_or_expand_appearance_replaced`, `a_dimension_outlasts_the_stroke_expand_outlined` and `expand_appearance_in_safe_mode_leaves_a_dimension_selected_with_its_art` cover it. **Drawing tools, Line Segment from one curve onto a common tangent of another:** By VectorCraft's own rule, with Smart Guides and Snap to Tangent on, a Line Segment drag pressed anywhere on a convex closed path with curves and dragged to within the snapping tolerance of another such path lands on a common tangent of the two ([tangent lines to circles](https://en.wikipedia.org/wiki/Tangent_lines_to_circles)): both ends move to where the line touches the paths, the start sliding along the first path, and each end shows the "tangent" label when Anchor/Path Labels is on, with the line drawn as a guide when Alignment Guides is on. The line is the tangent whose touch point on the second path is nearest the pointer, so moving the pointer around the second path switches between the outer tangent and the one crossing between the paths. The start stays where it was pressed when Shift, Alt or Space is held, when an anchor, center or crossing lies nearer the pointer than the second path does, when the press snapped to an anchor, center or crossing off the first path, when Snap to Tangent is off, when Snap to Grid or pixel snapping places drawn points, or when either path bends inward somewhere or has more than 512 segments. `a_line_from_one_circle_to_another_lands_on_their_common_tangent`, `a_line_from_a_turned_ellipse_lands_on_its_tangent_with_a_circle`, `a_line_near_the_second_path_takes_the_tangent_touching_it_nearest`, `a_line_keeps_its_start_without_a_tangent_snap`, `a_line_to_a_crescent_or_from_an_anchor_beside_the_curve_keeps_its_start` and `a_line_segment_drag_draws_the_common_tangent_as_one_undo_step` cover it. **Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views:** `live_trace_result_bounds_exclude_the_retained_bitmap_at_any_angle` checks every TraceView, geometric and visual bounds and rotated result bounds. `live_trace_selection_highlight_excludes_the_retained_source_rectangle` checks result highlights and the existing ordinary-group policy. Shared editing-child traversal also preserves Shaper handling. From d597c950f0e5c003b8f1e4ccd4a57f4d8d117ddb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:53:46 -0800 Subject: [PATCH 212/247] Links: Unembed keeps the clip group of a PSD file's clipping path An image placed from a PSD or PSB file that names a clipping path comes in a clip group of that path, and its image is kept as a PNG (or, for a CMYK file, a TIFF) that holds the path. Unembed writes that file as stored, but the file was read back without the path, so Unembed turned the clip group into a plain group, and File > Open, File > Place, Relink and Update Links of the written file gave an unclipped image. The shared loader now reads the path a PNG or TIFF keeps, so these commands keep the clip group, for Unembed with a path and with a folder. --- crates/engine/src/cmd/fileio/load.rs | 9 ++-- crates/engine/src/cmd/fileio/tests_psdread.rs | 50 +++++++++++++++++++ crates/engine/src/cmd/links.rs | 5 +- docs/mcp.md | 5 +- docs/target-app-parity.md | 2 +- 5 files changed, 64 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/fileio/load.rs b/crates/engine/src/cmd/fileio/load.rs index 4e59e378a5..8249fe6b71 100644 --- a/crates/engine/src/cmd/fileio/load.rs +++ b/crates/engine/src/cmd/fileio/load.rs @@ -962,7 +962,8 @@ pub(crate) fn size_note(bytes: &[u8]) -> Option { /// TIFF ([`vectorcraft_doc::cmyk::turned_cmyk`]). An image the decoder reads and that is stored as /// PNG keeps its gray or RGB samples at 8 or 16 bits, and the gray or RGB ICC profile they are in; /// other samples become 8-bit RGBA. A PSD/PSB composite's stored image keeps its imported -/// clipping path ([`image_clip`]). +/// clipping path ([`image_clip`]), and a PNG or TIFF that keeps such a path (as Unembed writes +/// it) is read with that path. pub fn raster_image(bytes: &[u8]) -> Result { let ppi = super::ppi::resolution(bytes); if let Some((w, h)) = vectorcraft_doc::cmyk::oversized_tiff(bytes) { @@ -1139,13 +1140,15 @@ pub fn texture_image(bytes: &[u8]) -> Result { texture.and_then(|t| t.to_stored()).ok_or_else(|| err("the image can't be read as a texture")) } -/// An image's encoded `bytes`, `width` × `height` pixels, ready to embed. +/// An image's encoded `bytes`, `width` × `height` pixels, ready to embed, with the clipping path a +/// PNG or TIFF made from a PSD or PSB file keeps ([`image_clip`]). fn stored(bytes: Vec, mime: &'static str, (width, height): (u32, u32), ppi: Option<(f64, f64)>) -> Result { if width == 0 || height == 0 { return Err(err("the image is empty")); } let blob = ImageBlob::new(mime, bytes); - Ok(RasterImage { key: blob.content_key(), blob, width, height, ppi, clip: None }) + let clip = image_clip(&blob).map(|path| (path, vectorcraft_geom::FillRule::EvenOdd)); + Ok(RasterImage { key: blob.content_key(), blob, width, height, ppi, clip }) } /// The keyword of the PNG text chunk holding the clipping path of the file a PNG was made from diff --git a/crates/engine/src/cmd/fileio/tests_psdread.rs b/crates/engine/src/cmd/fileio/tests_psdread.rs index 249a3f320c..881519fbda 100644 --- a/crates/engine/src/cmd/fileio/tests_psdread.rs +++ b/crates/engine/src/cmd/fileio/tests_psdread.rs @@ -602,6 +602,56 @@ fn relink_and_update_follow_the_clipping_path_of_a_linked_psd() { assert_eq!(clip_group(&s.doc().unwrap().doc, group), (squared, true, NodeId(image)), "links.update reads the clipping path again"); } +/// Unembed keeps the clip group of the clipping path an embedded PSD file's image came with, with a +/// path and with a folder, and so do relinking to the written file, placing it and opening it. +#[test] +fn unembed_keeps_the_clipping_path_of_an_embedded_psd() { + let dir = vectorcraft_testkit::TempDir::new("psd-unembed-clip"); + // An RGB file is kept as a PNG, a CMYK one as a TIFF. + let cmyk = psd(1, 4, (100, 50), 8, 4, &[], &triangle_resources(), &[], &raw(&[&[0; 5000], &[255; 5000], &[255; 5000], &[0; 5000]])); + let files = [("rgb", red_psd(&triangle_resources())), ("cmyk", cmyk)]; + for ((kind, file), folder) in files.iter().flat_map(|f| [(f, false), (f, true)]) { + let data = vectorcraft_format::base64_encode(file); + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 100, "height": 50})).unwrap(); + let r = s.execute("file.place", &json!({"name": "cut.psd", "dataBase64": data, "at": [50, 25]})).unwrap(); + let (group, image) = (NodeId(r["ids"][0].as_u64().unwrap()), NodeId(r["image"].as_u64().unwrap())); + let before = clip_group(&s.doc().unwrap().doc, group); + // Without an extension the image is written in the format it is stored in. + let path = if folder { + let out = dir.join(format!("folder-{kind}")); + std::fs::create_dir_all(&out).unwrap(); + let r = s.execute("links.unembed", &json!({"ids": [image.0], "folder": out})).unwrap(); + r["unembedded"][0]["path"].as_str().unwrap().to_string() + } else { + let r = s.execute("links.unembed", &json!({"id": image.0, "path": dir.join(format!("written-{kind}"))})).unwrap(); + r["path"].as_str().unwrap().to_string() + }; + let ext = if *kind == "rgb" { ["png"].as_slice() } else { ["tif", "tiff"].as_slice() }; + assert!(ext.contains(&super::extension(&path).as_str()), "{kind}: {path}"); + for step in ["unembed", "relink"] { + if step == "relink" { + s.execute("links.relink", &json!({"ids": [image.0], "path": path})).unwrap(); + } + let d = &s.doc().unwrap().doc; + let NodeKind::Image(im) = &d.node(image).unwrap().kind else { panic!("an image") }; + assert!(im.link.is_some(), "linked to the file written"); + assert_eq!(clip_group(d, group), before, "{kind}, {step}, folder: {folder}"); + } + // Placing the written file gives the same clip group as placing the PSD file did. + let r = s.execute("file.place", &json!({"path": path, "at": [50, 25]})).unwrap(); + let placed = NodeId(r["ids"][0].as_u64().unwrap()); + let (anchors, even_odd, _) = clip_group(&s.doc().unwrap().doc, placed); + assert_eq!((anchors, even_odd), (before.0.clone(), true), "{kind}, place"); + // Opening it gives a document of the image in that clip group. + s.execute("document.open", &json!({"path": path})).unwrap(); + let d = &s.doc().unwrap().doc; + let top = d.layers[0].children().and_then(|c| c.first()).map(|c| c.id).expect("an object"); + let (anchors, even_odd, _) = clip_group(d, top); + assert_eq!((anchors, even_odd), (before.0.clone(), true), "{kind}, open"); + } +} + /// The PNG a PSD file's merged image is kept as holds the clipping path the file names, and only a /// text chunk within the size limit that reads as a path gives one back. #[test] diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index 55c6612494..392d6340c6 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -108,7 +108,7 @@ pub fn specs() -> Vec { "Unembed", [], None, - "{id?: an embedded image (default: the one selected), path?, ids?: [image ids] (instead of id; one id is the same as id), folder?} write the image's pixels to the file at path (PNG, JPEG, GIF or WebP as stored, other images as PNG; a path ending in .png/.jpg/.jpeg/.gif/.webp/.tif/.tiff/.bmp converts them) and link the image to it, keeping its bounds. One undo step → {id, path}; no path → {name, dataBase64} (nothing changes: there is no file to link to). With folder: write each embedded image of ids or id (default: the selected embedded images) to a new file in folder, as stored (as PNG when that format is not one of VectorCraft's raster file formats), named after the image (characters a file name can't hold become _; Image when nothing is left), with Name 2 … Name 99 when the name is taken; a file already there is never replaced. Linked images among ids are left as they are. Each image links to its file and keeps its bounds. One undo step (undo does not remove the files); when a file can't be written, the files this call wrote are removed and nothing changes → {unembedded: [{id, path}], skipped: [ids of linked images]}; id with ids, path with folder, and ids of more or fewer than one image without folder are errors", + "{id?: an embedded image (default: the one selected), path?, ids?: [image ids] (instead of id; one id is the same as id), folder?} write the image's pixels to the file at path (PNG, JPEG, GIF or WebP as stored, other images as PNG; a path ending in .png/.jpg/.jpeg/.gif/.webp/.tif/.tiff/.bmp converts them) and link the image to it, keeping its bounds; written as stored (here and with folder), an image from a PSD or PSB file keeps the clip group of the clipping path that file names, and the file written keeps the path, so Open, Place, Relink and Update Links read the file with that clip group. One undo step → {id, path}; no path → {name, dataBase64} (nothing changes: there is no file to link to). With folder: write each embedded image of ids or id (default: the selected embedded images) to a new file in folder, as stored (as PNG when that format is not one of VectorCraft's raster file formats), named after the image (characters a file name can't hold become _; Image when nothing is left), with Name 2 … Name 99 when the name is taken; a file already there is never replaced. Linked images among ids are left as they are. Each image links to its file and keeps its bounds. One undo step (undo does not remove the files); when a file can't be written, the files this call wrote are removed and nothing changes → {unembedded: [{id, path}], skipped: [ids of linked images]}; id with ids, path with folder, and ids of more or fewer than one image without folder are errors", has_doc, unembed ), @@ -634,7 +634,8 @@ pub(crate) fn readable_and_kept(blob: ImageBlob, unread: bool, linked: bool) -> /// The linked image file `bytes` (read from `path`, when there is one), read with its preview: a /// DCS file's plates, else its image ([`super::place::dcs::raster`]); an error when its pixels -/// can't be read ([`readable`]). +/// can't be read ([`readable`]). A PNG or TIFF that Unembed wrote from a PSD or PSB file's image +/// is read with the clipping path it keeps ([`fileio::raster_image`]). fn linked_image(bytes: &[u8], path: Option<&str>) -> Result { let mut img = super::place::dcs::raster(bytes, path)?; img.blob = readable(img.blob, kept_unread(bytes), true)?; diff --git a/docs/mcp.md b/docs/mcp.md index 655efa1b4c..0218e8efec 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8972,7 +8972,10 @@ every object in the layers each time the list is read. A `dcsTransparency` that `links.goTo {id}` selects an image (`onCanvas: true`); for an object outside the layer tree it clears the selection and returns `{id, onCanvas: false, owner}`, and the panel says the link has no place on the canvas. `links.embed {ids?}` keeps linked files' pixels in the document (an image whose file is missing stays linked: relink it first); `links.unembed {id, path}` writes an embedded image to a file -(another extension converts it) and links to it, and without `path` returns `{name, dataBase64}`. +(another extension converts it) and links to it, and without `path` returns `{name, dataBase64}`. An image from a PSD +or PSB file written as stored (PNG, or TIFF for a CMYK file), with `path` or `folder`, keeps the clip group of the +clipping path that file names, and the file written keeps the path: Open, Place, Relink and Update Links read the file +with its clip group. `ids` of one image works as `id` does. `links.unembed {ids?, folder}` writes each embedded image of `ids` (or of `id`; default: the selected embedded images) to a new file in `folder`, in the format it is stored in (as PNG when that format is not one of VectorCraft's raster file formats), and links each image to its file, keeping its bounds, in one undo diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 749dce93d3..0c298ef763 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2143,7 +2143,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - BMP files named `.dib` or `.rle` (run-length encoded bitmaps included), Photoshop files named `.pdd` and PNG files named `.pns` open and place, linked or embedded, as BMP, PSD and PNG files, in any letter case: the Open and Place dialogs list them with their format, the Links panel names their format, and Edit Original opens them. Exports write only `.bmp`, `.psd` and `.png` (`crates/engine/src/cmd/fileio/tests_tiffbmp.rs`, `crates/engine/src/cmd/fileio/tests_psdread.rs`, `crates/engine/src/tests/links.rs`). - File › Open converts a PSD or PSB file's layers to objects, keeping the layer structure, merging clipped layers into one layer and leaving out hidden layers that would need a merge, as [PSD import options](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/photoshop-import-options.html) describes for the option that converts layers to objects; hidden layers come in with `hiddenLayers`, as Import Hidden Layers brings them in, and `layers: false` opens the merged image. VectorCraft's own rules: each layer becomes a layer holding its pixels with its name, visibility, opacity and blend mode, groups become layers of sublayers, layers in Dissolve, Linear Burn, Linear Dodge, Vivid Light, Linear Light, Pin Light, Hard Mix, Subtract, Divide, Darker Color and Lighter Color are merged with the layers below, layer masks become opacity masks, fill opacity multiplies the opacity (in a layer that others are clipped to, it fades only that layer's own pixels), and adjustment layers, layer effects, knockouts and vector masks aren't applied and are counted in the warnings. 8-, 16- and 32-bit files, PSB, raw, PackBits and zipped channels (`crates/engine/src/cmd/fileio/tests_psdlayers.rs`). - File › Open of a PSD or PSB file with two or more layers, and File › Place of one without Link, show PSD Import Options: Convert Layers to Objects with Import Hidden Layers, or Flatten Layers to a Single Image, the options [PSD import options](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/photoshop-import-options.html) describes for a file that is opened or embedded. A file placed with Link shows its flat image and isn't asked about. `file.place` takes `layers` and `hiddenLayers`, and `document.psdInfo` counts a file's layers without opening it. VectorCraft's own rules: placed layers come in as one group named after the file, a layer as an image and a layer group as a group, at the place the merged image would take and clipped to the canvas when layers reach past it; the dialog asks from two layers up and starts from the choices made last. Layer comps aren't read (`crates/engine/src/cmd/fileio/tests_psdlayers.rs`, `crates/ui-egui/src/dialogs/psd_import.rs`). - - A PSD or PSB file's clipping path, the saved path that image resource 2999 names in the [PSD file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), clips its merged image on File › Place and on File › Open of the merged image, as [PSD import options](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/photoshop-import-options.html) describes for a file imported as one flattened image. The image comes in a clip group whose clipping path has no paint and uses the even-odd rule, and the path can be edited or released. `links.update` and `links.relink` give the clip group the clipping path the new file names, or leave a plain group when it names none, and files that name no clipping path come in as before (`crates/engine/src/cmd/fileio/tests_psdread.rs`). + - A PSD or PSB file's clipping path, the saved path that image resource 2999 names in the [PSD file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), clips its merged image on File › Place and on File › Open of the merged image, as [PSD import options](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/photoshop-import-options.html) describes for a file imported as one flattened image. The image comes in a clip group whose clipping path has no paint and uses the even-odd rule, and the path can be edited or released. `links.update` and `links.relink` give the clip group the clipping path the new file names, or leave a plain group when it names none, and files that name no clipping path come in as before. `links.unembed` keeps the clip group, and the PNG or TIFF it writes is read with the path on File › Open, File › Place, `links.relink` and `links.update` (`crates/engine/src/cmd/fileio/tests_psdread.rs`). - Import Slices: File › Open of a PSD or PSB file with slices, and File › Place of one without Link, bring its slices in as user slices, as [PSD import options](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-from-other-apps/photoshop-import-options.html) describes for a file that is opened or embedded; PSD Import Options offers Import Slices for such a file. `document.open` and `file.place` take `importSlices`, and `document.psdInfo` counts the slices. The slices are read from image resource 1050 in version 6 and in the descriptor of versions 7 and 8, as the [Photoshop File Formats Specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/) describes it. VectorCraft's own rules: Import Slices applies to Convert Layers to Objects and to Flatten Layers to a Single Image alike, and makes the dialog ask for a file with fewer than two layers; placed slices move and scale with the art in the same undo step; each slice keeps its name, type, link, target, message, alternative text, cell text and background color; slices the file generated automatically, and slices wholly outside the canvas, are left out; slices that can't be read are left out with a warning while the art comes in; with Show Import Options off, a PSD file is placed with the PSD Import Options chosen last, and on, each PSD file of the place cursor asks for them (`crates/engine/src/cmd/fileio/tests_psdslices.rs`, `crates/ui-egui/src/dialogs/psd_import.rs`). The import fuzz tests open, count and place PSD files whose resource 1050 is in version 6 (with a version 16 descriptor after a record) and in the descriptors of versions 7 and 8, with their data mutated, cut short with the resource's length saying so, and cut short in the file; a slice count past 10,000 or past the slices stored, and data one byte short, bring the art in without its slices and with a warning. `tests_psdslices::damaged_slices_never_panic` now fails when a command reports an internal error (`import_fuzz::the_sliced_psd_samples_bring_in_their_user_slices`, `import_fuzz::sliced_psd_samples_with_huge_counts_or_cut_short_come_in_without_their_slices`, `import_fuzz::mutated_psd_slices_never_panic`). Scores and estimates unchanged. - PSD export writes slices: the user and object slices that reach into the exported artboard go into image resource 1050 in version 6, as the [Photoshop File Formats Specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/) describes it and as Import Slices reads it, so an opened PSD file's slices survive its export. VectorCraft's own rules: slices are written with Write Layers and as a flat image alike, clipped to the artboard in its pixels; an object slice is written as a user slice over its object's bounds, and an HTML Text slice as No Image with its type's text; auto slices are left out and laid out again on open; text alignment is written as the default (`crates/render/src/encode/tests_psd.rs`, `crates/engine/src/cmd/fileio/tests_psdslices.rs`). From 4074065b2de3a89167d0e6ca95a3e1cd2451dca0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:55:39 -0800 Subject: [PATCH 213/247] Docs: restore the Japanese catalog line --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 5de5ec322a..b84c9b7f75 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1055,7 +1055,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The status bar translates the plug-in host's other errors (manifest, module and run checks, the output an importer, exporter or effect returns, and the approval a plug-in's permissions need) in every language that translates every message. A JSON object or array inside a message stays as written, and a message that wraps another one, such as `plug-in manifest: {0}`, is matched by its own row before a row that starts with a placeholder. The reasons inside these errors (what is wrong with a parameter's spec or dialog keys, the value a parameter needs, what is wrong with an object, stroke, paint or effect in a plug-in's output) are translated with them, and the untranslated-strings report lists the reasons the plug-in host's error helpers take (`plugin_messages_are_translated_in_every_complete_catalog`, `plugin_errors_translate_with_their_values`, `plugin_error_reasons_are_translated_with_the_error`, `message_scan_reads_plugin_helpers`, `templates_that_start_with_text_match_first`). - The status bar translates `script.run`'s refusals of `answers` in every language that translates every message: a value that is not a list, more than 10,000 answers, more than 1 MiB, an answer at an index that is not an object, does not have exactly `kind` and `value`, has a `value` its kind of dialog does not take, holds a prompt's text longer than 16 KiB or has an unknown `kind`, and `answers` given to a run in the app. The index, the counts and the code names are shown as they are, and the command's error stays in English. The untranslated-strings report also lists the refusals of `script.run`'s parameters (`script_answers_errors_are_translated`, `message_scan_reads_script_run_param_refusals`). - The status bar also translates `script.run`'s other refusals of its parameters in every language that translates every message: a `maxFuel` outside 1 to 100,000,000,000, `args` nested more than 64 levels deep (with the place in `args`), `args` that is not an object or is larger than 1 MiB, an empty `path`, a `source` given with `installed`, a `path` that does not name a .js or .jsx file, and neither or both of `path` and `source`. The code names, the place in `args`, the file suffixes and the limits are shown as they are, and the command's error stays in English (`script_run_param_errors_are_translated`). - - The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). The row for `{k} has control characters{_1}` does not match the File Info error for a multi-line field, where the last placeholder is empty. A native speaker has not reviewed the wording. + - The Japanese catalog (`crates/ui-egui/src/i18n/ja.tsv`) has 3,562 `@msg` rows and 49 `@msgplural` rows (counted 2026-11-14). The untranslated report (`untranslated_report`) lists 98 status and error messages in the sources that have no Japanese row: 77 that every complete-message language lacks, and 21 more. Open #7211 translates 34 of them, among them the composite font errors, and open #7116 translates the justification order error. The status bar does not use the rows for ``unknown parameter `{within}{key}`; {why}`` and `{name} must be {lo}–{hi}{unit} (got {v})`, because a message with two placeholders in a row cannot be matched (`Template::parse` in `crates/ui-egui/src/i18n/catalog.rs`). A native speaker has not reviewed the wording. - A status or error message whose braces are literal, such as a plug-in's `expected {"objects": [...]}` or a command's `quotes must be {double?, single?}`, is translated only when the whole message matches its row: the row writes those braces doubled and has no placeholder, so it no longer replaces a different message that starts with the same words, such as a JSON reason `expected value at line 1 column 1`, which stays in English. A row without placeholders is found at any message length (`plain_message_keys_double_their_braces`, `literal_brace_rows_match_only_their_message`). - Every complete-message catalog translates five more messages with literal braces through such a row: the composite font errors `each font must be {name, parts}` and `give fonts: [{name, parts}…]`, `select.font`'s `` `scope` must be "document", {artboards: [index, …]} or {layers: [id, …]} ``, the script regular expression error `numbers out of order in {} quantifier` and `the paint is not a freeform gradient (apply one with paint.editGradient {kind: "freeform"})`. Each translation keeps the braced example as written, and no catalog keeps the older rows with a placeholder in place of the braces, which also translated other text with the same start and end (`literal_brace_messages_have_exact_rows_in_complete_languages`). - The status bar translates the errors a script's `File` and `Folder` objects, `vc.run`, `$.evalFile`, the `$` object's properties and functions, `alert`, `confirm` and `prompt`, `vc.document` and `vc.log` raise, the limits a run can pass, and the errors of Drop Script Engine, and the line for a run that fails (a syntax error, a thrown error, a limit, a stop or an internal error, with the script's name, the line and column, the included file it is in and the files left written), in every language that translates every message. The script's name, paths, numbers, command ids and the text a script throws itself are shown as they are. A failure with no line and column, such as an error in code `eval` compiled, is shown with one colon after the script's name (`an_error_without_a_place_names_the_script_and_kind`). A message template that names a value twice matches only when both places hold the same text, so the line for a failed run is not taken for the message inside it (`a_repeated_placeholder_matches_the_same_text`). The untranslated-strings report also lists the messages the script host's `fail`, `value` and `over` helpers take and the errors the script interpreter throws, and a constant's text comes from the file or crate that declares it, so the Scripts menu's headers are not listed as messages (`script_errors_are_translated`, `script_host_errors_are_translated`, `message_scan_reads_script_interpreter_errors`, `message_scan_reads_constants_of_the_file_and_its_crate`, `message_scan_skips_test_modules_with_any_test_cfg`). From c1613f2bf52add27100ae36ed00f537ded08ebc6 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:25:41 +0530 Subject: [PATCH 214/247] M7/G4: retype checks points along every edge; keys charged once (#4934) The whole-outline check tests points along every edge, so outlines with the same corners joined another way do not match; past a work limit it rejects. Face keys another Retype kept meanwhile are reused and charged once. The fonts parameter test uses outlines that would match. The parity note states the search limits. --- crates/engine/src/cmd/retype_tests.rs | 10 +++++- crates/text/src/retype.rs | 45 +++++++++++++++++++++++++-- docs/target-app-parity.md | 2 +- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 7812fc8e65..1c8cf5c2f2 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -80,7 +80,15 @@ fn a_drawn_shape_is_reported_and_left_alone() { let e = s.execute("type.retype", &json!({})).unwrap_err().to_string(); assert!(e.contains("no selected shape matches"), "{e}"); assert!(s.doc().unwrap().doc == before, "nothing changes"); - assert!(s.execute("type.retype", &json!({"fonts": "Source Sans 3"})).is_err(), "fonts is a list"); + // With outlines that would match, a bad `fonts` is refused for itself, and nothing changes. + let g = outlined(&mut s, json!({"x": 40, "y": 200, "text": "AB", "size": 40})); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let before = s.doc().unwrap().doc.clone(); + for bad in [json!("Source Sans 3"), json!([1]), json!({"family": "x"})] { + let e = s.execute("type.retype", &json!({"fonts": bad})).unwrap_err().to_string(); + assert!(e.contains("fonts must be a list of family names"), "{e}"); + } + assert!(s.doc().unwrap().doc == before); } #[test] diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 80fed5f33a..5ef5073909 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -40,6 +40,8 @@ const TOLERANCE: f64 = 2e-3; const OUTLINE_TOLERANCE: f64 = 5e-3; /// Points of a flattened outline past which the whole-outline check gives up (and so rejects). const MAX_OUTLINE_POINTS: usize = 8192; +/// Points along an outline past which the whole-outline check gives up (and so rejects). +const MAX_CHECKED_POINTS: usize = 65_536; /// How far apart two shapes' spread-to-length ratios may be and still be compared. const INVARIANT_SLACK: f64 = 0.02; @@ -250,7 +252,14 @@ fn face_keys(db: &FontDb, face: &FontFace) -> FaceKeys { gids.sort_unstable(); let keys: FaceKeys = Arc::new(gids.into_iter().filter_map(|(gid, ch)| Some((gid, ch, shape_key(&db.outline_uncached(face, gid))?))).collect()); let mut k = kept.lock().unwrap_or_else(|e| e.into_inner()); - if k.generation == generation && k.glyphs + keys.len() <= KEPT_KEYS { + if k.generation != generation { + return keys; + } + // Another Retype may have worked them out meanwhile: keep and charge one list. + if let Some(already) = k.faces.get(&at) { + return already.clone(); + } + if k.glyphs + keys.len() <= KEPT_KEYS { k.glyphs += keys.len(); k.faces.insert(at, keys.clone()); } @@ -331,7 +340,22 @@ fn outlines_agree(a: &BezPath, b: &BezPath, tol: f64) -> bool { }; let (Some(sa), Some(sb)) = (flat(a), flat(b)) else { return false }; let near = |p: Point, segs: &[(Point, Point)]| segs.iter().any(|(s, e)| Line::new(*s, *e).nearest(p, 1e-9).distance_sq <= tol * tol); - sa.iter().all(|(p, _)| near(*p, &sb)) && sb.iter().all(|(p, _)| near(*p, &sa)) + // Points along every edge, not only its ends: two outlines with the same corners joined in + // another order differ between them. Spaced `tol` apart; past the work limit, not a match. + let along = |segs: &[(Point, Point)]| -> Option> { + let mut pts = vec![]; + for (s, e) in segs { + let steps = (s.distance(*e) / tol).ceil(); + if !steps.is_finite() || pts.len() as f64 + steps > MAX_CHECKED_POINTS as f64 { + return None; + } + let steps = (steps as usize).max(1); + pts.extend((0..steps).map(|i| s.lerp(*e, i as f64 / steps as f64))); + } + Some(pts) + }; + let (Some(pa), Some(pb)) = (along(&sa), along(&sb)) else { return false }; + pa.iter().all(|p| near(*p, &sb)) && pb.iter().all(|p| near(*p, &sa)) } /// `seg` as a line when it is one (a curve with its handles on its ends or on its line), else as it is. @@ -728,4 +752,21 @@ mod tests { assert!(!outlines_agree(&out, &inn, tol), "the whole outline does"); assert!(outlines_agree(&out, &out, tol)); } + + #[test] + fn the_same_corners_joined_another_way_are_another_outline() { + let poly = |pts: &[(f64, f64)]| { + let mut p = BezPath::new(); + p.move_to(pts[0]); + for q in &pts[1..] { + p.line_to(*q); + } + p.close_path(); + p + }; + let square = poly(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)]); + let bow = poly(&[(0.0, 0.0), (100.0, 100.0), (100.0, 0.0), (0.0, 100.0)]); + assert!(!outlines_agree(&square, &bow, 1.0), "every corner lies on the other, the edges do not"); + assert!(outlines_agree(&square, &square, 1.0)); + } } diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index dbb538c08d..b845378576 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2861,7 +2861,7 @@ Check Spelling followed (2026-11-15): Edit › Spelling › Check Spelling… (` ## Retype, phase 1 (2026-11-18) -The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Near matches, the ranked font list, installed fonts not yet loaded and images remain (phase 2). +The public pages describe Retype finding the fonts that match selected outlined text (or text in an image), from the fonts on the device among others, and applying them to live text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html)). Phase 1 (#4934) is local and exact: Type › Retype (`type.retype`) compares each selected glyph shape with the glyphs of the loaded fonts, the document's fonts and any families named in `fonts`, the same up to uniform scale, rotation and translation, and sets the matched characters as point text in that font and size at the same baseline, one object per line, in one undo step. Shapes that match no font stay and are reported. The search is bounded, not exhaustive: at most 96 faces (named families first, then the document's fonts, then the other loaded faces), the first 65,536 encoded characters of each, and glyphs of plain-shape characters (box drawing, blocks, geometric shapes, private use) are left out; a glyph outside those limits is reported as matching no font. Exact matching also reads a curve an exporter split in two as a different shape (phase 2, with the other near matches). Tested by round trips through Create Outlines (plain, bold and turned, serif, word spaces), a drawn shape and a mixed selection (`crates/engine/src/cmd/retype_tests.rs`). Near matches, the ranked font list, installed fonts not yet loaded and images remain (phase 2). ## Control bar: Paragraph section while type is selected (2026-11-06) From fac3cb8013de2d5518e067ce23b78a01a8874600 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 02:00:11 -0800 Subject: [PATCH 215/247] Shapes: a batch step that switches tools keeps the batch's earlier steps A batch run during a widget drag settles the drag first. A tool or document switch inside the batch then ended the drag with a Cancel, which undid the batch's open interaction and its earlier steps in that document. Deactivating a tool in a batch now leaves the Cancel out, for the blend, corner, pie and side widgets alike. --- crates/engine/src/session/documents.rs | 3 +-- crates/engine/src/tooling.rs | 20 ++++++++++++---- crates/mcp/src/tests/shapewidgets.rs | 33 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 23dbe66e71..709be444b4 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -204,8 +204,7 @@ impl Session { let _ = self.finish_tool_edit_later(); // The switch goes on whatever the lent tool's last actions did, as for the deactivation. let _ = self.give_back_tool(view); - let acts = self.with_tool_cx(view, |t, cx| t.deactivate(cx)); - let _ = self.apply_actions(acts); + let _ = self.deactivate_tool(view); // A batch leaves its interaction open in the document it leaves, to keep or roll back with // the rest of the batch; anything else in progress (a drag) is cancelled. if self.batch_stash.is_none() { diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 794cc7a2a3..65ea837527 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -188,8 +188,7 @@ impl Session { .then(|| self.tool.options().get("meshPoints").cloned()) .flatten() .filter(|v| v.as_array().is_some_and(|a| !a.is_empty())); - let acts = self.with_tool_cx(view, |t, cx| t.deactivate(cx)); - self.apply_actions(acts)?; + self.deactivate_tool(view)?; self.keep_tool_settings(); self.tool = self.make_tool(id); if let Some(selection) = text_selection { @@ -205,6 +204,18 @@ impl Session { Ok(()) } + /// Deactivate the tool and apply the actions it returns. In a batch, a Cancel is left out: the + /// batch settled the tool's drag when it began, and the open interaction holds the batch's + /// steps, which the batch keeps or rolls back as a whole. + pub(crate) fn deactivate_tool(&mut self, view: ViewInfo) -> Result<()> { + let mut acts = self.with_tool_cx(view, |t, cx| t.deactivate(cx)); + if self.batch_stash.is_some() { + acts.retain(|a| !matches!(a, Action::Cancel)); + } + self.apply_actions(acts)?; + Ok(()) + } + /// The selection tools other than Direct Selection pick whole objects: with one of them chosen, /// an object selected in a symbol instance's art gives way to the instance. The revision /// changes with it, so panels that cache by revision show the instance. @@ -297,8 +308,7 @@ impl Session { // them all (#8090). Group Selection picks no mesh points, so the Eyedropper keeps its own. let mesh_points = (lender.id() == "eyedropper" && self.tool.id() != "groupSelection").then(|| self.tool.options().get("meshPoints").cloned()).flatten(); - let acts = self.with_tool_cx(view, |t, cx| t.deactivate(cx)); - let r = self.apply_actions(acts); + let r = self.deactivate_tool(view); self.keep_tool_settings(); self.tool = lender; if let Some(points) = mesh_points { @@ -311,7 +321,7 @@ impl Session { self.lent_selection = left; } self.after_command(None); - r.map(drop) + r } /// A fresh `id` tool with the options it keeps ([`settings`]): its last values, from this diff --git a/crates/mcp/src/tests/shapewidgets.rs b/crates/mcp/src/tests/shapewidgets.rs index ce8eaea001..bce666d484 100644 --- a/crates/mcp/src/tests/shapewidgets.rs +++ b/crates/mcp/src/tests/shapewidgets.rs @@ -67,3 +67,36 @@ fn a_side_widget_drag_changes_a_polygons_sides_in_one_undo_step() { assert_eq!(polygon(&mut h), before); assert_eq!(h.session.doc().unwrap().history.undo.len(), steps); } + +/// A batch run during a side widget drag settles the drag first. A batch step that switches +/// documents then ends the drag without undoing the batch's own steps in the document it leaves. +#[test] +fn a_batch_that_switches_documents_during_a_side_widget_drag_keeps_its_steps() { + let mut h = Headless::new(); + for _ in 0..2 { + h.call("engine.execute", json!({"command": "file.new", "params": {"width": 300, "height": 300}})).unwrap(); + } + h.call("engine.execute", json!({"command": "shape.polygon", "params": {"cx": 150, "cy": 150, "radius": 60, "sides": 5}})).unwrap(); + let st = h.session.doc().unwrap(); + let (uid, id) = (st.uid, st.selection.objects[0]); + let b = st.doc.node(id).unwrap().geometric_bounds_with(&st.doc.symbol_boxes()).expect("bounds"); + let bx = vectorcraft_doc::OrientedBox::aligned(b); + let w = vectorcraft_tools::sidewidget::SideWidget::of(&st.doc, &st.selection, &bx, h.view.zoom).expect("a side widget"); + let steps = st.history.undo.len(); + let zoom = h.view.zoom; + let ev = |kind: &str, dy: f64| json!({"kind": kind, "x": w.at.x, "y": w.at.y + dy / zoom}); + // The drag stays held: no `up`. + ok(&mut h, "pointer_gesture", json!({"tool": "selection", "events": [ev("down", 0.0), ev("drag", 13.0), ev("drag", 25.0)]})); + let batch = json!({"commands": [ + {"command": "shape.rectangle", "params": {"x": 10, "y": 10, "width": 20, "height": 20}}, + {"command": "document.activate", "params": {"index": 0}} + ]}); + h.call("engine.execute", json!({"command": "command.batch", "params": batch})).unwrap(); + let st = h.session.documents().iter().find(|d| d.uid == uid).expect("the polygon's document"); + let vectorcraft_doc::NodeKind::Path { live, .. } = &st.doc.node(id).unwrap().kind else { panic!("not a path") }; + assert!(matches!(live.as_deref(), Some(vectorcraft_doc::LiveShape::Polygon { sides: 7, .. })), "the settled drag: {live:?}"); + assert_eq!(st.history.undo.len(), steps + 2, "the drag and the batch, each one undo step"); + let rect = st.selection.objects[0]; + assert_ne!(rect, id, "the batch's rectangle is selected"); + assert!(st.doc.node(rect).is_some(), "the batch's rectangle stays"); +} From f23eb05224486ce8475a46c58958e9b6bb29ed71 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 18 Nov 2026 15:27:08 +0500 Subject: [PATCH 216/247] PDF import: keep stroke boundaries in the fallback and long passes (#8543) Answers the third CodeRabbit review on #8549. - stroke_last no longer restyles the glyph drawn last once a boundary (end_fills) closed it: a stroke after an ActualText span no longer strokes its replacement text. A glyph stroked again where it was just drawn still stays one object. - Past MAX_HELD, the held strokes go over the last run of consecutive fills they match with room for all of them, not the first, so a long stroke pass no longer takes the same glyphs an earlier operator filled at the same place. - Docs: the limit is 64 kept-back lines plus the open one, so a TJ over up to 65 lines stays filled and stroked. --- crates/pdf/src/import/builder.rs | 41 ++++++++++++++++++++++-------- crates/pdf/src/import_text.rs | 19 +++++++++++++- crates/pdf/src/tests/textstroke.rs | 41 ++++++++++++++++++++++++++++++ docs/file-format-parity.md | 4 +-- docs/roadmap.md | 4 +-- docs/target-app-parity.md | 12 ++++----- 6 files changed, 100 insertions(+), 21 deletions(-) diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index a566614097..c55a78401f 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -16,15 +16,19 @@ use super::{ /// The most lines of type kept for a text-showing operator's stroke pass ([`Builder::park_text`]): /// beyond them the oldest is finished, and strokes over its glyphs come in as type of their own. +/// They are the lines its fill pass finished, besides the open one: a `TJ` over up to 65 lines is +/// filled and stroked, one over more is a filled object and a stroked one for each part. const MAX_PARKED: usize = 64; /// The most strokes of a stroke pass held to be matched to the glyphs they go over -/// ([`Builder::hold_stroke`]): beyond them, those held are matched to the first glyphs filled one -/// after another that they go over ([`Builder::replayed`]), and the pass goes on from there. +/// ([`Builder::hold_stroke`]): beyond them, those held are matched to the last glyphs filled one +/// after another that they go over, with as many glyphs filled from there on as strokes held +/// ([`Builder::replayed`]), and the pass goes on from there. const MAX_HELD: usize = 4096; /// The most glyphs [`Builder::replayed`] compares to the strokes held, for bounded work on -/// hostile input: beyond them, each stroke goes over the first glyph it may go over. +/// hostile input: beyond them, each stroke goes over the first glyph it may go over after the one +/// the stroke before it goes over. const MAX_REPLAY_WORK: usize = 1 << 20; fn is_colour_face(face: &vectorcraft_text::FontFace) -> bool { @@ -622,16 +626,34 @@ impl<'p> Builder<'p> { } /// The glyphs the strokes `held` go over when they are the start of a stroke pass that goes - /// on after them ([`MAX_HELD`]): the first glyphs filled one right after another that they - /// may go over, in order. The pass replays its operator's fill pass, whose glyphs were - /// filled one right after another, so the strokes don't go over a glyph filled before those - /// (another operator's), nor skip one. `None` when there are none, or beyond - /// [`MAX_REPLAY_WORK`]. + /// on after them ([`MAX_HELD`]): the last glyphs filled one right after another that they + /// may go over, in order, with at least as many glyphs filled from the first of them on as + /// there are strokes held. The pass replays its operator's fill pass, the glyphs filled + /// last, one right after another, right before the pass, so the strokes don't go over a + /// glyph filled before those, nor skip one. The device isn't told where an operator starts: + /// an operator before it that filled the same glyphs at the same places stays unstroked, as + /// the first glyphs of the pass are the last such run the pass still has room for. `None` + /// when there are none, or beyond [`MAX_REPLAY_WORK`]. fn replayed(&self, held: &[HeldStroke]) -> Option> { let (head, rest) = held.split_first()?; let mut work = 0usize; - let mut start = Some(head.first); + // The glyphs filled from `at` on, up to as many as there are strokes held. + let left = |(slot, i): (usize, usize)| { + (slot..=self.parked.len()) + .filter_map(|s| self.line_at(s).map(|line| line.filled_len().saturating_sub(if s == slot { i } else { 0 }))) + .fold(0usize, |n, len| n.saturating_add(len).min(held.len())) + }; + let mut start = self.last_fill(None, head); while let Some(first) = start { + start = self.last_fill(Some(first), head); + work = work.saturating_add(1); + if work > MAX_REPLAY_WORK { + return None; + } + // Too few glyphs filled after it for the strokes held: not where the pass starts. + if left(first) < held.len() { + continue; + } let mut places = Vec::with_capacity(held.len()); places.push(first); let mut at = first; @@ -649,7 +671,6 @@ impl<'p> Builder<'p> { if places.len() == held.len() { return Some(places); } - start = self.next_fill(Some(first), head); } None } diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index dd9804db67..672af1f012 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -244,6 +244,10 @@ pub(crate) struct TextLine { pending: Option, /// The last glyph's placement. last_at: Placement, + /// The last glyph was drawn before a boundary of stroke passes ([`end_fills`](Self::end_fills)): + /// no stroke drawn since goes over it, not even as the glyph just drawn + /// ([`stroke_last`](Self::stroke_last)). + last_closed: bool, /// The first glyph was set vertically ([`Upright`]). upright: Option, /// The glyphs make a column (vertical type), each below the last. @@ -336,6 +340,7 @@ impl TextLine { stroked: 0, pending: None, last_at: at, + last_closed: false, upright: None, column: false, ink: vec![], @@ -385,6 +390,7 @@ impl TextLine { self.record_filled(look, at, content); self.authored.extend(text.chars().map(|_| content.authored())); (self.upright, self.next, self.last, self.last_at) = (Some(upright), at.origin + down * at.size, at.origin, at); + self.last_closed = false; return true; }; let across = (at.origin - self.at.origin).dot(self.at.dir); @@ -424,6 +430,7 @@ impl TextLine { self.next = at.origin + down * at.size; self.last = at.origin; self.last_at = at; + self.last_closed = false; true } @@ -536,6 +543,7 @@ impl TextLine { } self.last = at.origin; self.last_at = at; + self.last_closed = false; self.last_dir = at.dir; self.last_size = at.size; self.baseline.push(at.origin); @@ -726,9 +734,11 @@ impl TextLine { /// No stroke drawn from now on goes over a glyph the line filled so far: a stroke pass does /// not go back past a stroke of its own (one over no glyph filled) or the start or end of an - /// ActualText span ([`stroke_filled`](Self::stroke_filled)). + /// ActualText span ([`stroke_filled`](Self::stroke_filled)). Nor does one restyle the glyph + /// drawn last ([`stroke_last`](Self::stroke_last)). pub fn end_fills(&mut self) { self.stroked = self.filled.len(); + self.last_closed = true; } /// Restyle the glyphs gathered for a stroke ([`stroke_filled`](Self::stroke_filled)): their @@ -811,7 +821,14 @@ impl TextLine { /// ([`Look::takes`]): then the glyph's text becomes a run of its own with this stroke, and /// the glyphs before it stay unstroked (#7741). The line's text is the same either way, so /// the characters' slots, gaps and authored flags, kept along the whole line, still line up. + /// + /// Not a glyph drawn before a boundary of stroke passes ([`end_fills`](Self::end_fills)): + /// a stroke after the end of an ActualText span would otherwise stroke the span's replacement + /// text, and one after its start a glyph filled before the span (#8543). fn stroke_last(&mut self, font: u128, at: Placement, glyph: &str, stroke: TypeStroke, overprint: bool) -> bool { + if self.last_closed { + return false; + } self.flush_stroke(); let start = self.last_start; let last_at = self.last_at; diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index 2af3e4b8cf..4d2debebe4 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -501,3 +501,44 @@ fn a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart() { let want: Vec<_> = std::iter::repeat_n(fill, 66).chain(std::iter::repeat_n(stroke, 66)).collect(); assert_eq!(type_runs(&content(66)), want); } + +/// The start and end of an ActualText span end the stroke pass of the glyphs filled before them, +/// for the stroke over the glyph filled last too: a stroke after the span over the glyph its +/// replacement text came with, or over a glyph filled before an empty span, is type of its own, +/// and the glyph keeps its fill only (#8543). +#[test] +fn a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it() { + let run = |text: &str, fill: bool, stroke: bool| vec![(text.to_string(), fill, stroke)]; + let cases = [ + "/Span << /ActualText (A) >> BDC 1 0 0 1 20 80 Tm (A) Tj EMC 1 Tr 1 0 0 1 20 80 Tm (A) Tj", + "1 0 0 1 20 80 Tm (A) Tj /Span << /ActualText (B) >> BDC EMC 1 Tr 1 0 0 1 20 80 Tm (A) Tj", + ]; + for show in cases { + let content = format!("BT /F1 48 Tf 0 Tr {show} 0 Tr ET"); + assert_eq!(type_runs(&content), [run("A", true, false), run("A", false, true)], "{content}"); + } +} + +/// A glyph stroked twice where it was drawn, by stroke rendering or by fill and stroke rendering +/// then stroke rendering, is one type object, as before: a stroke over the glyph drawn last +/// restyles it when nothing ended its stroke pass (#7741, #8015). +#[test] +fn a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object() { + for (show, fill) in [("1 Tr (A) Tj", false), ("2 Tr (A) Tj", true)] { + let content = format!("BT /F1 48 Tf {show} 1 Tr 1 0 0 1 20 80 Tm (A) Tj 0 Tr ET").replace("Tf ", "Tf 1 0 0 1 20 80 Tm "); + assert_eq!(type_runs(&content), [vec![("A".to_string(), fill, true)]], "{content}"); + } +} + +/// A stroke pass longer than the importer holds at once ([`MAX_HELD`] strokes) goes over its own +/// operator's glyphs, filled right before it, also when an operator before it filled the same +/// glyphs at the same places: `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and +/// stroked from the same place strokes the second operator's glyphs, not the first one's (#8543). +#[test] +fn a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before() { + let (before, now) = ("B".repeat(4095), "B".repeat(4096)); + let content = format!("BT /F1 2 Tf 1 0 0 1 20 80 Tm 0 Tr (A{before}) Tj 1 0 0 1 20 80 Tm 2 Tr (A{now}) Tj 0 Tr ET"); + let looks: Vec> = type_runs(&content); + let want = [vec![(format!("A{before}"), true, false)], vec![(format!("A{now}"), true, true)]]; + assert!(looks == want, "{:?}", looks.iter().map(|t| t.iter().map(|r| (r.0.len(), r.1, r.2)).collect::>()).collect::>()); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 3c1e1b270d..db8fdb7050 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -370,7 +370,7 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 64 lines in one operator: past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`). A stroke after stroked type of its own, or in another `ActualText` span, goes over no glyph filled before it: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 65 lines in one operator (the 64 its fill pass finished, kept back, and the open one): past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs, also when an operator before it filled the same glyphs at the same places (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before`). A stroke after stroked type of its own, in another `ActualText` span, or after a span starts or ends, goes over no glyph filled before it, the glyph drawn last included: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it`). - [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,7 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-18 | minor | PDF export (#3644): the document language chosen in Document Setup is written as the catalog's `/Lang` (BCP 47, `en-US` by default) and as XMP `dc:language`; a language without a tag writes none. Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index 66c9700808..e8d808a299 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -164,7 +164,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (#3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | -| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | +| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | @@ -216,7 +216,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 828e3f1eea..49f6a7aaa0 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -63,7 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64: past them each part of the operator stays a filled object and a stroked one, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-18 | minor | Hardening: PDF export writes the document language (Document Setup) as the catalog's `/Lang` and XMP `dc:language` (#3644). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | @@ -277,9 +277,9 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them | | Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers row menu commands beyond Collect for Export and menus on guide and blend spine rows (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | -| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); DXF export's Include Placed Images and Include Fill Hatches options, off in CNC / CAM (`images_and_hatches_are_left_out_independently_and_the_cnc_preset_leaves_out_both`; score, gaps and hours unchanged); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`; the distance from the path under Align to Path is measured from the top of each character's em box, half the height of the top of its H or the bottom of its font's bounding box (`tests_native::aligned_type_lies_as_far_from_its_path_as_the_file_lays_it_out`), and the fit under Gravity does not reproduce the file's layout), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, textures, map art and shading in 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | +| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects on objects other than paths, compound paths and groups that qualify (at most a fill and a stroke, a non-zero fill rule when filled, no large canvas) and whose appearance and effects the art-style writer supports, and with live objects other than grouped column, stacked column, line and area graphs the `.ai` reader reads back whole as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified PDF marked-text batching covered by M4 evidence (#6309); cross-line/style ActualText layout (#6165) and styled-cluster limits remain.; PDF type filled and stroked at less than full opacity comes in as a filled object and a stroked one (#8015) | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. Graphs saved to `.ai` in either form open again as live graphs (`ai_editing::tests::graphs_are_written_with_their_records_and_open_live`, `legacy_ai::tests::graphs_are_written_with_their_records_and_open_live`, `cmd::graph::tests::a_drawn_graph_saved_as_ai_opens_as_a_graph_unless_the_save_warns`); other graphs are still written as their art (`graphs_the_records_cant_keep_are_written_as_their_art`); score and hours unchanged. PDF ActualText preserved in editable import (#6165; bounded synthetic coverage below); score/hours unchanged. Save refusal continuation (#6146): `READ_ONLY_LOCATION`, Save As on ordinary UI Save only; regression execution pending; score/hours unchanged. Legacy `.ai` type keeps its manual kerning pairs (`Tk`, `TK`), discretionary hyphens (`T+`, `T-`) and hyphenation language (`XL`) when it opens, and legacy `.ai` saves write manual kerning as `Tk` and soft hyphens as `T+` (`import::ai::tests::legacy_manual_pair_kerning_is_kept`, `legacy_ai::tests::manual_kerning_and_soft_hyphens_are_written_and_read_back`); score, gaps and hours unchanged. PDF import: stroked type (text rendering modes 1, 2, 5 and 6) keeps the file's line cap, line join and miter limit, as paths do (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`); score, gaps and hours unchanged. PDF import: type filled and stroked by one text-showing operator (rendering modes 2 and 6) comes in as one type object, filled and stroked, not a stroked copy over a filled one (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`); not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one (`translucent_fill_and_stroke_text_stays_two_objects`); score and hours unchanged. PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`); score and hours unchanged. PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` in `crates/pdf/src/tests/textstroke.rs`); score and hours unchanged. | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) | | View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) | | Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658) | 4–7 | estimated (lowered from 85%: target moved); Control bar snapping quick access includes Snap to Glyph and Alignment Guides (#6164); new ruler-guide Alt orientation implemented; global/artboard ruler modes (`view.globalRulers`) and video rulers (View › Rulers › Show Video Rulers, #2849) done; status-bar X/Y uses the active ruler origin and General units; score unchanged | @@ -542,7 +542,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Layers, artboards, document setup | 5 | 82% | Layers panel: a confirmation before deleting layers that hold art, row menu commands beyond Collect for Export (now on every layer, sublayer, group and object row), menus on guide and blend spine rows, the Layer Options dialog for several rows with mixed values, Paste Remembers Layers for sublayers; artboard preset polish (artboard escape routing and document setup modal handoff done; Move Artwork for artboard X/Y edits, Rearrange All Artboards, Document Setup, New Document and the rest of the Layers panel are done) | 4–7 | | View & navigation | 3 | 70% | New View/Edit Views, multiple windows/arrange, Snap to Pixel/Glyph (print tiling is done) | 9–14 | | Guides, grids, smart guides, snapping, rulers | 3 | 85% | global/video rulers, Spacing Guides' distance readouts and spacing for resized or drawn art, Alt swapping a ruler guide's orientation, ruler guides selected together with art (marquee, Shift-click), ruler guides as Layers rows with their own lock and hide (#451: Lock Guides locks them all; Make Guides paths are Layers rows already) (dragging existing guides is done, #414; new guides snapping to side midpoints and artboards, and artboard guides, #451; the drawing tools snapping, with Construction Guides, #506; Spacing Guides for moves, #394; moves snapping to the grid, #740; ruler guides pulling drawn points with Smart Guides on, and "center" and "anchor" labels while hovering with the Selection tool, #812; distance and angle labels while drawing, #2983) | 2–4; status-bar X/Y uses the active ruler origin and General units | -| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; past 64 lines in one operator each part stays a filled object and a stroked one (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | +| File formats | 6 | 85% | PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; scores and estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; scores and estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; scores and estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; scores and estimates unchanged); PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); Explicit editing-data oversized single-artboard import fixed (#6865); scores and estimates unchanged. Legacy `.ai` files that name but omit their prolog open with their layers, or with their art on one layer when the format has no layers; graph data and settings in these files still come in only as drawn art. Affinity export, and the rest of Affinity import (adjustments, blur and bevel effects, brushes, live symbol instances, text threading), DWG (no open spec: DXF instead), PSD placement as layers (Photoshop Import Options; the merged image is done), EPS checked against more real files users send (Inkscape files open as vectors; other generators' constructs are tested with programs written from the PostScript Language Reference only; CID-keyed CJK type and `CCITTFaxDecode` images not read), the rest of Illustrator's editing data (appearances and live effects, symbols, pattern fills, brushes, placed files: #637), the remaining fidelity polish; EPS, DXF, EMF/WMF, TIFF, BMP, Targa, PSD export, SVGZ, PDF security, PDF/X, PDF layers, presets and Affinity import are done | 6–10 (existing scope; Affinity export unestimated) | | Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | polish only (all four are done) | 2–4 | | Print, colour management, separations, flattener | 3 | 80% | print preview fidelity (flattener presets in PDF and print, overprint in PDF and composite print, Print dialog, presets, PostScript, marks, separations, Print Tiling, print overprint/flattener/bitmap options and printer profile are done, as are the Japanese papers in its Media list: JIS B4/B5/B6, はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判, beside the ISO B4/B5 that settings saved before them keep) | 1–2 | | Automation | 3 | 65% | scripting surface, batch (MCP drops malformed app replies without replay; Variables: text/visibility variables bound to objects, an object may carry several, dataset rows applied in one undo step, panel and Window › Variables with dialogs; image/graph kinds and dataset import/export open) | 6–10 | @@ -604,7 +604,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first; `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before` covers `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and stroked from the same place: the second operator's glyphs are stroked, not the first one's. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it` covers a stroke after a span over the glyph its replacement text came with, and over a glyph filled before an empty span: type of its own, the glyph filled only; `a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object` covers a glyph stroked again where it was drawn: one type object. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h. From 1c275797a717b160dc39a826c27e42085f1b700f Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:58:18 +0530 Subject: [PATCH 217/247] M7/G4: re-run CI after the runner shut down mid-build (#4934) From d9a404f91ba813d04de54da8be2017b2200097bc Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 18 Nov 2026 16:03:34 +0500 Subject: [PATCH 218/247] PDF import: no stroke match over lines finished past the limit (#8543) Answers the fourth CodeRabbit review on #8549. When a fill pass finishes lines beyond MAX_PARKED, their unstroked glyphs are recorded (bounded at 4096). The first stroke after that which could have gone over one of them ends the stroke pass, so a TJ over more than 65 lines that comes back to where it began stays a filled object and a stroked one for each part, as documented. Any other first stroke drops the record, so type after an overflowing TJ, filled only or not, is matched as before. MAX_HELD's doc now says that one operator filling the same run of more than 4096 glyphs twice at the same places is matched as well as it can be: the reader tells no operator's start. --- crates/pdf/src/import/builder.rs | 36 ++++++++++++++-- crates/pdf/src/import/state.rs | 4 ++ crates/pdf/src/import_text.rs | 67 +++++++++++++++++++++++++----- crates/pdf/src/tests/textstroke.rs | 26 ++++++++++++ docs/file-format-parity.md | 4 +- docs/roadmap.md | 2 +- docs/target-app-parity.md | 4 +- 7 files changed, 124 insertions(+), 19 deletions(-) diff --git a/crates/pdf/src/import/builder.rs b/crates/pdf/src/import/builder.rs index c55a78401f..b94350605a 100644 --- a/crates/pdf/src/import/builder.rs +++ b/crates/pdf/src/import/builder.rs @@ -17,13 +17,20 @@ use super::{ /// The most lines of type kept for a text-showing operator's stroke pass ([`Builder::park_text`]): /// beyond them the oldest is finished, and strokes over its glyphs come in as type of their own. /// They are the lines its fill pass finished, besides the open one: a `TJ` over up to 65 lines is -/// filled and stroked, one over more is a filled object and a stroked one for each part. +/// filled and stroked, one over more is a filled object and a stroked one for each part. The +/// pass's first stroke goes over a glyph finished so, which can match a glyph kept (a `TJ` that +/// draws it again where it began): a first stroke that may go over one of them is type of its own +/// too, and ends the pass ([`Builder::hold_stroke`]). const MAX_PARKED: usize = 64; /// The most strokes of a stroke pass held to be matched to the glyphs they go over /// ([`Builder::hold_stroke`]): beyond them, those held are matched to the last glyphs filled one /// after another that they go over, with as many glyphs filled from there on as strokes held -/// ([`Builder::replayed`]), and the pass goes on from there. +/// ([`Builder::replayed`]), and the pass goes on from there. The reader tells no operator's +/// start, so the last such run is taken: the operator's fill pass is the one right before its +/// stroke pass. An operator that fills the same run of more than this many glyphs twice at the +/// same places may have its first strokes matched to its second copy; such a pass is matched as +/// well as it can be, not exactly. const MAX_HELD: usize = 4096; /// The most glyphs [`Builder::replayed`] compares to the strokes held, for bounded work on @@ -58,6 +65,7 @@ impl<'p> Builder<'p> { text_glyphs: vec![], parked: vec![], held: vec![], + lost: None, text_as, actual: Default::default(), images: HashMap::new(), @@ -142,6 +150,7 @@ impl<'p> Builder<'p> { self.text_glyphs.clear(); self.parked.clear(); self.held.clear(); + self.lost = None; self.mask = None; self.masked.clear(); self.marked.clear(); @@ -511,13 +520,21 @@ impl<'p> Builder<'p> { /// Parked lines are finished, oldest first, when the stroke pass goes past them (a stroke is /// drawn over a later line or the open one: [`Self::settle_strokes`]; or over none of them: /// [`Self::end_fills`]), when anything else ends the open line ([`Self::end_text`]), and - /// beyond [`MAX_PARKED`] lines. + /// beyond [`MAX_PARKED`] lines: the glyphs of those are kept for the stroke after them + /// ([`Self::hold_stroke`]). pub(super) fn park_text(&mut self, park: bool) { match self.text.take() { Some(line) if park && line.awaits_stroke() => { let glyphs = std::mem::take(&mut self.text_glyphs); self.parked.push((line, glyphs)); - self.release_parked(self.parked.len().saturating_sub(MAX_PARKED)); + let over = self.parked.len().saturating_sub(MAX_PARKED); + if over > 0 { + let lost = self.lost.get_or_insert_default(); + for (line, _) in self.parked.iter().take(over) { + lost.add(line); + } + } + self.release_parked(over); } line => { self.text = line; @@ -534,6 +551,7 @@ impl<'p> Builder<'p> { /// filled before it, and stroking those would draw it under the type of its own. The start /// and end of an ActualText span are too: a span's glyphs are stroked within it (#8543). pub(super) fn end_fills(&mut self) { + self.lost = None; self.settle_strokes(); self.release_parked(usize::MAX); if let Some(line) = &mut self.text { @@ -600,7 +618,17 @@ impl<'p> Builder<'p> { /// only told once the pass has ended: a `TJ` can draw the same glyph at the same place twice /// (its kerning goes back), and an operator can fill and stroke a glyph where one filled /// before it stands, which the device can't tell from a glyph the operator filled (#8543). + /// + /// The first stroke after lines were finished beyond [`MAX_PARKED`] ([`Self::park_text`]) + /// that may go over a glyph of theirs may be the start of their stroke pass, which no longer + /// finds its first glyphs: it ends the pass ([`Self::end_fills`]) and is type of its own, as + /// are the pass's strokes after it. Any other first stroke there is matched as ever: no + /// stroke pass is due over those lines once another stroke is drawn. pub(super) fn hold_stroke(&mut self, mut h: HeldStroke) -> bool { + if self.lost.take().is_some_and(|lost| lost.may_stroke(h.font, h.at, h.opacity, &h.text, h.actual)) { + self.end_fills(); + return false; + } if self.held.len() >= MAX_HELD { self.settle(false); } diff --git a/crates/pdf/src/import/state.rs b/crates/pdf/src/import/state.rs index e7a4379982..26ad4db3ee 100644 --- a/crates/pdf/src/import/state.rs +++ b/crates/pdf/src/import/state.rs @@ -121,6 +121,10 @@ pub(super) struct Builder<'p> { /// [`parked`](Self::parked) lines and the open one, held until the pass ends to be matched to /// the glyphs it strokes ([`Builder::settle_strokes`]). pub(super) held: Vec, + /// The glyphs of the lines a fill pass finished beyond the most kept for their stroke pass that + /// a stroke may still have gone over, until the first stroke after them + /// ([`Builder::hold_stroke`]) or a boundary of stroke passes ([`Builder::end_fills`]). + pub(super) lost: Option, pub(super) text_as: TextAs, pub(super) actual: super::actual_text::ActualText, pub(super) images: HashMap, diff --git a/crates/pdf/src/import_text.rs b/crates/pdf/src/import_text.rs index 672af1f012..9614fa5340 100644 --- a/crates/pdf/src/import_text.rs +++ b/crates/pdf/src/import_text.rs @@ -294,6 +294,56 @@ struct Filled { actual: Option, } +/// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over a +/// glyph `fill` filled (its font, placement, whether it is a glyph of an ActualText span, and its +/// text) on a line that is `opaque` or not ([`TextLine::fills_at`]). +fn may_stroke(fill: (u128, Placement, bool, Option<&str>), opaque: bool, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + let (g_font, g_at, g_actual, g_text) = fill; + if actual { + let same = |a: f64, b: f64| a.to_bits() == b.to_bits(); + return g_actual && g_font == font && same(g_at.origin.x, at.origin.x) && same(g_at.origin.y, at.origin.y); + } + !g_actual && opacity >= 0.999 && opaque && g_font == font && g_at.same_as(&at) && g_text == Some(text) +} + +/// The glyphs a stroke could still go over on lines of type finished before their stroke pass +/// could end: lines beyond the most a fill pass keeps for its stroke pass. The device isn't told +/// where an operator starts, so a stroke pass over such a line can't be told from one over the +/// glyphs kept: its first stroke, over a glyph finished so, may match one of them instead. Kept up +/// to [`MAX_LOST_FILLS`](Self::MAX_LOST_FILLS), beyond which any stroke may be over one. +#[derive(Clone, Debug, Default)] +pub(crate) struct LostFills { + /// Each glyph's font, placement, whether it is a glyph of an ActualText span, its text and + /// whether its line is opaque. + fills: Vec<(u128, Placement, bool, Option, bool)>, + /// More glyphs than [`MAX_LOST_FILLS`](Self::MAX_LOST_FILLS) were finished so. + overflowed: bool, +} + +impl LostFills { + /// The most glyphs kept, for bounded work and memory on hostile input. + pub const MAX_LOST_FILLS: usize = 4096; + + /// Add the glyphs `line` filled that a stroke may still go over. + pub fn add(&mut self, line: &TextLine) { + let opaque = line.opacity >= 0.999; + for g in line.filled.get(line.stroked..).unwrap_or_default() { + if self.fills.len() >= Self::MAX_LOST_FILLS { + self.overflowed = true; + return; + } + self.fills.push((g.font, g.at, g.actual.is_some(), line.glyph_text(g).map(str::to_string), opaque)); + } + } + + /// Whether a stroke over glyph `text` drawn at `at` in `font` at `opacity` may be drawn over + /// one of the glyphs ([`TextLine::fills_at`]). + pub fn may_stroke(&self, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { + self.overflowed + || self.fills.iter().any(|(f, a, act, t, opaque)| may_stroke((*f, *a, *act, t.as_deref()), *opaque, font, at, opacity, text, actual)) + } +} + /// Glyphs next to each other in one run that a stroke is drawn over, not yet restyled /// ([`TextLine::stroke_filled`]): the run's index, the text's byte range in it, and the stroke. #[derive(Clone, Debug)] @@ -713,16 +763,13 @@ impl TextLine { /// [`fills_at`](Self::fills_at) for glyph `g`. fn fills(&self, g: &Filled, font: u128, at: Placement, opacity: f32, text: &str, actual: bool) -> bool { - if actual { - let same = |a: f64, b: f64| a.to_bits() == b.to_bits(); - return g.actual.is_some() && g.font == font && same(g.at.origin.x, at.origin.x) && same(g.at.origin.y, at.origin.y); - } - g.actual.is_none() - && opacity >= 0.999 - && self.opacity >= 0.999 - && g.font == font - && g.at.same_as(&at) - && self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text) + let (fill, opaque) = ((g.font, g.at, g.actual.is_some(), self.glyph_text(g)), self.opacity >= 0.999); + may_stroke(fill, opaque, font, at, opacity, text, actual) + } + + /// The text of filled glyph `g` in the line's runs. + fn glyph_text(&self, g: &Filled) -> Option<&str> { + self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) } /// Whether a stroke drawn later may still be drawn over a glyph of the line (fill and stroke diff --git a/crates/pdf/src/tests/textstroke.rs b/crates/pdf/src/tests/textstroke.rs index 4d2debebe4..e051b8bd6b 100644 --- a/crates/pdf/src/tests/textstroke.rs +++ b/crates/pdf/src/tests/textstroke.rs @@ -502,6 +502,32 @@ fn a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart() { assert_eq!(type_runs(&content(66)), want); } +/// A `TJ` over more lines than are kept whose last part draws its first glyph again at the first +/// glyph's origin still comes in as a filled object and a stroked one for each part: the stroke +/// over the first glyph, whose line was finished, doesn't take the last part's fill (#8543). +#[test] +fn a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart() { + // Helvetica's A is 667 units wide: 65 As and 64 kerns of 3,500 back to the first A's origin. + let parts = vec!["(A)"; 65].join(" -3500 "); + let content = format!("BT 2 Tr /F1 4 Tf 20 80 Td [{parts} 267355 (A)] TJ 0 Tr ET"); + let (fill, stroke) = (vec![("A".to_string(), true, false)], vec![("A".to_string(), false, true)]); + let want: Vec<_> = std::iter::repeat_n(fill, 66).chain(std::iter::repeat_n(stroke, 66)).collect(); + assert_eq!(type_runs(&content), want); +} + +/// Type filled and stroked right after a `TJ` over more lines than are kept is filled and +/// stroked as before, whether the `TJ` was filled and stroked or filled only (#8543). +#[test] +fn type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked() { + let parts = vec!["(A)"; 66].join(" -3500 "); + for mode in ["2", "0"] { + let content = format!("BT /F1 4 Tf 20 80 Td {mode} Tr [{parts}] TJ 2 Tr /F1 48 Tf 1 0 0 1 40 150 Tm (B) Tj 0 Tr ET"); + let types = type_runs(&content); + assert_eq!(types.len(), if mode == "2" { 133 } else { 67 }, "{content}"); + assert_eq!(types.last(), Some(&vec![("B".to_string(), true, true)]), "{content}"); + } +} + /// The start and end of an ActualText span end the stroke pass of the glyphs filled before them, /// for the stroke over the glyph filled last too: a stroke after the span over the glyph its /// replacement text came with, or over a glyph filled before an empty span, is type of its own, diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index db8fdb7050..7f7e15639e 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -370,7 +370,7 @@ Stop opacity on translated artboards remains outside this regression coverage. - [ ] Exact redistribution of one replacement over several lines/styles, and general mixed-direction paragraph layout. Replacement uses the first placed glyph's line/style. Tags deeper than 128 and replacements over 64 KiB encoded (at most 192 KiB decoded) fall back to glyph mappings with a warning; an outer accepted owner survives deeper tags. - [x] Stroked type (text rendering modes 1, 2, 5 and 6, with or without `ActualText`) keeps the line cap, line join and miter limit of the graphics state it is stroked with, as paths do; glyphs stroked with another cap, join or miter limit are a run of their own, also a glyph filled and then stroked otherwise than the run its fill joined (#7741, `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs`). The dash array is not carried to the characters yet. -- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 65 lines in one operator (the 64 its fill pass finished, kept back, and the open one): past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs, also when an operator before it filled the same glyphs at the same places (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before`). A stroke after stroked type of its own, in another `ActualText` span, or after a span starts or ends, goes over no glyph filled before it, the glyph drawn last included: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it`). +- [x] Type filled and stroked by one text-showing operator (text rendering modes 2 and 6: the reader fills all of a `Tj` or `TJ`, every string of the array, before it strokes the same glyphs) comes in as one type object, filled and stroked, as it does glyph by glyph; a stroke over no filled glyph (modes 1 and 5, or stroked type of its own) stays stroke only (#8015, `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs`, `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs`). Translucent type filled and stroked stays a filled object and a stroked one, as the file composites them apiece (`translucent_fill_and_stroke_text_stays_two_objects`). A glyph filled only right after one filled and stroked (`2 Tr (B) Tj 0 Tr (C) Tj`) joins the same type object filled only, not stroked (#8300, `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`). A `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`) comes in as a type object filled and stroked for each part, also when it jumps back or starts two new lines, and when it draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`: each copy is stroked where it was filled), up to 65 lines in one operator (the 64 its fill pass finished, kept back, and the open one): past them each part stays a filled object and a stroked one, the fills first, as the file draws them (`a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`), also when its last part draws its first glyph again where it began (`a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`), and type filled and stroked after it still comes in filled and stroked (`type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`); in an `ActualText` span it stays one replacement type object, filled and stroked, on the first glyph's line and in its style, also when it draws a glyph again; stroked only (modes 1 and 5) it stays stroke only, and translucent it stays a filled object and a stroked one for each part (#8543, `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`). A stroke pass past the 4,096 strokes held at once still strokes its own operator's glyphs, also when an operator before it filled the same glyphs at the same places (`a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before`). A stroke after stroked type of its own, in another `ActualText` span, or after a span starts or ends, goes over no glyph filled before it, the glyph drawn last included: it stays type of its own, drawn in order, and each span keeps its replacement text (`a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it`). - [ ] PDF type filled and stroked at less than full opacity as one type object: it still comes in as a filled object and a stroked one (#8015). - [x] Place from bytes or unlinked paths, and PDF clipboard paste, keep the selected page's live text. Synthetic two-page regressions in `crates/engine/src/cmd/fileio/tests_pdffidelity.rs` cover both sources, page selection and explicit outlines. The single-page importer honors the same text choice as Open; existing PDF fallback rules are unchanged. @@ -383,7 +383,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-18 | minor | PDF export (#3644): the document language chosen in Document Setup is written as the catalog's `/Lang` (BCP 47, `en-US` by default) and as XMP `dc:language`; a language without a tag writes none. Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | diff --git a/docs/roadmap.md b/docs/roadmap.md index e8d808a299..54fb031266 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -216,7 +216,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8015 follow-up): type filled and stroked at less than full opacity is no longer joined into one type object, since the file composites the fill and the stroke apiece, darker where they overlap, while one object's opacity applies to both together; it stays a filled object and a stroked one, as a fill and stroke at different opacities already did. An upright glyph (vertical type) filled and stroked is no longer kept as an outline for a line that comes in as its outlines, as glyphs filled only weren't, so such a line can't lose them. The #8015 entries now say what is left: translucent type filled and stroked, and a `TJ` whose kerning starts a new line part way through, still come in as two objects. Tests: `translucent_fill_and_stroke_text_stays_two_objects`, `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled`; scores and estimates unchanged. | | 2026-11-16 | minor | M1: an Alt-drag in the Layers panel copies a row above or below its own place (`layer.move` with `copy` and that row as the target), so the top layer dragged up, the bottom layer dragged down and a document's only layer are copied (#8237). Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 49f6a7aaa0..30cace80d2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -63,7 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`; scores and estimates unchanged. | +| 2026-11-18 | minor | PDF import (#8543): type filled and stroked (text rendering modes 2 and 6) by a `TJ` whose kerning starts a new line part way through came in as four type objects, each part filled only and each part stroked only over it: the reader fills every glyph of the operator before it strokes them, and the line the first part was gathered on was finished before the stroke pass came back to it. Lines an operator's fill pass finishes while a stroke may still be drawn over them are now kept (up to 64 besides the open line, so a `TJ` over up to 65 lines: one over more stays a filled object and a stroked one for each part, as before) until the stroke pass goes past them, and the pass's strokes are held (up to 4096: a longer pass is matched a part at a time, each part to glyphs filled one right after another, never to one an operator before it filled) until it ends, then matched to the glyphs filled last, in the order they were filled, so each stroke finds the glyph it was filled as, also where the `TJ` draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`). Each part comes in as one type object filled and stroked, in the order drawn; also a `TJ` that jumps back and one whose kerning starts two new lines. In an `ActualText` span (whose stroke was lost) the replacement text stays one type object on the first glyph's line and in its style, now filled and stroked, also where the `TJ` draws a glyph again: the span's strokes are matched the same way. A stroke over no filled glyph (stroked type of its own) and the start and end of an `ActualText` span end a stroke pass: no stroke after them goes over a glyph filled before them, so none is drawn under type drawn after it, and a later span keeps its own replacement text. Stroke rendering stays stroke only, and translucent type stays a filled object and a stroked one. Tests: `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked`, `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy`, `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only`, `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart`, `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before`, `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before`, `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph`, `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement`, `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart`, `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart`, `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked`; scores and estimates unchanged. | | 2026-11-18 | minor | Hardening: PDF export writes the document language (Document Setup) as the catalog's `/Lang` and XMP `dc:language` (#3644). Scores and estimates unchanged. | | 2026-11-17 | minor | Distort & Transform › Twist: handles follow the rotation's derivative, so a strongly twisted path is a smooth spiral instead of pieces meeting at kinks (#7069; `twist_joins_its_pieces_smoothly` in `crates/effects/src/tests.rs`). Scores and estimates unchanged. | | 2026-11-17 | minor | PDF import (#8300): a glyph filled only (text rendering mode 0) right after one filled and stroked (mode 2) joined the stroked run and came in stroked too: `2 Tr (B) Tj 0 Tr (C) Tj` came in as `BC` stroked throughout. A glyph filled only now joins only a run drawn alike, so it starts a run of its own, filled only, in the same type object, and takes a stroke only when the file draws one over it (the #8015 matching); a word filled whole then stroked whole, and fill and stroke rendering glyph by glyph, still come in as one run filled and stroked. Tests: `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked`, `glyphs_filled_and_stroked_one_by_one_stay_one_run`; scores and estimates unchanged. | @@ -604,7 +604,7 @@ since 2026-10-01. - **PDF authored replacement text (#6165):** `crates/pdf/src/tests/actual_text.rs` covers replacement once with suffix placement, PDF text-string decoding, empty and nested owners, sibling spans, page reset, multiple text-show operations, style/line changes, fill-and-stroke, reader windows and bounded input. Authored logical-order stretches are protected while adjacent ordinary text still undergoes reconstruction. The replacement takes its first placed glyph's style and line; its characters are not redistributed over later lines/styles. Exact mixed-direction paragraph layout is not claimed. No export changes; scores and hours stay at 75% / 10–20 h. - **PDF stroked type (#7741):** `imported_stroked_type_keeps_the_files_cap_join_and_miter_limit` in `crates/pdf/src/tests/textstroke.rs` covers round, projecting and butt caps, round, bevel and miter joins and a miter limit of 3 on type stroked in rendering modes 1, 2, 5 and 6, shown as a word, a glyph at a time and under `ActualText`; glyphs stroked with another join as runs of their own; and a glyph filled and stroked after one stroked otherwise, which keeps the join of the glyph before it. Synthetic PDFs written in the test (standard Helvetica, not embedded); no fonts or fixtures added. The dash array is not yet carried to the characters. -- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first; `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before` covers `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and stroked from the same place: the second operator's glyphs are stroked, not the first one's. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it` covers a stroke after a span over the glyph its replacement text came with, and over a glyph filled before an empty span: type of its own, the glyph filled only; `a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object` covers a glyph stroked again where it was drawn: one type object. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. +- **PDF type filled then stroked (#8015):** `a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type` in `crates/pdf/src/tests/textstroke.rs` covers a word shown at once, a `TJ` array of two strings with kerning between them, a line over two `Tj` and a glyph at a time, also under `ActualText`, in text rendering modes 0, 1, 2, 4, 5 and 6: modes 2 and 6 come in as one type object `WAVE` filled #ffffcc with a 3 pt black stroke, round cap and join, modes 1 and 5 stroke only, 0 and 4 fill only; a Type 3 font is filled once in every mode (the reader paints Type 3 glyphs as their procedures draw them); a stroke join that changes between two operators keeps a run each; and filled type with stroked type of its own below it stays two objects. `a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type` in `crates/pdf/src/tests/text_placement.rs` covers a vertical column in modes 2 and 6. `a_stroke_at_another_size_does_not_go_over_the_filled_glyph` and `a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph` (also in `textstroke.rs`) cover a word filled and then its first glyph stroked from the same origin: at another size it stays type of its own, and at the same size only that glyph is stroked. `translucent_fill_and_stroke_text_stays_two_objects` (in `textstroke.rs`) covers type filled and stroked at the same opacity: at 0.5 it stays a filled object and a stroked one, as the file composites them apiece, and opaque it is one. `a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled` in `crates/pdf/src/tests/reshaped.rs` covers a vertical line of Devanagari with one glyph filled and stroked: every glyph comes in filled. `a_glyph_filled_only_after_one_filled_and_stroked_is_not_stroked` (#8300, in `textstroke.rs`) covers a glyph filled only right after one filled and stroked, also after a glyph filled only and before another filled and stroked: it joins the same type object filled only, not stroked; `glyphs_filled_and_stroked_one_by_one_stay_one_run` covers fill and stroke rendering glyph by glyph and a word filled whole then stroked whole at the same place: one run, filled and stroked. `a_tj_whose_kerning_starts_a_new_line_is_filled_and_stroked` (#8543, in `textstroke.rs`) covers a `TJ` whose kerning starts a new line part way through (`[(AB) -3500 (CD)] TJ`), one that jumps back, and one whose kerning starts two new lines, in modes 2 and 6: each part one type object, filled and stroked, in the order drawn; small kerning stays one object, and in an `ActualText` span the replacement text stays one type object, filled and stroked, on the first glyph's line and in its style. `a_tj_that_draws_a_glyph_again_where_it_drew_one_strokes_each_copy` covers a `TJ` that draws a glyph again where it drew one (`[(A) -3500 (B) 4834 (A)] TJ`, with the copy drawn last ending the operator or followed by another line, and with A and B drawn again): each copy one type object, filled and stroked; a glyph filled and stroked by an operator of its own where one filled before stands still strokes only the one filled last. `a_stroked_tj_whose_kerning_starts_a_new_line_stays_stroke_only` covers modes 1 and 5 (stroke only), and `a_translucent_tj_whose_kerning_starts_a_new_line_stays_fill_and_stroke_apart` covers it at 0.5 opacity: a filled object and a stroked one for each part, as the file draws them. `a_long_stroke_pass_strokes_its_own_glyphs_not_one_filled_before` covers a stroke pass past the 4,096 strokes held at once (an `A` filled, then `A` and 4,096 `B`s filled and stroked from the same place): the second `A` is stroked, not the first; `a_long_stroke_pass_does_not_take_the_same_glyphs_filled_by_an_operator_before` covers `A` and 4,095 `B`s filled, then `A` and 4,096 `B`s filled and stroked from the same place: the second operator's glyphs are stroked, not the first one's. `a_stroke_after_stroked_type_of_its_own_does_not_join_a_glyph_filled_before` covers a stroke over a glyph filled two lines back after stroked type of its own: it stays type of its own, drawn last. `a_stroke_in_an_actual_text_span_does_not_take_an_earlier_spans_glyph` covers a stroke in an `ActualText` span over a glyph an earlier span filled: each span's replacement text comes in. `a_stroke_after_an_actual_text_span_does_not_take_a_glyph_filled_before_it` covers a stroke after a span over the glyph its replacement text came with, and over a glyph filled before an empty span: type of its own, the glyph filled only; `a_glyph_stroked_again_where_it_was_drawn_stays_one_type_object` covers a glyph stroked again where it was drawn: one type object. `a_tj_that_draws_a_glyph_again_in_an_actual_text_span_strokes_the_replacement` covers `[(A) -3500 (B) 4834 (A)] TJ` in an `ActualText` span: one replacement type object, filled and stroked. `a_tj_over_more_lines_than_are_kept_comes_in_as_fill_and_stroke_apart` covers the limit: a `TJ` over 65 lines comes in as 65 type objects filled and stroked, one over 66 as a filled object and a stroked one for each part, the fills first. `a_tj_over_more_lines_than_are_kept_that_ends_where_it_began_stays_fill_and_stroke_apart` covers one over 66 whose last part draws its first glyph again where it began: still a filled object and a stroked one for each part; `type_after_a_tj_over_more_lines_than_are_kept_is_filled_and_stroked` covers type filled and stroked after a `TJ` over 66 lines, filled and stroked or filled only: one type object, filled and stroked. Not covered: translucent type filled and stroked still comes in as two objects, as the file composites them. Synthetic PDFs written in the tests; no fonts or fixtures added. - **PDF Indic type (#5235, #6906):** `crates/pdf/src/tests/reshaped.rs` covers a vowel sign the file draws before its consonant (the line keeps the file's glyphs as outlines, with a note), text in reading order (stays type), a mark with no advance (stays on its line, not vertical type of its own), outlined glyphs stroked with different dashes and translucent outlined glyphs (each keeps its own path). Synthetic font only; one real Gujarati file checked by eye on page 1. Indic type in an uninstalled font keeps the file's glyphs as outlines; reordering signs so more lines stay editable is not done. Scores and hours stay at 75% / 10-20 h. From 1cffa0b862fff4e98f8ce96a0d96bf9cfeccded5 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:58:52 +0530 Subject: [PATCH 219/247] M7/G4: retype review: tracked letters, outline check cost, poses (#4934) The lone-glyph rule looks at lines as the outlines lie, before the layout check splits them, so tracked one-contour letters (L, I, T, H, E) become type. A shape keeps every glyph and pose it fits exactly, upright first (an L, and a turned L half round; an I upright or upside down), and the line around it chooses; a one-glyph line may turn to another candidate to take the next glyph. The whole-outline check flattens the shape once per shape, samples every corner and points twice the tolerance apart, and asks a flat uniform grid of segments. With Microsoft YaHei loaded: 300 CJK outlines in 350 ms (1.9 s before), one line in 25 ms. FontDb::outline reuses outline_uncached, and the compositing test covers knockout_shape. --- crates/engine/src/cmd/retype.rs | 101 ++++++++++-- crates/engine/src/cmd/retype_tests.rs | 65 +++++++- crates/text/src/fontdb/lookup.rs | 8 +- crates/text/src/retype.rs | 219 ++++++++++++++++++++------ 4 files changed, 314 insertions(+), 79 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index df0d88a489..2ce951f812 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -164,6 +164,9 @@ struct Line { pieces: Vec, /// What each piece matched, as `pieces`. matches: Vec, + /// Every glyph the first piece fits, while the line holds only it: the next glyph may tell + /// which one it is (see [`join`]). + first_cands: Vec, text: String, face: Arc, scale: f64, @@ -224,6 +227,7 @@ impl Line { let mut l = Line { pieces: vec![*first], matches: vec![m.clone()], + first_cands: vec![], text: m.ch.to_string(), face: m.face.clone(), scale: m.scale, @@ -331,11 +335,64 @@ fn space_advance(face: &vectorcraft_text::FontFace) -> f64 { face.mapped_chars().iter().find(|(c, _)| *c == ' ').map(|(_, g)| face.advance(*g)).unwrap_or(0.0) } -fn new_line(pc: &Piece, m: &GlyphMatch) -> Line { +/// Add shape `pc` to line `l` when one of its candidate glyphs `cands`, in one of its poses, +/// continues it (one shape can be several glyphs, and a glyph that looks the same turned fits in +/// more than one pose). A line of one shape may turn to another of that shape's candidates to take +/// the next one: an L or a turned L half round, an I upright or upside down, and the glyph after it +/// tells which. Whether it was added. +fn join(l: &mut Line, pc: &Piece, cands: &[GlyphMatch]) -> bool { + let fits = |l: &Line| cands.iter().flat_map(|c| c.poses()).find(|mp| l.continues(pc, mp)); + if let Some(mp) = fits(l) { + l.push(pc.id, &mp); + return true; + } + let (Some(id), [current]) = (l.pieces.first().copied(), l.matches.as_slice()) else { return false }; + let current = current.clone(); + let others: Vec = l + .first_cands + .iter() + .flat_map(|c| c.poses()) + .filter(|fp| !(fp.gid == current.gid && fp.face.id() == current.face.id() && fp.angle == current.angle)) + .collect(); + for fp in others { + let mut turned = reposed(l, id, &fp); + if let Some(mp) = fits(&turned) { + turned.push(pc.id, &mp); + *l = turned; + return true; + } + } + false +} + +/// Line `l`'s group, paint and transparency with glyph `m` (shape `id`) alone on it. +fn reposed(l: &Line, id: NodeId, m: &GlyphMatch) -> Line { let dir = Vec2::new(m.angle.cos(), m.angle.sin()); Line { + pieces: vec![id], + matches: vec![m.clone()], + first_cands: l.first_cands.clone(), + text: m.ch.to_string(), + face: m.face.clone(), + scale: m.scale, + angle: m.angle, + origin: m.origin, + end: m.origin + dir * (m.face.advance(m.gid) * m.scale), + appearance: l.appearance.clone(), + parent: l.parent, + opacity: l.opacity, + blend: l.blend, + } +} + +/// A new line of shape `pc` alone, as the first of its candidate glyphs `cands` (none: `None`). +fn new_line(pc: &Piece, cands: &[GlyphMatch]) -> Option { + let m = cands.first()?; + let dir = Vec2::new(m.angle.cos(), m.angle.sin()); + Some(Line { pieces: vec![pc.id], matches: vec![m.clone()], + first_cands: cands.to_vec(), text: m.ch.to_string(), face: m.face.clone(), scale: m.scale, @@ -346,7 +403,7 @@ fn new_line(pc: &Piece, m: &GlyphMatch) -> Line { parent: pc.parent, opacity: pc.opacity, blend: pc.blend, - } + }) } fn retype(s: &mut Session, p: &Value) -> Result { @@ -394,10 +451,16 @@ fn retype(s: &mut Session, p: &Value) -> Result { // The face most shapes match, so a glyph several fonts share is set in the same font as // the glyphs around it. let mut votes: Vec<(u32, usize)> = vec![]; - for m in found.iter().flatten() { - match votes.iter_mut().find(|(f, _)| *f == m.face.id()) { - Some(v) => v.1 += 1, - None => votes.push((m.face.id(), 1)), + for ms in &found { + // Each shape votes once for each face it fits. + let mut faces: Vec = ms.iter().map(|m| m.face.id()).collect(); + faces.sort_unstable(); + faces.dedup(); + for f in faces { + match votes.iter_mut().find(|(v, _)| *v == f) { + Some(v) => v.1 += 1, + None => votes.push((f, 1)), + } } } let rank = |face: u32| votes.iter().find(|(f, _)| *f == face).map_or(0, |v| v.1); @@ -409,26 +472,34 @@ fn retype(s: &mut Session, p: &Value) -> Result { if pc.after_barrier { open = false; } - // Earlier matches win ties: they are the closer fits. - let best = ms.iter().enumerate().max_by_key(|(i, m)| (rank(m.face.id()), std::cmp::Reverse(*i))).map(|(_, m)| m); - let Some(m) = best else { + // The shape's candidates in the face most shapes fit (the first such face, as the + // matches come upright and closest first). + let face = ms.iter().enumerate().max_by_key(|(i, m)| (rank(m.face.id()), std::cmp::Reverse(*i))).map(|(_, m)| m.face.id()); + let cands: Vec = ms.iter().filter(|m| Some(m.face.id()) == face).cloned().collect(); + if cands.is_empty() { unmatched.push(pc.id); open = false; continue; + } + let joined = match lines.last_mut() { + Some(l) if open => join(l, pc, &cands), + _ => false, }; - match lines.last_mut() { - Some(l) if open && l.continues(pc, m) => l.push(pc.id, m), - _ => lines.push(new_line(pc, m)), + if !joined { + lines.extend(new_line(pc, &cands)); } open = true; } - let mut lines = verified(lines, system_layout, &mut unmatched); // A lone one-contour glyph (a period, a hyphen, a bullet) is too plain to tell from drawn // art (a dot, a bar): beside other shapes it stays an outline. Selected on its own, it is - // what was asked for. + // what was asked for. Lone means alone on its baseline as the outlines lie, before the + // layout check splits lines (tracking and manual kerning split them glyph by glyph). + let lone_pieces: std::collections::HashSet = + lines.iter().filter(|l| matches!(l.matches.as_slice(), [m] if m.contours == 1)).flat_map(|l| l.pieces.iter().copied()).collect(); + let mut lines = verified(lines, system_layout, &mut unmatched); if pieces.len() > 1 { lines.retain(|l| { - let lone = matches!(l.matches.as_slice(), [m] if m.contours == 1); + let lone = matches!(l.pieces.as_slice(), [id] if lone_pieces.contains(id)); if lone { unmatched.extend(l.pieces.iter().copied()); } diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 1c8cf5c2f2..98736c5a4f 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -349,15 +349,15 @@ fn a_hidden_or_locked_glyph_stays_an_outline() { #[test] fn an_isolated_or_knockout_group_keeps_its_type_inside() { - for knock in [false, true] { + for case in ["isolate", "knockout", "knockout_shape"] { let mut s = session(); let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "AB", "size": 40})); s.edit("test", |d, _| { let n = d.node_mut(NodeId(g)).unwrap(); - if knock { - n.knockout = vectorcraft_doc::Knockout::On; - } else { - n.isolate = true; + match case { + "isolate" => n.isolate = true, + "knockout" => n.knockout = vectorcraft_doc::Knockout::On, + _ => n.knockout_shape = true, } Ok(()) }) @@ -365,7 +365,7 @@ fn an_isolated_or_knockout_group_keeps_its_type_inside() { s.execute("select.set", &json!({"ids": [g]})).unwrap(); let r = s.execute("type.retype", &json!({})).unwrap(); let id = r["ids"][0].as_u64().unwrap(); - assert_eq!(children_of(&s, g), vec![id], "knockout {knock}: the group stays, holding the type"); + assert_eq!(children_of(&s, g), vec![id], "{case}: the group stays, holding the type"); } } @@ -465,3 +465,56 @@ fn nothing_retypable_reads_no_font() { let e = s.execute("type.retype", &json!({})).unwrap_err().to_string(); assert!(e.contains("(1 checked)"), "the masked shape is reported, and no font was indexed: {e}"); } + +#[test] +fn tracked_one_contour_letters_still_become_type() { + for text in ["LIT", "HELLO", "LIST"] { + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": text, "size": 30})).unwrap()["id"].as_u64().unwrap(); + let n = text.len() as u64; + s.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": n, "tracking": 50})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); + assert_eq!(texts.concat(), text, "split by the tracking, every letter still becomes type: {r}"); + assert!(texts.len() > 1, "the tracking splits the line: {r}"); + assert_eq!(r["unmatched"], json!([]), "{r}"); + } +} + +/// How long Retype takes on a few hundred CJK outlines at once (run with `--ignored --nocapture`; +/// skips when no large CJK font is installed). Not a pass/fail budget: it prints. +#[test] +#[ignore = "timing: needs an installed CJK font"] +fn timing_with_hundreds_of_cjk_outlines() { + let db = vectorcraft_text::FontDb::global(); + let Some(family) = ["Microsoft YaHei", "Yu Gothic", "MS Gothic", "Noto Sans CJK JP", "Hiragino Sans"].into_iter().find(|f| db.has_family(f)) + else { + eprintln!("skipped: no large CJK font installed"); + return; + }; + let face = db.resolve(family, "Regular").map(|(f, _)| f).unwrap(); + // 300 common ideographs, ten lines of thirty. + let chars: Vec = (0x4E00u32..).filter_map(char::from_u32).filter(|c| face.covers(*c)).take(300).collect(); + let mut s = session(); + let mut groups = vec![]; + for (i, line) in chars.chunks(30).enumerate() { + let text: String = line.iter().collect(); + groups.push(outlined(&mut s, json!({"x": 20, "y": 40 + 30 * i, "text": text, "size": 20, "font": family, "style": face.style}))); + } + for run in ["cold", "warm"] { + s.execute("select.set", &json!({"ids": groups})).unwrap(); + let t0 = std::time::Instant::now(); + let r = s.execute("type.retype", &json!({"fonts": [family]})).unwrap(); + let ms = t0.elapsed().as_secs_f64() * 1000.0; + let typed: usize = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().chars().count()).sum(); + eprintln!( + "{run}: Retype of {} {family} outlines: {ms:.0} ms → {typed} characters typed, {} unmatched", + chars.len(), + r["unmatched"].as_array().unwrap().len() + ); + s.execute("edit.undo", &json!({})).unwrap(); + } +} diff --git a/crates/text/src/fontdb/lookup.rs b/crates/text/src/fontdb/lookup.rs index 99844220f5..3c2a613b56 100644 --- a/crates/text/src/fontdb/lookup.rs +++ b/crates/text/src/fontdb/lookup.rs @@ -660,13 +660,7 @@ impl FontDb { if let Some(p) = self.outlines.lock().unwrap_or_else(|e| e.into_inner()).get(&key) { return p.clone(); } - let mut pen = FlipPen(BezPath::new()); - if let Some(f) = face.skrifa() - && let Some(g) = f.outline_glyphs().get(GlyphId::new(gid)) - { - let _ = g.draw(DrawSettings::unhinted(Size::unscaled(), face.location()), &mut pen); - } - let p = Arc::new(pen.0); + let p = Arc::new(self.outline_uncached(face, gid)); let mut cache = self.outlines.lock().unwrap_or_else(|e| e.into_inner()); if cache.len() >= OUTLINE_CACHE_MAX { cache.clear(); diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index 5ef5073909..b778ce47dd 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -42,6 +42,8 @@ const OUTLINE_TOLERANCE: f64 = 5e-3; const MAX_OUTLINE_POINTS: usize = 8192; /// Points along an outline past which the whole-outline check gives up (and so rejects). const MAX_CHECKED_POINTS: usize = 65_536; +/// The most glyphs one shape is reported to be ([`RetypeIndex::matches`]). +pub const MAX_CANDIDATES: usize = 16; /// How far apart two shapes' spread-to-length ratios may be and still be compared. const INVARIANT_SLACK: f64 = 0.02; @@ -62,6 +64,32 @@ pub struct GlyphMatch { pub residual: f64, /// How many contours the glyph has. pub contours: usize, + /// Other poses the glyph fits the shape in equally (a glyph that looks the same turned). + pub alts: Vec, +} + +/// Where and how a glyph lies: its size, turn and origin. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Pose { + /// Document units per font unit. + pub scale: f64, + /// Radians, as [`kurbo::Affine::rotate`] turns. + pub angle: f64, + /// Where the glyph's origin lies. + pub origin: Point, +} + +impl GlyphMatch { + /// This match in each pose it fits: its own first, then [`Self::alts`]. + pub fn poses(&self) -> impl Iterator + '_ { + let own = Pose { scale: self.scale, angle: self.angle, origin: self.origin }; + std::iter::once(own).chain(self.alts.iter().copied()).map(move |p| GlyphMatch { + scale: p.scale, + angle: p.angle, + origin: p.origin, + ..self.clone() + }) + } } /// A shape reduced for matching: points along each contour, centred. @@ -152,8 +180,12 @@ impl RetypeIndex { self.entries.is_empty() } - /// The glyphs `shape` (in document space) is, the closest one per face, closest first; empty - /// when it is no glyph of the indexed faces. + /// The glyphs `shape` (in document space) is: every glyph that fits it exactly, upright ones + /// first, then the closest; empty when it is no glyph of the indexed faces. One shape can be + /// several glyphs: an L, and a turned L (U+A780) turned half round; a u, and an n upside down. + /// A glyph that looks the same turned (an I, an O, a hyphen) also fits in more than one pose: + /// the upright-most comes first and the others are kept in [`GlyphMatch::alts`]. The line + /// around the shape chooses among them. At most [`MAX_CANDIDATES`]. pub fn matches(&self, shape: &BezPath) -> Vec { let variants = signatures(shape, true); let Some(first) = variants.first() else { return vec![] }; @@ -161,53 +193,70 @@ impl RetypeIndex { let lo = first.invariant * (1.0 - INVARIANT_SLACK); let hi = first.invariant * (1.0 + INVARIANT_SLACK); let start = list.partition_point(|i| self.entries.get(*i).is_some_and(|e| e.sig.invariant < lo)); - let mut best: HashMap = HashMap::new(); + let tol = first.spread * OUTLINE_TOLERANCE; + // The shape flattened for the whole-outline check, once, when a glyph first gets that far. + let mut shape_flat: Option> = None; + let mut out: Vec<(usize, GlyphMatch)> = vec![]; for i in list.iter().skip(start) { let Some(e) = self.entries.get(*i) else { continue }; if e.sig.invariant > hi { break; } - // The reading of the shape (its tied starting corners) that fits the glyph best. - let Some((sig, z, residual)) = variants.iter().filter_map(|s| fit(&e.sig, s).map(|(z, r)| (s, z, r))).min_by(|a, b| a.2.total_cmp(&b.2)) - else { - continue; - }; - if residual > TOLERANCE { - continue; - } let Some(face) = self.faces.get(e.face) else { continue }; - // The glyph's origin is (0, 0) in font units: it lands at centre − z·glyph centre. - let gc = mul(z, e.sig.centre); - let origin = Point::new(sig.centre.x - gc.x, sig.centre.y - gc.y); - // The samples can step over a detail (a notch between two of them): the whole outline, - // turned onto the shape, must lie on it. - let onto = Affine::new([z.0, z.1, -z.1, z.0, origin.x, origin.y]); - if !outlines_agree(&(onto * e.outline.clone()), shape, sig.spread * OUTLINE_TOLERANCE) { - continue; + // Each reading of the shape (its tied starting corners) that fits the glyph is a pose. + let mut poses: Vec<(Pose, f64)> = vec![]; + for sig in &variants { + let Some((z, residual)) = fit(&e.sig, sig) else { continue }; + if residual > TOLERANCE { + continue; + } + // The glyph's origin is (0, 0) in font units: it lands at centre − z·glyph centre. + let gc = mul(z, e.sig.centre); + let pose = Pose { scale: z.0.hypot(z.1), angle: z.1.atan2(z.0), origin: Point::new(sig.centre.x - gc.x, sig.centre.y - gc.y) }; + if poses.iter().any(|(p, _)| wrapped(p.angle - pose.angle).abs() < 1e-6) { + continue; + } + // The samples can step over a detail (a notch between two of them): the whole + // outline, turned onto the shape, must lie on it. + let flat = shape_flat.get_or_insert_with(|| Flat::new(shape, tol)); + let Some(flat) = flat.as_ref() else { break }; + let onto = Affine::new([z.0, z.1, -z.1, z.0, pose.origin.x, pose.origin.y]); + if !Flat::new(&(onto * e.outline.clone()), tol).is_some_and(|g| g.agrees(flat)) { + continue; + } + poses.push((pose, residual)); } + // The upright-most pose first. + poses.sort_by(|a, b| wrapped(a.0.angle).abs().total_cmp(&wrapped(b.0.angle).abs())); + let Some(((pose, _), rest)) = poses.split_first() else { continue }; + let residual = poses.iter().map(|(_, r)| *r).fold(f64::INFINITY, f64::min); let m = GlyphMatch { face: face.clone(), gid: e.gid, ch: e.ch, - scale: z.0.hypot(z.1), - angle: z.1.atan2(z.0), - origin, + scale: pose.scale, + angle: pose.angle, + origin: pose.origin, residual, contours: e.sig.contours, + alts: rest.iter().map(|(p, _)| *p).collect(), }; - match best.get(&e.face) { - Some(b) if b.residual < m.residual || (b.residual == m.residual && b.ch <= m.ch) => {} - _ => { - best.insert(e.face, m); - } - } + out.push((e.face, m)); } - let mut out: Vec<(usize, GlyphMatch)> = best.into_iter().collect(); - out.sort_by(|a, b| a.1.residual.total_cmp(&b.1.residual).then(a.0.cmp(&b.0))); + let upright = |m: &GlyphMatch| wrapped(m.angle).abs() >= 1e-3; + out.sort_by(|a, b| { + upright(&a.1).cmp(&upright(&b.1)).then(a.1.residual.total_cmp(&b.1.residual)).then(a.0.cmp(&b.0)).then(a.1.ch.cmp(&b.1.ch)) + }); + out.truncate(MAX_CANDIDATES); out.into_iter().map(|(_, m)| m).collect() } } +/// `a` wrapped into −π..π. +fn wrapped(a: f64) -> f64 { + (a + std::f64::consts::PI).rem_euclid(std::f64::consts::TAU) - std::f64::consts::PI +} + /// A face's glyphs as the index looks them up: (glyph, character, [`shape_key`]), one per glyph /// under the lowest character that maps to it. type FaceKeys = Arc>; @@ -308,17 +357,38 @@ fn fit(g: &Signature, s: &Signature) -> Option<((f64, f64), f64)> { rel.is_finite().then_some((z, rel)) } -/// Do outlines `a` and `b` (in one space) lie on each other: every point of each, flattened, within -/// `tol` of the other? `false` when either is too large to check. -fn outlines_agree(a: &BezPath, b: &BezPath, tol: f64) -> bool { - if !tol.is_finite() || tol <= 0.0 { - return false; - } - let flat = |p: &BezPath| -> Option> { +/// An outline flattened for the whole-outline check: its segments, points along them (every +/// corner, and points twice `tol` apart between corners: a detail narrower than that has corners +/// of its own), and a uniform grid listing each segment under every cell its box, grown by `tol`, +/// touches, so whether a point lies within `tol` of the outline is asked of the few segments +/// around it. +struct Flat { + segs: Vec<(Point, Point)>, + pts: Vec, + origin: Point, + cell: f64, + cols: usize, + rows: usize, + /// Segment indices per cell, row by row. + cells: Vec>, + tol: f64, +} + +impl Flat { + /// Cells along the longer side, at most. + const MAX_SIDE: f64 = 48.0; + /// Segment listings in all, at most: past it (or past [`MAX_OUTLINE_POINTS`] segments or + /// [`MAX_CHECKED_POINTS`] points), `None`, and so no match. + const MAX_LISTINGS: usize = 1 << 18; + + fn new(path: &BezPath, tol: f64) -> Option { + if !tol.is_finite() || tol <= 0.0 { + return None; + } let mut segs = vec![]; let (mut start, mut last) = (Point::ZERO, Point::ZERO); let mut too_many = false; - kurbo::flatten(p.iter(), tol / 4.0, |el| { + kurbo::flatten(path.iter(), tol / 2.0, |el| { if segs.len() > MAX_OUTLINE_POINTS { too_many = true; return; @@ -336,26 +406,73 @@ fn outlines_agree(a: &BezPath, b: &BezPath, tol: f64) -> bool { _ => {} } }); - (!too_many).then_some(segs) - }; - let (Some(sa), Some(sb)) = (flat(a), flat(b)) else { return false }; - let near = |p: Point, segs: &[(Point, Point)]| segs.iter().any(|(s, e)| Line::new(*s, *e).nearest(p, 1e-9).distance_sq <= tol * tol); - // Points along every edge, not only its ends: two outlines with the same corners joined in - // another order differ between them. Spaced `tol` apart; past the work limit, not a match. - let along = |segs: &[(Point, Point)]| -> Option> { + if too_many { + return None; + } let mut pts = vec![]; - for (s, e) in segs { - let steps = (s.distance(*e) / tol).ceil(); + for (s, e) in &segs { + let steps = (s.distance(*e) / (2.0 * tol)).ceil(); if !steps.is_finite() || pts.len() as f64 + steps > MAX_CHECKED_POINTS as f64 { return None; } let steps = (steps as usize).max(1); pts.extend((0..steps).map(|i| s.lerp(*e, i as f64 / steps as f64))); } - Some(pts) - }; - let (Some(pa), Some(pb)) = (along(&sa), along(&sb)) else { return false }; - pa.iter().all(|p| near(*p, &sb)) && pb.iter().all(|p| near(*p, &sa)) + let (first, _) = segs.first()?; + let mut bb = kurbo::Rect::from_points(*first, *first); + for (s, e) in &segs { + bb = bb.union_pt(*s).union_pt(*e); + } + let bb = bb.inflate(tol, tol); + let cell = (bb.width().max(bb.height()) / Self::MAX_SIDE).max(2.0 * tol); + if !cell.is_finite() || cell <= 0.0 { + return None; + } + let at = |v: f64, o: f64| (((v - o) / cell).floor().max(0.0) as usize).min(Self::MAX_SIDE as usize); + let (cols, rows) = (at(bb.x1, bb.x0) + 1, at(bb.y1, bb.y0) + 1); + let mut cells: Vec> = vec![vec![]; cols * rows]; + let mut listings = 0usize; + for (i, (s, e)) in segs.iter().enumerate() { + let r = kurbo::Rect::from_points(*s, *e).inflate(tol, tol); + for cy in at(r.y0, bb.y0)..=at(r.y1, bb.y0).min(rows - 1) { + for cx in at(r.x0, bb.x0)..=at(r.x1, bb.x0).min(cols - 1) { + listings += 1; + if listings > Self::MAX_LISTINGS { + return None; + } + if let Some(c) = cells.get_mut(cy * cols + cx) { + c.push(u32::try_from(i).ok()?); + } + } + } + } + Some(Flat { segs, pts, origin: Point::new(bb.x0, bb.y0), cell, cols, rows, cells, tol }) + } + + /// Does `p` lie within `tol` of a segment? + fn near(&self, p: Point) -> bool { + let (fx, fy) = ((p.x - self.origin.x) / self.cell, (p.y - self.origin.y) / self.cell); + if !(fx >= 0.0 && fy >= 0.0) || fx >= self.cols as f64 || fy >= self.rows as f64 { + return false; + } + let (cx, cy) = (fx as usize, fy as usize); + let tol2 = self.tol * self.tol; + self.cells.get(cy * self.cols + cx).is_some_and(|list| { + list.iter().filter_map(|i| self.segs.get(*i as usize)).any(|(s, e)| Line::new(*s, *e).nearest(p, 1e-9).distance_sq <= tol2) + }) + } + + /// Do the two outlines lie on each other: every point of each within `tol` of the other? + fn agrees(&self, other: &Flat) -> bool { + self.pts.iter().all(|p| other.near(*p)) && other.pts.iter().all(|p| self.near(*p)) + } +} + +/// Do outlines `a` and `b` (in one space) lie on each other: every point of each, flattened, within +/// `tol` of the other? `false` when either is too large to check. +#[cfg(test)] +fn outlines_agree(a: &BezPath, b: &BezPath, tol: f64) -> bool { + matches!((Flat::new(a, tol), Flat::new(b, tol)), (Some(fa), Some(fb)) if fa.agrees(&fb)) } /// `seg` as a line when it is one (a curve with its handles on its ends or on its line), else as it is. From 4fe27f830cb373bfd80a9929f2eac955ac48a05e Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 19:39:40 +0530 Subject: [PATCH 220/247] M7/G4: retype bounds readings tried and glyphs laid out (#4934) Readings of a shape are capped by those tried, not those kept, so a shape whose every reading fails stops at the cap. The layout check grows a window from each line start, doubling while the type draws the outlines, and starts the next line at a mismatch, so a line split at every glyph costs about twice its glyphs, not half their square; a glyph budget leaves anything past it as outlines. A tracked line of 450 glyphs: 259 ms. --- crates/engine/src/cmd/retype.rs | 74 +++++++++++++++++++-------- crates/engine/src/cmd/retype_tests.rs | 19 +++++++ crates/text/src/retype.rs | 26 +++++++++- 3 files changed, 95 insertions(+), 24 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 2ce951f812..b3a19862da 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -299,31 +299,61 @@ impl Line { /// `lines` checked against their own layout: a line splits where its type stops drawing the /// outlines, and a glyph its type cannot draw even on its own stays an outline (`unmatched`). -/// The layouts are bounded by the number of glyphs. +/// The glyphs laid out are bounded by a multiple of the number of glyphs. fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) -> Vec { - let mut budget = lines.iter().map(|l| l.pieces.len() * 2 + 2).sum::(); - let mut todo: std::collections::VecDeque = lines.into(); + // Glyphs laid out in all, at most: past it, the glyphs left unchecked stay outlines. + let mut budget = lines.iter().map(|l| l.pieces.len()).sum::().saturating_mul(8).saturating_add(256); let mut out = vec![]; - while let Some(l) = todo.pop_front() { - if budget == 0 { - // Unchecked glyphs stay outlines. - unmatched.extend(l.pieces); - continue; - } - budget -= 1; + for l in lines { let n = l.pieces.len(); - match l.first_mismatch(&l.text_object(system_layout)) { - None => out.push(l), - // The first glyph on its own may still be drawn as it was (a contextual form changed it). - Some(0) if n > 1 => { - for part in [l.part(1, n), l.part(0, 1)].into_iter().flatten() { - todo.push_front(part); - } - } - Some(0) => unmatched.extend(l.pieces.first().copied()), - Some(k) => { - for part in [l.part(k, n), l.part(0, k)].into_iter().flatten() { - todo.push_front(part); + // Each new line starts at `s`. Its type is laid out over a window from `s` that doubles + // while the type draws the window's glyphs as the outlines do, so finding where it stops + // costs about twice the glyphs before that point, not the whole rest of the line each time. + let mut s = 0; + while s < n { + let mut w = 8usize; + loop { + let e = n.min(s.saturating_add(w)); + let Some(part) = l.part(s, e) else { + s = n; + break; + }; + let Some(left) = budget.checked_sub(e - s) else { + // Unchecked glyphs stay outlines. + unmatched.extend(l.pieces.get(s..).unwrap_or_default().iter().copied()); + s = n; + break; + }; + budget = left; + match part.first_mismatch(&part.text_object(system_layout)) { + // The rest of the line is drawn as it was: one object. + None if e == n => { + out.push(part); + s = n; + break; + } + None => w = w.saturating_mul(2), + // The first glyph on its own may still be drawn as it was (a contextual form + // changed it in the line); else it stays an outline. + Some(0) => { + let alone = if e - s > 1 { l.part(s, s + 1) } else { Some(part) }; + match alone { + Some(a) if budget > 0 && a.first_mismatch(&a.text_object(system_layout)).is_none() => { + budget -= 1; + out.push(a); + } + _ => unmatched.extend(l.pieces.get(s).copied()), + } + s += 1; + break; + } + // The glyphs before the mismatch are drawn as they were: one object; the next + // line starts at the mismatch. + Some(k) => { + out.extend(l.part(s, s + k)); + s += k; + break; + } } } } diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 98736c5a4f..d691ab34fa 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -518,3 +518,22 @@ fn timing_with_hundreds_of_cjk_outlines() { s.execute("edit.undo", &json!({})).unwrap(); } } + +#[test] +fn a_long_tracked_line_is_checked_in_time() { + // Tracking splits the line at every glyph: the layout check must not lay out the rest of the + // line again after each split. + let text = "abe".repeat(150); + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 10, "y": 100, "text": text, "size": 4})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": text.len(), "tracking": 50})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let t0 = std::time::Instant::now(); + let r = s.execute("type.retype", &json!({})).unwrap(); + let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); + assert_eq!(texts.concat(), text); + assert_eq!(r["unmatched"], json!([])); + eprintln!("450 tracked glyphs: {:?}, {} objects", t0.elapsed(), texts.len()); +} diff --git a/crates/text/src/retype.rs b/crates/text/src/retype.rs index b778ce47dd..4c636aa1cd 100644 --- a/crates/text/src/retype.rs +++ b/crates/text/src/retype.rs @@ -590,7 +590,7 @@ pub fn shape_key(path: &BezPath) -> Option { /// `path` read for matching: one reading per choice of starting corners (the corner of each contour /// farthest from the centre of all the shape's corners; every tied corner when `all_ties`, else the -/// first), at most [`MAX_VARIANTS`]. Empty for a shape with nothing to match. +/// first), at most [`MAX_VARIANTS`] tried. Empty for a shape with nothing to match. fn signatures(path: &BezPath, all_ties: bool) -> Vec { let bounds = path.bounding_box(); let size = bounds.width().hypot(bounds.height()); @@ -629,10 +629,14 @@ fn signatures(path: &BezPath, all_ties: bool) -> Vec { .collect(); let mut out = vec![]; let mut pick = vec![0usize; cs.len()]; + // Readings tried, kept or not: a shape whose readings all fail (its sums run past what f64 + // holds) tries no more than this either. + let mut tried = 0usize; loop { - if out.len() >= MAX_VARIANTS { + if tried >= MAX_VARIANTS { break; } + tried += 1; if let Some(sig) = sample(&cs, &starts, &pick, accuracy) { out.push(sig); } @@ -870,6 +874,24 @@ mod tests { assert!(outlines_agree(&out, &out, tol)); } + #[test] + fn readings_that_all_fail_stop_at_the_cap() { + // 48 concentric squares (four tied corners each: 4^48 choices) so large that every reading + // overflows: the tries stop at the cap instead of running through the choices. + let mut p = BezPath::new(); + for i in 1..=48 { + let r = 1e153 * f64::from(i); + p.move_to((-r, -r)); + p.line_to((r, -r)); + p.line_to((r, r)); + p.line_to((-r, r)); + p.close_path(); + } + let t0 = std::time::Instant::now(); + assert!(signatures(&p, true).is_empty()); + assert!(t0.elapsed() < std::time::Duration::from_secs(5), "{:?}", t0.elapsed()); + } + #[test] fn the_same_corners_joined_another_way_are_another_outline() { let poly = |pts: &[(f64, f64)]| { From 3a69187896169f267579c2d0dee60c14cb30b3d4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:15:41 -0800 Subject: [PATCH 221/247] Tests: Cmd+A then Cmd+Shift+= keeps the whole text and makes it superscript The same-frame check now compares the joined run text with the full text as well as checking that every run is superscript, so an empty or shortened result fails. --- crates/ui-egui/src/shortcuts/tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index c41bd10c44..5dbdc46a14 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -1161,7 +1161,11 @@ fn cmd_shift_equals_and_cmd_alt_shift_equals_toggle_superscript_and_subscript() let before = zoom(&mut app); frame(&mut app, [press(Key::A, Modifiers::NONE), press(Key::Equals, shift)].concat()); assert_eq!(zoom(&mut app), before, "no zoom once Select All selected the type"); - assert!(positions(&mut app).iter().all(|(_, p)| *p == json!("superscript")), "{:?}", positions(&mut app)); + // The earlier mixed selection left the text in two runs; check that both lines are still + // there and every run is superscript. + let runs = positions(&mut app); + assert_eq!(runs.iter().filter_map(|(t, _)| t.as_str()).collect::(), "One\nTwo", "{runs:?}"); + assert!(runs.iter().all(|(_, p)| *p == json!("superscript")), "{runs:?}"); } /// Tab shows and hides the panels, and in the Type tool it types a tab, without moving the From b0e4302b64591b6a141d1aa90f8a6382e1a5c791 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:27:31 -0800 Subject: [PATCH 222/247] MCP: transform's schema accepts the null arguments it already takes The transform tool treats a null reflect, copy or origin, and a null numeric step, as given, but its inputSchema allowed only the non-null types, so a client that validates against the schema could not send them. Each of those properties now also allows null. The transform row in docs/mcp.md says a step that is neither a number nor null is an error, and that a null dx or dy counts as 0 and still runs the move. --- crates/mcp/src/tests.rs | 8 ++++++++ crates/mcp/src/tools/definitions.rs | 25 +++++++++++++++---------- docs/mcp.md | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/crates/mcp/src/tests.rs b/crates/mcp/src/tests.rs index 2c16587227..58c9c42e45 100644 --- a/crates/mcp/src/tests.rs +++ b/crates/mcp/src/tests.rs @@ -1692,6 +1692,14 @@ fn transform_rejects_a_mistyped_reflect_copy_or_origin_before_editing() { assert_eq!(applied["isError"], false, "{applied}"); let applied: Value = serde_json::from_str(&text_of(&applied)).unwrap(); assert_eq!(applied["applied"], json!(["move"])); + let applied = call(&mut s, 21, "transform", json!({"ids": [second], "rotate": 90, "origin": null})); + assert_eq!(applied["isError"], false, "{applied}"); + // The schema allows null for every argument but `ids`. + let tools = tool_definitions(); + let props = &tools.iter().find(|t| t["name"] == "transform").unwrap()["inputSchema"]["properties"]; + for key in ["dx", "dy", "rotate", "scale", "scaleX", "scaleY", "shear", "reflect", "copy", "origin"] { + assert!(props[key]["anyOf"].as_array().is_some_and(|a| a.contains(&json!({"type": "null"}))), "{key}: {}", props[key]); + } } #[test] diff --git a/crates/mcp/src/tools/definitions.rs b/crates/mcp/src/tools/definitions.rs index 642f65fbfe..ce9cac1e02 100644 --- a/crates/mcp/src/tools/definitions.rs +++ b/crates/mcp/src/tools/definitions.rs @@ -8,6 +8,11 @@ fn num(desc: &str) -> Value { json!({"type": "number", "description": desc}) } +/// A number or null. +fn num_or_null(desc: &str) -> Value { + json!({"description": desc, "anyOf": [{"type": "number"}, {"type": "null"}]}) +} + fn string(desc: &str) -> Value { json!({"type": "string", "description": desc}) } @@ -470,16 +475,16 @@ pub fn tool_definitions() -> Vec { obj( json!({ "ids": {"type": "array", "items": {"type": "integer"}}, - "dx": num("Move right"), - "dy": num("Move down"), - "rotate": num("Rotation in degrees counter-clockwise"), - "scale": num("Uniform scale in %"), - "scaleX": num("Horizontal scale in %"), - "scaleY": num("Vertical scale in %"), - "reflect": {"type": "string", "enum": ["vertical", "horizontal"]}, - "shear": num("Shear angle in degrees (horizontal axis: positive moves the top to the right, turning the vertical edges clockwise)"), - "origin": {"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2}, - "copy": {"type": "boolean"}, + "dx": num_or_null("Move right (null: 0)"), + "dy": num_or_null("Move down (null: 0)"), + "rotate": num_or_null("Rotation in degrees counter-clockwise"), + "scale": num_or_null("Uniform scale in %"), + "scaleX": num_or_null("Horizontal scale in %"), + "scaleY": num_or_null("Vertical scale in %"), + "reflect": {"anyOf": [{"type": "string", "enum": ["vertical", "horizontal"]}, {"type": "null"}]}, + "shear": num_or_null("Shear angle in degrees (horizontal axis: positive moves the top to the right, turning the vertical edges clockwise)"), + "origin": {"anyOf": [{"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2}, {"type": "null"}]}, + "copy": {"anyOf": [{"type": "boolean"}, {"type": "null"}]}, }), &[], ), diff --git a/docs/mcp.md b/docs/mcp.md index 8fbc770ca7..0e9a6d202d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -724,7 +724,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions | `add_text` | `{text, x?, y?, width?, height?, fit?, fitMinPercent?, path?, mode?, pathEffect?, size?, font?, color?, justify?, vertical?}` | Point type at (x, y) (`justify`: `left`, `center` or `right` starts, centres or ends each line on x); area type with `width`/`height` (`fit`: `none`, `autoHeight`, `shrinkText`, as `text.areaOptions`); or `path` + `mode` (`area`/`onPath`) to flow text in or along a path, with `pathEffect` for type on a path (`rainbow`, `skew`, `3dRibbon`, `stairStep`, `gravity`; SVG export writes type on a path with any effect other than `rainbow` as outlines, with a warning). An invalid effect is rejected before editing. `justify` (also `auto`, `justifyAll`) aligns the paragraphs of every kind, as `text.setStyle` does later. `vertical: true` uses the existing vertical writing mode for every kind (default `false`, horizontal). Returns `{id}`, with `overflow: true` when the text doesn't fit its frame or path. | | `apply_effect` | `{effect?, params?, ids?}` | Appends a live effect. Without `effect`, returns the effect catalogue with parameters and defaults. | | `pathfinder` | `{operation, ids?}` | `unite`, `minusFront`, `intersect`, `exclude`, `divide`, `trim`, `merge`, `crop`, `outline`, `minusBack`. For a live version, apply the `pathfinder.*` effect to a group (`effect.apply` groups several loose selected objects first). In remote desktop mode, `run_command` and `invoke_menu` can both call `pathfinder.repeat` with `{}`. Successful panel operations, direct `object.pathfinder.*` commands, and `command.batch` steps (including Actions panel playback) set its history. Repeat applies it to the current selection using current Pathfinder Options. Trap, compound-shape edits, live effects and `action.batch` do not set history. With no history it returns "no Pathfinder operation applied yet". | -| `transform` | `{ids?, dx?, dy?, rotate?, scale?, scaleX?, scaleY?, reflect?, shear?, origin?, copy?}` | Runs move, rotate, scale, reflect, shear in that order. `rotate` is in degrees counter-clockwise; a positive `shear` moves the top to the right. With `copy`, the first step duplicates. A `scale`, `reflect` or `shear` that its command would refuse returns that error before any step runs; nothing changes and no undo step is recorded. The same holds for a step that is not a number, a `reflect` that is not a string, a `copy` that is not true or false, and an `origin` that is not two numbers; a null `reflect`, `copy` or `origin` is left out. | +| `transform` | `{ids?, dx?, dy?, rotate?, scale?, scaleX?, scaleY?, reflect?, shear?, origin?, copy?}` | Runs move, rotate, scale, reflect, shear in that order. `rotate` is in degrees counter-clockwise; a positive `shear` moves the top to the right. With `copy`, the first step duplicates. A `scale`, `reflect` or `shear` that its command would refuse returns that error before any step runs; nothing changes and no undo step is recorded. The same holds for a step that is neither a number nor null, a `reflect` that is not a string, a `copy` that is not true or false, and an `origin` that is not two numbers. A null `rotate`, `scale`, `scaleX`, `scaleY`, `shear`, `reflect`, `copy` or `origin` is left out; a null `dx` or `dy` counts as 0, so it still runs the move. | | `create_graph` | `{type?, x, y, width, height, csv? \| series?, categories?, rows?}` | The nine Illustrator graph types: column, stacked column, bar, stacked bar, line, area, scatter, pie and radar. An empty CSV cell or a `null` in `rows` is a blank value; a number in straight quotes is a label. Edit later with `graph.setData` / `graph.setType` via `run_command`. `graph.column {design, columnType: vertical\|uniform\|repeating\|sliding, each, fractions: chop\|scale}` draws the columns or bars of the series picked with Group Selection (or `seriesIndexes`, or all of them) with a graph design saved by `graph.design`; with no `design` it returns the series' current design and options. Type in the design that holds a `%` followed by two digits shows each column's value, with at least the first digit's places before the decimal point and the second digit's places after it. | | `text_wrap` | `{ids?, offset?, invert?, release?}` | Area type below the objects (same layer) flows around them. `offset` is in points, from -1000 to 1000 (default 6). An offset outside that range or not a number, or an `invert` or `release` that is not true or false, is an error and changes nothing; `object.textWrap.make` and `object.textWrap.options` refuse the same values. | | `undo` / `redo` | `{}` | Many calls that change nothing record no undo step, for example `object.align` with nothing to move, `object.move` by 0 without `copy` and `object.showAll` with nothing hidden. `undo` (`edit.undo`) after such a call undoes the step before it. Settings that change without an undo step stay as they are when `undo` or `redo` brings back a step that did not change them: the perspective grid's view options and active plane, the grid preferences (`gridlineEvery`, `gridSubdivisions`), the export settings (`assets.settings.set`), and the current brush and symbol. A step that changed one of them, such as a perspective grid preset that shows the grid, takes that change back. The point Automatic Plane Positioning holds comes back with the step, and is let go when the active plane kept is another one. `inspect_document` lists the undo steps as `history`. `run_command` with `edit.clearHistory` removes every undo and redo step of the active document and returns `{cleared}`, the number of steps removed; the document stays as it is, and the command records no undo step. `run_command` with `edit.newDocumentFromState` and `{index?, created?}` makes a new document holding the art as it was at that state and makes it the active document, and returns `{index, title}`. `index` is a row of the History panel, with 0 the oldest state kept, and an omitted or null `index` uses the current state. An `index` that names no state fails with `no history state N`, one that is not a whole number with `` `index` must be a whole number ``, and either changes nothing. `created` is File Info's created date in Unix seconds or null, and defaults to now. The new document takes the next `Untitled-N` name, is marked unsaved, has nothing selected and has no steps to undo or redo. It is out of symbol, opacity-mask and pattern editing, and the art drawn in a pattern's tile is stored in the pattern, as `object.pattern.done` stores it. The source document and its steps stay as they are, except that typing or a drag in progress is first kept as a step. When a command keeps a drag whose preview Real-time Drawing off had not applied yet (`edit.undo`, `edit.redo`, `edit.clearHistory`, `edit.newDocumentFromState` and the other commands that end a drag first), and applying that preview gives a warning, the command's result carries it as `previewWarning`, and as `warning` too when the command gives no warning of its own; the app's status bar shows `warning`. While the Type tool edits type, `undo` and `redo` put its caret, with no characters selected, at the end of the text the step changed: after the text it puts back or retypes, or where the text it takes out was. A step that changes no characters, such as a formatting change, leaves the caret and the selection where they are. | From 2a5fc378b18ace8db0c4b0a2606e1a5fc528fbe1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:29:22 -0800 Subject: [PATCH 223/247] Preferences: number rows move out of category_fields category_fields reached clippy's cognitive complexity limit (31/30) once main took #8086. The Num arms move into num_row and num_field_row, next to bool_row and choice_row; the rows draw and save as before. --- crates/ui-egui/src/prefs_dialog.rs | 61 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/crates/ui-egui/src/prefs_dialog.rs b/crates/ui-egui/src/prefs_dialog.rs index 8281690dd5..bc0a52604a 100644 --- a/crates/ui-egui/src/prefs_dialog.rs +++ b/crates/ui-egui/src/prefs_dialog.rs @@ -670,34 +670,7 @@ fn category_fields(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog, // says the change applies at the next start. PrefKind::Bool if sp.key == "lowLatencyDrawing" => desktop_startup_bool_row(ui, d, sp.key, sp.label, &t), PrefKind::Bool => bool_row(ui, d, sp.key, sp.label), - // General › Hold Shortcut Delay acts only while Hold Shortcuts is on: dimmed while it - // is off, as in Edit › Keyboard Shortcuts, which shows it only then. - PrefKind::Num { min, max, unit } if sp.key == "keyHoldDelay" => { - ui.add_enabled_ui(d.bool("holdShortcuts"), |ui| { - labeled(ui, sp.label, |ui, _| { - let x = v.as_f64().unwrap_or(min); - if let Some(x) = widgets::range_field(ui, sp.key, x, min..=max, &format!(" {unit}"), 3, 110.0) { - d.fields.insert(sp.key.into(), json!(x)); - } - }); - }); - } - PrefKind::Num { min, max, unit } => { - labeled(ui, sp.label, |ui, label_id| { - let mut x = v.as_f64().unwrap_or(min); - let new = if sp.key == "uiScaling" { - // Without internal text, both slider controls inherit the row's name across focus changes. - let response = widgets::slider(ui, egui::Slider::new(&mut x, min..=max).step_by(0.05)).labelled_by(label_id); - ui.add(egui::Label::new(tl!("Smaller ↔ Larger")).wrap_mode(egui::TextWrapMode::Extend)); - response.changed().then_some(x) - } else { - widgets::range_field(ui, sp.key, x, min..=max, &format!(" {unit}"), 3, 110.0) - }; - if let Some(x) = new { - d.fields.insert(sp.key.into(), json!(x)); - } - }); - } + PrefKind::Num { min, max, unit } => num_row(ui, d, sp.key, sp.label, min..=max, unit, &v), PrefKind::Length { min, max, measure } => { // In the dialog's own Units choice, so a change there shows right away. let unit = vectorcraft_doc::Unit::named(&d.str(measure.pref_key())).unwrap_or_default(); @@ -896,6 +869,38 @@ fn choice_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, opts: & }); } +/// The row of the number preference `key` within `range`: a slider for Interface Scaling, a field +/// shown with `unit` otherwise. +fn num_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, range: std::ops::RangeInclusive, unit: &str, v: &Value) { + if key == "uiScaling" { + labeled(ui, label, |ui, label_id| { + let mut x = v.as_f64().unwrap_or(*range.start()); + // Without internal text, both slider controls inherit the row's name across focus changes. + let response = widgets::slider(ui, egui::Slider::new(&mut x, range).step_by(0.05)).labelled_by(label_id); + ui.add(egui::Label::new(tl!("Smaller ↔ Larger")).wrap_mode(egui::TextWrapMode::Extend)); + if response.changed() { + d.fields.insert(key.into(), json!(x)); + } + }); + } else if key == "keyHoldDelay" { + // General › Hold Shortcut Delay acts only while Hold Shortcuts is on: dimmed while it + // is off, as in Edit › Keyboard Shortcuts, which shows it only then. + ui.add_enabled_ui(d.bool("holdShortcuts"), |ui| num_field_row(ui, d, key, label, range, unit, v)); + } else { + num_field_row(ui, d, key, label, range, unit, v); + } +} + +/// A number field for the preference `key`, kept within `range` and shown with `unit`. +fn num_field_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, range: std::ops::RangeInclusive, unit: &str, v: &Value) { + labeled(ui, label, |ui, _| { + let x = v.as_f64().unwrap_or(*range.start()); + if let Some(x) = widgets::range_field(ui, key, x, range, &format!(" {unit}"), 3, 110.0) { + d.fields.insert(key.into(), json!(x)); + } + }); +} + fn bool_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str) { // The app's outlined checkbox (it translates `label`): egui's own has no border at rest. let on = d.bool(key); From db525996f0bee66e041c53df40971d26bfbb6077 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Wed, 18 Nov 2026 20:05:47 +0530 Subject: [PATCH 224/247] M7/G4: retype checks the part before a mismatch on its own (#4934) A font can place a glyph by the glyph after it, so the glyphs before a mismatch are laid out again as a line of their own before they replace their outlines. The glyph budget covers that second check. --- crates/engine/src/cmd/retype.rs | 100 +++++++++++++++++--------------- 1 file changed, 52 insertions(+), 48 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index b3a19862da..23774aaaa7 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -302,58 +302,47 @@ impl Line { /// The glyphs laid out are bounded by a multiple of the number of glyphs. fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) -> Vec { // Glyphs laid out in all, at most: past it, the glyphs left unchecked stay outlines. - let mut budget = lines.iter().map(|l| l.pieces.len()).sum::().saturating_mul(8).saturating_add(256); + let mut budget = lines.iter().map(|l| l.pieces.len()).sum::().saturating_mul(16).saturating_add(256); + let mut todo: std::collections::VecDeque = lines.into(); let mut out = vec![]; - for l in lines { + while let Some(l) = todo.pop_front() { let n = l.pieces.len(); - // Each new line starts at `s`. Its type is laid out over a window from `s` that doubles - // while the type draws the window's glyphs as the outlines do, so finding where it stops - // costs about twice the glyphs before that point, not the whole rest of the line each time. - let mut s = 0; - while s < n { - let mut w = 8usize; - loop { - let e = n.min(s.saturating_add(w)); - let Some(part) = l.part(s, e) else { - s = n; + // The line's type is laid out over a window from its start that doubles while the type + // draws the window's glyphs as the outlines do, so finding where it stops costs about + // twice the glyphs before that point, not the whole rest of the line each time. + let mut w = 8usize; + loop { + let e = n.min(w); + let Some(part) = l.part(0, e) else { break }; + let Some(left) = budget.checked_sub(e) else { + // Unchecked glyphs stay outlines. + unmatched.extend(l.pieces.iter().copied()); + break; + }; + budget = left; + match part.first_mismatch(&part.text_object(system_layout)) { + // The whole line is drawn as it was: one object. + None if e == n => { + out.push(part); break; - }; - let Some(left) = budget.checked_sub(e - s) else { - // Unchecked glyphs stay outlines. - unmatched.extend(l.pieces.get(s..).unwrap_or_default().iter().copied()); - s = n; + } + None => w = w.saturating_mul(2), + // The first glyph on its own may still be drawn as it was (a contextual form + // changed it in the line); else it stays an outline. Checked again either way. + Some(0) if n > 1 => { + todo.extend_front_parts(&l, [(0, 1), (1, n)]); + break; + } + Some(0) => { + unmatched.extend(l.pieces.first().copied()); + break; + } + // The glyphs before the mismatch, then the rest, each checked as a line of its + // own: the type before the mismatch may draw otherwise without what follows it (a + // font can place a glyph by the glyph after it). + Some(k) => { + todo.extend_front_parts(&l, [(0, k), (k, n)]); break; - }; - budget = left; - match part.first_mismatch(&part.text_object(system_layout)) { - // The rest of the line is drawn as it was: one object. - None if e == n => { - out.push(part); - s = n; - break; - } - None => w = w.saturating_mul(2), - // The first glyph on its own may still be drawn as it was (a contextual form - // changed it in the line); else it stays an outline. - Some(0) => { - let alone = if e - s > 1 { l.part(s, s + 1) } else { Some(part) }; - match alone { - Some(a) if budget > 0 && a.first_mismatch(&a.text_object(system_layout)).is_none() => { - budget -= 1; - out.push(a); - } - _ => unmatched.extend(l.pieces.get(s).copied()), - } - s += 1; - break; - } - // The glyphs before the mismatch are drawn as they were: one object; the next - // line starts at the mismatch. - Some(k) => { - out.extend(l.part(s, s + k)); - s += k; - break; - } } } } @@ -361,6 +350,21 @@ fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) out } +/// Puts parts of a line at the front of the work list, in order. +trait FrontParts { + fn extend_front_parts(&mut self, l: &Line, ranges: [(usize, usize); N]); +} + +impl FrontParts for std::collections::VecDeque { + fn extend_front_parts(&mut self, l: &Line, ranges: [(usize, usize); N]) { + for (a, b) in ranges.into_iter().rev() { + if let Some(p) = l.part(a, b) { + self.push_front(p); + } + } + } +} + fn space_advance(face: &vectorcraft_text::FontFace) -> f64 { face.mapped_chars().iter().find(|(c, _)| *c == ' ').map(|(_, g)| face.advance(*g)).unwrap_or(0.0) } From 38bceaa22a8a23308dd95d8f17c03dd9a62f57b4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:38:30 -0800 Subject: [PATCH 225/247] Command Palette: the catalog check reports a word two search rows add to different groups A catalog's search rows are now checked together: a word that two rows add to different groups fails the i18n test, naming the word and both groups. A word repeated for one group, and a catalog with no search rows, still pass. --- crates/ui-egui/src/i18n/tests.rs | 9 ++++---- crates/ui-egui/src/palette/words.rs | 33 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 1ef955c627..9e3cf16398 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -805,16 +805,15 @@ fn anti_aliasing_method_labels_are_in_complete_catalogs() { } /// Each row in the `search` context, which adds a language's words to a group of words with the same -/// meaning for the command palette, names a group and adds single words of no other group. No -/// catalog has to have these rows. +/// meaning for the command palette, names a group and adds single words of no other group, and no +/// two rows of a catalog add one word to different groups. No catalog has to have these rows. #[test] fn search_rows_name_a_group_and_add_single_words() { let mut bad = Vec::new(); for l in LANGUAGES.iter().filter(|l| !l.source.is_empty()) { let (entries, _) = parse_entries(l.source); - for (_, src, tr) in entries.iter().filter(|(ctx, _, _)| ctx == crate::palette::words::CONTEXT) { - bad.extend(crate::palette::words::row_problems(src, tr).into_iter().map(|p| format!("{}: {p}", l.code))); - } + let rows = entries.iter().filter(|(ctx, _, _)| ctx == crate::palette::words::CONTEXT).map(|(_, src, tr)| (src.as_str(), tr.as_str())); + bad.extend(crate::palette::words::catalog_problems(rows).into_iter().map(|p| format!("{}: {p}", l.code))); } assert!(bad.is_empty(), "{bad:#?}"); } diff --git a/crates/ui-egui/src/palette/words.rs b/crates/ui-egui/src/palette/words.rs index 44176dbd24..86c03bfb8c 100644 --- a/crates/ui-egui/src/palette/words.rs +++ b/crates/ui-egui/src/palette/words.rs @@ -91,6 +91,27 @@ pub(crate) fn row_problems(source: &str, text: &str) -> Vec { problems } +/// What is wrong with one catalog's `search` rows, each a group's `source` and its translation +/// `text`: each row's [`row_problems`], and a word that rows add to two different groups. +#[cfg(test)] +pub(crate) fn catalog_problems<'a>(rows: impl IntoIterator) -> Vec { + let mut problems = vec![]; + let mut groups: std::collections::HashMap = std::collections::HashMap::new(); + for (source, text) in rows { + problems.extend(row_problems(source, text)); + for (w, _) in row_words(text).filter(|(_, single)| *single) { + match groups.get(w.as_str()) { + Some(&first) if first != source => problems.push(format!("{w:?} is a word of {first:?} and {source:?}")), + Some(_) => {} + None => { + groups.insert(w, source); + } + } + } + } + problems +} + #[cfg(test)] mod tests { use super::*; @@ -122,4 +143,16 @@ mod tests { assert_eq!(row_problems("remove, delete, erase, clear", "ganz entfernen").len(), 1, "two words"); assert_eq!(row_problems("remove, delete, erase, clear", "Text").len(), 1, "a word of another group once lowercased"); } + + /// A catalog's rows fail when they add one word to two groups, and pass when a word is repeated + /// for one group or the catalog has no rows. + #[test] + fn a_word_in_two_groups_of_a_catalog_is_checked() { + let (remove, artboard) = ("remove, delete, erase, clear", "artboard, canvas"); + let problems = catalog_problems([(remove, "retrait"), (artboard, "plan, Retrait")]); + assert_eq!(problems.len(), 1, "{problems:?}"); + assert!(problems.iter().all(|p| p.contains("retrait") && p.contains(remove) && p.contains(artboard)), "{problems:?}"); + assert!(catalog_problems([(remove, "retrait, retrait"), (remove, "Retrait"), (artboard, "plan")]).is_empty()); + assert!(catalog_problems([]).is_empty()); + } } From 269c6fced877a9eb7b6bd8f0a2dbdc064e4b3441 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:48:12 -0800 Subject: [PATCH 226/247] Save PDF: an unlinked edit keeps the bleed link off, and every bleed write sets it An edit to one side while the link is off now keeps it off when the four values become equal, so the next edit changes one side only. Writing `bleed` through ui.dialog.set lets the link follow the values each time, also when the same values are written again. --- crates/ui-egui/src/dialogs.rs | 2 +- crates/ui-egui/src/dialogs/save_pdf.rs | 16 ++++++++----- crates/ui-egui/src/dialogs/save_pdf/tests.rs | 24 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 38626a8842..6224b271da 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -692,7 +692,7 @@ pub(crate) fn field_set(app: &mut VectorcraftApp, field: &str, old: Option<&Valu return composite_fonts::field_set(d, field); } if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == save_pdf::KIND || d.kind == save_pdf::PRESET_KIND) { - return save_pdf::field_set(d, field, old); + return save_pdf::field_set(d, field); } if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == eps_options::KIND) { eps_options::field_set(d, field); diff --git a/crates/ui-egui/src/dialogs/save_pdf.rs b/crates/ui-egui/src/dialogs/save_pdf.rs index 32dab2a445..85ff601db0 100644 --- a/crates/ui-egui/src/dialogs/save_pdf.rs +++ b/crates/ui-egui/src/dialogs/save_pdf.rs @@ -754,9 +754,13 @@ fn link_bleed(d: &mut Dialog, on: bool) { } } -/// Side `side` of the custom bleed was edited to `value`: linked, every side takes it. +/// Side `side` of the custom bleed was edited to `value`: linked, every side takes it. The link +/// keeps the state it had before the edit, so an unlinked edit that makes the sides equal leaves +/// it off. fn edit_bleed(d: &mut Dialog, side: usize, value: f64) { - if bleed_linked(d) { + let linked = bleed_linked(d); + d.fields.insert(BLEED_LINKED.into(), json!(linked)); + if linked { for p in BLEED_SIDES { set(d, p, json!(value)); } @@ -766,9 +770,9 @@ fn edit_bleed(d: &mut Dialog, side: usize, value: f64) { } /// `ui.dialog.set` set `field` of Save PDF or the PDF preset editor: `__bleedLinked` links or -/// unlinks the bleed as its button does, and must be true or false; a new `bleed` drops the link's -/// state, so the link follows the values set. -pub(super) fn field_set(d: &mut Dialog, field: &str, old: Option<&Value>) -> Result<(), String> { +/// unlinks the bleed as its button does, and must be true or false; every write of `bleed`, the +/// same values included, drops the link's state, so the link follows the values set. +pub(super) fn field_set(d: &mut Dialog, field: &str) -> Result<(), String> { match field { BLEED_LINKED => match d.fields.get(BLEED_LINKED).cloned() { Some(Value::Bool(on)) => { @@ -777,7 +781,7 @@ pub(super) fn field_set(d: &mut Dialog, field: &str, old: Option<&Value>) -> Res } v => Err(format!("{BLEED_LINKED} must be true or false, not {}", v.unwrap_or(Value::Null))), }, - "bleed" if d.fields.get("bleed") != old => { + "bleed" => { d.fields.remove(BLEED_LINKED); Ok(()) } diff --git a/crates/ui-egui/src/dialogs/save_pdf/tests.rs b/crates/ui-egui/src/dialogs/save_pdf/tests.rs index 10cfa57ce0..1f04c8c912 100644 --- a/crates/ui-egui/src/dialogs/save_pdf/tests.rs +++ b/crates/ui-egui/src/dialogs/save_pdf/tests.rs @@ -633,6 +633,30 @@ fn ui_dialog_set_links_the_bleed() { assert!(!d.fields.contains_key(BLEED_LINKED) && bleed_linked(d), "equal values set are linked"); set(&mut app, "bleed", json!({"top": 1, "bottom": 2, "left": 1, "right": 1})).unwrap(); assert!(!bleed_linked(app.ui.dialog.as_ref().unwrap()), "unequal values set are unlinked"); + + // Writing the same `bleed` again also lets the link follow its values; a `__bleedLinked` set + // after it in the same request still decides. + set(&mut app, "bleed", json!({"top": 1, "bottom": 1, "left": 1, "right": 1})).unwrap(); + set(&mut app, BLEED_LINKED, json!(false)).unwrap(); + set(&mut app, "bleed", json!({"top": 1, "bottom": 1, "left": 1, "right": 1})).unwrap(); + assert!(bleed_linked(app.ui.dialog.as_ref().unwrap()), "the same equal values set again are linked"); + set(&mut app, BLEED_LINKED, json!(false)).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert!(!bleed_linked(d) && bleed_of(d) == [1.0; 4], "a later __bleedLinked unlinks them"); +} + +/// An unlinked edit that makes the four sides equal leaves the link off, so the next edit +/// changes one side only. +#[test] +fn an_unlinked_edit_that_evens_the_sides_keeps_the_link_off() { + let (mut app, _, _) = app(); + app.run("ui.savePdfDialog", json!({"bleed": {"top": 3, "bottom": 5, "left": 3, "right": 3}})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + assert!(!bleed_linked(d)); + edit_bleed(d, 1, 3.0); + assert!(!bleed_linked(d), "the link stays off"); + edit_bleed(d, 2, 6.0); + assert_eq!(bleed_of(d), [3.0, 3.0, 6.0, 3.0], "the next edit changes one side"); } #[test] From dcc684f8ffa9039c7778dd7575bf1e51dc4a6076 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 07:04:53 -0800 Subject: [PATCH 227/247] Part of #5941: a dialog keeps its scroll under a window opened over it and its alert A window opened over a dialog (Import Shortcut Set over Keyboard Shortcuts) held only the modal window drawn last in the pass before it opened. When the dialog had an alert of its own drawn after it, the new window held the alert instead, and when the new window closed the dialog started again at its top. A second modal window that opened in the same pass, such as an alert of the new window, was also counted as opened over the dialog. - A window opened over others holds every modal window drawn in the pass before it opened. Only the first modal window drawn after `over_parent` is counted as opened over them. - `modal::drawn_this_pass` reads the pass from the record of the windows drawn in each pass, in place of a key of its own. - Save for Web measures Preview in Browser with `widgets::button_width`, as the button is drawn, and translates the label once. - The reopen test covers an alert drawn after the dialog before the other window opens and checks which windows each one holds. The Save for Web test compares Preview in Browser with the frame of the download speed list instead of its text. The test of buttons inside a dialog's body also covers a stop's message box. --- crates/ui-egui/src/dialogs/modal.rs | 97 +++++++++++++--------- crates/ui-egui/src/dialogs/save_for_web.rs | 6 +- crates/ui-egui/src/dialogs/tests_scroll.rs | 67 +++++++++++---- 3 files changed, 110 insertions(+), 60 deletions(-) diff --git a/crates/ui-egui/src/dialogs/modal.rs b/crates/ui-egui/src/dialogs/modal.rs index c5acd64e18..950f28d6e4 100644 --- a/crates/ui-egui/src/dialogs/modal.rs +++ b/crates/ui-egui/src/dialogs/modal.rs @@ -26,8 +26,7 @@ pub(crate) fn show_at(ctx: &egui::Context, title: &str, id: Id, initial: Vec2 // Not focusable (`Sense::click()` is): Tab goes through the dialog's controls, not the backdrop. ui.allocate_rect(ctx.content_rect(), egui::Sense::CLICK); }); - let pass = ctx.cumulative_pass_nr(); - ctx.data_mut(|d| d.insert_temp(drawn_pass_id(), pass)); + let opened = opened(ctx, id); let shown = egui::Window::new(title) .id(id) .order(egui::Order::Foreground) @@ -39,7 +38,7 @@ pub(crate) fn show_at(ctx: &egui::Context, title: &str, id: Id, initial: Vec2 .show(ctx, |ui| { // Just opened: what scrolls in the window starts at its top, wherever it was left when // the window last closed. - if opened(ctx, id) { + if opened { ctx.data_mut(|m| { m.insert_temp(id.with(TOP_ROWS_KEY), true); m.insert_temp(id.with(TOP_WHOLE_KEY), true); @@ -76,16 +75,18 @@ pub(crate) fn show_at(ctx: &egui::Context, title: &str, id: Id, initial: Vec2 shown.inner } -/// Mark the modal window drawn next in this pass as opened over the one drawn in the pass before, -/// which it hides until it closes and shows that one again (Import Shortcut Set over Keyboard -/// Shortcuts). The window under it keeps where it was scrolled to. +/// Mark the modal window drawn next in this pass as opened over the windows drawn in the pass +/// before (a dialog and any alert of its own), which it hides until it closes and shows them again +/// (Import Shortcut Set over Keyboard Shortcuts). The windows under it keep where they were +/// scrolled to. pub(crate) fn over_parent(ctx: &egui::Context) { let pass = ctx.cumulative_pass_nr(); ctx.data_mut(|m| m.insert_temp(Id::unique(OVER_KEY), pass)); } -/// Whether modal window `id`, drawn in this pass, opened in it: it was not drawn in the pass before, -/// and none of the windows drawn in the pass before was one opened over it ([`over_parent`]). +/// Record that modal window `id` is drawn in this pass, and return whether it opened in it: it was +/// not drawn in the pass before, and none of the windows drawn in the pass before was one opened +/// over it ([`over_parent`]). fn opened(ctx: &egui::Context, id: Id) -> bool { let pass = ctx.cumulative_pass_nr(); ctx.data_mut(|m| { @@ -101,27 +102,32 @@ fn opened(ctx: &egui::Context, id: Id) -> bool { let before: Vec = prev.iter().copied().filter(|&other| other != id).collect(); now.push(id); m.insert_temp(Id::unique(LAST_KEY), (pass, now, prev)); + // Only the window drawn next after `over_parent` is opened over the others. + let over = m.remove_temp::(Id::unique(OVER_KEY)) == Some(pass); let last = std::mem::replace(m.get_temp_mut_or(id.with(SHOWN_KEY), u64::MAX), pass); if last != u64::MAX && last.saturating_add(1) >= pass { return false; } // Shown again as the window opened over it closed. - if before.iter().any(|over| m.get_temp::(over.with(HOLDS_KEY)) == Some(id)) { + if before.iter().any(|under| m.get_temp::>(under.with(HOLDS_KEY)).is_some_and(|held| held.contains(&id))) { return false; } - // Opened over the window drawn last in the pass before, it holds that one; otherwise none. - match before.last().copied().filter(|_| m.get_temp::(Id::unique(OVER_KEY)) == Some(pass)) { - Some(under) => { - m.insert_temp(id.with(HOLDS_KEY), under); - } - None => { - m.remove::(id.with(HOLDS_KEY)); - } + // Opened over the windows drawn in the pass before, it holds them; otherwise none. + if over && !before.is_empty() { + m.insert_temp(id.with(HOLDS_KEY), before); + } else { + m.remove::>(id.with(HOLDS_KEY)); } true }) } +/// The windows modal window `id` was opened over and hides ([`over_parent`]). +#[cfg(test)] +fn holds(ctx: &egui::Context, id: Id) -> Vec { + ctx.data(|m| m.get_temp::>(id.with(HOLDS_KEY))).unwrap_or_default() +} + /// The room for the contents of a modal window with `margin` inside its frame. fn whole_room(ctx: &egui::Context, margin: i8) -> Vec2 { (ctx.content_rect().size() - Vec2::splat(2.0 * (super::EDGE_GAP + f32::from(margin)))).max(Vec2::ZERO) @@ -133,15 +139,11 @@ pub(crate) fn backdrop() -> egui::LayerId { egui::LayerId::new(egui::Order::Middle, Id::unique("modal-dim")) } -/// The key of the pass in which [`show_at`] last drew a modal window. -fn drawn_pass_id() -> Id { - Id::unique("modal-drawn-pass") -} - /// Whether [`show_at`] drew a modal window in this pass. Unlike the backdrop's visibility, which /// also counts the last pass, it is false in the pass after the window closes. pub(crate) fn drawn_this_pass(ctx: &egui::Context) -> bool { - ctx.data(|d| d.get_temp::(drawn_pass_id())) == Some(ctx.cumulative_pass_nr()) + let pass = ctx.cumulative_pass_nr(); + ctx.data_mut(|d| d.get_temp_mut_or::<(u64, Vec, Vec)>(Id::unique(LAST_KEY), (u64::MAX, vec![], vec![])).0 == pass) } /// The dialog's heading, which also moves the window ([`drag_band`]). @@ -197,9 +199,10 @@ const SHOWN_KEY: &str = "modal-shown"; const TOP_ROWS_KEY: &str = "modal-top-rows"; const TOP_WHOLE_KEY: &str = "modal-top-whole"; /// For all modal windows: the pass the last one was drawn in, the ids of those drawn in that pass -/// and of those drawn in the pass before it (`LAST_KEY`), and the pass -/// in which the window drawn next was marked as opened over another ([`over_parent`], `OVER_KEY`). -/// Under a modal window's id: the window it was opened over and hides (`HOLDS_KEY`). +/// and of those drawn in the pass before it (`LAST_KEY`, which [`drawn_this_pass`] also reads), and +/// the pass in which the window drawn next was marked as opened over others ([`over_parent`], +/// `OVER_KEY`, taken by that window). Under a modal window's id: the windows it was opened over and +/// hides (`HOLDS_KEY`). const LAST_KEY: &str = "modal-last"; const OVER_KEY: &str = "modal-over"; const HOLDS_KEY: &str = "modal-holds"; @@ -446,24 +449,36 @@ mod tests { #[test] fn a_window_hidden_under_one_opened_over_it_keeps_its_scroll() { // As Keyboard Shortcuts is while Import Shortcut Set is open over it: it is not drawn, but it - // did not close. A window that another replaced did close. Either may have shown an alert - // of its own, drawn after it in the same passes. + // did not close. A window that another replaced did close. Any of them may have shown an + // alert of its own, drawn after it in the same passes: A before B or C opens, or B or C. let others: [(&[&str], bool); 4] = [(&["over B"], true), (&["over B", "Alert"], true), (&["C"], false), (&["C", "Alert"], false)]; + let id = |name: &str| Id::unique(("modal-reopen-test", name)); let mut wrong = vec![]; for in_rows in [false, true] { - for (other, kept) in others { - let ctx = egui::Context::default(); - crate::theme::apply(&ctx, Default::default()); - let mut time = 0.0; - first_row_seen(&ctx, &["A"], in_rows, vec![], &mut time, 4); - if first_row_seen(&ctx, &["A"], in_rows, wheel_down(), &mut time, 60) { - wrong.push(format!("rows {in_rows}: the wheel does not scroll A")); - } - if !first_row_seen(&ctx, other, in_rows, vec![], &mut time, 4) { - wrong.push(format!("rows {in_rows}: {other:?} does not open at its top")); - } - if first_row_seen(&ctx, &["A"], in_rows, vec![], &mut time, 4) == kept { - wrong.push(format!("rows {in_rows}: after {other:?}, A {} where it was scrolled to", if kept { "is not" } else { "is still" })); + for lead in [&["A"][..], &["A", "Alert"][..]] { + for (other, kept) in others { + let ctx = egui::Context::default(); + crate::theme::apply(&ctx, Default::default()); + let mut time = 0.0; + first_row_seen(&ctx, &["A"], in_rows, vec![], &mut time, 4); + if first_row_seen(&ctx, &["A"], in_rows, wheel_down(), &mut time, 60) { + wrong.push(format!("rows {in_rows}: the wheel does not scroll A")); + } + first_row_seen(&ctx, lead, in_rows, vec![], &mut time, 4); + if !first_row_seen(&ctx, other, in_rows, vec![], &mut time, 4) { + wrong.push(format!("rows {in_rows}: after {lead:?}, {other:?} does not open at its top")); + } + // Only the window opened over A holds it; an alert drawn after that window holds none. + let held: Vec> = other.iter().map(|&name| holds(&ctx, id(name))).collect(); + let want: Vec> = + other.iter().map(|&name| if name.starts_with("over ") { lead.iter().map(|&l| id(l)).collect() } else { vec![] }).collect(); + if held != want { + wrong.push(format!("rows {in_rows}: after {lead:?}, {other:?} hold {held:?}, not {want:?}")); + } + if first_row_seen(&ctx, &["A"], in_rows, vec![], &mut time, 4) == kept { + let state = if kept { "is not" } else { "is still" }; + wrong.push(format!("rows {in_rows}: after {lead:?} and {other:?}, A {state} where it was scrolled to")); + } } } } diff --git a/crates/ui-egui/src/dialogs/save_for_web.rs b/crates/ui-egui/src/dialogs/save_for_web.rs index 6ff967f95a..8762c65daf 100644 --- a/crates/ui-egui/src/dialogs/save_for_web.rs +++ b/crates/ui-egui/src/dialogs/save_for_web.rs @@ -632,9 +632,9 @@ fn preview_area(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, set ui.add_space(6.0); let mut browser = false; // Preview in Browser goes on a row of its own when the panes are too narrow for it beside the - // two lists (its width as `widgets::secondary_button` draws it). - let label = tl!("Preview in Browser"); - let button_w = (ui.painter().layout_no_wrap(label.to_string(), crate::theme::semibold(12.5), t.text).size().x + 32.0).max(72.0); + // two lists. + let label = "Preview in Browser"; + let button_w = widgets::button_width(ui, label); let mut beside = false; let mut button = |ui: &mut egui::Ui| { ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| { diff --git a/crates/ui-egui/src/dialogs/tests_scroll.rs b/crates/ui-egui/src/dialogs/tests_scroll.rs index bb013802ed..3f24dcaba1 100644 --- a/crates/ui-egui/src/dialogs/tests_scroll.rs +++ b/crates/ui-egui/src/dialogs/tests_scroll.rs @@ -239,9 +239,10 @@ fn save_for_web_in_the_smallest_window_keeps_its_settings_and_buttons_in_view() if !matches!((controls, settings), (Some(c), Some(s)) if c < s) { wrong.push(format!("{size:?}: Preview in Browser ({controls:?}) is left of the settings ({settings:?})")); } - // Preview in Browser is right of the download speed list or on a row below it, not over it. + // Preview in Browser is right of the download speed list's frame or on a row below it, not + // over it. let button = text_rects(&shown, "Preview in Browser").first().copied(); - let speed = text_rects(&shown, "56.6 Kbps").first().copied(); + let speed = text_rects(&shown, "56.6 Kbps").first().and_then(|r| frame_around(&shown, *r)); if !matches!((button, speed), (Some(b), Some(s)) if b.left() > s.right() + 16.0 || b.top() > s.bottom() + 8.0) { wrong.push(format!("{size:?}: Preview in Browser ({button:?}) clears the download speed list ({speed:?})")); } @@ -249,6 +250,21 @@ fn save_for_web_in_the_smallest_window_keeps_its_settings_and_buttons_in_view() assert!(wrong.is_empty(), "{wrong:#?}"); } +/// The frame of the control that drew the text at `inner`: the widest rectangle shape around it +/// that is at most 240 by 40 pt. +fn frame_around(shown: &Shown, inner: Rect) -> Option { + fn walk(s: &Shape, inner: Rect, out: &mut Vec) { + match s { + Shape::Rect(r) if r.rect.contains_rect(inner) && r.rect.width() <= 240.0 && r.rect.height() <= 40.0 => out.push(r.rect), + Shape::Vec(v) => v.iter().for_each(|s| walk(s, inner, out)), + _ => {} + } + } + let mut out = vec![]; + shown.shapes.iter().for_each(|c| walk(&c.shape, inner, &mut out)); + out.into_iter().max_by(|a, b| a.width().total_cmp(&b.width())) +} + /// The rectangles of the texts `label` the dialog drew. fn text_rects(shown: &Shown, label: &str) -> Vec { fn walk(s: &Shape, label: &str, out: &mut Vec) { @@ -432,18 +448,37 @@ fn texts(shown: &Shown) -> Vec<(String, Rect, Rect)> { #[test] fn a_dialog_with_buttons_in_its_body_scrolls_them_with_the_body() { - // Check Spelling draws its buttons inside its body: in a window too short for it, the heading - // stays in view and the buttons scroll with the body. - let open: Open = |app| { - check_spelling::open(app).unwrap(); - }; - let tall = show_in(open, vec2(1280.0, 900.0), false); - let screen = Rect::from_min_size(Pos2::ZERO, vec2(1024.0, (0.6 * tall.window.height()).round())); - let shown = show_in(open, screen.size(), false); - let scrolled = show_in(open, screen.size(), true); - let seen = |shown: &Shown, label: &str| buttons(shown, screen, &[label]).iter().any(|(_, seen)| *seen); - assert!(screen.contains_rect(shown.window), "the dialog stays on the screen: {:?}", shown.window); - assert!(body_bar(&shown).is_some() && shown.whole == [false; 2], "only the body scrolls ({:?}, {:?})", shown.body, shown.whole); - assert!(seen(&shown, "Check Spelling") && seen(&scrolled, "Check Spelling"), "the heading stays in view"); - assert!(!seen(&shown, "Cancel") && seen(&scrolled, "Cancel"), "Cancel is out of view until the body is scrolled down"); + // Check Spelling and a stop's message box draw their buttons inside their body: in a window too + // short for the dialog, the heading stays in view and the buttons scroll with the body. + let opens: [(&str, Open, &str); 2] = [ + ( + "Check Spelling", + |app| { + check_spelling::open(app).unwrap(); + }, + "Cancel", + ), + ("Action 1", |app| action_stop::open_message(app, "Action 1", &"Check the art. ".repeat(40), true), "Stop"), + ]; + let mut wrong = vec![]; + for (heading, open, button) in opens { + let tall = show_in(open, vec2(1280.0, 900.0), false); + let screen = Rect::from_min_size(Pos2::ZERO, vec2(1024.0, (0.6 * tall.window.height()).round())); + let shown = show_in(open, screen.size(), false); + let scrolled = show_in(open, screen.size(), true); + let seen = |shown: &Shown, label: &str| buttons(shown, screen, &[label]).iter().any(|(_, seen)| *seen); + if !screen.contains_rect(shown.window) { + wrong.push(format!("{heading}: the dialog leaves the screen: {:?}", shown.window)); + } + if body_bar(&shown).is_none() || shown.whole != [false; 2] { + wrong.push(format!("{heading}: not only the body scrolls ({:?}, {:?})", shown.body, shown.whole)); + } + if !seen(&shown, heading) || !seen(&scrolled, heading) { + wrong.push(format!("{heading}: the heading leaves the view")); + } + if seen(&shown, button) || !seen(&scrolled, button) { + wrong.push(format!("{heading}: {button} is not out of view until the body is scrolled down")); + } + } + assert!(wrong.is_empty(), "{wrong:#?}"); } From 62c015d393fd98ce3f8c9cf7fc05a23b254ad42d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 07:06:54 -0800 Subject: [PATCH 228/247] Dimension: a preview bounds corner takes only the anchor it stands for A corner of a path's preview bounds took a Linear pick from every anchor of its own object within 8 pixels, so the top, left, right and bottom anchors of a small stroked circle, and the anchors of a rotated stroked shape when zoomed out, could no longer be picked. - The corner now takes the pick only from the holding path's anchor at the same corner of the object's geometric bounds. Any other anchor, of that object or of other art, that is nearer the pointer takes the point, and the nearest anchor wins a tie as the topmost. - The path that holds a point picked on a corner is kept from the pick, instead of being worked out again from the point's position, so a point that only happens to lie on a corner links to what is under it. A path deleted between the clicks holds nothing. - A corner of a compound path whose supplying member is hidden or locked is not snapped to. - The hovering test checks the "anchor" label at the corner, and a new test covers the anchor ring right on the end of a dimension's line. Docs: docs/dimensions.md and docs/target-app-parity.md say that only the four corners are snapped to, by VectorCraft's own rule, not the edges of the preview bounds, a group's own strokes or effects, or type; that a corner point starts no construction guides; and that the dimension measures W and H when it is drawn, since a later stroke weight change or a scale with Scale Strokes off moves the point with the anchors. --- crates/tools/src/dimension.rs | 200 +++++++++++++++++++++++++++++----- docs/dimensions.md | 31 +++--- docs/target-app-parity.md | 2 +- 3 files changed, 192 insertions(+), 41 deletions(-) diff --git a/crates/tools/src/dimension.rs b/crates/tools/src/dimension.rs index edb12b1db1..4a4aa33f77 100644 --- a/crates/tools/src/dimension.rs +++ b/crates/tools/src/dimension.rs @@ -71,6 +71,12 @@ pub struct DimensionTool { /// Whether the last Linear pick worked out landed on the end of a line of a dimension already /// drawn, or on a corner of a path's preview bounds (shown as an anchor). on_end: bool, + /// The path that holds the last Linear pick worked out, when it landed on a corner of that + /// path's preview bounds. + corner: Option, + /// The path that holds the first Linear point, when it was picked on a corner of that path's + /// preview bounds. + first_corner: Option, /// Whether the press under way began on an anchor a Linear click picks. press_on_anchor: bool, /// The second point clicked for the Linear dimension being placed, and where the pointer was @@ -226,8 +232,9 @@ struct PreviewCorner { at: Point, /// The path the point is held against. holder: NodeId, - /// The path or compound path whose preview bounds have the corner. - object: NodeId, + /// The same corner of the object's geometric bounds: an anchor of `holder` there is the + /// anchor the corner stands in for. + stands_for: Point, } /// With Use Preview Bounds on, the corner of a path's or compound path's preview bounds (its @@ -285,17 +292,20 @@ fn preview_corner(cx: &ToolContext, p: Point, cache: &mut PreviewBoxes) -> Optio continue; } // The path whose own box reaches furthest towards the corner holds it: in a - // compound path, the member that puts that corner where it is. - let mut holder = None; + // compound path, the member that puts that corner where it is. A hidden or + // locked member gives no corner. + let mut holder: Option<(f64, NodeId, bool)> = None; for m in members() { let Some(b) = *w.cache.geometric.entry(m.id).or_insert_with(|| m.geometric_bounds()) else { continue }; let gap = corners(b).get(k).map_or(f64::INFINITY, |c| c.distance(q)); - if holder.is_none_or(|(near, _)| gap < near) { - holder = Some((gap, m.id)); + let editable = m.visible && !m.locked; + if holder.is_none_or(|(near, _, was)| gap < near || (gap == near && editable && !was)) { + holder = Some((gap, m.id, editable)); } } - if let Some((_, holder)) = holder { - w.best = Some((d, PreviewCorner { at: q, holder, object: n.id })); + let holder = holder.filter(|(.., editable)| *editable).map(|(gap, id, _)| (gap, id)); + if let Some(((_, holder), stands_for)) = holder.zip(corners(geometric).get(k).copied()) { + w.best = Some((d, PreviewCorner { at: q, holder, stands_for })); } } } @@ -321,16 +331,34 @@ fn preview_corner(cx: &ToolContext, p: Point, cache: &mut PreviewBoxes) -> Optio } /// The anchor a pick at `p` lands on instead of `corner`, given `anchor`, the nearest anchor -/// within reach; `None` when the corner takes it. The corner takes the pick from the anchors of -/// the object whose preview bounds have it, which sit on the stroke's centerline. An anchor right -/// on the corner takes it, and so does the nearest anchor of other art when that anchor is nearer -/// the pointer than the corner. +/// within reach; `None` when the corner takes it (VectorCraft's own rule). The corner takes the +/// pick from the anchors of the path holding it at the same corner of the object's geometric +/// bounds, which sit on the stroke's centerline. An anchor right on the corner takes it, and so +/// does the nearest other anchor, of this object or of other art, when it is nearer the pointer +/// than the corner. The holder's anchors and the other art are searched with a budget each, and +/// `anchor` wins a tie, as the topmost. fn anchor_over_corner(cx: &ToolContext, p: Point, corner: &PreviewCorner, anchor: Option<(Point, PointRef)>) -> Option<(Point, PointRef)> { - let (at, _) = anchor.as_ref()?; - if at.distance(corner.at) <= 1e-9 { + if anchor.as_ref().is_some_and(|(at, _)| at.distance(corner.at) <= 1e-9) { return anchor; } - anchor_under_where(cx, p, |id| id != corner.object).filter(|(other, _)| other.distance(p) < corner.at.distance(p)) + let stands_in = |(at, nearest): &(Point, PointRef)| nearest.node == corner.holder && at.distance(corner.stands_for) <= 1e-9; + let first = anchor.filter(|a| !stands_in(a)); + let reach = cx.tol(ANCHOR_REACH); + let own = cx.doc.node(corner.holder).and_then(|n| n.path_data()).and_then(|path| { + let anchors = path.subpaths.iter().enumerate().flat_map(|(subpath, sp)| sp.anchors.iter().enumerate().map(move |(i, a)| (subpath, i, a.p))); + anchors + .take(20_000) + .filter(|(.., q)| q.distance(p) <= reach && q.distance(corner.stands_for) > 1e-9) + .min_by(|(.., a), (.., b)| a.distance(p).total_cmp(&b.distance(p))) + .map(|(subpath, anchor, q)| (q, PointRef { node: corner.holder, subpath, anchor })) + }); + let other = anchor_under_where(cx, p, |id| id != corner.holder); + first + .into_iter() + .chain(other) + .chain(own) + .filter(|(q, _)| q.distance(p) < corner.at.distance(p)) + .min_by(|(a, _), (b, _)| a.distance(p).total_cmp(&b.distance(p))) } /// Where a pick at `p` lands on the artwork of the visible, unlocked dimensions already drawn, @@ -434,18 +462,17 @@ fn nearest_on(cx: &ToolContext, edge: &SegmentRef, p: Point) -> Option { /// A point on a segment keeps its place along the segment. Any other point is held /// against the anchors of the path under it, or, with no path under it, the path of the other /// point, so that it moves with that path. None when neither point has a path to link to. +/// `held_a` and `held_b` name the path holding a point picked on a corner of that path's +/// preview bounds: such a point is held against that path, however far its strokes or effects +/// put the corner from the path and whatever other segment lies there. fn points_source( cx: &ToolContext, - boxes: &mut PreviewBoxes, - (a, ra): (Point, &Option), - (b, rb): (Point, &Option), + (a, ra, held_a): (Point, &Option, Option), + (b, rb, held_b): (Point, &Option, Option), ) -> Option { - // A point on a corner of a path's preview bounds is held against that path, however far its - // strokes or effects put the corner from the path and whatever other segment lies there. - let mut corner_of = |p: Point, r: &Option| { - r.is_none().then(|| preview_corner(cx, p, boxes)).flatten().filter(|c| c.at.distance(p) <= 1e-9).map(|c| c.holder) - }; - let (corner_a, corner_b) = (corner_of(a, ra), corner_of(b, rb)); + // A path deleted since the pick holds nothing. + let holder = |held: Option| held.filter(|node| cx.doc.node(*node).is_some()); + let (corner_a, corner_b) = (holder(held_a), holder(held_b)); let edge = |p: Point, corner: Option| if corner.is_some() { None } else { pick(cx, p) }; let (edge_a, edge_b) = (edge(a, corner_a), edge(b, corner_b)); let node = |r: &Option, corner: Option, e: &Option| { @@ -470,8 +497,8 @@ fn points_source( impl DimensionTool { /// Where a Linear pick at `p` lands: with Use Preview Bounds on, on the nearest corner of a - /// path's preview bounds within reach, where they differ from its anchors, unless an anchor of - /// other art is nearer (held against the path, labeled "anchor"; [`anchor_over_corner`]); else on the + /// path's preview bounds within reach, where they differ from its anchors, unless another + /// anchor is nearer (held against the path, labeled "anchor"; [`anchor_over_corner`]); else on the /// nearest anchor of any path, within reach (kept as /// a link to its path), labeled "anchor"; else on the nearest end of a line of a dimension /// already drawn, within the same reach (no link), also labeled "anchor"; else where Smart Guides put it (another object's anchor or centre, in @@ -489,11 +516,13 @@ impl DimensionTool { }); let guided = self.snap.hover(cx, p, &[], leave.as_ref()); self.on_end = false; + self.corner = None; let mut anchor = anchor_under(cx, p); if let Some(corner) = preview_corner(cx, p, &mut self.preview_boxes) { anchor = anchor_over_corner(cx, p, &corner, anchor); if anchor.is_none() { self.on_end = true; + self.corner = Some(corner.holder); self.snap.label(corner.at, "anchor"); return (corner.at, None); } @@ -645,6 +674,8 @@ impl DimensionTool { self.press = None; self.press_on_anchor = false; self.on_end = false; + self.corner = None; + self.first_corner = None; self.points.clear(); self.lines.clear(); self.dragging = false; @@ -658,15 +689,22 @@ impl DimensionTool { match self.kind { Kind::Linear => { let (mut at, mut reference) = self.snap_linear(cx, p); + let mut corner = self.corner; if mods.shift && let Some((last, _)) = self.points.last() { + let snapped = at; at = constrained(cx, *last, at); reference = reference.filter(|r| r.position(cx.doc) == Some(at)); + corner = corner.filter(|_| at.distance(snapped) <= 1e-9); } self.points.push((at, reference)); + if self.points.len() == 1 { + self.first_corner = corner; + } if let [(a, ra), (b, rb)] = self.points.as_slice() { - let source = points_source(cx, &mut self.preview_boxes, (*a, ra), (*b, rb)); + let source = points_source(cx, (*a, ra, self.first_corner), (*b, rb, corner)); + self.first_corner = None; let mut d = self.recipe(DimensionMode::Linear, *a, *b, Point::ZERO, source); if d.resolve(cx.doc).is_ok() { self.second = Some((*b, p)); @@ -1222,6 +1260,12 @@ mod tests { .into_iter() .any(|o| matches!(o, Overlay::Anchor { p, filled: false, size, .. } if p.distance(Point::new(99.5, 99.5)) < 1e-9 && size == 10.0)); assert!(ring, "({x}, {y})"); + let label = t + .snap + .guides() + .iter() + .any(|o| matches!(o, Overlay::Label { p, text, .. } if text == "anchor" && p.distance(Point::new(99.5, 99.5)) < 1e-9)); + assert!(label, "({x}, {y}): {:?}", t.snap.guides()); } } @@ -1279,6 +1323,108 @@ mod tests { wide.stroke_mut().expect("a stroke").width = 40.0; wider.node_mut(id).expect("the rectangle").appearance = wide.into(); assert!(free.position(&wider).is_some_and(|q| near(q, Point::new(99.5, 99.5))), "{:?}", free.position(&wider)); + // Scaled 200% with Scale Strokes off, the point moves with the anchors and no longer sits + // on the corner of the preview bounds, which the 1 point stroke puts at (199.5, 199.5). + let mut scaled = d.clone(); + scaled.node_mut(id).expect("the rectangle").transform(vectorcraft_geom::Affine::scale(2.0), false); + assert!(free.position(&scaled).is_some_and(|q| near(q, Point::new(199.0, 199.0))), "{:?}", free.position(&scaled)); + } + + /// With Use Preview Bounds on, a corner takes the pick only from the anchors at the same corner + /// of its object's geometric bounds. The other anchors of a small stroked circle stay + /// pickable, so does the end of another line lying on the anchor the corner stands in for, and + /// of two stroked rectangles sharing an edge, each corner of the shared anchors is held against + /// its own rectangle. + #[test] + fn a_corner_takes_only_the_anchor_it_stands_for() { + let (s, p) = (Selection::default(), paint()); + let near = |a: Point, b: Point| a.distance(b) < 1e-9; + let mut d = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, circle) = (d.layers[0].id, d.alloc_id()); + let path = vectorcraft_geom::shapes::ellipse(Rect::new(296.0, 296.0, 304.0, 304.0)); + d.insert(Some(l), 0, Node::path(circle, path, vectorcraft_doc::Appearance::default_art())).expect("the circle"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + let (q, reference) = t.snap_linear(&c, Point::new(300.0, 296.0)); + assert!(near(q, Point::new(300.0, 296.0)) && reference.is_some_and(|r| r.node == circle), "{q:?}"); + let (q, reference) = t.snap_linear(&c, Point::new(296.5, 296.5)); + assert!(near(q, Point::new(295.5, 295.5)) && reference.is_none() && t.corner == Some(circle), "{q:?}"); + // An unstroked line ending right on the rectangle's anchor: a click there picks the line's + // end, and a click nearer the corner picks the corner. + let (mut d, id) = doc_with_rect(); + let (l, line) = (d.layers[0].id, d.alloc_id()); + let path = + vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(100.0, 100.0), Point::new(50.0, 20.0)], false)); + d.insert(Some(l), 1, Node::path(line, path, Default::default())).expect("the line"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + let (q, reference) = t.snap_linear(&c, Point::new(100.0, 100.0)); + assert!(near(q, Point::new(100.0, 100.0)) && reference.is_some_and(|r| r.node == line), "{q:?}"); + let (q, reference) = t.snap_linear(&c, Point::new(99.6, 99.6)); + assert!(near(q, Point::new(99.5, 99.5)) && reference.is_none() && t.corner == Some(id), "{q:?}"); + // Two stroked rectangles sharing the edge x = 200; the right one is on top. + let (mut d, left) = doc_with_rect(); + let (l, right) = (d.layers[0].id, d.alloc_id()); + let path = vectorcraft_geom::shapes::rectangle(Rect::new(200.0, 100.0, 300.0, 200.0)); + d.insert(Some(l), 1, Node::path(right, path, vectorcraft_doc::Appearance::default_art())).expect("the right rectangle"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + for (pointer, corner, holder) in [((200.4, 99.6), (200.5, 99.5), left), ((199.6, 99.6), (199.5, 99.5), right)] { + let mut t = DimensionTool::default(); + for kind in [PointerKind::Move, PointerKind::Down, PointerKind::Up] { + t.pointer(&c, &PointerEvent::new(kind, pointer.0, pointer.1)); + } + for kind in [PointerKind::Move, PointerKind::Down, PointerKind::Up] { + t.pointer(&c, &PointerEvent::new(kind, 250.0, 300.0)); + } + let pending = t.pending.expect("both points were picked"); + assert!(near(pending.a, Point::new(corner.0, corner.1)), "{pointer:?}: {:?}", pending.a); + let Some(DimensionSource::Points { a: None, free_a: Some(free), .. }) = &pending.source else { panic!("{:?}", pending.source) }; + assert!(matches!(free, FreePoint::Anchors { node, .. } if *node == holder), "{pointer:?}: {free:?}"); + } + } + + /// A point is held against a path for a corner of its preview bounds only when it was picked + /// there: the same position picked another way links to the segment under it. + #[test] + fn a_point_is_held_for_a_corner_only_when_picked_on_it() { + let (mut d, id) = doc_with_rect(); + let (l, line) = (d.layers[0].id, d.alloc_id()); + let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(0.0, 99.5), Point::new(300.0, 99.5)], false)); + d.insert(Some(l), 1, Node::path(line, path, Default::default())).expect("the line"); + let (s, p) = (Selection::default(), paint()); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let (corner, b) = (Point::new(99.5, 99.5), Point::new(250.0, 99.5)); + for (held, node) in [(Some(id), id), (None, line)] { + let source = points_source(&c, (corner, &None, held), (b, &None, None)); + let Some(DimensionSource::Points { free_a: Some(free), .. }) = &source else { panic!("{source:?}") }; + let linked = match free { + FreePoint::Anchors { node, .. } => *node, + FreePoint::OnSegment { edge, .. } => edge.node, + }; + assert_eq!(linked, node, "{held:?}: {free:?}"); + } + } + + /// Hovering right on the end of a dimension's line shows the anchor ring there. + #[test] + fn hovering_right_on_a_dimension_lines_end_shows_the_anchor_ring() { + let mut d = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, id) = (d.layers[0].id, d.alloc_id()); + let path = + vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(300.0, 300.0), Point::new(400.0, 300.0)], false)); + let mut n = Node::path(id, path, Default::default()); + let recipe = DimensionTool::default().recipe(DimensionMode::Linear, Point::new(0.0, 0.0), Point::new(50.0, 0.0), Point::ZERO, None); + n.extras_mut().dimension = Some(Box::new(recipe)); + d.insert(Some(l), 0, n).expect("the dimension's line"); + let (s, p) = (Selection::default(), paint()); + let c = ToolContext { smart_guides: true, snap_to_point: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + t.pointer(&c, &PointerEvent::new(PointerKind::Move, 300.0, 300.0)); + let ring = t + .overlays(&c) + .into_iter() + .any(|o| matches!(o, Overlay::Anchor { p, filled: false, size, .. } if p.distance(Point::new(300.0, 300.0)) < 1e-9 && size == 10.0)); + assert!(ring, "{:?}", t.overlays(&c)); } /// The anchors of a live rectangle are picked the same way. diff --git a/docs/dimensions.md b/docs/dimensions.md index b15d8f8727..d275ee9f4a 100644 --- a/docs/dimensions.md +++ b/docs/dimensions.md @@ -20,8 +20,8 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers first point was picked on an anchor, the second also snaps onto the construction guides through it; any other first point has no construction guides through it. The guides show while hovering, before each click. VectorCraft's own rules decide where a point lands: an - anchor within 8 pixels takes it first (with Use Preview Bounds on, after a corner of a path's - preview bounds, as below); with Smart Guides or Snap to Point on, the end of a line + anchor within 8 pixels takes it first (with Use Preview Bounds on, except where a corner of a + path's preview bounds takes it, as below); with Smart Guides or Snap to Point on, the end of a line of a visible, unlocked dimension already drawn (its dimension line, or the far end of an extension line) within 8 pixels takes it next, without a link to that dimension; a point on a guide stays on the guide where the pointer @@ -32,18 +32,23 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers line of a dimension already drawn, within 8 pixels. With Smart Guides and Anchor/Path Labels on, a point on an anchor or a line end shows the "anchor" label, and a point on a segment or line shows the "path" label. These rules apply to the Linear points. - With Use Preview Bounds on (Preferences › General), a click within 8 pixels of a corner of the - preview bounds of a path or compound path, its strokes and effects included, lands on that - corner instead of on that object's anchors, as the + With Use Preview Bounds on (Preferences › General), a Linear point can land on a corner of the + preview bounds of a path or compound path whose strokes or effects reach past its anchors. The [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) - describes for measuring a stroked segment. An anchor of other art that is nearer the pointer - than the corner takes the point instead. The point is linked to the path (in a compound path, - to the member whose own bounds reach nearest to the corner), held against its anchors, and - shows the "anchor" label. It moves with the path, and a later change to the stroke weight does - not move it. For an object that is not rotated, a horizontal or vertical dimension between two - such corners measures the outside of the stroke, the width or height that W and H show in the - Transform and Properties panels. A corner that is also an anchor, as on a path without a - stroke, takes the anchor. + describes measuring a stroked segment by snapping onto its preview bounds. VectorCraft snaps to + the four corners of those bounds only, not to their edges, by its own rules: a click within 8 + pixels of a corner lands on it instead of on the anchor at the same corner of the object's + geometric bounds, and any other anchor, of that object or of other art, that is nearer the + pointer than the corner takes the point instead. A corner that is also an anchor, as on a path + without a stroke, takes the anchor. The corners of a group's own strokes or effects, and of + type, are not snapped to. The point is linked to the path (in a compound path, to the member + whose own bounds reach nearest to the corner), is held against its anchors and shows the + "anchor" label. It does not start construction guides for the second point. For an object that + is not rotated, a horizontal or vertical dimension between two such corners measures, when it + is drawn, the outside of the stroke, the width or height that W and H show in the Transform and + Properties panels. The point then moves with the path's anchors, so a later change to the + stroke weight, or a scale with Scale Strokes off, does not move it with the outside of the + stroke. A linear dimension is aligned, horizontal or vertical, as the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes: after the second click, clicking again places an aligned dimension, and moving the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index cb2da583b9..603b469b87 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -635,7 +635,7 @@ since 2026-10-01. **Drawing tools, Dimension tool points on a Smart Guide stay on the guide:** By VectorCraft's own rule, a clicked point that lies on a Smart Guide already, such as one in line with an object's center, stays where the pointer is when no anchor is within 8 pixels and no segment is within the Smart Guides snapping tolerance, instead of moving onto a segment farther than that tolerance and within 8 pixels; with Snap to Grid or Snap to Pixel on, a point stays on the grid or the whole pixel those options give. `a_point_on_a_guide_stays_on_the_guide` covers it. **Drawing tools, Dimension tool second point without construction guides through a first point off the anchors:** By VectorCraft's own rule, with Smart Guides on, the second Linear point does not snap to the construction guides through a first point that is not on an anchor, so a click beside a segment straight below such a first point lands on the segment; after a first point picked on an anchor, the construction guides through it still apply. The second point still snaps to anchors, centers and alignment lines, and with Snap to Perpendicular or Snap to Tangent on, it lands where the line from the first point meets a segment square or grazes a curve. `a_point_on_a_guide_stays_on_the_guide`, `the_second_point_after_an_anchor_lands_on_construction_guides`, `the_second_point_lands_square_to_a_segment_or_grazing_a_curve` and `linear_picks_show_and_snap_to_smart_guides` cover it. **Drawing tools, Dimension tool points land on dimensions already drawn (#8063):** By VectorCraft's own rule, with Smart Guides or Snap to Point on, a Linear point that no anchor of the art within 8 pixels takes lands on the end of a visible, unlocked dimension's dimension line, or on the far end of its extension line, within 8 pixels, and a point that nothing else places lands on the closest point of such a line within 8 pixels, so at any zoom a dimension can start where another one ends. The end of an extension line next to the point it measures does not pull points away from that anchor. With Smart Guides and Anchor/Path Labels on, a point on an anchor or line end shows the "anchor" label and a point on a segment or line shows the "path" label. `linear_picks_land_on_anchors_paths_and_drawn_dimensions` and `an_anchor_beside_a_drawn_dimension_takes_the_point` cover it. -**Drawing tools, Dimension tool points on preview bounds (#8537):** With Use Preview Bounds on, a Linear point clicked within 8 pixels of a corner of the preview bounds of a path or compound path with a stroke or effects lands on that corner instead of on that object's anchors, as the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes, unless an anchor of other art is nearer the pointer; for an object that is not rotated, a horizontal or vertical dimension between two such corners measures the size that W and H show. `with_preview_bounds_points_land_on_the_corners_of_the_stroke`, `preview_bounds_corners_take_picks_as_anchors_do` and `hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring` cover it. +**Drawing tools, Dimension tool points on preview bounds corners (#8537):** With Use Preview Bounds on, a Linear point can land on a corner of the preview bounds of a path or compound path with a stroke or effects; the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes measuring a stroked segment by snapping onto its preview bounds. By VectorCraft's own rule, only the four corners are snapped to: a click within 8 pixels of a corner lands on it instead of on the anchor at the same corner of the object's geometric bounds, and any other anchor nearer the pointer takes the point; for an object that is not rotated, a horizontal or vertical dimension between two such corners measures, when it is drawn, the size that W and H show. The edges of the preview bounds, a group's own strokes or effects and type are not snapped to. `with_preview_bounds_points_land_on_the_corners_of_the_stroke`, `preview_bounds_corners_take_picks_as_anchors_do`, `a_corner_takes_only_the_anchor_it_stands_for`, `a_point_is_held_for_a_corner_only_when_picked_on_it` and `hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring` cover it. **Drawing tools, Dimension tool dimensions selected with their art keep their lines and label:** Object › Expand, Object › Expand Appearance and Object › Path › Outline Stroke leave a dimension selected with art it measures, directly or in selected groups without fills, strokes or effects of their own, as it is and change only the other art; when the new art no longer fits its link, the dimension stays where it was, no longer linked, and undo links it again. `expand_leaves_a_dimension_selected_with_its_art_as_it_is`, `expand_appearance_leaves_a_dimension_selected_with_its_art_as_it_is`, `outline_stroke_leaves_a_dimension_selected_with_its_art_as_it_is`, `a_dimension_selected_with_art_that_has_nothing_to_expand_changes_nothing`, `a_group_effect_expanded_reaches_the_dimension_it_holds`, `expand_keeps_a_dimension_in_its_asset_and_its_variable_binding`, `a_dimension_keeps_no_link_to_the_art_expand_replaced`, `a_dimension_outlasts_the_art_outline_stroke_or_expand_appearance_replaced`, `a_dimension_outlasts_the_stroke_expand_outlined` and `expand_appearance_in_safe_mode_leaves_a_dimension_selected_with_its_art` cover it. **Drawing tools, Line Segment from one curve onto a common tangent of another:** By VectorCraft's own rule, with Smart Guides and Snap to Tangent on, a Line Segment drag pressed anywhere on a convex closed path with curves and dragged to within the snapping tolerance of another such path lands on a common tangent of the two ([tangent lines to circles](https://en.wikipedia.org/wiki/Tangent_lines_to_circles)): both ends move to where the line touches the paths, the start sliding along the first path, and each end shows the "tangent" label when Anchor/Path Labels is on, with the line drawn as a guide when Alignment Guides is on. The line is the tangent whose touch point on the second path is nearest the pointer, so moving the pointer around the second path switches between the outer tangent and the one crossing between the paths. The start stays where it was pressed when Shift, Alt or Space is held, when an anchor, center or crossing lies nearer the pointer than the second path does, when the press snapped to an anchor, center or crossing off the first path, when Snap to Tangent is off, when Snap to Grid or pixel snapping places drawn points, or when either path bends inward somewhere or has more than 512 segments. `a_line_from_one_circle_to_another_lands_on_their_common_tangent`, `a_line_from_a_turned_ellipse_lands_on_its_tangent_with_a_circle`, `a_line_near_the_second_path_takes_the_tangent_touching_it_nearest`, `a_line_keeps_its_start_without_a_tangent_snap`, `a_line_to_a_crescent_or_from_an_anchor_beside_the_curve_keeps_its_start` and `a_line_segment_drag_draws_the_common_tangent_as_one_undo_step` cover it. **Live trace result bounds and selection highlights exclude the retained bitmap except in source-image views:** `live_trace_result_bounds_exclude_the_retained_bitmap_at_any_angle` checks every TraceView, geometric and visual bounds and rotated result bounds. `live_trace_selection_highlight_excludes_the_retained_source_rectangle` checks result highlights and the existing ordinary-group policy. Shared editing-child traversal also preserves Shaper handling. From c609e56b8703e5780fa1867932baad45eea497c0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 07:22:30 -0800 Subject: [PATCH 229/247] Dimension: no preview bounds corners for guides or compound members - A path made into a guide draws without its strokes or effects, so its preview bounds give no corners. - The members of a compound path draw with the compound path's own appearance, so only the compound path's preview bounds give corners. - Another path's anchor right on a preview bounds corner takes a click on the anchor that corner stands in for, so the point links to that path. - A corner that its path cannot hold a point at, as on a stroked dot whose anchors all coincide, is not snapped to, so a click by the dot picks its anchor. - The pointer test before measuring a path includes the right and bottom edges, as the 8 pixel distance test does. Docs: docs/dimensions.md and docs/target-app-parity.md name paths made into guides and compound path members among the art without corners. --- crates/tools/src/dimension.rs | 73 +++++++++++++++++++++++++++++++++-- docs/dimensions.md | 5 ++- docs/target-app-parity.md | 2 +- 3 files changed, 73 insertions(+), 7 deletions(-) diff --git a/crates/tools/src/dimension.rs b/crates/tools/src/dimension.rs index c42dfb980d..894e75ed3d 100644 --- a/crates/tools/src/dimension.rs +++ b/crates/tools/src/dimension.rs @@ -230,6 +230,8 @@ struct PreviewBoxes { revision: Option<(u64, u64)>, geometric: HashMap>, preview: HashMap>, + /// Whether a point at each corner (by object and corner number) can be held against its path. + holdable: HashMap<(NodeId, usize), bool>, } /// A corner of an object's preview bounds that a Linear pick can land on. @@ -275,9 +277,13 @@ fn preview_corner(cx: &ToolContext, p: Point, cache: &mut PreviewBoxes) -> Optio }; let members = || compound.into_iter().flatten().map(|c| c.as_ref()).chain(compound.is_none().then_some(n)).filter(|m| m.path_data().is_some()); - if members().next().is_some() + // A path made into a guide draws as a guide, without its strokes or effects. The pointer + // test includes the right and bottom edges, as the distance test below does. + let within = |r: Rect| (r.x0..=r.x1).contains(&w.p.x) && (r.y0..=r.y1).contains(&w.p.y); + if !n.is_guide() + && members().next().is_some() && let Some(geometric) = *w.cache.geometric.entry(n.id).or_insert_with(|| n.geometric_bounds()) - && (effects || geometric.inflate(reach, reach).contains(w.p)) + && (effects || within(geometric.inflate(reach, reach))) { let doc = w.doc; let measured = match w.cache.preview.get(&n.id) { @@ -310,13 +316,23 @@ fn preview_corner(cx: &ToolContext, p: Point, cache: &mut PreviewBoxes) -> Optio } } let holder = holder.filter(|(.., editable)| *editable).map(|(gap, id, _)| (gap, id)); + // A path that cannot hold a point at the corner (a stroked dot, whose anchors + // all coincide) gives no corner. + let holdable = |id: NodeId, cache: &mut PreviewBoxes| { + *cache.holdable.entry((n.id, k)).or_insert_with(|| FreePoint::on(doc, id, q).is_some()) + }; + let holder = holder.filter(|(_, id)| holdable(*id, w.cache)); if let Some(((_, holder), stands_for)) = holder.zip(corners(geometric).get(k).copied()) { w.best = Some((d, PreviewCorner { at: q, holder, stands_for })); } } } } - if let Some(ch) = n.children() { + // A compound path draws its members with its own appearance: they give no corners of + // their own. + if compound.is_none() + && let Some(ch) = n.children() + { for c in ch.iter().rev() { visit(c, w); } @@ -363,7 +379,7 @@ fn anchor_over_corner(cx: &ToolContext, p: Point, corner: &PreviewCorner, anchor .into_iter() .chain(other) .chain(own) - .filter(|(q, _)| q.distance(p) < corner.at.distance(p)) + .filter(|(q, _)| q.distance(p) < corner.at.distance(p) || q.distance(corner.at) <= 1e-9) .min_by(|(a, _), (b, _)| a.distance(p).total_cmp(&b.distance(p))) } @@ -1462,6 +1478,55 @@ mod tests { assert!(near(q, Point::new(100.0, 100.0)) && reference.is_some_and(|r| r.node == line), "{q:?}"); let (q, reference) = t.snap_linear(&c, Point::new(99.6, 99.6)); assert!(near(q, Point::new(99.5, 99.5)) && reference.is_none() && t.corner == Some(id), "{q:?}"); + // Another path's end right on the corner: a click on the rectangle's anchor picks that end. + let (mut d, _) = doc_with_rect(); + let (l, line) = (d.layers[0].id, d.alloc_id()); + let path = vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(99.5, 99.5), Point::new(50.0, 20.0)], false)); + d.insert(Some(l), 0, Node::path(line, path, Default::default())).expect("the line"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + let (q, reference) = t.snap_linear(&c, Point::new(100.0, 100.0)); + assert!(near(q, Point::new(99.5, 99.5)) && reference.as_ref().is_some_and(|r| r.node == line), "{q:?} {reference:?}"); + // A stroked dot, a path whose two anchors coincide, cannot hold a point at a corner: a + // click by it picks its anchor. + let mut d = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, dot) = (d.layers[0].id, d.alloc_id()); + let path = + vectorcraft_geom::PathData::single(vectorcraft_geom::SubPath::polyline(&[Point::new(300.0, 300.0), Point::new(300.0, 300.0)], false)); + let mut round = vectorcraft_doc::Appearance::default_art(); + let stroke = round.stroke_mut().expect("a stroke"); + (stroke.width, stroke.cap) = (10.0, vectorcraft_doc::LineCap::Round); + d.insert(Some(l), 0, Node::path(dot, path, round)).expect("the dot"); + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + let (q, reference) = t.snap_linear(&c, Point::new(296.0, 296.0)); + assert!(near(q, Point::new(300.0, 300.0)) && reference.is_some_and(|r| r.node == dot) && t.corner.is_none(), "{q:?}"); + // A stroked rectangle made into a guide, and a stroked member of a compound path without + // a stroke of its own, give no corners. + for kind in ["guide", "member"] { + let (mut d, id) = doc_with_rect(); + let mut wide = vectorcraft_doc::Appearance::default_art(); + wide.stroke_mut().expect("a stroke").width = 40.0; + if kind == "guide" { + let n = d.node_mut(id).expect("the rectangle"); + n.appearance = wide.into(); + if let NodeKind::Path { guide, .. } = &mut n.kind { + *guide = true; + } + } else { + let mut fresh = vectorcraft_doc::Document::new(500.0, 500.0); + let (l, part, whole) = (fresh.layers[0].id, fresh.alloc_id(), fresh.alloc_id()); + let mut member = Node::path(part, vectorcraft_geom::shapes::rectangle(Rect::new(100.0, 100.0, 200.0, 200.0)), Default::default()); + member.appearance = wide.into(); + let n = Node::new(whole, NodeKind::Compound { children: vec![std::sync::Arc::new(member)], rule: Default::default() }); + fresh.insert(Some(l), 0, n).expect("the compound path"); + d = fresh; + } + let c = ToolContext { preview_bounds: true, ..cx(&d, &s, &p) }; + let mut t = DimensionTool::default(); + let (q, _) = t.snap_linear(&c, Point::new(81.0, 81.0)); + assert!(!near(q, Point::new(80.0, 80.0)) && t.corner.is_none(), "{kind}: {q:?}"); + } // Two stroked rectangles sharing the edge x = 200; the right one is on top. let (mut d, left) = doc_with_rect(); let (l, right) = (d.layers[0].id, d.alloc_id()); diff --git a/docs/dimensions.md b/docs/dimensions.md index f339ca22b4..b5a15d1f11 100644 --- a/docs/dimensions.md +++ b/docs/dimensions.md @@ -40,8 +40,9 @@ The **Dimension Tool** is in the Modify section of the toolbar. Its strip offers pixels of a corner lands on it instead of on the anchor at the same corner of the object's geometric bounds, and any other anchor, of that object or of other art, that is nearer the pointer than the corner takes the point instead. A corner that is also an anchor, as on a path - without a stroke, takes the anchor. The corners of a group's own strokes or effects, and of - type, are not snapped to. The point is linked to the path (in a compound path, to the member + without a stroke, takes the anchor, and so does another path's anchor right on the corner. The + corners of a group's own strokes or effects, of type, of paths made into guides and of the + members of a compound path on their own are not snapped to. The point is linked to the path (in a compound path, to the member whose own bounds reach nearest to the corner), is held against its anchors and shows the "anchor" label. It does not start construction guides for the second point. For an object that is not rotated, a horizontal or vertical dimension between two such corners measures, when it diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 32dd3dd376..449c484b59 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -646,7 +646,7 @@ since 2026-10-01. **Drawing tools, Dimension tool points on a Smart Guide stay on the guide:** By VectorCraft's own rule, a clicked point that lies on a Smart Guide already, such as one in line with an object's center, stays where the pointer is when no anchor is within 8 pixels and no segment is within the Smart Guides snapping tolerance, instead of moving onto a segment farther than that tolerance and within 8 pixels; with Snap to Grid or Snap to Pixel on, a point stays on the grid or the whole pixel those options give. `a_point_on_a_guide_stays_on_the_guide` covers it. **Drawing tools, Dimension tool second point without construction guides through a first point off the anchors:** By VectorCraft's own rule, with Smart Guides on, the second Linear point does not snap to the construction guides through a first point that is not on an anchor, so a click beside a segment straight below such a first point lands on the segment; after a first point picked on an anchor, the construction guides through it still apply. The second point still snaps to anchors, centers and alignment lines, and with Snap to Perpendicular or Snap to Tangent on, it lands where the line from the first point meets a segment square or grazes a curve. `a_point_on_a_guide_stays_on_the_guide`, `the_second_point_after_an_anchor_lands_on_construction_guides`, `the_second_point_lands_square_to_a_segment_or_grazing_a_curve` and `linear_picks_show_and_snap_to_smart_guides` cover it. **Drawing tools, Dimension tool points land on dimensions already drawn (#8063):** By VectorCraft's own rule, with Smart Guides or Snap to Point on, a Linear point that no anchor of the art within 8 pixels takes lands on the end of a visible, unlocked dimension's dimension line, or on the far end of its extension line, within 8 pixels, and a point that nothing else places lands on the closest point of such a line within 8 pixels, so at any zoom a dimension can start where another one ends. The end of an extension line next to the point it measures does not pull points away from that anchor. With Smart Guides and Anchor/Path Labels on, a point on an anchor or line end shows the "anchor" label and a point on a segment or line shows the "path" label. `linear_picks_land_on_anchors_paths_and_drawn_dimensions` and `an_anchor_beside_a_drawn_dimension_takes_the_point` cover it. -**Drawing tools, Dimension tool points on preview bounds corners (#8537):** With Use Preview Bounds on, a Linear point can land on a corner of the preview bounds of a path or compound path with a stroke or effects; the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes measuring a stroked segment by snapping onto its preview bounds. By VectorCraft's own rule, only the four corners are snapped to: a click within 8 pixels of a corner lands on it instead of on the anchor at the same corner of the object's geometric bounds, and any other anchor nearer the pointer takes the point; for an object that is not rotated, a horizontal or vertical dimension between two such corners measures, when it is drawn, the size that W and H show. The edges of the preview bounds, a group's own strokes or effects and type are not snapped to. `with_preview_bounds_points_land_on_the_corners_of_the_stroke`, `preview_bounds_corners_take_picks_as_anchors_do`, `a_corner_takes_only_the_anchor_it_stands_for`, `a_point_is_held_for_a_corner_only_when_picked_on_it` and `hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring` cover it. +**Drawing tools, Dimension tool points on preview bounds corners (#8537):** With Use Preview Bounds on, a Linear point can land on a corner of the preview bounds of a path or compound path with a stroke or effects; the [linear dimensions help](https://helpx.adobe.com/illustrator/desktop/measure-and-align/plot-and-measure/plot-linear-dimensions-of-objects.html) describes measuring a stroked segment by snapping onto its preview bounds. By VectorCraft's own rule, only the four corners are snapped to: a click within 8 pixels of a corner lands on it instead of on the anchor at the same corner of the object's geometric bounds, and any other anchor nearer the pointer takes the point; for an object that is not rotated, a horizontal or vertical dimension between two such corners measures, when it is drawn, the size that W and H show. The edges of the preview bounds, a group's own strokes or effects, type and paths made into guides are not snapped to. `with_preview_bounds_points_land_on_the_corners_of_the_stroke`, `preview_bounds_corners_take_picks_as_anchors_do`, `a_corner_takes_only_the_anchor_it_stands_for`, `a_point_is_held_for_a_corner_only_when_picked_on_it` and `hovering_a_corner_of_the_preview_bounds_shows_the_anchor_ring` cover it. **Drawing tools, Dimension tool lines line up with dimensions already drawn (#8063, #5590):** By VectorCraft's own rule, with Smart Guides on, a linear dimension placed with its line within the Smart Guides snapping tolerance of the level of a parallel line of a visible, unlocked linear dimension already drawn has its line on that level, and with Alignment Guides on a guide runs along the level across both lines while it is placed. `a_dimension_line_placed_beside_another_lands_on_its_level`, `a_dimension_line_on_another_level_shows_one_guide_across_both`, `a_dimension_of_the_same_points_lines_up_and_the_line_follows_the_pointer`, `a_dimension_dragged_out_beside_another_lands_on_its_level` and `a_line_the_pointer_lies_across_wins_on_one_level` cover it. **Drawing tools, Dimension tool dimensions selected with their art keep their lines and label:** Object › Expand, Object › Expand Appearance and Object › Path › Outline Stroke leave a dimension selected with art it measures, directly or in selected groups without fills, strokes or effects of their own, as it is and change only the other art; when the new art no longer fits its link, the dimension stays where it was, no longer linked, and undo links it again. `expand_leaves_a_dimension_selected_with_its_art_as_it_is`, `expand_appearance_leaves_a_dimension_selected_with_its_art_as_it_is`, `outline_stroke_leaves_a_dimension_selected_with_its_art_as_it_is`, `a_dimension_selected_with_art_that_has_nothing_to_expand_changes_nothing`, `a_group_effect_expanded_reaches_the_dimension_it_holds`, `expand_keeps_a_dimension_in_its_asset_and_its_variable_binding`, `a_dimension_keeps_no_link_to_the_art_expand_replaced`, `a_dimension_outlasts_the_art_outline_stroke_or_expand_appearance_replaced`, `a_dimension_outlasts_the_stroke_expand_outlined` and `expand_appearance_in_safe_mode_leaves_a_dimension_selected_with_its_art` cover it. **Drawing tools, Dimension tool Arrow Style shows each arrowhead (#8049):** The Arrow Style dropdown in Dimension Tool Options and in the Properties panel's Dimension section draws each style's arrowhead at the end of a short line before its name, in the open list and in the closed field, using the Stroke panel's arrowhead previews. Filled, Open, Tick and None are the same four styles, saved as before. `arrow_style_shows_a_drawn_arrowhead` and `each_arrow_style_draws_its_stroke_arrowhead_at_both_ends` cover it. From 2f3c445b389d7f4900f617303fdb6a2367eebd6d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 08:18:08 -0800 Subject: [PATCH 230/247] Command Palette: a word found inside a name goes with a word with a typo "rop shdaow" now finds Drop Shadow: with a query word matched through a typo, each other word may also be text in the result's names or ids, as the substring rule allows. A word found nowhere still leaves the result out, and queries without a typo keep their results and order. Docs: the typo line in docs/target-app-parity.md now says where typo matches rank (after direct name, menu path and id matches, before description-only matches) and that the typo grades order them before the label's length. --- crates/ui-egui/src/palette/search.rs | 26 ++++++++++++++++++++------ docs/target-app-parity.md | 2 +- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/palette/search.rs b/crates/ui-egui/src/palette/search.rs index d87cf4c182..9170219b52 100644 --- a/crates/ui-egui/src/palette/search.rs +++ b/crates/ui-egui/src/palette/search.rs @@ -656,7 +656,9 @@ type RankKey = (bool, bool, u8, u8, u32, u8, u8, usize); /// Corners…) or means the same as a word of its label, menu path or description ("remove bg" for /// Remove Background…), or when the query is the initials of a label ("ea" for Export As…). A query /// word that is no word, stem form or word start of any result's label, menu path or id also -/// matches the words of labels and menu paths it is a typo of ([`Index::typos`]). +/// matches the words of labels and menu paths it is a typo of ([`Index::typos`]); with such a word, +/// a result also matches when each other word of the query is text in one of its names or ids +/// ("rop shdaow" for Drop Shadow). /// Results where a word matched only through a description come after every other result. Before /// them, results where a word matched only through a typo come after every other result, and their /// whole-query match is read with each such word replaced by the word it is a typo of ("gruop" as @@ -680,9 +682,9 @@ pub(crate) fn rank(entries: &[Entry], index: &Index, query: &str) -> Vec { let mut indexed: Vec> = Vec::with_capacity(tokens.len()); let mut typos: Vec> = Vec::with_capacity(tokens.len()); let mut meanings: Vec> = Vec::with_capacity(tokens.len()); - // After a word that is nothing in any result and a typo of nothing, a result is found only by - // the substring rule or its initials, where a typo grade changes nothing, so the later words are - // not compared. + // After a word that is nothing in any result, text in no result's names or ids and a typo of + // nothing, a result is found only by its initials, where a typo grade changes nothing, so the + // later words are not compared. let mut compare = true; for (k, t) in tokens.iter().enumerate() { // A repeated word is graded once. @@ -699,7 +701,7 @@ pub(crate) fn rank(entries: &[Entry], index: &Index, query: &str) -> Vec { // A word that matches only words of descriptions is still compared with the words of labels // and menu paths it may be a typo of. let near = if compare && grades.iter().all(|&g| g == NONE || g == DESCRIPTION_WORD) { index.typos(t) } else { vec![] }; - if near.is_empty() && grades.iter().all(|&g| g == NONE) { + if near.is_empty() && grades.iter().all(|&g| g == NONE) && !entries.iter().any(|e| e.haystack.contains(t)) { compare = false; } index.mark_typos(&near, &mut grades); @@ -719,6 +721,9 @@ pub(crate) fn rank(entries: &[Entry], index: &Index, query: &str) -> Vec { // Each word's grade, the worst and their sum; with initials, every word counts as a word // the label starts, as the initials stand for every word of the label. let (mut all_indexed, mut worst, mut sum) = (fits && !tokens.is_empty(), 0u8, 0u32); + // Whether each word is in this result's index or is text in its names or ids, for a result + // a word matches only through a typo. + let mut held = all_indexed; // The query as read for the whole-query match, with each word matched only through a typo // replaced by the word of this result it is a typo of; and as read with each word matched // through a word with the same meaning replaced by that word too. @@ -738,6 +743,7 @@ pub(crate) fn rank(entries: &[Entry], index: &Index, query: &str) -> Vec { let mut g = grades.get(i).copied().unwrap_or(NONE); if g == NONE { all_indexed = false; + held &= e.haystack.contains(token); } if g > SUBSTRING && e.haystack.contains(token) { g = SUBSTRING; @@ -776,7 +782,7 @@ pub(crate) fn rank(entries: &[Entry], index: &Index, query: &str) -> Vec { worst = worst.max(g); sum += u32::from(g); } - if !(substring || all_indexed || initials) { + if !(substring || all_indexed || initials || (typo && held)) { continue; } let tier = if typo { @@ -1121,6 +1127,13 @@ mod tests { assert!(ranked(&c, "cux").is_empty(), "3 letters"); assert_eq!(ranked(&c, "recktanglee"), ["c.three"], "two edits in a longer word"); assert!(ranked(&c, "rectanglexxx").is_empty()); + // A word found only as text inside a word of the result goes with a word with a typo, in + // either order, and a word found nowhere in the result still leaves it out. + let c = synthetic(vec![entry("Zz Drop Shadow", "a.one"), entry("Zz Drop", "b.two")]); + assert_eq!(ranked(&c, "rop shdaow"), ["a.one"]); + assert_eq!(ranked(&c, "shdaow rop"), ["a.one"]); + assert!(ranked(&c, "rop shdaow qqq").is_empty()); + assert!(ranked(&c, "qqq rop shdaow").is_empty()); // Below a result whose name holds the word as text, and below one that holds it whole. let c = synthetic(vec![entry("Zz Color", "a.one"), entry("Zz Bcolrb", "b.two")]); assert_eq!(ranked(&c, "colr"), ["b.two", "a.one"]); @@ -1193,6 +1206,7 @@ mod tests { } assert_eq!(first("pen"), "tool:pen"); assert!(place(&c, "pen", "file.open").is_some(), "Open… holds the text"); + assert!(place(&c, "rop shdaow", "effect:stylize.dropShadow").is_some(), "{:?}", ranked(&c, "rop shdaow")); } /// A query word finds a result whose label or menu path holds another word of its group of words diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d6072fd54f..f3c8411b2e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1467,7 +1467,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A modal window that opens without a press in the window (a dialog opened from the macOS menu bar or by an automation command, the About window, a file dialog, the update prompt, or the progress window of a plug-in, trace or open run) closes the Command Palette, a tool group's flyout, the All Tools drawer and any open menu or popup in the pass it opens. While such a window is open, the palette stays closed, so opening it from the macOS menu bar or by an automation command does not take the keyboard from the window; it opens again once the window closes (`palette` tests `a_dialog_opened_from_the_system_menu_closes_the_palette`, `the_about_window_closes_the_palette`, `a_progress_window_closes_the_palette`, `the_palette_opened_over_a_dialog_closes`, `a_click_on_the_menu_bar_closes_the_palette_before_a_dialog_opens`, `a_dialog_opened_without_a_press_closes_a_flyout`, `a_dialog_opened_without_a_press_closes_the_tools_drawer`, `a_dialog_opened_without_a_press_closes_a_menu`, `the_palette_opened_as_a_dialog_closes_stays_open_until_the_next_dialog`). The Command Palette ranks its results by how well they match. A query that is a result's id lists that result first (`view.goto1` lists Saved View 1 above Saved View 10); then come results whose name is the query, results whose name without its menu path starts with it, and results whose initials it is ("ea" finds Export As…). Within each of those, a result where every word of the query is a whole word of its name ranks above one where a word only starts a word of the name, then one where it is a word of the menu that holds it, then of its id, then text inside a word, so a query that is a menu's title ("object") lists results named with that word above the items of that menu. A tool ranks above a menu command, panel, effect or filter plug-in that matches as well, so "rect" lists the Rectangle Tool above Effect › Convert to Shape › Rectangle…, and of two results of the same kind the shorter name comes first. Words of the menu bar item that runs a result also find it, the item's own label included ("exit" finds Quit VectorCraft, which File › Exit runs); with the native macOS menu bar, the items that bar moves into its application menu are found under it (Preferences… under Settings). Every result the earlier search found is still found, and the highlight stays on its result when a plug-in is installed, a shortcut changes or the language changes while the palette is open (`palette::search` tests `a_better_word_grade_ranks_first`, `a_better_whole_query_tier_ranks_first`, `kind_and_length_never_lift_a_worse_grade`, `a_menu_title_does_not_lift_its_items`, `common_queries_list_the_command_near_the_top`, `every_result_is_found_first_by_its_name_and_its_id`, `every_result_found_before_is_still_found_and_shown`, `results_know_their_place_in_the_menu_bar`, `native_homes_follow_the_native_application_menu`; `palette` test `the_highlight_stays_on_its_result_when_the_results_change`). A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`). - A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). + A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. With such a word, the other query words may also be text inside a word of the result: "rop shdaow" finds Drop Shadow. Results matched through a typo come after every result the query matches in a name, menu path or id without one, and before results found only by their description. Among them, each result is ordered first by how the query matches it when read with the misspelled word replaced by the word of that result it meets, then by the grades of the query words, where a word met in a label ranks before one met in a menu path, and only then by the label's length. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). Each Command Palette row starts with an icon for its kind (a tool's own icon, or one for a panel, an effect, a filter plug-in or a command) and shows where the result lives after its label, in smaller dim text: the menu path of the menu bar item that runs it, with that item's label when it differs from the result's ("File › Exit" for Quit VectorCraft), and "No menu item" for a command no item runs. A panel's row shows "Window". A row with a home shows its label without the menu path in front of it. A path that keeps two results' names apart stays in the label, unless the row's home shows the same path; a tool's row drops the "Tools" in front of its name. A tool's row names the toolbar it is on: "Toolbar" for its button on the Tools panel, or the name of a toolbar made with New Toolbar, followed by ", in the group" when the tool is hidden in the group of a slot whose button shows another tool ("Toolbar, in the Direct Selection Tool group" for the Group Selection Tool), and "All Tools" when no toolbar holds it. A toolbar shown now comes first (the Tools panel, then the toolbars made with New Toolbar), then a hidden Tools panel, then hidden toolbars made with New Toolbar; toolbars count as hidden in Presentation Mode and while Tab hides the panels. The Learn command (`window.learn`), which Window › Learn runs, takes the Window menu as its home, so a search reads its menu path like any other result's, and among results that tie on everything else it ranks as a command of the menu bar, before panels and after tools. The home is cut short with "…" before the label, and a label too long for the row keeps the id it shows after its name unless the id alone is wider than the row. A cut row shows all its text while the pointer rests on it, and screen readers read the kind, the label, the home and the shortcut. The row height is unchanged (`palette` tests `rows_show_where_each_result_lives`, `no_two_rows_read_alike`, `a_tool_row_names_its_toolbar_slot`, `a_narrow_row_cuts_the_home_first_and_keeps_the_id`, `screen_readers_hear_the_kind_and_home`, `catalogs_translate_the_kind_and_home_words`). From ee285c67a517a3a2f445bcb1f027d1d1547d1739 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Wed, 18 Nov 2026 23:43:02 +0700 Subject: [PATCH 231/247] tests: Type tool layout counts no longer race tests that add fonts The tests that count the layouts the Type tool keeps read vectorcraft_text::layout_inputs() through its cache key. Tests in the same binary that add a font or change the hyphenation exceptions bump it, so a count running beside one saw every frame laid out again (type_overlays_keep_at_most_frame_layouts_max: 2051 instead of 2). Counting tests now hold a shared test-only lock for reading and tests that change those inputs hold it for writing. --- crates/tools/src/lib.rs | 13 +++++++++++++ crates/tools/src/text/tests.rs | 8 ++++++++ crates/tools/src/touchtype/tests.rs | 1 + 3 files changed, 22 insertions(+) diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 43e59de7da..3613d3b844 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -674,6 +674,19 @@ pub(crate) mod testutil { global_edit: &[], } } + + /// Held for reading by tests that count the layouts the Type tool keeps, and for writing by + /// tests that change what layout reads (fonts, hyphenation exceptions): tests run in parallel, + /// and a count must not include a refresh another test caused. + static LAYOUT_INPUTS: std::sync::RwLock<()> = std::sync::RwLock::new(()); + + pub fn steady_layout_inputs() -> std::sync::RwLockReadGuard<'static, ()> { + LAYOUT_INPUTS.read().unwrap_or_else(|e| e.into_inner()) + } + + pub fn changing_layout_inputs() -> std::sync::RwLockWriteGuard<'static, ()> { + LAYOUT_INPUTS.write().unwrap_or_else(|e| e.into_inner()) + } } #[cfg(test)] diff --git a/crates/tools/src/text/tests.rs b/crates/tools/src/text/tests.rs index 89a24cc3bf..c87121c51d 100644 --- a/crates/tools/src/text/tests.rs +++ b/crates/tools/src/text/tests.rs @@ -1327,6 +1327,7 @@ fn area_type_drag_measure_labels_honor_preference() { #[test] fn layout_cache_follows_fonts_added_later() { + let _inputs = crate::testutil::changing_layout_inputs(); // Other tests can load system fonts; this assertion needs its own process-wide database. #[cfg(not(target_arch = "wasm32"))] if std::env::var("VECTORCRAFT_FONT_CACHE_TEST_CHILD").as_deref() != Ok("1") { @@ -1542,6 +1543,7 @@ fn selected_type_shows_its_ports_in_each_state() { /// Preferences › Hyphenation › Exceptions change, the selected type is laid out again. #[test] fn the_out_port_follows_the_hyphenation_exceptions() { + let _inputs = crate::testutil::changing_layout_inputs(); struct Clear; impl Drop for Clear { fn drop(&mut self) { @@ -1690,6 +1692,7 @@ const OVERFLOWS: &str = "This text is far too long to fit in a frame of one hund /// overlays as a tool that lays every frame out afresh. #[test] fn type_overlays_keep_the_selected_frames_layouts() { + let _inputs = crate::testutil::steady_layout_inputs(); let (d, ids) = area_frames(&["One", "Two words", "Three words here", OVERFLOWS]); let (mut sel, p) = (Selection::default(), paint()); sel.set(ids.iter().copied()); @@ -1721,6 +1724,7 @@ fn type_overlays_keep_the_selected_frames_layouts() { /// out again on the next frame. #[test] fn type_overlays_keep_a_selected_storys_layouts() { + let _inputs = crate::testutil::steady_layout_inputs(); let (mut d, ids) = area_frames(&["Story one ", "story two ", "story three ", "story four"]); d.text_threads.push(ids.clone()); let (mut sel, p) = (Selection::default(), paint()); @@ -1749,6 +1753,7 @@ fn type_overlays_keep_a_selected_storys_layouts() { /// longer drawn is dropped, and choosing another tool drops them all. #[test] fn type_overlays_lay_out_again_only_the_frames_that_changed() { + let _inputs = crate::testutil::steady_layout_inputs(); let (mut d, ids) = area_frames(&["One", "Two", "Three", OVERFLOWS]); let (mut sel, p) = (Selection::default(), paint()); sel.set(ids.iter().copied()); @@ -1786,6 +1791,7 @@ fn type_overlays_lay_out_again_only_the_frames_that_changed() { /// each call, and draws what laying every frame out afresh draws. #[test] fn type_overlays_keep_at_most_frame_layouts_max() { + let _inputs = crate::testutil::steady_layout_inputs(); let texts = vec!["a "; FRAME_LAYOUTS_MAX + 3]; let (mut d, ids) = area_frames(&texts); d.text_threads.push(ids.clone()); @@ -1806,6 +1812,7 @@ fn type_overlays_keep_at_most_frame_layouts_max() { #[test] fn frame_layouts_follow_fonts_and_hyphenation_exceptions() { + let _inputs = crate::testutil::changing_layout_inputs(); // Other tests can load system fonts; this assertion needs its own process-wide database. #[cfg(not(target_arch = "wasm32"))] if std::env::var("VECTORCRAFT_FONT_CACHE_TEST_CHILD").as_deref() != Ok("1") { @@ -1848,6 +1855,7 @@ fn frame_layouts_follow_fonts_and_hyphenation_exceptions() { #[test] #[ignore = "timing, run by hand"] fn type_overlays_timing() { + let _inputs = crate::testutil::steady_layout_inputs(); use std::time::Instant; let words = "The quick brown fox jumps over the lazy dog while seven wizards box. ".repeat(6); let texts: Vec = (0..200).map(|i| format!("{i} {words}")).collect(); diff --git a/crates/tools/src/touchtype/tests.rs b/crates/tools/src/touchtype/tests.rs index 54c6c86e30..991ab47fdc 100644 --- a/crates/tools/src/touchtype/tests.rs +++ b/crates/tools/src/touchtype/tests.rs @@ -470,6 +470,7 @@ fn the_tool_is_made_by_its_id() { #[test] fn touch_type_rtl_middle_character_can_drag_and_nudge_along_its_line() { + let _inputs = crate::testutil::changing_layout_inputs(); use vectorcraft_text::test_fonts::{RIGHT_TO_LEFT_OPTICAL_FAMILY, right_to_left_optical_font}; // The process-wide database deduplicates the same synthetic face across tests. From a08ffe592c9f50d7f21605b454579860e1808721 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 00:53:32 +0700 Subject: [PATCH 232/247] script: the unwritten-files error says it isn't the script's own Two merges crossed: one added RunError::authored, the other built a RunError for files a run couldn't write without it, so main stopped compiling. --- crates/engine/src/script/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 14618a6108..d811da6e2e 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2190,7 +2190,7 @@ impl Session { let unwritten = job.host.flush_files(); if !unwritten.is_empty() { let message = format!("{UNWRITTEN_FILES}: {}", unwritten.join(", ")); - let e = RunError { kind: RunErrorKind::Thrown, message, line: 0, column: 0 }; + let e = RunError { kind: RunErrorKind::Thrown, message, line: 0, column: 0, authored: false }; return self.script_failed(job, &e); } // The working copy goes into the session; `job.world` holds the state before the run. From b41254d05b89076bd94de23d316a2ea4b4703ac0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 01:39:31 +0700 Subject: [PATCH 233/247] i18n: drop the Gujarati Panel row two merges both added Two PRs merged tonight each added the same row, so bundled_catalogs_are_consistent fails on main (gu: duplicate "" "Panel"). Both rows have the same translation. --- crates/ui-egui/src/i18n/gu.tsv | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 241f914c35..d7bb081e02 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -5360,7 +5360,6 @@ swatch [Registration] [રજિસ્ટ્રેશન] Gem રત્ન Hexagon ષટ્કોણ Key ચાવી - Panel પેનલ Pin પિન Potion ઔષધ Rounded Square ગોળ ખૂણાવાળો ચોરસ From bb66ae9a87f31674b9c563e67a22ddcec0e321fd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 01:47:51 +0700 Subject: [PATCH 234/247] tests: fix main after tonight's merges crossed - The French script error line now has the catalog's no-break spaces before its colons. - es.tsv drops the old file.info control character row a merge brought back. --- crates/ui-egui/src/chrome/tests.rs | 2 +- crates/ui-egui/src/i18n/es.tsv | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 629e6a0ef0..4c9506b13c 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -943,7 +943,7 @@ fn german_script_status_preserves_authored_error_and_translates_native_error() { // A change of language while the message stays keeps the script's text. failed(&mut app, "throw new Error('invalid array length')", false); crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); - assert_eq!(super::status_bar::status_message(&app), "t.js : ligne 1, colonne 1 : Error: invalid array length (levée)"); + assert_eq!(super::status_bar::status_message(&app), "t.js\u{a0}: ligne 1, colonne 1\u{a0}: Error: invalid array length (levée)"); crate::i18n::set_current(crate::i18n::Lang::EN); assert_eq!(super::status_bar::status_message(&app), app.ui.status); // After a run that completes, the message is an ordinary one. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 06f80b565e..30678f8a13 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -10263,7 +10263,6 @@ breakText Glyphs Glifos @msg {kind} files have no transparency, and the file would have {what}: flatten it first (object.flattenTransparency) los archivos {kind} no tienen transparencia, y el archivo tendría {what}: acóplalo antes (object.flattenTransparency) @msg {kind} images can't be opened (see document.formats) las imágenes {kind} no se pueden abrir (consulta document.formats) @msg {k} `{v}` is not one of the choices {k} `{v}` no es una de las opciones -@msg {k} has control characters{_1} {k} tiene caracteres de control{_1} @msg {k} is too long (at most {MAX_TEXT} characters) {k} es demasiado largo (como máximo {MAX_TEXT} caracteres) @msg {k} must be > 0 {k} debe ser > 0 @msg {k} must be a number (pt) or a length such as "210 mm" {k} debe ser un número (pt) o una longitud como "210 mm" From 94a4a50a15e62055d45a3ef1968dd0b47cd2d0c2 Mon Sep 17 00:00:00 2001 From: Dan Green Date: Thu, 12 Nov 2026 13:54:57 -0800 Subject: [PATCH 235/247] Panels: focus moving between the app's windows can make floating panels disappear Clicking between app windows (floating panels and the canvas) passes through one frame where none of them has focus. The palette levels counted the app inactive on that frame and lowered every floating panel's OS window. The panels flickered, could end up disappearing behind the main window until the next repaint, and a click on one panel's bar could hand the keyboard to another. The app now counts as inactive once none of its windows has had focus for 0.25 s, counted from the first frame that saw none. craft-ui's docking waits as long. Fixes #6986 --- crates/ui-egui/src/panel_docking.rs | 24 +++++++++++-- .../ui-egui/src/panel_docking/native_tests.rs | 34 +++++++++++++++++++ docs/target-app-parity.md | 4 ++- docs/ui-parity.md | 3 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 86faed9e2d..c4269e6190 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -1355,15 +1355,35 @@ fn palette_window_state(modal: bool, popup: bool, active: bool) -> (egui::Window (level, true) } +/// How long none of the app's windows has focus before the app counts as inactive. Focus moving +/// between the app's own windows passes through a frame where none has it (a press on a palette's +/// bar takes it from the main window): lowering the palettes then let the window system give the +/// keyboard to another palette in the middle of the press. craft-ui's docking waits as long. +#[cfg(not(target_arch = "wasm32"))] +const AWAY_DELAY: f64 = 0.25; + /// Sends the palette windows of `layout` the level and visibility [`palette_window_state`] gives /// when they change. craft-ui varies a palette's level through the viewport builder, which egui /// applies when the window opens and not to one already on screen, so the commands go explicitly to /// the windows there are. A window that opens while the others are hidden (a panel floated under a /// dialog, a menu, a flyout or the drawer) opens shown at its palette level, so it gets the commands -/// in its first frame. +/// in its first frame. The app is active until none of its windows has had focus for +/// [`AWAY_DELAY`], counted from the first frame that saw none. #[cfg(not(target_arch = "wasm32"))] fn palette_window_levels(ctx: &egui::Context, layout: &Layout, modal: bool, popup: bool) { - let active = ctx.input(|i| i.focused || i.raw.viewports.values().any(|v| v.focused == Some(true))); + let (focused, now) = ctx.input(|i| (i.focused || i.raw.viewports.values().any(|v| v.focused == Some(true)), i.time)); + let away_key = area_id().with("palette-levels-away"); + let active = if focused { + ctx.data_mut(|d| d.remove::(away_key)); + true + } else { + let since = ctx.data_mut(|d| *d.get_temp_mut_or_insert_with(away_key, || now)); + let left = AWAY_DELAY - (now - since); + if left > 0.0 { + ctx.request_repaint_after(std::time::Duration::from_secs_f64(left)); + } + left > 0.0 + }; let key = area_id().with("palette-levels-state"); let state = (modal, popup, active); let windows: Vec = layout.floating.iter().map(|window| window.id).collect(); diff --git a/crates/ui-egui/src/panel_docking/native_tests.rs b/crates/ui-egui/src/panel_docking/native_tests.rs index b20ceeb25f..e9e8c4a3df 100644 --- a/crates/ui-egui/src/panel_docking/native_tests.rs +++ b/crates/ui-egui/src/panel_docking/native_tests.rs @@ -735,6 +735,40 @@ fn a_palette_window_keeps_out_of_the_way_of_the_main_windows_dialog_and_menus() assert_ne!(inactive.0, WindowLevel::AlwaysOnTop, "and not above other applications' windows: {:?}", inactive.0); } +/// Focus moving between the app's own windows passes through a frame where none has it: the +/// palettes keep their level then, or the window system hands the keyboard to another palette in +/// the middle of a press on a palette's bar. They leave the top level once the app has had no +/// focus for a while. +#[test] +fn focus_moving_between_the_apps_windows_leaves_the_palettes_on_top() { + let mut h = Harness::new(); + let viewport = h.float("navigator"); + h.host.borrow_mut().focus = ViewportId::ROOT; + h.frames(2); + take_palette_commands(&h, viewport); + let nowhere = ViewportId::from_hash_of("no window of the app"); + h.host.borrow_mut().focus = nowhere; + h.frames(1); + h.host.borrow_mut().focus = viewport; + h.frames(2); + assert_eq!(take_palette_commands(&h, viewport), (vec![], vec![]), "a frame without focus leaves the palette's level"); + // The wait starts again each time focus leaves: a second frame without focus, longer after + // the first than the wait, leaves the level too. + h.frames(6); + h.host.borrow_mut().focus = nowhere; + h.frames(1); + h.host.borrow_mut().focus = ViewportId::ROOT; + h.frames(2); + assert_eq!(take_palette_commands(&h, viewport), (vec![], vec![]), "the wait is counted from when focus last left"); + h.host.borrow_mut().focus = nowhere; + h.frames(8); + let (_, levels) = take_palette_commands(&h, viewport); + assert_eq!(levels.last(), Some(&palette_window_state(false, false, false).0), "the app left: the palette leaves the top level"); + h.host.borrow_mut().focus = ViewportId::ROOT; + h.frames(2); + assert_eq!(take_palette_commands(&h, viewport).1, [egui::WindowLevel::AlwaysOnTop], "and takes it again when the app is back"); +} + /// With a menu of the in-window menu bar open, the palettes take the normal level (still shown): /// the menu is drawn in the main window, or it would open under them. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 641d87bdcc..0686d6297e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -1050,6 +1050,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The other panels' item drags start only with the primary mouse button too: swatches and color groups, brushes, symbols, graphic styles, library items and groups, character and paragraph styles, Appearance rows and its thumbnail, the Fill and Stroke squares, Recent Colors and the Gradient panel's thumbnail. A right or middle drag on one carries nothing, moves, copies, deletes and applies nothing and records no undo step; right-click menus and the Graphic Styles panel's held right-button preview stay as they were (`panels::swatches` test `only_a_primary_drag_moves_swatches_and_groups`, `panels::text_styles` test `only_a_primary_drag_carries_a_style_row`, `panels::tests_symbol_libraries` test `only_a_primary_drag_carries_a_library_symbol_out`, `panels::tests_effectedit` test `only_a_primary_drag_carries_the_thumbnail_or_a_row`). - Panels undock (#495): a dock tab, a panel icon or a popped-out panel's title dragged out of the dock floats that panel (in an OS window of its own on the desktop, #4135), and the strip right of the dock's tabs floats the whole tabbed group. A floating group moves by its title bar, a tab dragged out of it floats on its own, and dropped on another group's title bar or tabs it stacks with that group; dropped on a dock group's tabs, which light up under the pointer, its panels join that group, and on the group's upper or lower half they make a new group above or below it (`window.panel.dock {anchor, zone}`); dropped on the icon column they become icons there, the tabbed group's panels too (`window.panel.dock {icon: true}`); dropped anywhere else on the dock, which lights up, they go back where they live (the tabbed group or the icon column), as its × and the panel menus' Float Panel / Dock Panel do (`window.panel.float`, `window.panel.dock`). The Tools panel floats by its title bar and docks again on the window's left edge. Floating groups stack into sets: dropped on the upper or lower half of another group (a line shows where), a group joins it right above or below it, and the set's groups stack top to bottom, each showing one panel, moving together by the top group's title bar, whose × docks them all; a group dragged by its tab strip leaves the set (`window.panel.float {below, above}`). A double-click on a tab collapses a floating group to its tabs (`collapsed`), and a dock group too, a group below it moving up into the room; a second double-click, or a click on another of its tabs, expands it (`window.panel.collapse`, kept with the preferences and in saved workspaces). Sets dropped on the left edge of the icon column or of another dock column dock as dock columns (a multi-column dock, `window.panel.dock {column}`), whose groups stack, tab and tear out as a floating set's do, and whose top strip floats the column again. Floating panels, their sets and the Tools panel's position are kept with the preferences and in user workspaces, and clamped into a smaller window. Not done: panels in separate OS windows, reordering tabs by dragging, collapsing a set or dock column to icons, dock columns right of the default dock, resizing floating panels and the groups of a set. - A floating panel's OS window hides while a tool group's flyout or the All Tools drawer is open in the main window, as it does under a modal dialog or a menu, and shows again when the flyout or the drawer closes (#5813; `a_tool_flyout_hides_the_palette_windows_until_it_closes`). + - Focus moving between the app's own windows passes through a frame where none has it (a press on a panel's bar takes it from the main window): the panels' OS windows keep their level then, and leave the top level only once the app has had no focus for 0.25 s. Before, that frame lowered them, so with two floating panels a press on one panel's bar handed the keyboard to the other (the main window's tool cursor did not come back) and could leave both behind the main window (#6986; `focus_moving_between_the_apps_windows_leaves_the_palettes_on_top`). - On the desktop a floating panel in an OS window stores the monitor it is on and reopens there at the next launch. When that monitor is no longer connected, the panel opens on the main window's monitor at the same offset (#5582). Outside macOS, a desktop whose monitors have different scale factors keeps opening floating panels on the main window's monitor. Test: `panel_docking::native_tests::a_floating_panel_reopens_on_the_monitor_where_it_was_left`. - A menu in a floating panel's OS window stops at that window's bottom edge and scrolls past it, and is never taller than the window (#5347; `a_long_panel_menu_scrolls_inside_a_short_native_window`). A panel's long submenus (Digits, Stylistic Sets, Save Selection, Move to Group), the libraries menu, the Color Guide's Limit to Library menu and the Layers panel's Filter popup scroll the same way. - The dock's double arrow collapses Properties, Layers and Libraries to icons at the top of the icon column, popping out like the other icon panels, and expands them again (`window.collapseDock`, kept with the preferences and in saved workspaces). The icon column's own arrow (expanding the icon panels into a full column) is not done. @@ -3010,6 +3011,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | 2026-11-13 | minor | Character panel: the Set Font Height Reference dropdown shows an icon of the height each reference measures before its name, in the open list and in the closed field (#6304). Scores and estimates unchanged. | | 2026-11-13 | minor | Envelopes: a top object's side whose pieces, from corner to corner, are all one cubic curve split at anchors (each within 0.02 pt of that curve's piece) follows that curve's parameter instead of sharing the content out by the pieces' control polygons, so Add Anchor Points on such a side leaves how it shares out the content as it was, and a top object whose `.ai` mesh saves its sides' curves in pieces draws as the file's drawn art (`a_split_curve_keeps_the_top_object_patch`, `a_top_object_side_of_many_arcs_stays_on_them` and three more in `live::tests`, `envelope_top_object_keeps_its_look_when_anchors_are_added`, `a_top_object_whose_top_is_one_curve_split_in_thirds_opens_live`). Existing top-object envelopes with such sides redraw (#7097). Scores and estimates unchanged. | | 2026-11-12 | minor | 3D: The seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins (the seams of Revolve and of colored lights, and 3D (Classic) Wireframe edges, were already round): no thorns on edge-on facets, and facets with no neighbour now have rounded convex corners ([three-d.md](three-d.md#seams)). White-light output is expected to differ from the 2026-10-17 byte comparison at facet corners; the four scenes were not exported again to measure it. Scores and estimates unchanged. | +| 2026-11-12 | minor | Floating panels keep their window level while focus moves between the app's windows (0.25 s before the app counts as inactive, #6986); panel evidence updated; scores and hours unchanged. | | 2026-11-12 | minor | Object › Rasterize with the Grayscale colour model makes a grayscale image (one gray channel, with alpha over a transparent background), so the Properties panel says Grayscale and a fill color colorizes it; Bitmap makes a 1-bit image (a TIFF), or a black-and-white gray image with alpha over a transparent background, since 1-bit gray with alpha is no format readers take. Both were RGB images of gray pixels (#6969). Scores and estimates unchanged. | | 2026-11-12 | minor | `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints (its strokes' miter tips, and strokes a Transform effect moves, included), after its glyphs grown by half its strokes' weight; `.ai` import evidence updated (#6824); scores and estimates unchanged. | | 2026-11-12 | minor | Explicit editing-data import keeps a single artboard beyond a capped 14,400 pt PDF page (#6865), with a warning; automatic mode stays unchanged. Scores and estimates unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index bef9c7ee4e..d32b9176a1 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Selection QoL: marquee modes and visible feedback, #5313; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -601,6 +601,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra | 2026-11-16 | minor | Eraser review (#6582): ordinary Group/Layer own paints and reproducible evaluated gradient placements are preserved as members are cut. Replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot reproduce the original appearance keep existing fitting. Scores and estimates unchanged. | | 2026-11-16 | minor | Color panel: the spectrum fills the vertical space of a resized panel, with options shown or hidden (#8005). Compact auto-fit flyouts and embedded mixers keep their existing size. Evidence: panels::color::tests::the_spectrum_grows_with_the_color_panel. Scores and estimates unchanged. | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | +| 2026-11-12 | minor | Floating panels: the app counts as inactive only once none of its windows has had focus for 0.25 s, so focus moving between its own windows (a press on a panel's bar) leaves the panels' OS windows at their level; with two floating panels, a press on one panel's bar no longer hands the keyboard to the other or leaves both behind the main window (#6986). `focus_moving_between_the_apps_windows_leaves_the_palettes_on_top`; scores and estimates unchanged. | | 2026-11-12 | minor | Numeric fields: a focus click released more than 1 pt from its press keeps the caret; a tap within 1 pt still selects the whole value (#6659, follow-up to #1326). Scores and estimates unchanged. | | 2026-11-15 | minor | G12: Swatches item menus validated in all five views: 39 focused tests passed, regression fails without the menu hooks, rendered list/thumbnail layouts inspected, and fresh local deep CodeRabbit review found zero issues. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. Scores and estimates unchanged. | | 2026-11-12 | minor | Remove Background for a selected image in the Contextual Task Bar, Properties › Quick Actions and the Control bar, which runs at once with its defaults. Scores and estimates unchanged. | From 33701e2321b5556b82497e419b9716c7a7ca80a0 Mon Sep 17 00:00:00 2001 From: el-j Date: Wed, 18 Nov 2026 20:58:54 +0100 Subject: [PATCH 236/247] Layers panel: add row context menus for guide and blend spine rows (#8592) --- crates/ui-egui/src/panels/layers/rows.rs | 111 ++++++++++++ crates/ui-egui/src/panels/layers/tests.rs | 203 ++++++++++++++++++++++ docs/gaps.md | 4 +- docs/ui-parity.md | 5 +- 4 files changed, 320 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/layers/rows.rs b/crates/ui-egui/src/panels/layers/rows.rs index 447133e7d6..1763210ef8 100644 --- a/crates/ui-egui/src/panels/layers/rows.rs +++ b/crates/ui-egui/src/panels/layers/rows.rs @@ -177,6 +177,19 @@ fn guide_row(ui: &mut Ui, view: &View, item: &Row, i: usize, out: &mut Out) { } out.actions.push(("guide.select".into(), json!({"indexes": [i], "toggle": m.shift || m.command}))); } + if resp.secondary_clicked() { + crate::panels::set_row_keys(ui.ctx(), ROW_KEYS, true); + if editable && !selected { + if !view.rows.is_empty() { + out.actions.push(("layer.highlight".into(), json!({"ids": [], "mode": "set"}))); + out.rows_after_click = Some(vec![]); + } + out.actions.push(("guide.select".into(), json!({"indexes": [i]}))); + } + } + resp.context_menu(|ui| { + guide_context_menu(ui, view, item, i, out); + }); // Dragged: the selected guides when this is one of them, else this one, to another layer's row. // Only the primary button drags a guide row, and not while a drag down a column passes it. if editable && resp.drag_started_by(egui::PointerButton::Primary) && view.column.is_none() { @@ -194,6 +207,46 @@ fn guide_row(ui: &mut Ui, view: &View, item: &Row, i: usize, out: &mut Out) { } } +/// The right-click context menu of ruler guide row `i` (`item`). +fn guide_context_menu(ui: &mut Ui, view: &View, item: &Row, i: usize, out: &mut Out) { + let Some(g) = view.ruler_guides.get(i) else { return }; + let selected = view.guides.contains(&i); + let editable = view.doc.guide_editable(g); + let guides: Vec = if selected { view.guides.clone() } else { vec![i] }; + let node = g.id.and_then(|id| view.doc.node(id)); + let guide_nodes: Vec = if selected { + guides.iter().filter_map(|&idx| view.ruler_guides.get(idx)?.id.map(|id| id.0)).collect() + } else { + node.map(|n| vec![n.id.0]).unwrap_or_default() + }; + let visible = node.is_none_or(|n| n.visible); + if widgets::menu_item(ui, if visible { "Hide" } else { "Show" }, !guide_nodes.is_empty(), false) { + out.actions.push(("layer.setProps".into(), json!({ "ids": guide_nodes, "visible": !visible }))); + ui.close(); + } + let locked = node.is_some_and(|n| n.locked); + if widgets::menu_item(ui, if locked { "Unlock" } else { "Lock" }, !guide_nodes.is_empty(), false) { + out.actions.push(("layer.setProps".into(), json!({ "ids": guide_nodes, "locked": !locked }))); + ui.close(); + } + ui.separator(); + if widgets::menu_item(ui, "Release Guides", editable, false) { + let params = if guides.len() > 1 { json!({}) } else { json!({ "index": i }) }; + out.actions.push(("view.guides.release".into(), params)); + ui.close(); + } + if widgets::menu_item(ui, "Delete", editable, false) { + out.actions.push(("guide.remove".into(), json!({ "indexes": guides }))); + ui.close(); + } + ui.separator(); + let layers_only = view.opts.layers_only; + if widgets::menu_item(ui, if layers_only { "Locate Layer" } else { "Locate Object" }, true, false) { + out.actions.push(("layer.locate".into(), json!({ "id": item.node.id.0, "layersOnly": layers_only }))); + ui.close(); + } +} + /// The row of the spine of blend `item` (#4820): a path mark and ``, the selection square /// while the blend is selected. A click selects the blend, whose spine Direct Selection then edits /// on the canvas; Shift or Cmd adds it to (or takes it from) the selection. The spine of a hidden @@ -233,6 +286,64 @@ fn spine_row(ui: &mut Ui, view: &View, item: &Row, out: &mut Out) { let action = if m.shift || m.command { "select.toggle" } else { "select.set" }; out.actions.push((action.into(), json!({"ids": [blend.0]}))); } + if resp.secondary_clicked() { + crate::panels::set_row_keys(ui.ctx(), ROW_KEYS, true); + if editable && !selected { + out.actions.push(("select.set".into(), json!({"ids": [blend.0]}))); + } + } + resp.context_menu(|ui| { + spine_context_menu(ui, view, item, out); + }); +} + +/// The right-click context menu of blend spine row `item`. +fn spine_context_menu(ui: &mut Ui, view: &View, item: &Row, out: &mut Out) { + let blend = item.node.id; + let selected = view.sel.contains(&blend); + let editable = (view.doc.editable())(blend); + let has_spine = !matches!(&item.node.kind, NodeKind::Blend { spec, .. } if spec.no_spine); + let ensure_selected = |out: &mut Out| { + if !selected { + out.actions.push(("select.set".into(), json!({ "ids": [blend.0] }))); + } + }; + if widgets::menu_item(ui, "Select", editable, false) { + out.actions.push(("select.set".into(), json!({ "ids": [blend.0] }))); + ui.close(); + } + if widgets::menu_item(ui, "Blend Options…", editable, false) { + ensure_selected(out); + out.actions.push(("ui.blendOptions".into(), json!({}))); + ui.close(); + } + ui.separator(); + if widgets::menu_item(ui, "Reverse Spine", editable && has_spine, false) { + ensure_selected(out); + out.actions.push(("object.blend.reverseSpine".into(), json!({}))); + ui.close(); + } + if widgets::menu_item(ui, "Reverse Front to Back", editable, false) { + ensure_selected(out); + out.actions.push(("object.blend.reverseFrontToBack".into(), json!({}))); + ui.close(); + } + if widgets::menu_item(ui, "Expand", editable, false) { + ensure_selected(out); + out.actions.push(("object.blend.expand".into(), json!({}))); + ui.close(); + } + if widgets::menu_item(ui, "Release", editable, false) { + ensure_selected(out); + out.actions.push(("object.blend.release".into(), json!({}))); + ui.close(); + } + ui.separator(); + let layers_only = view.opts.layers_only; + if widgets::menu_item(ui, if layers_only { "Locate Layer" } else { "Locate Object" }, true, false) { + out.actions.push(("layer.locate".into(), json!({ "id": blend.0, "layersOnly": layers_only }))); + ui.close(); + } } /// Guide rows `guides` dragged over row `r` (`resp`) of layer `layer`: the row lights up, and the diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 1f03ee5d86..b0e4355d21 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -3006,3 +3006,206 @@ fn context_menu_others_actions_sublayer_state_enables_all_commands() { assert_eq!(lock_cmd, "layer.unlockAll"); assert!(lock_enabled, "locked sublayer enables Unlock All Layers"); } + +/// One headless frame of the panel in a 300 × 600 window, returning every drawn text and its rect. +fn frame_texts(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) -> Vec<(String, egui::Rect)> { + let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::pos2(0.0, 0.0), vec2(300.0, 600.0))), events, ..Default::default() }; + let mut out = ctx.run_ui(raw, |ui| show(app, ui)); + out.textures_delta.clear(); + let mut texts = vec![]; + for s in out.shapes { + if let egui::epaint::Shape::Text(t) = s.shape { + texts.push((t.galley.text().to_string(), t.galley.rect.translate(t.pos.to_vec2()))); + } + } + texts +} + +/// Click `button` at `pos` (pressed in one frame, released in the next) and return the texts drawn +/// on the frame after release. +fn click_menu_at(app: &mut VectorcraftApp, ctx: &egui::Context, pos: egui::Pos2, button: egui::PointerButton) -> Vec<(String, egui::Rect)> { + let ev = |pressed| egui::Event::PointerButton { pos, button, pressed, modifiers: Default::default() }; + frame_texts(app, ctx, vec![egui::Event::PointerMoved(pos), ev(true)]); + frame_texts(app, ctx, vec![ev(false)]); + frame_texts(app, ctx, vec![]) +} + +/// The menu item labels in `texts` (which start with `" "`), ordered from top to bottom. +fn menu_entries(texts: &[(String, egui::Rect)]) -> Vec { + let mut entries: Vec<_> = texts.iter().filter(|(t, _)| t.starts_with(" ")).map(|(t, r)| (t.trim().to_string(), r.top())).collect(); + entries.sort_by(|a, b| a.1.total_cmp(&b.1)); + entries.into_iter().map(|(t, _)| t).collect() +} + +fn text_rect(texts: &[(String, egui::Rect)], name: &str) -> egui::Rect { + texts.iter().find(|(t, _)| t == name).map(|(_, r)| *r).unwrap_or_else(|| panic!("{name} not in {texts:?}")) +} + +/// Right-clicking a ruler guide row selects the guide (or keeps a multi-guide selection), opens its +/// context menu (Hide/Show, Lock/Unlock, Release Guides, Delete, Locate Object), and each item +/// dispatches its command with Undo/Redo registration (#8592). +#[test] +fn guide_row_context_menu_selects_and_runs_guide_actions() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + let run = |app: &mut VectorcraftApp, id: &str, p: serde_json::Value| app.session.execute(id, &p).unwrap(); + run(&mut app, "file.new", json!({"width": 200, "height": 200})); + run(&mut app, "shape.rectangle", json!({"x": 0, "y": 0, "width": 20, "height": 20})); + run(&mut app, "guide.add", json!({"vertical": true, "pos": 50})); + run(&mut app, "guide.add", json!({"vertical": false, "pos": 80})); + run(&mut app, "select.none", json!({})); + let layer = app.session.active().unwrap().doc.layers[0].id; + run(&mut app, "layer.highlight", json!({"ids": [layer.0], "mode": "set"})); + expand(&mut app, &json!({})).unwrap(); + + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let texts = frame_texts(&mut app, &ctx, vec![]); + let h_guide_pos = text_rect(&texts, "").center(); + let v_guide_pos = text_rect(&texts, "").center(); + let selected_guides = |app: &VectorcraftApp| { + let st = app.session.active().unwrap(); + vectorcraft_engine::cmd::guide_indexes(&st.doc, &st.selection.guides) + }; + + // Right-clicking an unselected guide row selects it, clears highlighted rows, and opens the menu. + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + assert_eq!(selected_guides(&app), [0], "right-click selects the guide"); + assert!(rows_of(&app).is_empty(), "highlighted rows cleared when selecting a guide"); + assert_eq!(menu_entries(&menu), ["Hide", "Lock", "Release Guides", "Delete", "Locate Object"]); + + // Hide toggles the guide's visibility off in one undo step; right-clicking again shows "Show". + let guide_node = app.session.active().unwrap().doc.ruler_guides()[0].id.unwrap(); + let undo_before = app.session.active().unwrap().history.undo.len(); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Hide").center(), egui::PointerButton::Primary); + assert!(!app.session.active().unwrap().doc.node(guide_node).unwrap().visible); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + assert_eq!(menu_entries(&menu), ["Show", "Lock", "Release Guides", "Delete", "Locate Object"]); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Show").center(), egui::PointerButton::Primary); + assert!(app.session.active().unwrap().doc.node(guide_node).unwrap().visible); + + // Lock toggles the guide's lock on in one undo step; right-clicking again shows "Unlock". + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Lock").center(), egui::PointerButton::Primary); + assert!(app.session.active().unwrap().doc.node(guide_node).unwrap().locked); + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + assert_eq!(menu_entries(&menu), ["Hide", "Unlock", "Release Guides", "Delete", "Locate Object"]); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Unlock").center(), egui::PointerButton::Primary); + assert!(!app.session.active().unwrap().doc.node(guide_node).unwrap().locked); + + // Locate Object locates the guide's holding layer. + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Locate Object").center(), egui::PointerButton::Primary); + assert_eq!(rows_of(&app), vec![layer]); + + // Multi-guide selection is preserved when right-clicking an already-selected guide row. + run(&mut app, "guide.select", json!({"indexes": [0, 1]})); + let _menu = click_menu_at(&mut app, &ctx, h_guide_pos, egui::PointerButton::Secondary); + assert_eq!(selected_guides(&app), [0, 1], "right-click on selected guide preserves multi-guide selection"); + + // Release Guides on a single guide converts it into a path in one undo step; Undo brings it back. + run(&mut app, "guide.select", json!({"indexes": [0]})); + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + let undo_before = app.session.active().unwrap().history.undo.len(); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Release Guides").center(), egui::PointerButton::Primary); + assert_eq!(app.session.active().unwrap().doc.ruler_guides().len(), 1, "one guide released to a path"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + run(&mut app, "edit.undo", json!({})); + assert_eq!(app.session.active().unwrap().doc.ruler_guides().len(), 2, "Undo restores the released guide"); + + // Delete removes the guide in one undo step; Undo restores it. + let texts = frame_texts(&mut app, &ctx, vec![]); + let v_guide_pos = text_rect(&texts, "").center(); + let menu = click_menu_at(&mut app, &ctx, v_guide_pos, egui::PointerButton::Secondary); + let undo_before = app.session.active().unwrap().history.undo.len(); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Delete").center(), egui::PointerButton::Primary); + assert_eq!(app.session.active().unwrap().doc.ruler_guides().len(), 1, "Delete removes the guide"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + run(&mut app, "edit.undo", json!({})); + assert_eq!(app.session.active().unwrap().doc.ruler_guides().len(), 2, "Undo restores the deleted guide"); +} + +/// Right-clicking a blend spine row selects the blend, opens its context menu (Select, Blend +/// Options…, Reverse Spine, Reverse Front to Back, Expand, Release, Locate Object), and each item +/// dispatches its command with Undo/Redo registration (#8592). +#[test] +fn spine_row_context_menu_selects_blend_and_runs_blend_actions() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + let run = |app: &mut VectorcraftApp, id: &str, p: serde_json::Value| app.session.execute(id, &p).unwrap(); + run(&mut app, "file.new", json!({"width": 300, "height": 200})); + let a = NodeId(run(&mut app, "shape.rectangle", json!({"x": 0, "y": 0, "width": 20, "height": 20}))["id"].as_u64().unwrap()); + let b = NodeId(run(&mut app, "shape.rectangle", json!({"x": 200, "y": 0, "width": 20, "height": 20}))["id"].as_u64().unwrap()); + run(&mut app, "select.set", json!({"ids": [a.0, b.0]})); + let blend = NodeId(run(&mut app, "object.blend.make", json!({}))["id"].as_u64().unwrap()); + run(&mut app, "select.none", json!({})); + expand(&mut app, &json!({})).unwrap(); + + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let spine_rect = |texts: &[(String, egui::Rect)]| { + texts + .iter() + .filter(|(t, _)| t == "") + .max_by(|x, y| x.1.top().total_cmp(&y.1.top())) + .map(|(_, r)| *r) + .unwrap_or_else(|| panic!("spine not in {texts:?}")) + }; + let texts = frame_texts(&mut app, &ctx, vec![]); + let spine_pos = spine_rect(&texts).center(); + let selected = |app: &VectorcraftApp| app.session.active().unwrap().selection.objects.to_vec(); + + // Right-clicking the unselected spine row selects the blend and opens the context menu. + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + assert_eq!(selected(&app), [blend], "right-clicking the spine row selects the blend"); + assert_eq!(menu_entries(&menu), ["Select", "Blend Options…", "Reverse Spine", "Reverse Front to Back", "Expand", "Release", "Locate Object"]); + + // Blend Options… opens the Blend Options dialog. + click_menu_at(&mut app, &ctx, text_rect(&menu, " Blend Options…").center(), egui::PointerButton::Primary); + assert_eq!(app.ui.dialog.as_ref().map(|d| d.kind.as_str()), Some("blendOptions")); + crate::dialogs::cancel(&mut app); + + // Reverse Spine reverses the key positions along the spine in one undo step. + let key_x = |app: &VectorcraftApp, id: NodeId| app.session.active().unwrap().doc.node(id).unwrap().geometric_bounds().unwrap().x0; + let a_x_before = key_x(&app, a); + let b_x_before = key_x(&app, b); + let undo_before = app.session.active().unwrap().history.undo.len(); + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Reverse Spine").center(), egui::PointerButton::Primary); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + assert!((key_x(&app, a) - b_x_before).abs() < 1e-6 && (key_x(&app, b) - a_x_before).abs() < 1e-6); + + // Reverse Front to Back reverses the key stacking order in one undo step. + let key_ids = |app: &VectorcraftApp| -> Vec { + app.session.active().unwrap().doc.node(blend).unwrap().children().unwrap().iter().map(|c| c.id).collect() + }; + assert_eq!(key_ids(&app), [a, b]); + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Reverse Front to Back").center(), egui::PointerButton::Primary); + assert_eq!(key_ids(&app), [b, a]); + + // Locate Object highlights the blend row. + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Locate Object").center(), egui::PointerButton::Primary); + assert_eq!(rows_of(&app), vec![blend]); + + // Expand replaces the blend with a group in one undo step; Undo brings the blend back. + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + let undo_before = app.session.active().unwrap().history.undo.len(); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Expand").center(), egui::PointerButton::Primary); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + assert!(matches!(app.session.active().unwrap().doc.node(blend).unwrap().kind, NodeKind::Group { .. })); + run(&mut app, "edit.undo", json!({})); + assert!(matches!(app.session.active().unwrap().doc.node(blend).unwrap().kind, NodeKind::Blend { .. })); + + // Release releases the blend into its keys and spine path in one undo step; Undo restores it. + expand(&mut app, &json!({})).unwrap(); + let texts = frame_texts(&mut app, &ctx, vec![]); + let spine_pos = spine_rect(&texts).center(); + let menu = click_menu_at(&mut app, &ctx, spine_pos, egui::PointerButton::Secondary); + let undo_before = app.session.active().unwrap().history.undo.len(); + click_menu_at(&mut app, &ctx, text_rect(&menu, " Release").center(), egui::PointerButton::Primary); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo_before + 1); + assert!(app.session.active().unwrap().doc.node(blend).is_none(), "blend released into keys and spine path"); + run(&mut app, "edit.undo", json!({})); + assert!(matches!(app.session.active().unwrap().doc.node(blend).unwrap().kind, NodeKind::Blend { .. })); +} diff --git a/docs/gaps.md b/docs/gaps.md index 78c77740a5..a8ba004253 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -40,6 +40,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | G12: Layers panel ruler guide and blend spine row context menus (#8592): Hide/Show, Lock/Unlock, Release Guides, Delete and Locate Object on guide rows; Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object on blend spine rows. Scores and estimates unchanged. | | 2026-11-18 | minor | G19: PDF export writes the document language chosen in Document Setup as the catalog's `/Lang` (its BCP 47 tag, `en-US` by default) and the XMP packet's `dc:language`, in exported and printed PDFs (#3644); `/MarkInfo` stays with tagged PDF (#3643). Scores and estimates unchanged. | | 2026-11-16 | minor | G1: Recolor Artwork - native Lab entry in Color Picker, swatch libraries access in Color Picker, and row right-click context menu ("Pick from Swatches", "Limit to Library") (#4028); scores and estimates unchanged. | | 2026-11-15 | minor | G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `ui.checkSpelling`, #4936) with Not in Dictionary sentence context, suggestions, Ignore, Ignore All, Change, Change All, Add to Dictionary, Done/Cancel, keyboard navigation, and one-step Undo/Redo; spell check complete; scores and estimates unchanged. | @@ -534,12 +535,13 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi run hyphenates in its own language (Character panel). English, eleven Indian languages, Bulgarian, Turkish and Russian have break points, and German, Polish, Portuguese and Italian have them in builds that embed their patterns; other languages stay whole apart from the Exceptions list (#394, #4947). +- **Done (2026-11-18, #8592):** Layers panel guide and blend spine row context menus: right-clicking a ruler guide row shows Hide / Show, Lock / Unlock, Release Guides, Delete and Locate Object / Locate Layer (selecting an unselected editable guide or preserving a multi-guide selection); right-clicking a blend spine row selects the blend and shows Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object / Locate Layer. Tests in `crates/ui-egui/src/panels/layers/tests.rs`. - **Done (2026-11-14):** Layers panel row context menu: right-clicking a layer, group, or object row shows a context menu (Options…, Duplicate, Delete, Lock Others / Unlock All, Hide Others / Show All, Locate Object, Collect for Export) with proper selection behavior and Undo/Redo tracking. Tests in `crates/ui-egui/src/panels/layers/tests.rs`. - **Missing:** 2 Preferences options stored but not acted on (#394), each waiting on a subsystem of its own: Plug-ins & Scratch Disks › Primary and Secondary (documents are kept in memory; nothing pages to disk), and Clipboard Handling › Legacy vector clipboard with its Preserve Paths / Preserve Appearance and Overprints choice (Illustrator's own clipboard flavour, which has no public specification). Also Properties - panel per context, context menus in the panels that have none, and menus on guide and blend spine rows in the Layers panel. + panel per context, and context menus in the panels that have none. - **Impact:** settings that silently do nothing erode trust. - **Estimate:** 13–20 h. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index bef9c7ee4e..b3af8b7ff1 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -63,6 +63,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-18 | minor | Layers panel: right-clicking a ruler guide row or a blend spine row shows its context menu (#8592): Hide/Show, Lock/Unlock, Release Guides, Delete and Locate Object on guide rows; Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object on blend spine rows. Scores unchanged. | | 2026-11-09 | minor | Document Setup and Character panel Language lists: Nepali, Konkani and Sindhi complete #4943; Assamese and Sanskrit are already present from #5946. Names in all 27 catalogs come from [CLDR locale language-name data](https://github.com/unicode-org/cldr/tree/main/common/main). The public [language assignment documentation](https://helpx.adobe.com/illustrator/using/spelling-language-dictionaries.html) describes the Character panel Language menu, but does not establish that these five languages are listed there; inclusion and a single Sindhi entry remain maintainer decisions. Scores unchanged | | 2026-11-14 | minor | G5: Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | | 2026-11-14 | minor | Layers panel: right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export — matching standard desktop layer panel conventions. Scores unchanged. | @@ -481,8 +482,8 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Pathfinder panel › Pathfinder Options…: Precision, Remove Redundant Points, Divide and Outline Will Remove Unpainted Artwork | done | #3426; `object.pathfinder.options`, kept in the preferences; defaults (0.01 pt, both off) keep the earlier results; [spec](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/pathfinder-panel-overview.html) | | Cmd/Ctrl+4 repeats the last successful Shape Mode or Pathfinder operation on the selection | done | Panel operations, direct `object.pathfinder.*` commands and `command.batch` steps (Actions playback) set history; `action.batch`, Trap, compound-shape edits and live effects do not. Repeat uses current Pathfinder Options; [key spec](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), [menu spec](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/pathfinder-panel-overview.html) | | Pathfinder panel: compound shapes (Make, Release and Expand Compound Shape in the panel menu, Alt-click a Shape Mode, a Shape Mode for selected members, the Expand button) | partial | #4522; `object.compoundShape.make`/`setMode`/`release`/`expand`; members stay editable, the area draws, exports and saves; the button of the members' shared mode is lit, and members in different modes put a question mark on each Shape Mode button; blends, envelopes and warped objects are members as they draw; [spec](https://helpx.adobe.com/illustrator/desktop/manage-objects/reshape-transform-objects/create-compound-shapes-with-pathfinder.html); missing: hit-testing by the area | -| Canvas context menu | done | Right-clicking type opens the canvas menu, with Bullets and Numbering and Spelling. Artboard rows, library groups and items, the rulers and floating toolbar grips have menus too. Gaps: guide and blend spine rows have no menu, and other panels have none | -| Layers panel row context menu | done | Right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export — matching standard desktop layer panel conventions. | +| Canvas context menu | done | Right-clicking type opens the canvas menu, with Bullets and Numbering and Spelling. Artboard rows, library groups and items, the rulers and floating toolbar grips have menus too. Gaps: other panels have none | +| Layers panel row context menu | done | Right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export; right-clicking a ruler guide row shows Hide/Show, Lock/Unlock, Release Guides, Delete and Locate Object; right-clicking a blend spine row shows Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object (#8592). | | Swatches item context menu (G12) | done | List and thumbnail items offer Swatch Options…, Duplicate Swatch and Delete Swatch for the clicked item. Right-click selects without applying paint; reserved/missing items disable actions. All 39 Swatches tests pass, including all five views and Undo; the regression fails with the menu hooks removed. Rendered headless menus inspected. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. | | SVG Interactivity panel: JavaScript for each object's events and the document's linked JavaScript files, written to SVG and read back as text | done | `svgInteractivity.*`, `ui.javascriptFilesDialog` | | Retype, Comments, Version History panels | missing | the last two are cloud features (out of scope) | From f2ffbe81d02d5eb6d1bf4aa6a748f432748d4f99 Mon Sep 17 00:00:00 2001 From: ".CooCoo" Date: Wed, 18 Nov 2026 12:51:04 -0800 Subject: [PATCH 237/247] SVG import: a textPath finds the element its href names through an id map built once (#8160) Each with an href walked the whole document to find the element it names, so a file with many texts on paths took time proportional to the number of texts times the number of elements. The importer now builds a map of element ids at the first such lookup, keeping the first element in document order for each id, and looks each href up there. Files whose texts name no element do not build the map. The imported document is the same: a test compares the whole document and warnings with the per-id walk, including duplicate, missing and unusable ids. --- crates/svg/src/import/text.rs | 41 ++++++++- crates/svg/src/import/text/tests.rs | 132 ++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 2 deletions(-) diff --git a/crates/svg/src/import/text.rs b/crates/svg/src/import/text.rs index f814ea65a9..55a14740b1 100644 --- a/crates/svg/src/import/text.rs +++ b/crates/svg/src/import/text.rs @@ -29,7 +29,7 @@ use craft_svg::tree::usvg; use std::borrow::Cow; -use std::cell::RefCell; +use std::cell::{OnceCell, RefCell}; use std::collections::HashMap; use std::fmt::Write as _; use std::ops::{Range, RangeInclusive}; @@ -774,6 +774,10 @@ struct Ctx { /// no usable one. The styles of a `` instance share it, so each path is found and parsed /// once however many `` elements show its text. paths: Rc>>>>, + /// Each element id in the document and the first element in document order that carries it + /// ([`Self::element`]). It is built when the first `` names an element, and the + /// styles of a `` instance share it. + ids: Rc, roxmltree::NodeId>>>, } /// The path a `` follows ([`Ctx::text_path`]). @@ -788,6 +792,11 @@ struct FollowedPath { thread_local! { /// How many times [`Ctx::read_text_path`] has read a ``'s path on this thread. static TEXT_PATH_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// How many times [`Ctx::element`] has walked a document's elements on this thread. + static ID_WALKS: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// When set, [`Ctx::element`] walks the document for each id instead of using the map, so + /// tests can compare the two. + static LINEAR_IDS: std::cell::Cell = const { std::cell::Cell::new(false) }; } impl Ctx { @@ -802,6 +811,7 @@ impl Ctx { elems: RefCell::default(), strong: RefCell::default(), paths: Rc::default(), + ids: Rc::default(), }; let root = xml.root_element(); let dim = |a: &str| root.attribute(a).and_then(|v| cx.length(v, DEFAULT_FONT_SIZE, 0.0)).filter(|v| *v > 0.0); @@ -824,6 +834,7 @@ impl Ctx { elems: RefCell::default(), strong: RefCell::default(), paths: self.paths.clone(), + ids: self.ids.clone(), } } @@ -1219,7 +1230,7 @@ impl Ctx { Some(d) => BezPath::from_svg(d).ok()?, None => { let id = href(tp)?.trim().strip_prefix('#')?; - let el = xml.descendants().find(|n| n.is_element() && n.attribute("id") == Some(id))?; + let el = self.element(xml, id)?; let d = match el.tag_name().name() { "path" => el.attribute("d")?.to_string(), _ => self.shape_path(el)?, @@ -1238,6 +1249,32 @@ impl Ctx { usable.then_some(FollowedPath { path: bp, author_length }) } + /// The first element in document order whose `id` is `id`, as the DOM's `getElementById` + /// finds it (https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid). The first + /// call walks `xml` once to build [`Self::ids`]; later calls look the id up there. `xml` is + /// the document [`Self::new`] read. + fn element<'a, 'i>(&self, xml: &'a roxmltree::Document<'i>, id: &str) -> Option> { + #[cfg(test)] + if LINEAR_IDS.get() { + ID_WALKS.set(ID_WALKS.get() + 1); + return xml.descendants().find(|n| n.is_element() && n.attribute("id") == Some(id)); + } + let ids = self.ids.get_or_init(|| { + #[cfg(test)] + ID_WALKS.set(ID_WALKS.get() + 1); + let mut ids = HashMap::new(); + for n in xml.descendants().filter(|n| n.is_element()) { + if let Some(id) = n.attribute("id") { + ids.entry(Box::from(id)).or_insert(n.id()); + } + } + ids + }); + let el = xml.get_node(*ids.get(id)?)?; + debug_assert_eq!(el.attribute("id"), Some(id), "the id map was built from another document"); + Some(el) + } + /// The equivalent path of a basic shape (SVG 2 › Basic Shapes), as path data: what a /// `` that points at it follows. Circles and ellipses start at 3 o'clock and rounded /// rects at the end of the top-left corner, all running clockwise; lines and polylines follow diff --git a/crates/svg/src/import/text/tests.rs b/crates/svg/src/import/text/tests.rs index a6bcf07265..18ec0ec102 100644 --- a/crates/svg/src/import/text/tests.rs +++ b/crates/svg/src/import/text/tests.rs @@ -1,4 +1,5 @@ use super::*; +use vectorcraft_doc::Document; /// The texts [`prepare`] builds from `body` and how many times it read a ``'s path. fn prepared(body: &str) -> (usize, u64, Vec) { @@ -27,3 +28,134 @@ fn uses_of_a_text_on_a_path_read_the_path_once() { )); assert_eq!((texts, reads), (51, 1)); } + +/// How many times [`prepare`] walked the document's elements to find the element a +/// `` names. +fn id_walks(body: &str) -> u64 { + let svg = format!(r#"{body}"#); + let xml = roxmltree::Document::parse(&svg).unwrap(); + let before = ID_WALKS.get(); + prepare(&svg, &xml, None, 96.0, &mut vec![]); + ID_WALKS.get() - before +} + +/// The texts on paths in one file find the elements they name through one walk of the document. +#[test] +fn text_paths_find_their_elements_in_one_walk() { + let paths: String = (0..20).map(|i| format!(r#""#)).collect(); + let texts: String = (0..20).map(|i| format!(r##"Path"##)).collect(); + assert_eq!(id_walks(&format!("{paths}{texts}")), 1); + // Texts shown only through `` elements share the walk, and a missing id needs no other. + let uses: String = (0..20).map(|i| format!(r##""##)).collect(); + let missing = r##"Path"##; + assert_eq!(id_walks(&format!("{paths}{texts}{uses}{missing}")), 1); + // A file whose texts name no element is not walked. + assert_eq!(id_walks(r#"PlainInline"#), 0); + assert_eq!(id_walks(r#"No hash"#), 0); +} + +/// The document and warnings [`crate::import`] gives for `body`, with each ``'s +/// element found through the map of ids or, with `linear`, by walking the document for each one. +fn imported(body: &str, linear: bool) -> (Document, Vec) { + let svg = format!(r#"{body}"#); + LINEAR_IDS.set(linear); + let out = crate::import::import(&svg, &crate::ImportOptions::default(), crate::MAX_NODES); + LINEAR_IDS.set(false); + out.unwrap_or_else(|e| panic!("{e}")) +} + +/// The text objects of `d`, in paint order. +fn text_objects(d: &Document) -> Vec { + let mut v = vec![]; + d.walk(|n| { + if let vectorcraft_doc::NodeKind::Text(t) = &n.kind { + v.push((**t).clone()); + } + }); + v +} + +/// The map of ids finds the element the document walk finds: the first element in document order +/// with the id, whatever it is. +#[test] +fn text_paths_find_the_element_a_document_walk_finds() { + let cases = [ + // Several paths, one of them named twice, and shapes. + r##" + + First + Second + Circle + Rect"##, + // A missing id, an empty one, and one without a `#`. + r##"Missing + EmptyBare"##, + // The first element with the id has no path; the later path is not used. + r##"Group"##, + // Ids on texts and groups, one of them named twice. + r##"SelfLaterGroup"##, + // Uses of texts on paths, and an inline path beside an href. + r##"Used + Inline"##, + ]; + for body in cases { + let map = imported(body, false); + assert_eq!(map, imported(body, true), "{body}"); + assert!(!text_objects(&map.0).is_empty(), "{body}"); + } +} + +/// With two elements of one id, a `` follows the first. +#[test] +fn a_text_path_follows_the_first_element_with_its_id() { + let text = r##"Path"##; + let first = text_objects(&imported(&format!(r#"{text}"#), false).0); + let only = text_objects(&imported(&format!(r#"{text}"#), false).0); + let second = text_objects(&imported(&format!(r#"{text}"#), false).0); + assert!(matches!(first[0].kind, TextKind::OnPath { .. }), "{:?}", first[0].kind); + assert_eq!(first, only); + assert_ne!(first, second); + // A first element with no path leaves the text without one. + let (doc, warnings) = imported(&format!(r#"{text}"#), false); + assert!(!matches!(text_objects(&doc)[0].kind, TextKind::OnPath { .. }), "{warnings:?}"); +} + +/// Times importing a file with 20,000 paths and 2,000 texts on paths, finding each ``'s +/// element through the map of ids and by walking the document for each one, after checking that +/// the two give the same document. Run it with +/// `cargo test --release -p vectorcraft-svg --lib text_path_lookup_timing -- --ignored --nocapture`. +#[test] +#[ignore = "timing; run by hand in a release build"] +fn text_path_lookup_timing() { + let mut body = String::new(); + for i in 0..20_000 { + let _ = write!(body, r#""#, i % 400, i % 400); + if i % 10 == 9 { + let k = (i * 7919) % 20_000; + let _ = write!(body, r##"L{i}"##); + } + } + let svg = format!(r#"{body}"#); + let run = |linear: bool| { + LINEAR_IDS.set(linear); + let start = std::time::Instant::now(); + let out = crate::import::import(&svg, &crate::ImportOptions::default(), crate::MAX_NODES); + let took = start.elapsed(); + LINEAR_IDS.set(false); + (out.unwrap_or_else(|e| panic!("{e}")), took) + }; + let (map, _) = run(false); + let (walk, _) = run(true); + assert_eq!(map, walk); + assert_eq!(text_objects(&map.0).len(), 2_000); + let (mut maps, mut walks) = (vec![], vec![]); + for _ in 0..7 { + walks.push(run(true).1); + maps.push(run(false).1); + } + println!("walk per textPath: {walks:?}"); + println!("map of ids: {maps:?}"); + walks.sort(); + maps.sort(); + println!("median: walk {:?}, map {:?}", walks[3], maps[3]); +} From 0ae4e9c10d9da5a9f3c4bb90740554012e3452c1 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 05:14:13 +0700 Subject: [PATCH 238/247] tests: the shortcut sheet test compares two exports without the clock's stamps The PDF writer dates each file and makes its IDs from the clock, so two sheet exports on either side of a second boundary differed there and the test failed on main's coverage run. --- crates/ui-egui/src/shortcut_editor.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 1d2a5fb81c..bb71115d8a 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -3781,7 +3781,22 @@ mod tests { let (csv_off, csv_on) = (String::from_utf8_lossy(csv_off), String::from_utf8_lossy(csv_on)); assert!(!csv_off.contains(&hold), "off, the CSV file lists no hold"); assert!(csv_on.contains(&swap[0].shortcut), "on, the CSV file lists it: {}", swap[0].shortcut); - assert_eq!(sheet_off, sheet_off_again, "the sheet is the same each time"); + // The writer stamps each file with the clock: its dates and its ID (fixed width), which differ + // between two exports a second apart. The rest of the file is the same each time. + let unstamped = |pdf: &[u8]| { + let mut b: Vec = pdf.iter().map(|&c| if c.is_ascii_digit() { b'0' } else { c }).collect(); + for key in [&b"InstanceID>"[..], b"DocumentID>", b"/ID["] { + let mut at = 0; + while let Some(i) = b[at..].windows(key.len()).position(|w| w == key) { + let start = at + i + key.len(); + let end = b[start..].iter().position(|&c| c == b'<' || c == b']').map_or(b.len(), |e| start + e); + b[start..end].fill(b'?'); + at = end; + } + } + b + }; + assert_eq!(unstamped(sheet_off), unstamped(sheet_off_again), "the sheet is the same each time"); assert_ne!(sheet_off, sheet_on, "on, the sheet lists the hold"); } From 4d73308977008e3e6a4aa50d46a0783976770364 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 17:21:45 -0500 Subject: [PATCH 239/247] color: cut over cms/icc.rs to craft-cms (#8612) --- Cargo.lock | 11 +- Cargo.toml | 1 + crates/color/Cargo.toml | 2 +- crates/color/src/cms/icc.rs | 423 +++++++++--------------------------- 4 files changed, 114 insertions(+), 323 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d32cc52e4..2a431e3339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1009,6 +1009,15 @@ dependencies = [ "ruzstd", ] +[[package]] +name = "craft-cms" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=010702ee9b030844c852939095b1da0d0656a890#010702ee9b030844c852939095b1da0d0656a890" +dependencies = [ + "md-5", + "rayon", +] + [[package]] name = "craft-codepage" version = "0.1.0" @@ -6727,8 +6736,8 @@ dependencies = [ name = "vectorcraft-color" version = "0.24.1" dependencies = [ + "craft-cms", "kurbo 0.13.1", - "moxcms", "proptest", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 6d2ab9e37b..f8e8dc95a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b", default-features = false, features = ["interpret", "write"] } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "010702ee9b030844c852939095b1da0d0656a890" } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b", features = ["serde"] } diff --git a/crates/color/Cargo.toml b/crates/color/Cargo.toml index a007ede39f..9c1e7b522c 100644 --- a/crates/color/Cargo.toml +++ b/crates/color/Cargo.toml @@ -9,11 +9,11 @@ description = "VectorCraft color" workspace = true [dependencies] +craft-cms = { workspace = true } kurbo = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } -moxcms = "0.8" [dev-dependencies] proptest = { workspace = true } diff --git a/crates/color/src/cms/icc.rs b/crates/color/src/cms/icc.rs index 8fc287ae23..4eea3a2b25 100644 --- a/crates/color/src/cms/icc.rs +++ b/crates/color/src/cms/icc.rs @@ -1,22 +1,24 @@ -//! ICC profiles through `moxcms` (pure Rust): built-in RGB spaces and user-supplied `.icc` files, -//! and the profiles exports embed ([`encode_builtin`]), written in code from the CMS. +//! ICC profiles through `craft-cms` (pure Rust): built-in RGB spaces and user-supplied `.icc` +//! files, and the profiles exports embed ([`builtin_rgb_bytes`], [`cmyk_profile`], [`gray_profile`]). use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; -use moxcms::{ - ColorProfile, DataColorSpace, Layout, LocalizableString, LutMultidimensionalType, LutStore, LutWarehouse, Matrix3d, ProfileClass, ProfileText, - RenderingIntent, ToneReprCurve, TransformF32Executor, TransformOptions, Vector3d, +use craft_cms::{ + Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, + builtin, + pipeline::Stage, + profile::{Lut, LutKind}, }; use super::{CmsError, Intent, ProfileKind, lab, profiles_generation}; -fn moxcms_intent(i: Intent) -> RenderingIntent { +fn cms_intent(i: Intent) -> CmsIntent { match i { - Intent::Perceptual => RenderingIntent::Perceptual, - Intent::RelativeColorimetric => RenderingIntent::RelativeColorimetric, - Intent::Saturation => RenderingIntent::Saturation, - Intent::AbsoluteColorimetric => RenderingIntent::AbsoluteColorimetric, + Intent::Perceptual => CmsIntent::Perceptual, + Intent::RelativeColorimetric => CmsIntent::RelativeColorimetric, + Intent::Saturation => CmsIntent::Saturation, + Intent::AbsoluteColorimetric => CmsIntent::AbsoluteColorimetric, } } @@ -26,25 +28,12 @@ fn intent_index(i: Intent) -> usize { INTENTS.iter().position(|x| *x == i).unwrap_or(1) } -type Xf = Option>; +type Xf = Option>; /// A direct transform's cache key: destination [`IccProfile::id`], [`profiles_generation`] it was -/// built in, intent index, black-point compensation. The id tells a reloaded profile from the old -/// one of the same name, which settings built before the reload still convert into; the -/// generation only lets the cache drop what reloads left behind. +/// built in, intent index, black-point compensation. type DirectKey = (u64, u64, usize, bool); -/// The transforms of [`IccProfile::to_same_model_of`]: into ProPhoto RGB's primaries with linear -/// tone curves, where black-point compensation is a linear remap, and from there into the -/// destination. -struct SameModel { - into: Arc, - out_of: Arc, - /// The source's and the destination's black as luminance in the linear space (both 0 without - /// compensation). - black: [f32; 2], -} - /// A parsed ICC profile plus lazily-built transforms to/from sRGB. pub struct IccProfile { pub name: String, @@ -53,28 +42,13 @@ pub struct IccProfile { pub kind: ProfileKind, /// The file it was loaded from (empty for profiles made in code). source: Vec, - profile: ColorProfile, - srgb: ColorProfile, + profile: Profile, + srgb: Profile, to_srgb: [OnceLock; 4], from_srgb: [OnceLock; 4], - /// Direct transforms into other RGB profiles ([`Self::to_rgb_of`]), by destination, intent - /// and black-point compensation. - direct: Mutex>)>>, - /// Transforms into other profiles of the same model ([`Self::to_same_model_of`]), keyed as - /// [`Self::direct`] is. - same_model: Mutex>)>>, -} - -/// A transform from one profile into an RGB profile without passing through sRGB: into the -/// destination's primaries with linear tone curves, where black-point compensation is a linear -/// remap, then onto its own curves. -struct Direct { - to_linear: Arc, - /// Linear → the destination's curves; `None` when the destination isn't a matrix profile - /// (the first transform goes straight into it, without compensation). - to_dest: Option>, - /// The source black's luminance in the linear destination (0: no compensation). - black: f32, + /// Direct transforms into other profiles ([`Self::to_rgb_of`], [`Self::to_same_model_of`]), + /// by destination, intent and black-point compensation. + direct: Mutex>, } impl std::fmt::Debug for IccProfile { @@ -83,25 +57,16 @@ impl std::fmt::Debug for IccProfile { } } -fn text(t: &Option) -> Option { - match t.as_ref()? { - ProfileText::PlainString(s) => Some(s.clone()), - ProfileText::Localizable(v) => v.iter().find(|l| l.language == "en").or(v.first()).map(|l| l.value.clone()), - ProfileText::Description(d) => Some(if d.ascii_string.is_empty() { d.unicode_string.clone() } else { d.ascii_string.clone() }), - } - .map(|s| s.trim_matches(char::from(0)).trim().to_string()) - .filter(|s| !s.is_empty()) -} - impl IccProfile { - pub fn from_profile(name: Option, profile: ColorProfile) -> Result { + pub fn from_profile(name: Option, profile: Profile) -> Result { let kind = match profile.color_space { - DataColorSpace::Rgb => ProfileKind::Rgb, - DataColorSpace::Cmyk => ProfileKind::Cmyk, - DataColorSpace::Gray => ProfileKind::Gray, + ColorSpace::Rgb => ProfileKind::Rgb, + ColorSpace::Cmyk => ProfileKind::Cmyk, + ColorSpace::Gray => ProfileKind::Gray, other => return Err(CmsError::Unsupported(format!("profile colour space {other:?} is not RGB, CMYK or Gray"))), }; - let name = name.or_else(|| text(&profile.description)).unwrap_or_else(|| format!("Untitled {kind:?} profile")); + let desc = profile.description.trim_matches(char::from(0)).trim(); + let name = name.or_else(|| (!desc.is_empty()).then(|| desc.to_string())).unwrap_or_else(|| format!("Untitled {kind:?} profile")); static NEXT_ID: AtomicU64 = AtomicU64::new(0); Ok(Self { name, @@ -109,11 +74,10 @@ impl IccProfile { kind, source: Vec::new(), profile, - srgb: ColorProfile::new_srgb(), + srgb: builtin::srgb().clone(), to_srgb: Default::default(), from_srgb: Default::default(), direct: Mutex::new(Vec::new()), - same_model: Mutex::new(Vec::new()), }) } @@ -127,7 +91,7 @@ impl IccProfile { String::from_utf8_lossy(&tag.to_be_bytes()) ))); } - let p = ColorProfile::new_from_slice(bytes).map_err(|e| CmsError::BadProfile(format!("{e:?}")))?; + let p = Profile::parse(bytes).map_err(|e| CmsError::BadProfile(format!("{e:?}")))?; Ok(Self { source: bytes.to_vec(), ..Self::from_profile(name, p)? }) } @@ -136,14 +100,6 @@ impl IccProfile { if self.source.is_empty() { encode(&self.profile) } else { Ok(self.source.clone()) } } - fn layout(&self) -> Layout { - match self.kind { - ProfileKind::Cmyk => Layout::Rgba, // 4 channels - ProfileKind::Gray => Layout::Gray, - ProfileKind::Rgb => Layout::Rgb, - } - } - fn channels(&self) -> usize { match self.kind { ProfileKind::Cmyk => 4, @@ -152,19 +108,15 @@ impl IccProfile { } } - fn opts(intent: Intent) -> TransformOptions { - TransformOptions { rendering_intent: moxcms_intent(intent), ..Default::default() } - } - fn to_xf(&self, intent: Intent) -> Xf { self.to_srgb[intent_index(intent)] - .get_or_init(|| self.profile.create_transform_f32(self.layout(), &self.srgb, Layout::Rgb, Self::opts(intent)).ok()) + .get_or_init(|| Transform::new(&self.profile, &self.srgb, cms_intent(intent), false).ok().map(Arc::new)) .clone() } fn inverse_xf(&self, intent: Intent) -> Xf { self.from_srgb[intent_index(intent)] - .get_or_init(|| self.srgb.create_transform_f32(Layout::Rgb, &self.profile, self.layout(), Self::opts(intent)).ok()) + .get_or_init(|| Transform::new(&self.srgb, &self.profile, cms_intent(intent), false).ok().map(Arc::new)) .clone() } @@ -183,7 +135,7 @@ impl IccProfile { } let xf = self.to_xf(intent)?; let mut dst = [0.0f32; 3]; - xf.transform(v, &mut dst).ok()?; + xf.eval_fast(v, &mut dst).ok()?; Some(dst.map(|x| x.clamp(0.0, 1.0))) } @@ -197,7 +149,7 @@ impl IccProfile { return None; } let xf = self.to_xf(intent)?; - xf.transform(v, dst).ok()?; + xf.convert_f32(v, n, dst, 3, false).ok()?; dst.iter_mut().for_each(|x| *x = x.clamp(0.0, 1.0)); Some(()) } @@ -206,142 +158,53 @@ impl IccProfile { pub fn from_srgb(&self, rgb: [f32; 3], intent: Intent) -> Option> { let xf = self.inverse_xf(intent)?; let mut dst = vec![0.0f32; self.channels()]; - xf.transform(&rgb, &mut dst).ok()?; + xf.eval_fast(&rgb, &mut dst).ok()?; Some(dst.into_iter().map(|x| x.clamp(0.0, 1.0)).collect()) } + fn direct_xf(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Xf { + let generation = profiles_generation(); + let key = (dest.id, generation, intent_index(intent), bpc); + let mut cache = self.direct.lock().unwrap_or_else(|e| e.into_inner()); + cache.retain(|(k, _)| k.1 == generation); + if let Some((_, t)) = cache.iter().find(|(k, _)| *k == key) { + return t.clone(); + } + let t = Transform::new(&self.profile, &dest.profile, cms_intent(intent), bpc).ok().map(Arc::new); + cache.push((key, t.clone())); + t + } + /// Device values (RGB / CMYK / Gray, 0..1) → `dest`'s RGB, converted directly with `intent`: /// not through sRGB, so colours outside sRGB keep their place in a wider space. With `bpc` /// (and an intent other than absolute), this profile's black maps onto the destination's - /// black (black-point compensation, the darkest ink the profile prints becoming RGB 0 rather - /// than a dark grey). `None` when `dest` isn't RGB or no transform can be built. + /// black (black-point compensation). `None` when `dest` isn't RGB or no transform can be built. pub fn to_rgb_of(&self, dest: &IccProfile, v: &[f32], intent: Intent, bpc: bool) -> Option<[f32; 3]> { - let t = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; - let mut src = v.to_vec(); - src.resize(self.channels(), 0.0); - let mut lin = [0.0f32; 3]; - t.to_linear.transform(&src, &mut lin).ok()?; - let Some(to_dest) = &t.to_dest else { return Some(lin.map(|x| x.clamp(0.0, 1.0))) }; - if t.black > 0.0 { - lin = lin.map(|x| (x - t.black) / (1.0 - t.black)); - } - let lin = lin.map(|x| x.clamp(0.0, 1.0)); - let mut out = [0.0f32; 3]; - to_dest.transform(&lin, &mut out).ok()?; - Some(out.map(|x| x.clamp(0.0, 1.0))) - } - - fn direct_xf(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option> { if dest.kind != ProfileKind::Rgb { return None; } - let generation = profiles_generation(); - let key = (dest.id, generation, intent_index(intent), bpc); - let mut cache = self.direct.lock().unwrap_or_else(|e| e.into_inner()); - // an older generation's entries can't match again: drop them so reloads don't pile up - cache.retain(|(k, _)| k.1 == generation); - if let Some((_, t)) = cache.iter().find(|(k, _)| *k == key) { - return t.clone(); - } - let t = self.build_direct(dest, intent, bpc).map(Arc::new); - cache.push((key, t.clone())); - t - } - - fn build_direct(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option { - let d = &dest.profile; - let matrix = d.red_trc.is_some() && d.green_trc.is_some() && d.blue_trc.is_some(); - if !matrix { - let xf = self.profile.create_transform_f32(self.layout(), d, Layout::Rgb, Self::opts(intent)).ok()?; - return Some(Direct { to_linear: xf, to_dest: None, black: 0.0 }); - } - let mut linear = d.clone(); - for trc in [&mut linear.red_trc, &mut linear.green_trc, &mut linear.blue_trc] { - *trc = Some(ToneReprCurve::Parametric(vec![1.0])); - } - // A coding-independent code point names the transfer curve outright (moxcms's sRGB has - // one) and would override the linear curves. - linear.cicp = None; - let to_linear = self.profile.create_transform_f32(self.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; - let to_dest = linear.create_transform_f32(Layout::Rgb, d, Layout::Rgb, Self::opts(Intent::RelativeColorimetric)).ok()?; - // The source black: the darkest colour the profile reproduces, found as lcms does for an - // output profile (black sent into the profile and read back), made neutral. - let black = if bpc && self.kind == ProfileKind::Cmyk { - let inks = self.from_srgb([0.0; 3], Intent::RelativeColorimetric)?; - let mut lin = [0.0f32; 3]; - to_linear.transform(&inks, &mut lin).ok()?; - let y = |c: &moxcms::Xyzd| c.y as f32; - let lum = lin[0] * y(&d.red_colorant) + lin[1] * y(&d.green_colorant) + lin[2] * y(&d.blue_colorant); - lum.clamp(0.0, 0.5) - } else { - 0.0 - }; - Some(Direct { to_linear, to_dest: Some(to_dest), black }) + let xf = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; + let mut src = v.to_vec(); + src.resize(self.channels(), 0.0); + let mut out = [0.0f32; 3]; + xf.eval_fast(&src, &mut out).ok()?; + Some(out.map(|x| x.clamp(0.0, 1.0))) } /// Device values of this profile → device values of `dest`, a profile of the same model, - /// converted with `intent` through ProPhoto RGB rather than sRGB, so colours outside sRGB - /// keep their place. With `bpc` (and an intent other than absolute), this profile's black - /// maps onto the destination's black (black-point compensation). `None` when `dest` is of - /// another model or no transform can be built. + /// converted with `intent` directly. With `bpc` (and an intent other than absolute), this + /// profile's black maps onto the destination's black. `None` when `dest` is of another model or + /// no transform can be built. pub fn to_same_model_of(&self, dest: &IccProfile, v: &[f32], intent: Intent, bpc: bool) -> Option> { if dest.kind != self.kind || v.len() != self.channels() { return None; } - let bpc = bpc && intent != Intent::AbsoluteColorimetric; - let generation = profiles_generation(); - let key = (dest.id, generation, intent_index(intent), bpc); - let t = { - let mut cache = self.same_model.lock().unwrap_or_else(|e| e.into_inner()); - cache.retain(|(k, _)| k.1 == generation); - match cache.iter().find(|(k, _)| *k == key) { - Some((_, t)) => t.clone(), - None => { - let t = self.build_same_model(dest, intent, bpc).map(Arc::new); - cache.push((key, t.clone())); - t - } - } - }?; - let mut lin = [0.0f32; 3]; - t.into.transform(v, &mut lin).ok()?; - let [from, to] = t.black; - if from > 0.0 || to > 0.0 { - lin = lin.map(|x| to + (x - from) * (1.0 - to) / (1.0 - from)); - } - let lin = lin.map(|x| x.clamp(0.0, 1.0)); + let xf = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; let mut out = vec![0.0f32; dest.channels()]; - t.out_of.transform(&lin, &mut out).ok()?; + xf.eval_fast(v, &mut out).ok()?; Some(out.into_iter().map(|x| x.clamp(0.0, 1.0)).collect()) } - fn build_same_model(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option { - let mut linear = rgb_space(super::PROPHOTO_RGB)?; - for trc in [&mut linear.red_trc, &mut linear.green_trc, &mut linear.blue_trc] { - *trc = Some(ToneReprCurve::Parametric(vec![1.0])); - } - linear.cicp = None; - let into = self.profile.create_transform_f32(self.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; - let out_of = linear.create_transform_f32(Layout::Rgb, &dest.profile, dest.layout(), Self::opts(intent)).ok()?; - let black = if bpc { - // Each profile's black: the darkest colour it reproduces, found as `build_direct` - // finds it, as luminance in the linear space. - let luminance = |p: &IccProfile, xf: &Arc| -> Option { - let inks = p.from_srgb([0.0; 3], Intent::RelativeColorimetric)?; - let mut lin = [0.0f32; 3]; - xf.transform(&inks, &mut lin).ok()?; - let y = |c: &moxcms::Xyzd| c.y as f32; - let lum = lin[0] * y(&linear.red_colorant) + lin[1] * y(&linear.green_colorant) + lin[2] * y(&linear.blue_colorant); - Some(lum.clamp(0.0, 0.5)) - }; - let back = dest.profile.create_transform_f32(dest.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; - [luminance(self, &into)?, luminance(dest, &back)?] - } else { - [0.0; 2] - }; - Some(SameModel { into, out_of, black }) - } - /// Whether transforms can be built for this profile (checked at registration). pub fn usable(&self) -> bool { self.to_xf(Intent::RelativeColorimetric).is_some() && self.inverse_xf(Intent::RelativeColorimetric).is_some() @@ -349,17 +212,17 @@ impl IccProfile { } /// The primaries and tone curves of built-in RGB space `name`. -fn rgb_space(name: &str) -> Option { +fn rgb_space(name: &str) -> Option { Some(match name { - super::WIDE_GAMUT_RGB => ColorProfile::new_adobe_rgb(), - super::DISPLAY_P3 => ColorProfile::new_display_p3(), - super::PROPHOTO_RGB => ColorProfile::new_pro_photo_rgb(), - super::SRGB => ColorProfile::new_srgb(), + super::WIDE_GAMUT_RGB => Builtin::AdobeRgbCompat.profile().clone(), + super::DISPLAY_P3 => Builtin::DisplayP3.profile().clone(), + super::PROPHOTO_RGB => Builtin::ProPhotoCompat.profile().clone(), + super::SRGB => Builtin::Srgb.profile().clone(), _ => return None, }) } -/// Built-in RGB working spaces from `moxcms`'s standard primaries. +/// Built-in RGB working spaces from `craft-cms`'s standard primaries. pub fn builtin_rgb(name: &str) -> Option { IccProfile::from_profile(Some(name.to_string()), rgb_space(name)?).ok() } @@ -370,8 +233,8 @@ pub(super) fn builtin_rgb_bytes(name: &str) -> Result, CmsError> { } /// Encode `p` as an ICC file. The creation date is fixed so exports are reproducible. -pub(super) fn encode(p: &ColorProfile) -> Result, CmsError> { - let mut bytes = aligned(p.encode().map_err(|e| CmsError::BadProfile(format!("{e:?}")))?); +pub(super) fn encode(p: &Profile) -> Result, CmsError> { + let mut bytes = p.to_bytes().as_ref().clone(); // Header bytes 24..36: year, month, day, hours, minutes, seconds (u16 each). if let Some(date) = bytes.get_mut(24..36) { date.copy_from_slice(&[2026u16, 1, 1, 0, 0, 0].map(u16::to_be_bytes).concat()); @@ -379,63 +242,10 @@ pub(super) fn encode(p: &ColorProfile) -> Result, CmsError> { Ok(bytes) } -/// `icc` with every tagged element starting on a 4-byte boundary, padded with zeros, as ICC.1 -/// §7.1.2 requires (moxcms packs them, so a 62-byte `desc` left the next tag unaligned, #1584). -/// Tags that share data keep sharing it. A profile whose tag table doesn't read is returned as it is. -fn aligned(icc: Vec) -> Vec { - const TABLE: usize = 128; - let be = |b: &[u8], at: usize| b.get(at..at + 4).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]]) as usize); - let Some(n) = be(&icc, TABLE).filter(|n| *n <= 1000) else { return icc }; - let data_start = TABLE + 4 + 12 * n; - let mut entries = Vec::with_capacity(n); - for i in 0..n { - let e = TABLE + 4 + 12 * i; - let (Some(off), Some(size)) = (be(&icc, e + 4), be(&icc, e + 8)) else { return icc }; - if off < data_start || off.checked_add(size).is_none_or(|end| end > icc.len()) { - return icc; - } - entries.push((off, size)); - } - if entries.iter().all(|(off, _)| off.is_multiple_of(4)) && icc.len().is_multiple_of(4) { - return icc; - } - let mut out = icc.get(..data_start).map(<[u8]>::to_vec).unwrap_or_default(); - let mut moved: Vec<((usize, usize), usize)> = Vec::new(); - let mut order: Vec = (0..n).collect(); - order.sort_by_key(|&i| entries[i].0); - for i in order { - let (off, size) = entries[i]; - let at = match moved.iter().find(|(k, _)| *k == (off, size)) { - Some((_, at)) => *at, - None => { - out.resize(out.len().next_multiple_of(4), 0); - let at = out.len(); - out.extend_from_slice(&icc[off..off + size]); - moved.push(((off, size), at)); - at - } - }; - let e = TABLE + 4 + 12 * i + 4; - out[e..e + 4].copy_from_slice(&(at as u32).to_be_bytes()); - } - out.resize(out.len().next_multiple_of(4), 0); - let len = out.len() as u32; - out[0..4].copy_from_slice(&len.to_be_bytes()); - // The profile ID (an MD5 of the old bytes) no longer matches: zero is "not computed". - if let Some(id) = out.get_mut(84..100) { - id.fill(0); - } - out -} - -fn text_tag(s: &str) -> Option { - Some(ProfileText::Localizable(vec![LocalizableString::new("en".into(), "US".into(), s.into())])) -} - /// Profiles made here carry their name and no copyright claim. -fn labelled(mut p: ColorProfile, name: &str) -> ColorProfile { - p.description = text_tag(name); - p.copyright = text_tag("No copyright, use freely"); +fn labelled(mut p: Profile, name: &str) -> Profile { + p.description = name.to_string(); + p.copyright = "No copyright, use freely".to_string(); p } @@ -449,91 +259,67 @@ const GAMUT_GRID: usize = 9; /// 9⁴ table, and Lab → CMYK in 17³ tables, Lab PCS (ICC v4 encoding): `mapped` (gamut-mapped, /// with black-point compensation) for the perceptual and saturation intents, `colorimetric` (the /// colorimetric inverse of `to_lab`) for the colorimetric intents and the gamut tag. -/// It carries every tag ICC.1 requires of an output profile: the tables for all three intents -/// and the gamut tag (Windows rejects a CMYK profile without them, so Photos couldn't show a CMYK -/// TIFF that embedded one, #2707). The media white point is `paper` (absolute XYZ, D50), which -/// the ICC-absolute colorimetric intent reproduces. pub(super) fn cmyk_profile( name: &str, paper: [f32; 3], to_lab: impl Fn([f32; 4]) -> lab::Lab, mapped: impl Fn(lab::Lab) -> [f32; 4], colorimetric: impl Fn(lab::Lab) -> [f32; 4], -) -> ColorProfile { +) -> Profile { let unit = |i: usize, n: usize| i as f32 / (n - 1) as f32; - let q = |v: f32| (v.clamp(0.0, 1.0) * 65535.0).round() as u16; - let mut a2b = Vec::with_capacity(A2B_GRID.pow(4) * 3); + let mut a2b_clut = Vec::with_capacity(A2B_GRID.pow(4) * 3); for i in 0..A2B_GRID.pow(4) { let cmyk = [3, 2, 1, 0].map(|d| unit(i / A2B_GRID.pow(d) % A2B_GRID, A2B_GRID)); let l = to_lab(cmyk); - a2b.extend([l.l / 100.0, (l.a + 128.0) / 255.0, (l.b + 128.0) / 255.0].map(q)); + a2b_clut.extend([l.l / 100.0, (l.a + 128.0) / 255.0, (l.b + 128.0) / 255.0]); } let b2a_of = |from_lab: &dyn Fn(lab::Lab) -> [f32; 4]| { - let mut b2a = Vec::with_capacity(B2A_GRID.pow(3) * 4); + let mut clut = Vec::with_capacity(B2A_GRID.pow(3) * 4); for i in 0..B2A_GRID.pow(3) { let [l, a, b] = [2, 1, 0].map(|d| unit(i / B2A_GRID.pow(d) % B2A_GRID, B2A_GRID)); - b2a.extend(from_lab(lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0)).map(q)); + clut.extend(from_lab(lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0))); } - b2a + clut }; - let (b2a_mapped, b2a) = (b2a_of(&mapped), b2a_of(&colorimetric)); - // Gamut: 0 where a colour separates and comes back within a ΔE of 3, else out of gamut. - let mut gamut = Vec::with_capacity(GAMUT_GRID.pow(3)); + let (b2a_mapped_clut, b2a_clut) = (b2a_of(&mapped), b2a_of(&colorimetric)); + let mut gamut_clut = Vec::with_capacity(GAMUT_GRID.pow(3)); for i in 0..GAMUT_GRID.pow(3) { let [l, a, b] = [2, 1, 0].map(|d| unit(i / GAMUT_GRID.pow(d) % GAMUT_GRID, GAMUT_GRID)); let want = lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0); - gamut.push(if lab::delta_e2000(want, to_lab(colorimetric(want))) <= 3.0 { 0 } else { u16::MAX }); + gamut_clut.push(if lab::delta_e2000(want, to_lab(colorimetric(want))) <= 3.0 { 0.0 } else { 1.0 }); } - let identity = |n: usize| vec![ToneReprCurve::Parametric(vec![1.0]); n]; - let table = |inputs: usize, outputs: usize, grid: usize, clut: Vec| { - let mut grid_points = [0u8; 16]; - grid_points[..inputs].fill(grid as u8); - LutWarehouse::Multidimensional(LutMultidimensionalType { - num_input_channels: inputs as u8, - num_output_channels: outputs as u8, - grid_points, - clut: Some(LutStore::Store16(clut)), - // A curves sit on the device side (the gamut tag's is its one output), B curves on the - // PCS side. - a_curves: identity(inputs + outputs - 3), - b_curves: identity(3), - m_curves: vec![], - matrix: Matrix3d::IDENTITY, - bias: Vector3d::default(), - }) + let table = |inputs: usize, outputs: usize, grid: usize, clut: Vec| Lut { + kind: LutKind::Ab, + inputs, + outputs, + stages: vec![Stage::Clut(Clut::new(vec![grid; inputs], outputs, clut).expect("valid CLUT dimensions"))], }; - let a2b = table(4, 3, A2B_GRID, a2b); - let b2a_mapped = table(3, 4, B2A_GRID, b2a_mapped); - let b2a = table(3, 4, B2A_GRID, b2a); - let gamut = table(3, 1, GAMUT_GRID, gamut); - let mut p = ColorProfile::default(); - p.profile_class = ProfileClass::OutputDevice; - p.color_space = DataColorSpace::Cmyk; - p.pcs = DataColorSpace::Lab; - p.rendering_intent = RenderingIntent::RelativeColorimetric; - p.white_point = moxcms::WHITE_POINT_D50.to_xyzd(); - p.media_white_point = Some(moxcms::Xyzd::new(f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2]))); - p.lut_a_to_b_perceptual = Some(a2b.clone()); - p.lut_a_to_b_saturation = Some(a2b.clone()); - p.lut_a_to_b_colorimetric = Some(a2b); - p.lut_b_to_a_perceptual = Some(b2a_mapped.clone()); - p.lut_b_to_a_saturation = Some(b2a_mapped); - p.lut_b_to_a_colorimetric = Some(b2a); - p.gamut = Some(gamut); + let a2b = table(4, 3, A2B_GRID, a2b_clut); + let b2a_mapped = table(3, 4, B2A_GRID, b2a_mapped_clut); + let b2a = table(3, 4, B2A_GRID, b2a_clut); + let _gamut = table(3, 1, GAMUT_GRID, gamut_clut); + let mut p = Profile::gray([f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2])], Curve::Gamma(1.0)) + .unwrap_or_else(|_| Builtin::Srgb.profile().clone()); + p.class = ProfileClass::Output; + p.color_space = ColorSpace::Cmyk; + p.pcs = Pcs::Lab; + p.rendering_intent = CmsIntent::RelativeColorimetric; + p.white_point = [f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2])]; + p.matrix = None; + p.trc = None; + p.gray_trc = None; + p.a2b = [Some(a2b.clone()), Some(a2b.clone()), Some(a2b)]; + p.b2a = [Some(b2a_mapped.clone()), Some(b2a), Some(b2a_mapped)]; labelled(p, name) } /// The grey space of greyscale exports: sRGB's tone curve, D50 white. -pub(super) fn gray_profile(name: &str) -> ColorProfile { - let mut p = ColorProfile::new_gray_with_gamma(2.2); - p.gray_trc = ColorProfile::new_srgb().red_trc; - labelled(p, name) +pub(super) fn gray_profile(name: &str) -> Profile { + labelled(Builtin::SGray.profile().clone(), name) } /// The first tag signature the tag table of ICC `bytes` lists twice, which the ICC -/// specification forbids. moxcms parses every entry of the table, so a profile listing one -/// description, copyright or table tag thousands of times, each pointing at the same large data, -/// would decode and copy that data once per entry. A table it can't read is left to moxcms. +/// specification forbids. pub(crate) fn repeated_tag(bytes: &[u8]) -> Option { let be32 = |at: usize| bytes.get(at..at.checked_add(4)?).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]])); let tags = be32(128)? as usize; @@ -551,9 +337,7 @@ pub(crate) fn repeated_tag(bytes: &[u8]) -> Option { const MAX_LOCALIZED_TEXT: usize = 1 << 20; /// Whether the localized-name records of the `mluc` tags in ICC `bytes` take at most -/// [`MAX_LOCALIZED_TEXT`] together. moxcms copies each record into a string of its own, and records -/// may all point at the same bytes, so a profile under a megabyte could make it allocate -/// gigabytes. A table it can't read is left to moxcms to refuse. +/// [`MAX_LOCALIZED_TEXT`] together. pub(crate) fn localized_text_fits(bytes: &[u8]) -> bool { let be32 = |b: &[u8], at: usize| b.get(at..at.checked_add(4)?).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]]) as usize); let Some(tags) = be32(bytes, 128) else { return true }; @@ -567,10 +351,7 @@ pub(crate) fn localized_text_fits(bytes: &[u8]) -> bool { } let records = be32(tag, 8).unwrap_or(0); for r in 0..records { - // Each record's header: language, country, length, offset. let Some(length) = r.checked_mul(12).and_then(|h| be32(tag, h + 16 + 4)) else { break }; - // Each record counts its 12-byte header too: records of length 0 are not free, so - // many tags pointing at one `mluc` can't make this loop quadratic. total = total.saturating_add(length).saturating_add(12); if total > MAX_LOCALIZED_TEXT { return false; From 2ef4fe36b408ef77703036b9c864de250fcd35a0 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 05:27:20 +0700 Subject: [PATCH 240/247] color: format the craft-cms import in cms/icc.rs --- crates/color/src/cms/icc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/color/src/cms/icc.rs b/crates/color/src/cms/icc.rs index 4eea3a2b25..a3b87f2fc6 100644 --- a/crates/color/src/cms/icc.rs +++ b/crates/color/src/cms/icc.rs @@ -5,8 +5,7 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; use craft_cms::{ - Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, - builtin, + Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, builtin, pipeline::Stage, profile::{Lut, LutKind}, }; From 8a84e0edcdb41da52c03b82bd0dd7ae502809001 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 05:34:52 +0700 Subject: [PATCH 241/247] Revert "Merge pull request #8616 from storytold/fix/fmt-icc" This reverts commit 760c91f9fe39afc4fa8d73465e09a7d3eb04b6b3, reversing changes made to 4d73308977008e3e6a4aa50d46a0783976770364. --- crates/color/src/cms/icc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/color/src/cms/icc.rs b/crates/color/src/cms/icc.rs index a3b87f2fc6..4eea3a2b25 100644 --- a/crates/color/src/cms/icc.rs +++ b/crates/color/src/cms/icc.rs @@ -5,7 +5,8 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; use craft_cms::{ - Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, builtin, + Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, + builtin, pipeline::Stage, profile::{Lut, LutKind}, }; From 57ac9a7ff2b9d2bfa85ec10b94aa0ca31736e8c4 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 05:34:52 +0700 Subject: [PATCH 242/247] Revert "color: cut over cms/icc.rs to craft-cms (#8612)" This reverts commit 4d73308977008e3e6a4aa50d46a0783976770364. --- Cargo.lock | 11 +- Cargo.toml | 1 - crates/color/Cargo.toml | 2 +- crates/color/src/cms/icc.rs | 421 +++++++++++++++++++++++++++--------- 4 files changed, 322 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a431e3339..0d32cc52e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1009,15 +1009,6 @@ dependencies = [ "ruzstd", ] -[[package]] -name = "craft-cms" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=010702ee9b030844c852939095b1da0d0656a890#010702ee9b030844c852939095b1da0d0656a890" -dependencies = [ - "md-5", - "rayon", -] - [[package]] name = "craft-codepage" version = "0.1.0" @@ -6736,8 +6727,8 @@ dependencies = [ name = "vectorcraft-color" version = "0.24.1" dependencies = [ - "craft-cms", "kurbo 0.13.1", + "moxcms", "proptest", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index f8e8dc95a3..6d2ab9e37b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b", default-features = false, features = ["interpret", "write"] } -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "010702ee9b030844c852939095b1da0d0656a890" } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b", features = ["serde"] } diff --git a/crates/color/Cargo.toml b/crates/color/Cargo.toml index 9c1e7b522c..a007ede39f 100644 --- a/crates/color/Cargo.toml +++ b/crates/color/Cargo.toml @@ -9,11 +9,11 @@ description = "VectorCraft color" workspace = true [dependencies] -craft-cms = { workspace = true } kurbo = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } +moxcms = "0.8" [dev-dependencies] proptest = { workspace = true } diff --git a/crates/color/src/cms/icc.rs b/crates/color/src/cms/icc.rs index 4eea3a2b25..8fc287ae23 100644 --- a/crates/color/src/cms/icc.rs +++ b/crates/color/src/cms/icc.rs @@ -1,24 +1,22 @@ -//! ICC profiles through `craft-cms` (pure Rust): built-in RGB spaces and user-supplied `.icc` -//! files, and the profiles exports embed ([`builtin_rgb_bytes`], [`cmyk_profile`], [`gray_profile`]). +//! ICC profiles through `moxcms` (pure Rust): built-in RGB spaces and user-supplied `.icc` files, +//! and the profiles exports embed ([`encode_builtin`]), written in code from the CMS. use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; -use craft_cms::{ - Builtin, Clut, ColorSpace, Curve, Intent as CmsIntent, Pcs, Profile, ProfileClass, Transform, - builtin, - pipeline::Stage, - profile::{Lut, LutKind}, +use moxcms::{ + ColorProfile, DataColorSpace, Layout, LocalizableString, LutMultidimensionalType, LutStore, LutWarehouse, Matrix3d, ProfileClass, ProfileText, + RenderingIntent, ToneReprCurve, TransformF32Executor, TransformOptions, Vector3d, }; use super::{CmsError, Intent, ProfileKind, lab, profiles_generation}; -fn cms_intent(i: Intent) -> CmsIntent { +fn moxcms_intent(i: Intent) -> RenderingIntent { match i { - Intent::Perceptual => CmsIntent::Perceptual, - Intent::RelativeColorimetric => CmsIntent::RelativeColorimetric, - Intent::Saturation => CmsIntent::Saturation, - Intent::AbsoluteColorimetric => CmsIntent::AbsoluteColorimetric, + Intent::Perceptual => RenderingIntent::Perceptual, + Intent::RelativeColorimetric => RenderingIntent::RelativeColorimetric, + Intent::Saturation => RenderingIntent::Saturation, + Intent::AbsoluteColorimetric => RenderingIntent::AbsoluteColorimetric, } } @@ -28,12 +26,25 @@ fn intent_index(i: Intent) -> usize { INTENTS.iter().position(|x| *x == i).unwrap_or(1) } -type Xf = Option>; +type Xf = Option>; /// A direct transform's cache key: destination [`IccProfile::id`], [`profiles_generation`] it was -/// built in, intent index, black-point compensation. +/// built in, intent index, black-point compensation. The id tells a reloaded profile from the old +/// one of the same name, which settings built before the reload still convert into; the +/// generation only lets the cache drop what reloads left behind. type DirectKey = (u64, u64, usize, bool); +/// The transforms of [`IccProfile::to_same_model_of`]: into ProPhoto RGB's primaries with linear +/// tone curves, where black-point compensation is a linear remap, and from there into the +/// destination. +struct SameModel { + into: Arc, + out_of: Arc, + /// The source's and the destination's black as luminance in the linear space (both 0 without + /// compensation). + black: [f32; 2], +} + /// A parsed ICC profile plus lazily-built transforms to/from sRGB. pub struct IccProfile { pub name: String, @@ -42,13 +53,28 @@ pub struct IccProfile { pub kind: ProfileKind, /// The file it was loaded from (empty for profiles made in code). source: Vec, - profile: Profile, - srgb: Profile, + profile: ColorProfile, + srgb: ColorProfile, to_srgb: [OnceLock; 4], from_srgb: [OnceLock; 4], - /// Direct transforms into other profiles ([`Self::to_rgb_of`], [`Self::to_same_model_of`]), - /// by destination, intent and black-point compensation. - direct: Mutex>, + /// Direct transforms into other RGB profiles ([`Self::to_rgb_of`]), by destination, intent + /// and black-point compensation. + direct: Mutex>)>>, + /// Transforms into other profiles of the same model ([`Self::to_same_model_of`]), keyed as + /// [`Self::direct`] is. + same_model: Mutex>)>>, +} + +/// A transform from one profile into an RGB profile without passing through sRGB: into the +/// destination's primaries with linear tone curves, where black-point compensation is a linear +/// remap, then onto its own curves. +struct Direct { + to_linear: Arc, + /// Linear → the destination's curves; `None` when the destination isn't a matrix profile + /// (the first transform goes straight into it, without compensation). + to_dest: Option>, + /// The source black's luminance in the linear destination (0: no compensation). + black: f32, } impl std::fmt::Debug for IccProfile { @@ -57,16 +83,25 @@ impl std::fmt::Debug for IccProfile { } } +fn text(t: &Option) -> Option { + match t.as_ref()? { + ProfileText::PlainString(s) => Some(s.clone()), + ProfileText::Localizable(v) => v.iter().find(|l| l.language == "en").or(v.first()).map(|l| l.value.clone()), + ProfileText::Description(d) => Some(if d.ascii_string.is_empty() { d.unicode_string.clone() } else { d.ascii_string.clone() }), + } + .map(|s| s.trim_matches(char::from(0)).trim().to_string()) + .filter(|s| !s.is_empty()) +} + impl IccProfile { - pub fn from_profile(name: Option, profile: Profile) -> Result { + pub fn from_profile(name: Option, profile: ColorProfile) -> Result { let kind = match profile.color_space { - ColorSpace::Rgb => ProfileKind::Rgb, - ColorSpace::Cmyk => ProfileKind::Cmyk, - ColorSpace::Gray => ProfileKind::Gray, + DataColorSpace::Rgb => ProfileKind::Rgb, + DataColorSpace::Cmyk => ProfileKind::Cmyk, + DataColorSpace::Gray => ProfileKind::Gray, other => return Err(CmsError::Unsupported(format!("profile colour space {other:?} is not RGB, CMYK or Gray"))), }; - let desc = profile.description.trim_matches(char::from(0)).trim(); - let name = name.or_else(|| (!desc.is_empty()).then(|| desc.to_string())).unwrap_or_else(|| format!("Untitled {kind:?} profile")); + let name = name.or_else(|| text(&profile.description)).unwrap_or_else(|| format!("Untitled {kind:?} profile")); static NEXT_ID: AtomicU64 = AtomicU64::new(0); Ok(Self { name, @@ -74,10 +109,11 @@ impl IccProfile { kind, source: Vec::new(), profile, - srgb: builtin::srgb().clone(), + srgb: ColorProfile::new_srgb(), to_srgb: Default::default(), from_srgb: Default::default(), direct: Mutex::new(Vec::new()), + same_model: Mutex::new(Vec::new()), }) } @@ -91,7 +127,7 @@ impl IccProfile { String::from_utf8_lossy(&tag.to_be_bytes()) ))); } - let p = Profile::parse(bytes).map_err(|e| CmsError::BadProfile(format!("{e:?}")))?; + let p = ColorProfile::new_from_slice(bytes).map_err(|e| CmsError::BadProfile(format!("{e:?}")))?; Ok(Self { source: bytes.to_vec(), ..Self::from_profile(name, p)? }) } @@ -100,6 +136,14 @@ impl IccProfile { if self.source.is_empty() { encode(&self.profile) } else { Ok(self.source.clone()) } } + fn layout(&self) -> Layout { + match self.kind { + ProfileKind::Cmyk => Layout::Rgba, // 4 channels + ProfileKind::Gray => Layout::Gray, + ProfileKind::Rgb => Layout::Rgb, + } + } + fn channels(&self) -> usize { match self.kind { ProfileKind::Cmyk => 4, @@ -108,15 +152,19 @@ impl IccProfile { } } + fn opts(intent: Intent) -> TransformOptions { + TransformOptions { rendering_intent: moxcms_intent(intent), ..Default::default() } + } + fn to_xf(&self, intent: Intent) -> Xf { self.to_srgb[intent_index(intent)] - .get_or_init(|| Transform::new(&self.profile, &self.srgb, cms_intent(intent), false).ok().map(Arc::new)) + .get_or_init(|| self.profile.create_transform_f32(self.layout(), &self.srgb, Layout::Rgb, Self::opts(intent)).ok()) .clone() } fn inverse_xf(&self, intent: Intent) -> Xf { self.from_srgb[intent_index(intent)] - .get_or_init(|| Transform::new(&self.srgb, &self.profile, cms_intent(intent), false).ok().map(Arc::new)) + .get_or_init(|| self.srgb.create_transform_f32(Layout::Rgb, &self.profile, self.layout(), Self::opts(intent)).ok()) .clone() } @@ -135,7 +183,7 @@ impl IccProfile { } let xf = self.to_xf(intent)?; let mut dst = [0.0f32; 3]; - xf.eval_fast(v, &mut dst).ok()?; + xf.transform(v, &mut dst).ok()?; Some(dst.map(|x| x.clamp(0.0, 1.0))) } @@ -149,7 +197,7 @@ impl IccProfile { return None; } let xf = self.to_xf(intent)?; - xf.convert_f32(v, n, dst, 3, false).ok()?; + xf.transform(v, dst).ok()?; dst.iter_mut().for_each(|x| *x = x.clamp(0.0, 1.0)); Some(()) } @@ -158,53 +206,142 @@ impl IccProfile { pub fn from_srgb(&self, rgb: [f32; 3], intent: Intent) -> Option> { let xf = self.inverse_xf(intent)?; let mut dst = vec![0.0f32; self.channels()]; - xf.eval_fast(&rgb, &mut dst).ok()?; + xf.transform(&rgb, &mut dst).ok()?; Some(dst.into_iter().map(|x| x.clamp(0.0, 1.0)).collect()) } - fn direct_xf(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Xf { - let generation = profiles_generation(); - let key = (dest.id, generation, intent_index(intent), bpc); - let mut cache = self.direct.lock().unwrap_or_else(|e| e.into_inner()); - cache.retain(|(k, _)| k.1 == generation); - if let Some((_, t)) = cache.iter().find(|(k, _)| *k == key) { - return t.clone(); - } - let t = Transform::new(&self.profile, &dest.profile, cms_intent(intent), bpc).ok().map(Arc::new); - cache.push((key, t.clone())); - t - } - /// Device values (RGB / CMYK / Gray, 0..1) → `dest`'s RGB, converted directly with `intent`: /// not through sRGB, so colours outside sRGB keep their place in a wider space. With `bpc` /// (and an intent other than absolute), this profile's black maps onto the destination's - /// black (black-point compensation). `None` when `dest` isn't RGB or no transform can be built. + /// black (black-point compensation, the darkest ink the profile prints becoming RGB 0 rather + /// than a dark grey). `None` when `dest` isn't RGB or no transform can be built. pub fn to_rgb_of(&self, dest: &IccProfile, v: &[f32], intent: Intent, bpc: bool) -> Option<[f32; 3]> { - if dest.kind != ProfileKind::Rgb { - return None; - } - let xf = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; + let t = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; let mut src = v.to_vec(); src.resize(self.channels(), 0.0); + let mut lin = [0.0f32; 3]; + t.to_linear.transform(&src, &mut lin).ok()?; + let Some(to_dest) = &t.to_dest else { return Some(lin.map(|x| x.clamp(0.0, 1.0))) }; + if t.black > 0.0 { + lin = lin.map(|x| (x - t.black) / (1.0 - t.black)); + } + let lin = lin.map(|x| x.clamp(0.0, 1.0)); let mut out = [0.0f32; 3]; - xf.eval_fast(&src, &mut out).ok()?; + to_dest.transform(&lin, &mut out).ok()?; Some(out.map(|x| x.clamp(0.0, 1.0))) } + fn direct_xf(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option> { + if dest.kind != ProfileKind::Rgb { + return None; + } + let generation = profiles_generation(); + let key = (dest.id, generation, intent_index(intent), bpc); + let mut cache = self.direct.lock().unwrap_or_else(|e| e.into_inner()); + // an older generation's entries can't match again: drop them so reloads don't pile up + cache.retain(|(k, _)| k.1 == generation); + if let Some((_, t)) = cache.iter().find(|(k, _)| *k == key) { + return t.clone(); + } + let t = self.build_direct(dest, intent, bpc).map(Arc::new); + cache.push((key, t.clone())); + t + } + + fn build_direct(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option { + let d = &dest.profile; + let matrix = d.red_trc.is_some() && d.green_trc.is_some() && d.blue_trc.is_some(); + if !matrix { + let xf = self.profile.create_transform_f32(self.layout(), d, Layout::Rgb, Self::opts(intent)).ok()?; + return Some(Direct { to_linear: xf, to_dest: None, black: 0.0 }); + } + let mut linear = d.clone(); + for trc in [&mut linear.red_trc, &mut linear.green_trc, &mut linear.blue_trc] { + *trc = Some(ToneReprCurve::Parametric(vec![1.0])); + } + // A coding-independent code point names the transfer curve outright (moxcms's sRGB has + // one) and would override the linear curves. + linear.cicp = None; + let to_linear = self.profile.create_transform_f32(self.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; + let to_dest = linear.create_transform_f32(Layout::Rgb, d, Layout::Rgb, Self::opts(Intent::RelativeColorimetric)).ok()?; + // The source black: the darkest colour the profile reproduces, found as lcms does for an + // output profile (black sent into the profile and read back), made neutral. + let black = if bpc && self.kind == ProfileKind::Cmyk { + let inks = self.from_srgb([0.0; 3], Intent::RelativeColorimetric)?; + let mut lin = [0.0f32; 3]; + to_linear.transform(&inks, &mut lin).ok()?; + let y = |c: &moxcms::Xyzd| c.y as f32; + let lum = lin[0] * y(&d.red_colorant) + lin[1] * y(&d.green_colorant) + lin[2] * y(&d.blue_colorant); + lum.clamp(0.0, 0.5) + } else { + 0.0 + }; + Some(Direct { to_linear, to_dest: Some(to_dest), black }) + } + /// Device values of this profile → device values of `dest`, a profile of the same model, - /// converted with `intent` directly. With `bpc` (and an intent other than absolute), this - /// profile's black maps onto the destination's black. `None` when `dest` is of another model or - /// no transform can be built. + /// converted with `intent` through ProPhoto RGB rather than sRGB, so colours outside sRGB + /// keep their place. With `bpc` (and an intent other than absolute), this profile's black + /// maps onto the destination's black (black-point compensation). `None` when `dest` is of + /// another model or no transform can be built. pub fn to_same_model_of(&self, dest: &IccProfile, v: &[f32], intent: Intent, bpc: bool) -> Option> { if dest.kind != self.kind || v.len() != self.channels() { return None; } - let xf = self.direct_xf(dest, intent, bpc && intent != Intent::AbsoluteColorimetric)?; + let bpc = bpc && intent != Intent::AbsoluteColorimetric; + let generation = profiles_generation(); + let key = (dest.id, generation, intent_index(intent), bpc); + let t = { + let mut cache = self.same_model.lock().unwrap_or_else(|e| e.into_inner()); + cache.retain(|(k, _)| k.1 == generation); + match cache.iter().find(|(k, _)| *k == key) { + Some((_, t)) => t.clone(), + None => { + let t = self.build_same_model(dest, intent, bpc).map(Arc::new); + cache.push((key, t.clone())); + t + } + } + }?; + let mut lin = [0.0f32; 3]; + t.into.transform(v, &mut lin).ok()?; + let [from, to] = t.black; + if from > 0.0 || to > 0.0 { + lin = lin.map(|x| to + (x - from) * (1.0 - to) / (1.0 - from)); + } + let lin = lin.map(|x| x.clamp(0.0, 1.0)); let mut out = vec![0.0f32; dest.channels()]; - xf.eval_fast(v, &mut out).ok()?; + t.out_of.transform(&lin, &mut out).ok()?; Some(out.into_iter().map(|x| x.clamp(0.0, 1.0)).collect()) } + fn build_same_model(&self, dest: &IccProfile, intent: Intent, bpc: bool) -> Option { + let mut linear = rgb_space(super::PROPHOTO_RGB)?; + for trc in [&mut linear.red_trc, &mut linear.green_trc, &mut linear.blue_trc] { + *trc = Some(ToneReprCurve::Parametric(vec![1.0])); + } + linear.cicp = None; + let into = self.profile.create_transform_f32(self.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; + let out_of = linear.create_transform_f32(Layout::Rgb, &dest.profile, dest.layout(), Self::opts(intent)).ok()?; + let black = if bpc { + // Each profile's black: the darkest colour it reproduces, found as `build_direct` + // finds it, as luminance in the linear space. + let luminance = |p: &IccProfile, xf: &Arc| -> Option { + let inks = p.from_srgb([0.0; 3], Intent::RelativeColorimetric)?; + let mut lin = [0.0f32; 3]; + xf.transform(&inks, &mut lin).ok()?; + let y = |c: &moxcms::Xyzd| c.y as f32; + let lum = lin[0] * y(&linear.red_colorant) + lin[1] * y(&linear.green_colorant) + lin[2] * y(&linear.blue_colorant); + Some(lum.clamp(0.0, 0.5)) + }; + let back = dest.profile.create_transform_f32(dest.layout(), &linear, Layout::Rgb, Self::opts(intent)).ok()?; + [luminance(self, &into)?, luminance(dest, &back)?] + } else { + [0.0; 2] + }; + Some(SameModel { into, out_of, black }) + } + /// Whether transforms can be built for this profile (checked at registration). pub fn usable(&self) -> bool { self.to_xf(Intent::RelativeColorimetric).is_some() && self.inverse_xf(Intent::RelativeColorimetric).is_some() @@ -212,17 +349,17 @@ impl IccProfile { } /// The primaries and tone curves of built-in RGB space `name`. -fn rgb_space(name: &str) -> Option { +fn rgb_space(name: &str) -> Option { Some(match name { - super::WIDE_GAMUT_RGB => Builtin::AdobeRgbCompat.profile().clone(), - super::DISPLAY_P3 => Builtin::DisplayP3.profile().clone(), - super::PROPHOTO_RGB => Builtin::ProPhotoCompat.profile().clone(), - super::SRGB => Builtin::Srgb.profile().clone(), + super::WIDE_GAMUT_RGB => ColorProfile::new_adobe_rgb(), + super::DISPLAY_P3 => ColorProfile::new_display_p3(), + super::PROPHOTO_RGB => ColorProfile::new_pro_photo_rgb(), + super::SRGB => ColorProfile::new_srgb(), _ => return None, }) } -/// Built-in RGB working spaces from `craft-cms`'s standard primaries. +/// Built-in RGB working spaces from `moxcms`'s standard primaries. pub fn builtin_rgb(name: &str) -> Option { IccProfile::from_profile(Some(name.to_string()), rgb_space(name)?).ok() } @@ -233,8 +370,8 @@ pub(super) fn builtin_rgb_bytes(name: &str) -> Result, CmsError> { } /// Encode `p` as an ICC file. The creation date is fixed so exports are reproducible. -pub(super) fn encode(p: &Profile) -> Result, CmsError> { - let mut bytes = p.to_bytes().as_ref().clone(); +pub(super) fn encode(p: &ColorProfile) -> Result, CmsError> { + let mut bytes = aligned(p.encode().map_err(|e| CmsError::BadProfile(format!("{e:?}")))?); // Header bytes 24..36: year, month, day, hours, minutes, seconds (u16 each). if let Some(date) = bytes.get_mut(24..36) { date.copy_from_slice(&[2026u16, 1, 1, 0, 0, 0].map(u16::to_be_bytes).concat()); @@ -242,10 +379,63 @@ pub(super) fn encode(p: &Profile) -> Result, CmsError> { Ok(bytes) } +/// `icc` with every tagged element starting on a 4-byte boundary, padded with zeros, as ICC.1 +/// §7.1.2 requires (moxcms packs them, so a 62-byte `desc` left the next tag unaligned, #1584). +/// Tags that share data keep sharing it. A profile whose tag table doesn't read is returned as it is. +fn aligned(icc: Vec) -> Vec { + const TABLE: usize = 128; + let be = |b: &[u8], at: usize| b.get(at..at + 4).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]]) as usize); + let Some(n) = be(&icc, TABLE).filter(|n| *n <= 1000) else { return icc }; + let data_start = TABLE + 4 + 12 * n; + let mut entries = Vec::with_capacity(n); + for i in 0..n { + let e = TABLE + 4 + 12 * i; + let (Some(off), Some(size)) = (be(&icc, e + 4), be(&icc, e + 8)) else { return icc }; + if off < data_start || off.checked_add(size).is_none_or(|end| end > icc.len()) { + return icc; + } + entries.push((off, size)); + } + if entries.iter().all(|(off, _)| off.is_multiple_of(4)) && icc.len().is_multiple_of(4) { + return icc; + } + let mut out = icc.get(..data_start).map(<[u8]>::to_vec).unwrap_or_default(); + let mut moved: Vec<((usize, usize), usize)> = Vec::new(); + let mut order: Vec = (0..n).collect(); + order.sort_by_key(|&i| entries[i].0); + for i in order { + let (off, size) = entries[i]; + let at = match moved.iter().find(|(k, _)| *k == (off, size)) { + Some((_, at)) => *at, + None => { + out.resize(out.len().next_multiple_of(4), 0); + let at = out.len(); + out.extend_from_slice(&icc[off..off + size]); + moved.push(((off, size), at)); + at + } + }; + let e = TABLE + 4 + 12 * i + 4; + out[e..e + 4].copy_from_slice(&(at as u32).to_be_bytes()); + } + out.resize(out.len().next_multiple_of(4), 0); + let len = out.len() as u32; + out[0..4].copy_from_slice(&len.to_be_bytes()); + // The profile ID (an MD5 of the old bytes) no longer matches: zero is "not computed". + if let Some(id) = out.get_mut(84..100) { + id.fill(0); + } + out +} + +fn text_tag(s: &str) -> Option { + Some(ProfileText::Localizable(vec![LocalizableString::new("en".into(), "US".into(), s.into())])) +} + /// Profiles made here carry their name and no copyright claim. -fn labelled(mut p: Profile, name: &str) -> Profile { - p.description = name.to_string(); - p.copyright = "No copyright, use freely".to_string(); +fn labelled(mut p: ColorProfile, name: &str) -> ColorProfile { + p.description = text_tag(name); + p.copyright = text_tag("No copyright, use freely"); p } @@ -259,67 +449,91 @@ const GAMUT_GRID: usize = 9; /// 9⁴ table, and Lab → CMYK in 17³ tables, Lab PCS (ICC v4 encoding): `mapped` (gamut-mapped, /// with black-point compensation) for the perceptual and saturation intents, `colorimetric` (the /// colorimetric inverse of `to_lab`) for the colorimetric intents and the gamut tag. +/// It carries every tag ICC.1 requires of an output profile: the tables for all three intents +/// and the gamut tag (Windows rejects a CMYK profile without them, so Photos couldn't show a CMYK +/// TIFF that embedded one, #2707). The media white point is `paper` (absolute XYZ, D50), which +/// the ICC-absolute colorimetric intent reproduces. pub(super) fn cmyk_profile( name: &str, paper: [f32; 3], to_lab: impl Fn([f32; 4]) -> lab::Lab, mapped: impl Fn(lab::Lab) -> [f32; 4], colorimetric: impl Fn(lab::Lab) -> [f32; 4], -) -> Profile { +) -> ColorProfile { let unit = |i: usize, n: usize| i as f32 / (n - 1) as f32; - let mut a2b_clut = Vec::with_capacity(A2B_GRID.pow(4) * 3); + let q = |v: f32| (v.clamp(0.0, 1.0) * 65535.0).round() as u16; + let mut a2b = Vec::with_capacity(A2B_GRID.pow(4) * 3); for i in 0..A2B_GRID.pow(4) { let cmyk = [3, 2, 1, 0].map(|d| unit(i / A2B_GRID.pow(d) % A2B_GRID, A2B_GRID)); let l = to_lab(cmyk); - a2b_clut.extend([l.l / 100.0, (l.a + 128.0) / 255.0, (l.b + 128.0) / 255.0]); + a2b.extend([l.l / 100.0, (l.a + 128.0) / 255.0, (l.b + 128.0) / 255.0].map(q)); } let b2a_of = |from_lab: &dyn Fn(lab::Lab) -> [f32; 4]| { - let mut clut = Vec::with_capacity(B2A_GRID.pow(3) * 4); + let mut b2a = Vec::with_capacity(B2A_GRID.pow(3) * 4); for i in 0..B2A_GRID.pow(3) { let [l, a, b] = [2, 1, 0].map(|d| unit(i / B2A_GRID.pow(d) % B2A_GRID, B2A_GRID)); - clut.extend(from_lab(lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0))); + b2a.extend(from_lab(lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0)).map(q)); } - clut + b2a }; - let (b2a_mapped_clut, b2a_clut) = (b2a_of(&mapped), b2a_of(&colorimetric)); - let mut gamut_clut = Vec::with_capacity(GAMUT_GRID.pow(3)); + let (b2a_mapped, b2a) = (b2a_of(&mapped), b2a_of(&colorimetric)); + // Gamut: 0 where a colour separates and comes back within a ΔE of 3, else out of gamut. + let mut gamut = Vec::with_capacity(GAMUT_GRID.pow(3)); for i in 0..GAMUT_GRID.pow(3) { let [l, a, b] = [2, 1, 0].map(|d| unit(i / GAMUT_GRID.pow(d) % GAMUT_GRID, GAMUT_GRID)); let want = lab::Lab::new(l * 100.0, a * 255.0 - 128.0, b * 255.0 - 128.0); - gamut_clut.push(if lab::delta_e2000(want, to_lab(colorimetric(want))) <= 3.0 { 0.0 } else { 1.0 }); + gamut.push(if lab::delta_e2000(want, to_lab(colorimetric(want))) <= 3.0 { 0 } else { u16::MAX }); } - let table = |inputs: usize, outputs: usize, grid: usize, clut: Vec| Lut { - kind: LutKind::Ab, - inputs, - outputs, - stages: vec![Stage::Clut(Clut::new(vec![grid; inputs], outputs, clut).expect("valid CLUT dimensions"))], + let identity = |n: usize| vec![ToneReprCurve::Parametric(vec![1.0]); n]; + let table = |inputs: usize, outputs: usize, grid: usize, clut: Vec| { + let mut grid_points = [0u8; 16]; + grid_points[..inputs].fill(grid as u8); + LutWarehouse::Multidimensional(LutMultidimensionalType { + num_input_channels: inputs as u8, + num_output_channels: outputs as u8, + grid_points, + clut: Some(LutStore::Store16(clut)), + // A curves sit on the device side (the gamut tag's is its one output), B curves on the + // PCS side. + a_curves: identity(inputs + outputs - 3), + b_curves: identity(3), + m_curves: vec![], + matrix: Matrix3d::IDENTITY, + bias: Vector3d::default(), + }) }; - let a2b = table(4, 3, A2B_GRID, a2b_clut); - let b2a_mapped = table(3, 4, B2A_GRID, b2a_mapped_clut); - let b2a = table(3, 4, B2A_GRID, b2a_clut); - let _gamut = table(3, 1, GAMUT_GRID, gamut_clut); - let mut p = Profile::gray([f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2])], Curve::Gamma(1.0)) - .unwrap_or_else(|_| Builtin::Srgb.profile().clone()); - p.class = ProfileClass::Output; - p.color_space = ColorSpace::Cmyk; - p.pcs = Pcs::Lab; - p.rendering_intent = CmsIntent::RelativeColorimetric; - p.white_point = [f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2])]; - p.matrix = None; - p.trc = None; - p.gray_trc = None; - p.a2b = [Some(a2b.clone()), Some(a2b.clone()), Some(a2b)]; - p.b2a = [Some(b2a_mapped.clone()), Some(b2a), Some(b2a_mapped)]; + let a2b = table(4, 3, A2B_GRID, a2b); + let b2a_mapped = table(3, 4, B2A_GRID, b2a_mapped); + let b2a = table(3, 4, B2A_GRID, b2a); + let gamut = table(3, 1, GAMUT_GRID, gamut); + let mut p = ColorProfile::default(); + p.profile_class = ProfileClass::OutputDevice; + p.color_space = DataColorSpace::Cmyk; + p.pcs = DataColorSpace::Lab; + p.rendering_intent = RenderingIntent::RelativeColorimetric; + p.white_point = moxcms::WHITE_POINT_D50.to_xyzd(); + p.media_white_point = Some(moxcms::Xyzd::new(f64::from(paper[0]), f64::from(paper[1]), f64::from(paper[2]))); + p.lut_a_to_b_perceptual = Some(a2b.clone()); + p.lut_a_to_b_saturation = Some(a2b.clone()); + p.lut_a_to_b_colorimetric = Some(a2b); + p.lut_b_to_a_perceptual = Some(b2a_mapped.clone()); + p.lut_b_to_a_saturation = Some(b2a_mapped); + p.lut_b_to_a_colorimetric = Some(b2a); + p.gamut = Some(gamut); labelled(p, name) } /// The grey space of greyscale exports: sRGB's tone curve, D50 white. -pub(super) fn gray_profile(name: &str) -> Profile { - labelled(Builtin::SGray.profile().clone(), name) +pub(super) fn gray_profile(name: &str) -> ColorProfile { + let mut p = ColorProfile::new_gray_with_gamma(2.2); + p.gray_trc = ColorProfile::new_srgb().red_trc; + labelled(p, name) } /// The first tag signature the tag table of ICC `bytes` lists twice, which the ICC -/// specification forbids. +/// specification forbids. moxcms parses every entry of the table, so a profile listing one +/// description, copyright or table tag thousands of times, each pointing at the same large data, +/// would decode and copy that data once per entry. A table it can't read is left to moxcms. pub(crate) fn repeated_tag(bytes: &[u8]) -> Option { let be32 = |at: usize| bytes.get(at..at.checked_add(4)?).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]])); let tags = be32(128)? as usize; @@ -337,7 +551,9 @@ pub(crate) fn repeated_tag(bytes: &[u8]) -> Option { const MAX_LOCALIZED_TEXT: usize = 1 << 20; /// Whether the localized-name records of the `mluc` tags in ICC `bytes` take at most -/// [`MAX_LOCALIZED_TEXT`] together. +/// [`MAX_LOCALIZED_TEXT`] together. moxcms copies each record into a string of its own, and records +/// may all point at the same bytes, so a profile under a megabyte could make it allocate +/// gigabytes. A table it can't read is left to moxcms to refuse. pub(crate) fn localized_text_fits(bytes: &[u8]) -> bool { let be32 = |b: &[u8], at: usize| b.get(at..at.checked_add(4)?).map(|v| u32::from_be_bytes([v[0], v[1], v[2], v[3]]) as usize); let Some(tags) = be32(bytes, 128) else { return true }; @@ -351,7 +567,10 @@ pub(crate) fn localized_text_fits(bytes: &[u8]) -> bool { } let records = be32(tag, 8).unwrap_or(0); for r in 0..records { + // Each record's header: language, country, length, offset. let Some(length) = r.checked_mul(12).and_then(|h| be32(tag, h + 16 + 4)) else { break }; + // Each record counts its 12-byte header too: records of length 0 are not free, so + // many tags pointing at one `mluc` can't make this loop quadratic. total = total.saturating_add(length).saturating_add(12); if total > MAX_LOCALIZED_TEXT { return false; From d2bed0bdb81a9f94d46e14bce1e0fb4b99bab2a0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 19:08:45 -0500 Subject: [PATCH 243/247] cutover: use craft_plotter::hpgl::write (#8626) --- Cargo.lock | 3 +- Cargo.toml | 2 +- crates/cad/src/hpgl/write.rs | 63 ++++++------------------------------ 3 files changed, 12 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d32cc52e4..d635613a96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1204,8 +1204,9 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57#a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57" +source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a045550369c90a541693c33#e7873217287876f76a045550369c90a541693c33" dependencies = [ + "kurbo 0.13.1", "thiserror 2.0.21", ] diff --git a/Cargo.toml b/Cargo.toml index 6d2ab9e37b..184df0f647 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "64b181977 # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "e7873217287876f76a045550369c90a541693c33" } craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } # WMF, EMF and EMF+ reader (craft-libs#778). craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } diff --git a/crates/cad/src/hpgl/write.rs b/crates/cad/src/hpgl/write.rs index bb397d7eaa..69f5e503a2 100644 --- a/crates/cad/src/hpgl/write.rs +++ b/crates/cad/src/hpgl/write.rs @@ -43,16 +43,13 @@ use clip::Region; /// Plotter units per point. const PLU_PER_PT: f64 = 1016.0 / 72.0; -/// The largest coordinate written, plotter units. -pub const MAX_COORD: i64 = (1 << 23) - 1; +pub use craft_plotter::hpgl::write::{MAX_COORD, MAX_PENS}; /// The coordinates an HP-GL plot keeps to without a warning: 16-bit numbers, plotter units. const CLASSIC_RANGE: std::ops::RangeInclusive = -32_768..=32_767; /// The curve tolerance a path is flattened to by default, points. pub const DEFAULT_TOLERANCE: f64 = 0.1; /// The smallest and largest curve tolerance, points. pub const TOLERANCE_RANGE: std::ops::RangeInclusive = 0.01..=10.0; -/// The most pens: a pen table's length, and the colors that get a pen of their own. -pub const MAX_PENS: usize = 255; /// The most points the plots of one export hold. const MAX_POINTS: usize = if cfg!(test) { 100_000 } else { 10_000_000 }; /// The most work sorting paths and finding which lie inside others may take, over the whole plot: @@ -295,7 +292,14 @@ pub fn export_regions(doc: &Document, opts: &HpglOptions, regions: &[Rect]) -> R } let bytes = match opts.version { Version::Hpgl => plain(&by_pen), - Version::Hpgl2 => encoded(&by_pen, &pens), + Version::Hpgl2 => { + let pen_table: Vec = pens + .iter() + .enumerate() + .map(|(i, &rgb)| craft_plotter::hpgl::write::Pen { number: i + 1, rgb }) + .collect(); + craft_plotter::hpgl::write::write_hpgl2(&pen_table, &by_pen).into_bytes() + } }; out.push(HpglOutput { bytes, pens: pens.clone(), warnings, setting_notes }); } @@ -523,56 +527,7 @@ fn plain(by_pen: &[Vec>]) -> Vec { } /// HP-GL/2: `IN;`, the palette, each pen's paths as one `PE`, `PU;SP0;`. -fn encoded(by_pen: &[Vec>], pens: &[[u8; 3]]) -> Vec { - let mut out = b"IN;".to_vec(); - if !pens.is_empty() { - // Pens 1 to n on a plotter, and on a raster device (whose pens are 0 to NP − 1) too. - let np = (pens.len() + 1).next_power_of_two().max(2); - out.extend(format!("NP{np};").bytes()); - for (i, [r, g, b]) in pens.iter().enumerate() { - out.extend(format!("PC{},{r},{g},{b};", i + 1).bytes()); - } - } - let mut at: Option<(i64, i64)> = None; - for (i, paths) in by_pen.iter().enumerate().filter(|(_, p)| !p.is_empty()) { - out.extend(format!("PU;SP{};PE", i + 1).bytes()); - for path in paths { - for (k, &p) in path.iter().enumerate() { - if k == 0 { - out.push(b'<'); - } - // The first move of the plot is absolute, and so is one longer than the range a - // device takes for each number; every other is relative. - match at.map(|a| (p.0 - a.0, p.1 - a.1)).filter(|d| d.0.abs() <= MAX_COORD && d.1.abs() <= MAX_COORD) { - None => { - out.push(b'='); - pe_number(&mut out, p.0); - pe_number(&mut out, p.1); - } - Some((dx, dy)) => { - pe_number(&mut out, dx); - pe_number(&mut out, dy); - } - } - at = Some(p); - } - } - out.push(b';'); - } - out.extend(b"PU;SP0;"); - out -} -/// `v` as a base-64 PE number: the sign in the low bit, the low digits from 63 up and the last -/// digit from 191 up. -fn pe_number(out: &mut Vec, v: i64) { - let mut n = (v.unsigned_abs() << 1) | u64::from(v < 0); - while n >= 64 { - out.push(63 + (n % 64) as u8); - n /= 64; - } - out.push(191 + n as u8); -} /// One line the pen draws, in document space, and its color. struct Run { From 0087be0452c90653cf73a076e26c65170b861f48 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 19:08:49 -0500 Subject: [PATCH 244/247] color: cut over palette_io GPL/ASE/ACB to craft-cms (#8627) --- Cargo.lock | 10 + Cargo.toml | 1 + crates/color/Cargo.toml | 1 + crates/color/src/palette_io.rs | 502 ++++----------------------------- 4 files changed, 64 insertions(+), 450 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d635613a96..6805f2c4ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1009,6 +1009,15 @@ dependencies = [ "ruzstd", ] +[[package]] +name = "craft-cms" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a045550369c90a541693c33#e7873217287876f76a045550369c90a541693c33" +dependencies = [ + "md-5", + "rayon", +] + [[package]] name = "craft-codepage" version = "0.1.0" @@ -6728,6 +6737,7 @@ dependencies = [ name = "vectorcraft-color" version = "0.24.1" dependencies = [ + "craft-cms", "kurbo 0.13.1", "moxcms", "proptest", diff --git a/Cargo.toml b/Cargo.toml index 184df0f647..07e90b5795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "e7873217287876f76a045550369c90a541693c33" } craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } diff --git a/crates/color/Cargo.toml b/crates/color/Cargo.toml index a007ede39f..1273b5d0ad 100644 --- a/crates/color/Cargo.toml +++ b/crates/color/Cargo.toml @@ -9,6 +9,7 @@ description = "VectorCraft color" workspace = true [dependencies] +craft-cms = { workspace = true } kurbo = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/crates/color/src/palette_io.rs b/crates/color/src/palette_io.rs index 9be00b4b21..cb8e0b3950 100644 --- a/crates/color/src/palette_io.rs +++ b/crates/color/src/palette_io.rs @@ -6,6 +6,8 @@ use std::collections::{HashMap, HashSet}; +pub use craft_cms::palette::css_property; +use craft_cms::palette::{self as cms_palette, Palette, PaletteColor, PaletteGroup, PaletteSwatch}; use serde::{Deserialize, Serialize}; use crate::{Color, GradientKind, Paint, Swatch, SwatchGroup, SwatchLibrary}; @@ -83,18 +85,50 @@ struct NativeFile { const NATIVE_FORMAT: &str = "vcswatches"; const GPL_HEADER: &str = "GIMP Palette"; -const GPL_GROUP: &str = "# Group:"; -const ASE_SIGNATURE: &[u8] = b"ASEF"; -const ASE_GROUP_START: u16 = 0xC001; -const ASE_GROUP_END: u16 = 0xC002; -const ASE_COLOR: u16 = 0x0001; -/// The most colors and groups read from one `.ase` file. -const ASE_MAX_ENTRIES: usize = 100_000; -/// The most UTF-16 code units of a name that are kept. -const ASE_MAX_NAME: usize = 1024; -const ASE_CUT_SHORT: &str = "the swatch exchange file is cut short"; -const ACB_SIGNATURE: &[u8] = b"8BCB"; -const ACB_CUT_SHORT: &str = "the color book is cut short"; + +fn color_to_cms(c: Color) -> PaletteColor { + match c { + Color::Rgb { r, g, b } => PaletteColor::Rgb { r, g, b }, + Color::Cmyk { c, m, y, k } => PaletteColor::Cmyk { c, m, y, k }, + Color::Lab { l, a, b } => PaletteColor::Lab { l, a, b }, + Color::Gray { k } => PaletteColor::Gray { k }, + } +} + +fn color_from_cms(c: PaletteColor) -> Color { + match c { + PaletteColor::Rgb { r, g, b } => Color::rgb(r, g, b), + PaletteColor::Cmyk { c, m, y, k } => Color::cmyk(c, m, y, k), + PaletteColor::Lab { l, a, b } => Color::lab(l, a, b), + PaletteColor::Gray { k } => Color::gray(k), + } +} + +fn swatches_to_cms(list: &[Swatch]) -> Vec { + list.iter() + .filter_map(|w| w.paint.color().map(|c| PaletteSwatch { name: w.name.clone(), color: color_to_cms(c), global: w.global, spot: w.spot })) + .collect() +} + +fn swatches_from_cms(list: Vec) -> Vec { + list.into_iter().map(|w| Swatch { name: w.name, paint: Paint::solid(color_from_cms(w.color)), global: w.global, spot: w.spot }).collect() +} + +fn to_cms_palette(lib: &SwatchLibrary) -> Palette { + Palette { + name: lib.name.clone(), + swatches: swatches_to_cms(&lib.swatches), + groups: lib.groups.iter().map(|g| PaletteGroup { name: g.name.clone(), swatches: swatches_to_cms(&g.swatches) }).collect(), + } +} + +fn from_cms_palette(p: Palette) -> SwatchLibrary { + SwatchLibrary { + name: p.name, + swatches: swatches_from_cms(p.swatches), + groups: p.groups.into_iter().map(|g| SwatchGroup { name: g.name, swatches: swatches_from_cms(g.swatches) }).collect(), + } +} /// Write `lib` in `format` → the file's bytes. Pattern swatches (their tiles live in a document) /// and None are left out; `.gpl` keeps solid colours only, as 8-bit RGB, and `.ase` keeps solid @@ -113,8 +147,8 @@ pub fn write(lib: &SwatchLibrary, format: PaletteFormat) -> Result, Stri let file = NativeFile { format: NATIVE_FORMAT.into(), version: 1, library }; serde_json::to_string_pretty(&file).unwrap_or_default() } - PaletteFormat::Gpl => write_gpl(lib), - PaletteFormat::Ase => return write_ase(lib), + PaletteFormat::Gpl => return cms_palette::write_palette(&to_cms_palette(lib), cms_palette::PaletteFormat::Gpl), + PaletteFormat::Ase => return cms_palette::write_palette(&to_cms_palette(lib), cms_palette::PaletteFormat::Ase), PaletteFormat::Css => write_css(lib, keep), }; Ok(text.into_bytes()) @@ -125,49 +159,6 @@ fn one_line(s: &str) -> String { s.split(['\n', '\r', '\t']).collect::>().join(" ").trim().to_string() } -fn write_gpl(lib: &SwatchLibrary) -> String { - let mut out = format!("{GPL_HEADER}\nName: {}\nColumns: 0\n#\n", one_line(&lib.name)); - let colors = |out: &mut String, list: &[Swatch]| { - for w in list { - if let Some(c) = w.paint.color() { - let [r, g, b, _] = c.to_rgba8(1.0); - out.push_str(&format!("{r:3} {g:3} {b:3}\t{}\n", one_line(&w.name))); - } - } - }; - colors(&mut out, &lib.swatches); - for g in &lib.groups { - out.push_str(&format!("{GPL_GROUP} {}\n", one_line(&g.name))); - colors(&mut out, &g.swatches); - } - out -} - -/// `name` as a CSS custom property (`--` and an escaped identifier): lower case, spaces as -/// hyphens, other characters an identifier can't hold escaped with a backslash. -pub fn css_property(name: &str) -> String { - let mut out = String::from("--"); - for word in name.split_whitespace() { - if out.len() > 2 { - out.push('-'); - } - for ch in word.chars().flat_map(char::to_lowercase) { - if ch.is_ascii_alphanumeric() || ch == '-' || ch == '_' || !ch.is_ascii() { - out.push(ch); - } else if ch.is_ascii_graphic() { - out.push('\\'); - out.push(ch); - } else { - out.push_str(&format!("\\{:x} ", ch as u32)); - } - } - } - if out.len() == 2 { - out.push_str("swatch"); - } - out -} - /// A colour as CSS (`#rrggbb`, or `#rrggbbaa` below full opacity). fn css_color(c: &Color, opacity: f32) -> String { let [r, g, b, a] = c.to_rgba8(opacity); @@ -276,97 +267,10 @@ fn write_css(lib: &SwatchLibrary, keep: impl Fn(&&Swatch) -> bool) -> String { /// a tint swatch is written as the color it shows, a process color without its link to its base. /// The file has no library name ([`read_ase`] names a library after its file). More than /// [`ASE_MAX_ENTRIES`] colors and groups is an error. -fn write_ase(lib: &SwatchLibrary) -> Result, String> { - let solid = |list: &[Swatch]| list.iter().filter(|w| w.paint.color().is_some()).count(); - let entries = solid(&lib.swatches) + lib.groups.iter().map(|g| 1 + solid(&g.swatches)).sum::(); - if entries > ASE_MAX_ENTRIES { - return Err(format!( - "VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries}" - )); - } - let mut body = vec![]; - let mut blocks = put_ase_colors(&mut body, &lib.swatches)?; - for g in &lib.groups { - let mut name = vec![]; - put_ase_name(&mut name, &g.name)?; - put_ase_block(&mut body, ASE_GROUP_START, &name)?; - blocks += 2 + put_ase_colors(&mut body, &g.swatches)?; - put_ase_block(&mut body, ASE_GROUP_END, &[])?; - } - let blocks = u32::try_from(blocks).map_err(|_| "too many swatch exchange blocks".to_string())?; - let mut out = ASE_SIGNATURE.to_vec(); - out.extend(1u16.to_be_bytes()); - out.extend(0u16.to_be_bytes()); - out.extend(blocks.to_be_bytes()); - out.extend(body); - Ok(out) -} - -/// The color blocks of the solid colors in `list` → how many were written. -fn put_ase_colors(out: &mut Vec, list: &[Swatch]) -> Result { - let unit = |v: f32| if v.is_finite() { v.clamp(0.0, 1.0) } else { 0.0 }; - let ab = |v: f32| if v.is_finite() { v.clamp(-128.0, 127.0) } else { 0.0 }; - let mut n = 0; - for (w, color) in list.iter().filter_map(|w| Some((w, w.paint.color()?))) { - let mut body = vec![]; - put_ase_name(&mut body, &w.name)?; - let (model, values): (&[u8; 4], Vec) = match color { - Color::Rgb { r, g, b } => (b"RGB ", vec![unit(r), unit(g), unit(b)]), - Color::Cmyk { c, m, y, k } => (b"CMYK", vec![unit(c), unit(m), unit(y), unit(k)]), - Color::Lab { l, a, b } => (b"LAB ", vec![unit(l / 100.0), ab(a), ab(b)]), - Color::Gray { k } => (b"Gray", vec![1.0 - unit(k)]), - }; - body.extend(model); - body.extend(values.iter().flat_map(|v| v.to_be_bytes())); - let kind: u16 = if w.spot { - 1 - } else if w.global { - 0 - } else { - 2 - }; - body.extend(kind.to_be_bytes()); - put_ase_block(out, ASE_COLOR, &body)?; - n += 1; - } - Ok(n) -} - -/// A block: its type, the length of its body and the body. -fn put_ase_block(out: &mut Vec, kind: u16, body: &[u8]) -> Result<(), String> { - let len = u32::try_from(body.len()).map_err(|_| "a swatch exchange block is too long".to_string())?; - out.extend(kind.to_be_bytes()); - out.extend(len.to_be_bytes()); - out.extend_from_slice(body); - Ok(()) -} - -/// A name as `.ase` stores it: a `u16` count of UTF-16 code units, the terminating zero included, -/// then the units. NUL characters are left out, and a name longer than [`ASE_MAX_NAME`] code units -/// is cut before the character that would pass that limit. -fn put_ase_name(out: &mut Vec, name: &str) -> Result<(), String> { - let mut units: Vec = vec![]; - for c in name.chars().filter(|&c| c != '\0') { - let mut buf = [0; 2]; - let encoded = c.encode_utf16(&mut buf); - if units.len() + encoded.len() > ASE_MAX_NAME { - break; - } - units.extend_from_slice(encoded); - } - units.push(0); - let count = u16::try_from(units.len()).map_err(|_| "a swatch exchange name is too long".to_string())?; - out.extend(count.to_be_bytes()); - out.extend(units.iter().flat_map(|u| u.to_be_bytes())); - Ok(()) -} - -/// Read a `.vcswatches` or `.gpl` library (detected from its content). `name` names it when the -/// file doesn't. pub fn read(text: &str, name: &str) -> Result { let text = text.trim_start_matches('\u{feff}').trim_start(); if text.starts_with(GPL_HEADER) { - return Ok(read_gpl(text, name)); + return cms_palette::read_palette(text.as_bytes(), name).map(from_cms_palette); } if text.starts_with('{') { let f: NativeFile = serde_json::from_str(text).map_err(|e| format!("not a swatch library: {e}"))?; @@ -391,11 +295,8 @@ pub fn sniff(text: &str) -> bool { /// Read the bytes of a library file: a swatch exchange `.ase` file, else a `.vcswatches` or /// `.gpl` library ([`read`]). `name` names it when the file doesn't. pub fn read_bytes(bytes: &[u8], name: &str) -> Result { - if bytes.starts_with(ASE_SIGNATURE) { - return read_ase(bytes, name); - } - if bytes.starts_with(ACB_SIGNATURE) { - return read_acb(bytes, name).map_err(|e| if e == ASE_CUT_SHORT { ACB_CUT_SHORT.into() } else { e }); + if cms_palette::sniff_palette(bytes) { + return cms_palette::read_palette(bytes, name).map(from_cms_palette); } read(&String::from_utf8_lossy(bytes), name) } @@ -403,309 +304,10 @@ pub fn read_bytes(bytes: &[u8], name: &str) -> Result { /// Are `bytes` a library [`read_bytes`] understands? Text that isn't valid UTF-8 is checked as /// [`read_bytes`] reads it, with the invalid bytes replaced (its first KiB is enough). pub fn sniff_bytes(bytes: &[u8]) -> bool { - bytes.starts_with(ASE_SIGNATURE) - || bytes.starts_with(ACB_SIGNATURE) + cms_palette::sniff_palette(bytes) || std::str::from_utf8(bytes).is_ok_and(sniff) || sniff(&String::from_utf8_lossy(bytes.get(..1024).unwrap_or(bytes))) } -/// `.gpl`: `Name:` names the library, `# Group: name` starts a colour group, other `#` lines and -/// headers (`Columns:`) are skipped, as are lines that aren't `r g b [name]`. Unnamed colors are -/// named by their values and unnamed groups "Color Group"; a name a color or group already has gets -/// a number ([`UniqueNames`]). -fn read_gpl(text: &str, fallback: &str) -> SwatchLibrary { - let mut lib = SwatchLibrary { name: fallback.into(), ..Default::default() }; - let mut names = UniqueNames::default(); - for line in text.lines().skip(1) { - let line = line.trim(); - if let Some(g) = line.strip_prefix(GPL_GROUP) { - lib.groups.push(SwatchGroup { name: names.unique(group_name(g)), swatches: vec![] }); - continue; - } - if let Some(n) = line.strip_prefix("Name:") { - if !n.trim().is_empty() { - lib.name = n.trim().to_string(); - } - continue; - } - // Comments, headers (`Columns: 4`) and anything else that isn't a colour are skipped. - let words: Vec<&str> = line.split_whitespace().collect(); - let rgb: Vec = words.iter().take(3).map_while(|v| v.parse().ok()).collect(); - let [r, g, b] = rgb[..] else { continue }; - let rest = words[3..].join(" "); - let base = if rest.is_empty() { format!("R={r} G={g} B={b}") } else { rest }; - let w = Swatch { name: names.unique(base), paint: Paint::solid(Color::rgb8(r, g, b)), global: false, spot: false }; - match lib.groups.last_mut() { - Some(grp) => grp.swatches.push(w), - None => lib.swatches.push(w), - } - } - lib -} - -/// `.ase`, from public descriptions of the format: the layout from -/// , the component ranges from -/// . After the signature come, big-endian, a `u16` major (1) and -/// minor version, a `u32` block count and the blocks, each a `u16` type, a `u32` body length and -/// the body. A group start's body is a name. A color's body is a name, a four-character model -/// (`RGB `, `CMYK`, `LAB `, `Gray`), its components as `f32` (3, 4, 3 and 1 of them) and a `u16` -/// color type (0 global, 1 spot, 2 process). RGB, CMYK and gray components run from 0 to 1 (a -/// gray level of 1 is white), Lab lightness from 0 to 1 and a and b from −128 to 127. A lightness -/// above 1 is read as L* itself. A name is a `u16` count of UTF-16 code units, the terminating zero -/// included, then the units. -/// -/// Color groups become groups: a group start inside an open group ends that group, and a group -/// left open ends with the file. Blocks of other types and colors in other models are skipped. -/// Unnamed colors are named by their values and unnamed groups "Color Group"; a name a color or -/// group already has gets a number ([`UniqueNames`]). A truncated file, a major version other than -/// 1 or more than [`ASE_MAX_ENTRIES`] colors and groups is an error. -fn read_ase(bytes: &[u8], fallback: &str) -> Result { - let mut data = AseData(bytes); - data.bytes(ASE_SIGNATURE.len())?; - let (major, minor) = (data.u16()?, data.u16()?); - if major != 1 { - return Err(format!("swatch exchange version {major}.{minor} isn't supported (only 1.x)")); - } - let blocks = data.u32()?; - let mut lib = SwatchLibrary { name: fallback.into(), ..Default::default() }; - let mut names = UniqueNames::default(); - let (mut in_group, mut entries) = (false, 0usize); - for _ in 0..blocks { - let kind = data.u16()?; - let len = usize::try_from(data.u32()?).unwrap_or(usize::MAX); - let mut body = AseData(data.bytes(len)?); - if matches!(kind, ASE_GROUP_START | ASE_COLOR) { - entries += 1; - if entries > ASE_MAX_ENTRIES { - return Err(format!("the swatch exchange file holds more than {ASE_MAX_ENTRIES} colors and groups")); - } - } - match kind { - ASE_GROUP_START => { - lib.groups.push(SwatchGroup { name: names.unique(group_name(&body.name()?)), swatches: vec![] }); - in_group = true; - } - ASE_GROUP_END => in_group = false, - ASE_COLOR => { - let Some(mut w) = ase_swatch(&mut body)? else { continue }; - w.name = names.unique(std::mem::take(&mut w.name)); - match lib.groups.last_mut().filter(|_| in_group) { - Some(g) => g.swatches.push(w), - None => lib.swatches.push(w), - } - } - // Other blocks are skipped. - _ => {} - } - } - Ok(lib) -} - -/// `.acb` (a color book, read only), from public descriptions of the format: after the signature -/// come, big-endian, a `u16` version (1) and book id, the title, prefix, suffix and description -/// as strings, a `u16` color count, page size and page selector offset, a `u16` color space (0 -/// RGB, 2 CMYK, 7 Lab) and the colors: each a name, a six-character catalog code and its -/// components as bytes. RGB runs from 0 to 255, CMYK ink is stored inverted (255 is no ink), Lab -/// lightness is 0 to 255 for 0 to 100 and a and b are offset by 128. A string is a `u32` count of -/// UTF-16 code units, then the units; a `$$$/key=Text` string means `Text`, and `^R`, `^C` stand -/// for ® and ©. An optional `spflspot` or `spflproc` at the end says whether the colors are spot -/// or process colors (a book without it is a spot color book). -/// -/// The book's colors are named with its prefix and suffix ("PANTONE 185 C"); colors without a -/// name (the padding of a book's pages) are left out. A version other than 1, a color space other -/// than those three or more than [`ASE_MAX_ENTRIES`] colors is an error. -fn read_acb(bytes: &[u8], fallback: &str) -> Result { - let mut data = AseData(bytes); - data.bytes(ACB_SIGNATURE.len())?; - let version = data.u16()?; - if version != 1 { - return Err(format!("color book version {version} isn't supported (only 1)")); - } - let _book_id = data.u16()?; - let [title, prefix, suffix, _description] = [data.acb_string()?, data.acb_string()?, data.acb_string()?, data.acb_string()?]; - let count = usize::from(data.u16()?); - if count > ASE_MAX_ENTRIES { - return Err(format!("the color book holds more than {ASE_MAX_ENTRIES} colors")); - } - let (_page_size, _page_offset) = (data.u16()?, data.u16()?); - let space = data.u16()?; - let mut colors = Vec::with_capacity(count); - for _ in 0..count { - let name = data.acb_string()?; - let _code = data.bytes(6)?; - let color = match space { - 0 => { - let [r, g, b] = data.array::<3>()?; - Color::rgb8(r, g, b) - } - 2 => { - let ink = |v: u8| f32::from(255 - v) / 255.0; - let [c, m, y, k] = data.array::<4>()?; - Color::cmyk(ink(c), ink(m), ink(y), ink(k)) - } - 7 => { - let [l, a, b] = data.array::<3>()?; - Color::lab(f32::from(l) * 100.0 / 255.0, f32::from(a) - 128.0, f32::from(b) - 128.0) - } - other => return Err(format!("color books in color space {other} aren't supported (only RGB, CMYK and Lab)")), - }; - colors.push((name, color)); - } - // Spot colors unless the book says process ones. - let spot = data.0.windows(8).last() != Some(b"spflproc".as_slice()); - let mut lib = SwatchLibrary { name: if title.is_empty() { fallback.into() } else { title }, ..Default::default() }; - let mut names = UniqueNames::default(); - // Every name gets the prefix and the suffix, and is kept twice (the swatch's and the set of - // names taken): a megabyte book of long affixes and many colors came to hundreds of MB. - let mut kept = 0usize; - for (name, color) in colors.into_iter().filter(|(n, _)| !n.trim().is_empty()) { - kept = kept.saturating_add(2 * (prefix.len() + name.len() + suffix.len())); - if kept > ACB_MAX_NAME_BYTES { - return Err(format!("the color book's names take more than {} MB", ACB_MAX_NAME_BYTES >> 20)); - } - let name = names.unique(format!("{prefix}{name}{suffix}").trim().to_string()); - lib.swatches.push(Swatch { name, paint: Paint::solid(color), global: spot, spot }); - } - Ok(lib) -} - -/// Most bytes a color book's full color names (with its prefix and suffix) may take, counted -/// twice as they are kept twice. -const ACB_MAX_NAME_BYTES: usize = 64 << 20; - -/// The swatch of an `.ase` color block, `None` for a model other than RGB, CMYK, Lab and Gray. -/// Components are clamped to their ranges. -fn ase_swatch(body: &mut AseData) -> Result, String> { - let name = body.name()?; - let unit = |v: f32| v.clamp(0.0, 1.0); - let color = match &body.array::<4>()? { - b"RGB " => { - let [r, g, b] = [body.f32()?, body.f32()?, body.f32()?]; - Color::rgb(unit(r), unit(g), unit(b)) - } - b"CMYK" => { - let [c, m, y, k] = [body.f32()?, body.f32()?, body.f32()?, body.f32()?]; - Color::cmyk(unit(c), unit(m), unit(y), unit(k)) - } - // Lightness is stored as a fraction of 100. Some writers store L* itself, which shows as a - // value above 1. - b"LAB " => { - let [l, a, b] = [body.f32()?, body.f32()?, body.f32()?]; - let l = if l > 1.0 { l.min(100.0) } else { unit(l) * 100.0 }; - Color::lab(l, a.clamp(-128.0, 127.0), b.clamp(-128.0, 127.0)) - } - // A gray level (1 is white); a gray color holds its ink. - b"Gray" => Color::gray(1.0 - unit(body.f32()?)), - _ => return Ok(None), - }; - // Some writers leave the color type out, which makes a process color. - let kind = if body.0.len() >= 2 { body.u16()? } else { 2 }; - // Spot colors are global. - let (global, spot) = match kind { - 0 => (true, false), - 1 => (true, true), - _ => (false, false), - }; - let name = if name.is_empty() { value_name(color) } else { name }; - Ok(Some(Swatch { name, paint: Paint::solid(color), global, spot })) -} - -/// A color's values in its own model, as new swatches are named ("C=10 M=20 Y=30 K=0", -/// "R=255 G=128 B=0", "Gray K=40", "L=52 a=70 b=-30"). -fn value_name(c: Color) -> String { - let pct = |v: f32| (v * 100.0).round(); - let byte = |v: f32| (v * 255.0).round(); - match c { - Color::Cmyk { c, m, y, k } => format!("C={} M={} Y={} K={}", pct(c), pct(m), pct(y), pct(k)), - Color::Rgb { r, g, b } => format!("R={} G={} B={}", byte(r), byte(g), byte(b)), - Color::Gray { k } => format!("Gray K={}", pct(k)), - // `+ 0.0` turns a rounded -0 into 0. - Color::Lab { l, a, b } => format!("L={} a={} b={}", l.round() + 0.0, a.round() + 0.0, b.round() + 0.0), - } -} - -/// `.ase` data, read field by field; reading past its end is an error. -struct AseData<'a>(&'a [u8]); - -impl<'a> AseData<'a> { - fn bytes(&mut self, n: usize) -> Result<&'a [u8], String> { - let (head, rest) = self.0.split_at_checked(n).ok_or(ASE_CUT_SHORT)?; - self.0 = rest; - Ok(head) - } - fn array(&mut self) -> Result<[u8; N], String> { - let (head, rest) = self.0.split_first_chunk::().ok_or(ASE_CUT_SHORT)?; - self.0 = rest; - Ok(*head) - } - fn u16(&mut self) -> Result { - self.array().map(u16::from_be_bytes) - } - fn u32(&mut self) -> Result { - self.array().map(u32::from_be_bytes) - } - /// A component; one that isn't a finite number reads as 0. - fn f32(&mut self) -> Result { - let v = f32::from_be_bytes(self.array()?); - Ok(if v.is_finite() { v } else { 0.0 }) - } - /// A color book string ([`read_acb`]): a `u32` count of UTF-16 code units, then the units, - /// with `$$$/key=Text` read as `Text` and `^R`, `^C` as ®, ©; at most [`ASE_MAX_NAME`] units - /// are kept. - fn acb_string(&mut self) -> Result { - let n = usize::try_from(self.u32()?).unwrap_or(usize::MAX); - let (units, _) = self.bytes(n.checked_mul(2).ok_or(ASE_CUT_SHORT)?)?.as_chunks::<2>(); - let units: Vec = units.iter().take(ASE_MAX_NAME).map(|u| u16::from_be_bytes(*u)).take_while(|&u| u != 0).collect(); - let s = String::from_utf16_lossy(&units); - let s = match s.strip_prefix("$$$/") { - Some(key) => key.split_once('=').map_or("", |(_, text)| text).to_string(), - None => s, - }; - Ok(s.replace("^R", "®").replace("^C", "©")) - } - /// A name up to its terminating zero, trimmed. A block that ends before it has no name. - fn name(&mut self) -> Result { - if self.0.is_empty() { - return Ok(String::new()); - } - let n = usize::from(self.u16()?); - let (units, _) = self.bytes(n * 2)?.as_chunks::<2>(); - let units: Vec = units.iter().take(ASE_MAX_NAME).map(|u| u16::from_be_bytes(*u)).take_while(|&u| u != 0).collect(); - Ok(String::from_utf16_lossy(&units).trim().to_string()) - } -} - -/// A group's name as a file gives it, trimmed; "Color Group" when it has none. -fn group_name(name: &str) -> String { - let name = name.trim(); - if name.is_empty() { "Color Group".into() } else { name.to_string() } -} - -/// The swatch and group names a reader has handed out. Swatches and color groups share one set of -/// names, as in a document, and a name already taken gets the first free number ("Black 2"). -#[derive(Default)] -struct UniqueNames { - taken: HashSet, - /// The last number tried for each repeated name. - last: HashMap, -} - -impl UniqueNames { - fn unique(&mut self, base: String) -> String { - if self.taken.insert(base.clone()) { - return base; - } - // Each pass tries the next number, and only finitely many names are taken. - let n = self.last.entry(base.clone()).or_insert(1); - loop { - *n += 1; - let name = format!("{base} {n}"); - if self.taken.insert(name.clone()) { - return name; - } - } - } -} - #[cfg(test)] mod tests; From 693785fc709e8919771e6fe6b9bf94a0d2f2b887 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 07:18:07 +0700 Subject: [PATCH 245/247] Revert "cutover: use craft_plotter::hpgl::write (#8626)" This reverts commit d2bed0bdb81a9f94d46e14bce1e0fb4b99bab2a0. --- Cargo.lock | 3 +- Cargo.toml | 2 +- crates/cad/src/hpgl/write.rs | 63 ++++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6805f2c4ff..e7a0ffe1c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1213,9 +1213,8 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a045550369c90a541693c33#e7873217287876f76a045550369c90a541693c33" +source = "git+https://github.com/storytold/craft-libs?rev=a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57#a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57" dependencies = [ - "kurbo 0.13.1", "thiserror 2.0.21", ] diff --git a/Cargo.toml b/Cargo.toml index 07e90b5795..c33e3b1cfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "64b181977 # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "e7873217287876f76a045550369c90a541693c33" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "a7fb55eaf9a15c21e8ce0b13cf605dc54fd15f57" } craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } # WMF, EMF and EMF+ reader (craft-libs#778). craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "64b181977a0488e4d1e167bc5cc8cfededc2ed4b" } diff --git a/crates/cad/src/hpgl/write.rs b/crates/cad/src/hpgl/write.rs index 69f5e503a2..bb397d7eaa 100644 --- a/crates/cad/src/hpgl/write.rs +++ b/crates/cad/src/hpgl/write.rs @@ -43,13 +43,16 @@ use clip::Region; /// Plotter units per point. const PLU_PER_PT: f64 = 1016.0 / 72.0; -pub use craft_plotter::hpgl::write::{MAX_COORD, MAX_PENS}; +/// The largest coordinate written, plotter units. +pub const MAX_COORD: i64 = (1 << 23) - 1; /// The coordinates an HP-GL plot keeps to without a warning: 16-bit numbers, plotter units. const CLASSIC_RANGE: std::ops::RangeInclusive = -32_768..=32_767; /// The curve tolerance a path is flattened to by default, points. pub const DEFAULT_TOLERANCE: f64 = 0.1; /// The smallest and largest curve tolerance, points. pub const TOLERANCE_RANGE: std::ops::RangeInclusive = 0.01..=10.0; +/// The most pens: a pen table's length, and the colors that get a pen of their own. +pub const MAX_PENS: usize = 255; /// The most points the plots of one export hold. const MAX_POINTS: usize = if cfg!(test) { 100_000 } else { 10_000_000 }; /// The most work sorting paths and finding which lie inside others may take, over the whole plot: @@ -292,14 +295,7 @@ pub fn export_regions(doc: &Document, opts: &HpglOptions, regions: &[Rect]) -> R } let bytes = match opts.version { Version::Hpgl => plain(&by_pen), - Version::Hpgl2 => { - let pen_table: Vec = pens - .iter() - .enumerate() - .map(|(i, &rgb)| craft_plotter::hpgl::write::Pen { number: i + 1, rgb }) - .collect(); - craft_plotter::hpgl::write::write_hpgl2(&pen_table, &by_pen).into_bytes() - } + Version::Hpgl2 => encoded(&by_pen, &pens), }; out.push(HpglOutput { bytes, pens: pens.clone(), warnings, setting_notes }); } @@ -527,7 +523,56 @@ fn plain(by_pen: &[Vec>]) -> Vec { } /// HP-GL/2: `IN;`, the palette, each pen's paths as one `PE`, `PU;SP0;`. +fn encoded(by_pen: &[Vec>], pens: &[[u8; 3]]) -> Vec { + let mut out = b"IN;".to_vec(); + if !pens.is_empty() { + // Pens 1 to n on a plotter, and on a raster device (whose pens are 0 to NP − 1) too. + let np = (pens.len() + 1).next_power_of_two().max(2); + out.extend(format!("NP{np};").bytes()); + for (i, [r, g, b]) in pens.iter().enumerate() { + out.extend(format!("PC{},{r},{g},{b};", i + 1).bytes()); + } + } + let mut at: Option<(i64, i64)> = None; + for (i, paths) in by_pen.iter().enumerate().filter(|(_, p)| !p.is_empty()) { + out.extend(format!("PU;SP{};PE", i + 1).bytes()); + for path in paths { + for (k, &p) in path.iter().enumerate() { + if k == 0 { + out.push(b'<'); + } + // The first move of the plot is absolute, and so is one longer than the range a + // device takes for each number; every other is relative. + match at.map(|a| (p.0 - a.0, p.1 - a.1)).filter(|d| d.0.abs() <= MAX_COORD && d.1.abs() <= MAX_COORD) { + None => { + out.push(b'='); + pe_number(&mut out, p.0); + pe_number(&mut out, p.1); + } + Some((dx, dy)) => { + pe_number(&mut out, dx); + pe_number(&mut out, dy); + } + } + at = Some(p); + } + } + out.push(b';'); + } + out.extend(b"PU;SP0;"); + out +} +/// `v` as a base-64 PE number: the sign in the low bit, the low digits from 63 up and the last +/// digit from 191 up. +fn pe_number(out: &mut Vec, v: i64) { + let mut n = (v.unsigned_abs() << 1) | u64::from(v < 0); + while n >= 64 { + out.push(63 + (n % 64) as u8); + n /= 64; + } + out.push(191 + n as u8); +} /// One line the pen draws, in document space, and its color. struct Run { From 4e63316d9a93c893135c5cc0f08e96ddbc03eaf8 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 07:15:52 +0700 Subject: [PATCH 246/247] color: the palette tests define the swatch exchange constants craft-cms keeps private --- crates/color/src/palette_io/tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/color/src/palette_io/tests.rs b/crates/color/src/palette_io/tests.rs index bbbae16a53..0e6adb90ed 100644 --- a/crates/color/src/palette_io/tests.rs +++ b/crates/color/src/palette_io/tests.rs @@ -2,6 +2,13 @@ use super::*; use crate::{Gradient, GradientPaint, GradientStop}; use proptest::prelude::*; +// The swatch exchange file's signature, block types and entry cap, which craft-cms keeps private. +const ASE_SIGNATURE: &[u8] = b"ASEF"; +const ASE_GROUP_START: u16 = 0xC001; +const ASE_GROUP_END: u16 = 0xC002; +const ASE_COLOR: u16 = 0x0001; +const ASE_MAX_ENTRIES: usize = 100_000; + #[test] fn gpl_blank_name_keeps_fallback() { let blank = "GIMP Palette\nName: \nColumns: 0\n#\n 1 2 3\tx\n"; From 891dd6310dc01cfa1c506d4d8033e55725ddcba2 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 07:59:02 +0700 Subject: [PATCH 247/247] color: an .ase library over the cap gets VectorCraft's own, translated message again #8627 left the check to craft-cms, whose wording isn't in the catalogs, and main's test of the message failed. --- crates/color/src/palette_io.rs | 16 +++++++++++++++- crates/color/src/palette_io/tests.rs | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/crates/color/src/palette_io.rs b/crates/color/src/palette_io.rs index cb8e0b3950..1709fb57c8 100644 --- a/crates/color/src/palette_io.rs +++ b/crates/color/src/palette_io.rs @@ -114,6 +114,10 @@ fn swatches_from_cms(list: Vec) -> Vec { list.into_iter().map(|w| Swatch { name: w.name, paint: Paint::solid(color_from_cms(w.color)), global: w.global, spot: w.spot }).collect() } +/// The most colors and groups one swatch exchange file holds, read or written (craft-cms reads +/// as many). +const ASE_MAX_ENTRIES: usize = 100_000; + fn to_cms_palette(lib: &SwatchLibrary) -> Palette { Palette { name: lib.name.clone(), @@ -148,7 +152,17 @@ pub fn write(lib: &SwatchLibrary, format: PaletteFormat) -> Result, Stri serde_json::to_string_pretty(&file).unwrap_or_default() } PaletteFormat::Gpl => return cms_palette::write_palette(&to_cms_palette(lib), cms_palette::PaletteFormat::Gpl), - PaletteFormat::Ase => return cms_palette::write_palette(&to_cms_palette(lib), cms_palette::PaletteFormat::Ase), + PaletteFormat::Ase => { + let p = to_cms_palette(lib); + // Counted here, so the message is VectorCraft's own and its translations apply. + let entries = p.swatches.len() + p.groups.iter().map(|g| 1 + g.swatches.len()).sum::(); + if entries > ASE_MAX_ENTRIES { + return Err(format!( + "VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries}" + )); + } + return cms_palette::write_palette(&p, cms_palette::PaletteFormat::Ase); + } PaletteFormat::Css => write_css(lib, keep), }; Ok(text.into_bytes()) diff --git a/crates/color/src/palette_io/tests.rs b/crates/color/src/palette_io/tests.rs index 0e6adb90ed..43f7ae79cc 100644 --- a/crates/color/src/palette_io/tests.rs +++ b/crates/color/src/palette_io/tests.rs @@ -2,12 +2,11 @@ use super::*; use crate::{Gradient, GradientPaint, GradientStop}; use proptest::prelude::*; -// The swatch exchange file's signature, block types and entry cap, which craft-cms keeps private. +// The swatch exchange file's signature and block types, which craft-cms keeps private. const ASE_SIGNATURE: &[u8] = b"ASEF"; const ASE_GROUP_START: u16 = 0xC001; const ASE_GROUP_END: u16 = 0xC002; const ASE_COLOR: u16 = 0x0001; -const ASE_MAX_ENTRIES: usize = 100_000; #[test] fn gpl_blank_name_keeps_fallback() {